This commit was manufactured by cvs2svn to create tag 'v20080807'.
diff --git a/assembly/plugins/org.eclipse.jsf.branding/.classpath b/assembly/plugins/org.eclipse.jsf.branding/.classpath
deleted file mode 100644
index 7cec603..0000000
--- a/assembly/plugins/org.eclipse.jsf.branding/.classpath
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/assembly/plugins/org.eclipse.jsf.branding/.cvsignore b/assembly/plugins/org.eclipse.jsf.branding/.cvsignore
deleted file mode 100644
index 7033a79..0000000
--- a/assembly/plugins/org.eclipse.jsf.branding/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-bin
-@dot*
-temp.folder
-build.xml
diff --git a/assembly/plugins/org.eclipse.jsf.branding/.project b/assembly/plugins/org.eclipse.jsf.branding/.project
deleted file mode 100644
index bd50004..0000000
--- a/assembly/plugins/org.eclipse.jsf.branding/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jsf.branding</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/assembly/plugins/org.eclipse.jsf.branding/META-INF/MANIFEST.MF b/assembly/plugins/org.eclipse.jsf.branding/META-INF/MANIFEST.MF
deleted file mode 100644
index 8524822..0000000
--- a/assembly/plugins/org.eclipse.jsf.branding/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,7 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %plugin.Name
-Bundle-SymbolicName: org.eclipse.jsf
-Bundle-Version: 1.0.1.qualifier
-Bundle-Localization: plugin
-Bundle-Vendor: %plugin.Provider
diff --git a/assembly/plugins/org.eclipse.jsf.branding/about.html b/assembly/plugins/org.eclipse.jsf.branding/about.html
deleted file mode 100644
index 7c80c6c..0000000
--- a/assembly/plugins/org.eclipse.jsf.branding/about.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 06, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/assembly/plugins/org.eclipse.jsf.branding/about.ini b/assembly/plugins/org.eclipse.jsf.branding/about.ini
deleted file mode 100644
index a21a3ec..0000000
--- a/assembly/plugins/org.eclipse.jsf.branding/about.ini
+++ /dev/null
@@ -1,29 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
diff --git a/assembly/plugins/org.eclipse.jsf.branding/about.mappings b/assembly/plugins/org.eclipse.jsf.branding/about.mappings
deleted file mode 100644
index bddaab4..0000000
--- a/assembly/plugins/org.eclipse.jsf.branding/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
\ No newline at end of file
diff --git a/assembly/plugins/org.eclipse.jsf.branding/about.properties b/assembly/plugins/org.eclipse.jsf.branding/about.properties
deleted file mode 100644
index c62b076..0000000
--- a/assembly/plugins/org.eclipse.jsf.branding/about.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-###############################################################################
-# Copyright (c) 2005 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are 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:
-# Oracle Corporation - initial API and implementation
-###############################################################################
-
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-
-blurb=JavaServer Faces Tools\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2005. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
diff --git a/assembly/plugins/org.eclipse.jsf.branding/build.properties b/assembly/plugins/org.eclipse.jsf.branding/build.properties
deleted file mode 100644
index ab20e78..0000000
--- a/assembly/plugins/org.eclipse.jsf.branding/build.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2006 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are 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:
-# Oracle Corporation - initial API and implementation
-###############################################################################
-bin.includes = META-INF/,\
- eclipse32.png,\
- eclipse32.gif,\
- about.properties,\
- about.mappings,\
- about.ini,\
- about.html,\
- plugin.properties,\
- component.xml
-
diff --git a/assembly/plugins/org.eclipse.jsf.branding/component.xml b/assembly/plugins/org.eclipse.jsf.branding/component.xml
deleted file mode 100644
index d470a56..0000000
--- a/assembly/plugins/org.eclipse.jsf.branding/component.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jsf">
-<description url=""></description>
-<component-depends unrestricted="true"></component-depends>
-<plugin id="org.eclipse.jst.jsf.common" fragment="false"/>
-<plugin id="org.eclipse.jst.jsf.common.ui" fragment="false"/>
-<plugin id="org.eclipse.jst.jsf.core" fragment="false"/>
-<plugin id="org.eclipse.jst.jsf.ui" fragment="false"/>
-<plugin id="org.eclipse.jst.jsf.standard.tagsupport" fragment="false"/>
-<plugin id="org.eclipse.jst.jsf.facesconfig" fragment="false"/>
-<plugin id="org.eclipse.jst.jsf.facesconfig.ui" fragment="false"/>
-<plugin id="org.eclipse.jst.pagedesigner" fragment="false"/>
-<plugin id="org.eclipse.jst.pagedesigner.jsf.ui" fragment="false"/>
-<plugin id="org.eclipse.jst.pagedesigner.jsp.core" fragment="false"/>
-<plugin id="org.eclipse.jst.jsf.doc.dev" fragment="false"/>
-</component>
-
-
-
-
-
-
-
diff --git a/assembly/plugins/org.eclipse.jsf.branding/eclipse32.gif b/assembly/plugins/org.eclipse.jsf.branding/eclipse32.gif
deleted file mode 100644
index e6ad7cc..0000000
--- a/assembly/plugins/org.eclipse.jsf.branding/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/assembly/plugins/org.eclipse.jsf.branding/eclipse32.png b/assembly/plugins/org.eclipse.jsf.branding/eclipse32.png
deleted file mode 100644
index 568fac1..0000000
--- a/assembly/plugins/org.eclipse.jsf.branding/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/assembly/plugins/org.eclipse.jsf.branding/plugin.properties b/assembly/plugins/org.eclipse.jsf.branding/plugin.properties
deleted file mode 100644
index 2b7a864..0000000
--- a/assembly/plugins/org.eclipse.jsf.branding/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are 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:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-plugin.Name=JavaServer Faces Tools
-plugin.Provider=Eclipse.org
\ No newline at end of file
diff --git a/jsf/features/org.eclipse.jst.webpageeditor.feature/.cvsignore b/jsf/features/org.eclipse.jst.webpageeditor.feature/.cvsignore
deleted file mode 100644
index c14487c..0000000
--- a/jsf/features/org.eclipse.jst.webpageeditor.feature/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/jsf/features/org.eclipse.jst.webpageeditor.feature/.project b/jsf/features/org.eclipse.jst.webpageeditor.feature/.project
deleted file mode 100644
index e089155..0000000
--- a/jsf/features/org.eclipse.jst.webpageeditor.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.webpageeditor.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jsf/features/org.eclipse.jst.webpageeditor.feature/build.properties b/jsf/features/org.eclipse.jst.webpageeditor.feature/build.properties
deleted file mode 100644
index 4469d34..0000000
--- a/jsf/features/org.eclipse.jst.webpageeditor.feature/build.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2007 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are 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:
-# Oracle Corporation - initial API and implementation
-###############################################################################
-bin.includes = feature.xml,\
- license.html,\
- feature.properties,\
- epl-v10.html,\
- eclipse_update_120.jpg
diff --git a/jsf/features/org.eclipse.jst.webpageeditor.feature/eclipse_update_120.jpg b/jsf/features/org.eclipse.jst.webpageeditor.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708..0000000
--- a/jsf/features/org.eclipse.jst.webpageeditor.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jsf/features/org.eclipse.jst.webpageeditor.feature/epl-v10.html b/jsf/features/org.eclipse.jst.webpageeditor.feature/epl-v10.html
deleted file mode 100644
index ed4b196..0000000
--- a/jsf/features/org.eclipse.jst.webpageeditor.feature/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>"Contribution" means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>"Contributor" means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>"Licensed Patents " mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>"Program" means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>"Recipient" means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor ("Commercial
-Contributor") hereby agrees to defend and indemnify every other
-Contributor ("Indemnified Contributor") against any losses, damages and
-costs (collectively "Losses") arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]> <![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
\ No newline at end of file
diff --git a/jsf/features/org.eclipse.jst.webpageeditor.feature/feature.properties b/jsf/features/org.eclipse.jst.webpageeditor.feature/feature.properties
deleted file mode 100644
index bc691ab..0000000
--- a/jsf/features/org.eclipse.jst.webpageeditor.feature/feature.properties
+++ /dev/null
@@ -1,144 +0,0 @@
-###############################################################################
-# Copyright (c) 2005, 2007 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are 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:
-# Gerry Kessler - initial API and implementation
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=Web Page Editor (Optional)
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=Web Page Editor (Optional)
-
-# "copyright" property - text of the "Feature Update Copyright"
-feature.copyright=\
-Copyright (c) 2007 Oracle Corporation.\
-All rights reserved. This program and the accompanying materials\
-are 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\
-\n\
-Contributors:\n\
- Oracle Corporation - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-licenseURL=license.html
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-license=\
-ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
-June 7, 2007\n\
-\n\
-Usage Of Content\n\
-\n\
-THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
-OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
-USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
-AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
-AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
-AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
-OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
-BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
-\n\
-Applicable Licenses\n\
-\n\
-Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
-is provided to you under the terms and conditions of the Eclipse Public\n\
-License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
-Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
-For purposes of the EPL, "Program" will mean the Content.\n\
-\n\
-Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse.org CVS\n\
-repository ("Repository") in CVS modules ("Modules") and made available\n\
-as downloadable archives ("Downloads").\n\
-\n\
- - Content may be structured and packaged into modules to facilitate delivering,\n\
- extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
- plug-in fragments ("Fragments"), and features ("Features").\n\
- - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
- in a directory named "plugins".\n\
- - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
- Each Feature may be packaged as a sub-directory in a directory named "features".\n\
- Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
- numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
- - Features may also include other Features ("Included Features"). Within a Feature, files\n\
- named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-Features may also include other Features ("Included Features"). Files named\n\
-"feature.xml" may contain a list of the names and version numbers of\n\
-Included Features.\n\
-\n\
-The terms and conditions governing Plug-ins and Fragments should be\n\
-contained in files named "about.html" ("Abouts"). The terms and\n\
-conditions governing Features and Included Features should be contained\n\
-in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
-Licenses may be located in any directory of a Download or Module\n\
-including, but not limited to the following locations:\n\
-\n\
- - The top-level (root) directory\n\
- - Plug-in and Fragment directories\n\
- - Inside Plug-ins and Fragments packaged as JARs\n\
- - Sub-directories of the directory named "src" of certain Plug-ins\n\
- - Feature directories\n\
-\n\
-Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Eclipse Update Manager, you must agree to a license ("Feature Update\n\
-License") during the installation process. If the Feature contains\n\
-Included Features, the Feature Update License should either provide you\n\
-with the terms and conditions governing the Included Features or inform\n\
-you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties". Such Abouts,\n\
-Feature Licenses and Feature Update Licenses contain the terms and\n\
-conditions (or references to such terms and conditions) that govern your\n\
-use of the associated Content in that directory.\n\
-\n\
-THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
-TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
-SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
-\n\
- - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
- - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
- - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
- - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
- - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
- - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
-\n\
-IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
-is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
-govern that particular Content.\n\
-\n\
-Cryptography\n\
-\n\
-Content may contain encryption software. The country in which you are\n\
-currently may have restrictions on the import, possession, and use,\n\
-and/or re-export to another country, of encryption software. BEFORE\n\
-using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use,\n\
-and re-export of encryption software, to see if this is permitted.\n\
-\n\
-Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
-########### end of license property ##########################################
diff --git a/jsf/features/org.eclipse.jst.webpageeditor.feature/feature.xml b/jsf/features/org.eclipse.jst.webpageeditor.feature/feature.xml
deleted file mode 100644
index f341cb0..0000000
--- a/jsf/features/org.eclipse.jst.webpageeditor.feature/feature.xml
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jst.webpageeditor.feature"
- label="%featureName"
- version="2.0.0.qualifier"
- provider-name="%providerName"
- image="eclipse_update_120.jpg">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <url>
- <update label="%updateSiteName" url="http://download.eclipse.org/webtools/updates"/>
- <discovery label="Web Tools Platform (WTP) Updates" url="http://download.eclipse.org/webtools/updates"/>
- </url>
-
- <requires>
- <import plugin="org.eclipse.core.runtime" version="3.2.0" match="compatible"/>
- <import plugin="org.eclipse.debug.ui" version="3.2.0" match="compatible"/>
- <import plugin="org.eclipse.emf.ecore" version="2.2.0" match="compatible"/>
- <import plugin="org.eclipse.gef" version="3.2.0" match="compatible"/>
- <import plugin="org.eclipse.jface.text" version="3.2.0" match="compatible"/>
- <import plugin="org.eclipse.ui.workbench.texteditor" version="3.2.0" match="compatible"/>
- <import plugin="org.eclipse.wst.sse.ui" version="1.0.101"/>
- <import plugin="org.eclipse.jst.jsp.core" version="1.1.0"/>
- <import plugin="org.eclipse.jst.jsp.ui" version="1.1.0"/>
- <import plugin="org.eclipse.jst.pagedesigner.jsp.core" version="1.0.0" match="compatible"/>
- <import plugin="org.eclipse.jst.jsf.common.ui" version="1.0.0" match="compatible"/>
- <import plugin="org.eclipse.ui.ide" version="3.2.0" match="compatible"/>
- <import plugin="org.eclipse.jdt.ui" version="3.2.0" match="compatible"/>
- <import plugin="org.eclipse.jst.jsf.common" version="1.0.0" match="compatible"/>
- <import plugin="org.eclipse.jst.jsf.core" version="1.0.0" match="compatible"/>
- <import plugin="org.eclipse.jdt.core" version="3.2.0" match="compatible"/>
- <import plugin="javax.servlet" version="2.4.0" match="compatible"/>
- <import plugin="org.apache.commons.el" version="1.0.0" match="compatible"/>
- <import plugin="javax.servlet.jsp" version="2.0.0" match="compatible"/>
- <import plugin="org.eclipse.ui.views.properties.tabbed" version="3.2.0" match="compatible"/>
- <import plugin="org.eclipse.core.resources" version="3.2.0" match="compatible"/>
- <import plugin="org.eclipse.wst.common.ui" version="1.1.0" match="equivalent"/>
- <import plugin="org.eclipse.wst.common.uriresolver" version="1.1.0" match="equivalent"/>
- <import plugin="org.eclipse.jst.j2ee" version="1.1.0" match="equivalent"/>
- <import plugin="org.eclipse.jst.j2ee.web" version="1.1.0" match="equivalent"/>
- <import plugin="org.eclipse.wst.html.ui" version="1.0.100" match="equivalent"/>
- <import plugin="org.eclipse.wst.css.core" version="1.1.0" match="equivalent"/>
- <import plugin="org.eclipse.wst.html.core" version="1.1.0" match="equivalent"/>
- <import plugin="org.eclipse.wst.xml.ui" version="1.0.100" match="equivalent"/>
- <import plugin="org.eclipse.wst.xml.core" version="1.1.0" match="equivalent"/>
- <import plugin="org.eclipse.wst.sse.core" version="1.1.0" match="equivalent"/>
- <import plugin="org.eclipse.jst.jsf.facesconfig" version="1.1.0" match="compatible"/>
- <import plugin="org.eclipse.jst.pagedesigner" version="1.1.0" match="compatible"/>
- <import plugin="org.eclipse.jst.pagedesigner.jsp.core" version="1.1.0" match="compatible"/>
- <import plugin="org.eclipse.wst.common.modulecore" version="1.1.0" match="equivalent"/>
- <import plugin="org.eclipse.jst.jsf.common.ui" version="1.1.0" match="compatible"/>
- <import plugin="org.eclipse.jst.jsf.core" version="1.1.0" match="compatible"/>
- <import plugin="org.eclipse.jst.jsf.common" version="1.1.0" match="compatible"/>
- </requires>
-
- <plugin
- id="org.eclipse.jst.pagedesigner"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jst.pagedesigner.jsf.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jst.pagedesigner.jsp.core"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
diff --git a/jsf/features/org.eclipse.jst.webpageeditor.feature/license.html b/jsf/features/org.eclipse.jst.webpageeditor.feature/license.html
deleted file mode 100644
index a450af9..0000000
--- a/jsf/features/org.eclipse.jst.webpageeditor.feature/license.html
+++ /dev/null
@@ -1,97 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
-<!-- saved from url=(0044)http://www.eclipse.org/legal/epl/notice.html -->
-<HTML><HEAD><TITLE>Eclipse.org Software User Agreement</TITLE>
-<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<META content="MSHTML 6.00.2800.1479" name=GENERATOR></HEAD>
-<BODY lang=EN-US vLink=purple link=blue>
-<H2>Eclipse Foundation Software User Agreement</H2>
-
-<H3>Usage Of Content</H3>
-<P>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION
-AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT"). USE OF
-THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE
-TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED
-BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED
-BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE
-AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS OF ANY
-APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU
-MAY NOT USE THE CONTENT.</P>
-<H3>Applicable Licenses</H3>
-<P>Unless otherwise indicated, all Content made available by the Eclipse
-Foundation is provided to you under the terms and conditions of the Eclipse
-Public License Version 1.0 ("EPL"). A copy of the EPL is provided with this
-Content and is also available at <A
-href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-<P>Content includes, but is not limited to, source code, object code,
-documentation and other files maintained in the Eclipse.org CVS repository
-("Repository") in CVS modules ("Modules") and made available as downloadable
-archives ("Downloads").</P>
-<P>Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments
-("Fragments"), and features ("Features"). A Feature is a bundle of one or more
-Plug-ins and/or Fragments and associated material. Files named "feature.xml" may
-contain a list of the names and version numbers of the Plug-ins and/or Fragments
-associated with a Feature. Plug-ins and Fragments are located in directories
-named "plugins" and Features are located in directories named "features".</P>
-<P>Features may also include other Features ("Included Features"). Files named
-"feature.xml" may contain a list of the names and version numbers of Included
-Features.</P>
-<P>The terms and conditions governing Plug-ins and Fragments should be contained
-in files named "about.html" ("Abouts"). The terms and conditions governing
-Features and Included Features should be contained in files named "license.html"
-("Feature Licenses"). Abouts and Feature Licenses may be located in any
-directory of a Download or Module including, but not limited to the following
-locations:</P>
-<UL>
- <LI>The top-level (root) directory
- <LI>Plug-in and Fragment directories
- <LI>Subdirectories of the directory named "src" of certain Plug-ins
- <LI>Feature directories </LI></UL>
-<P>Note: if a Feature made available by the Eclipse Foundation is installed
-using the Eclipse Update Manager, you must agree to a license ("Feature Update
-License") during the installation process. If the Feature contains Included
-Features, the Feature Update License should either provide you with the terms
-and conditions governing the Included Features or inform you where you can
-locate them. Feature Update Licenses may be found in the "license" property of
-files named "feature.properties". Such Abouts, Feature Licenses and Feature
-Update Licenses contain the terms and conditions (or references to such terms
-and conditions) that govern your use of the associated Content in that
-directory.</P>
-<P>THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL
-OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</P>
-<UL>
- <LI>Common Public License Version 1.0 (available at <A
- href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</A>)
-
- <LI>Apache Software License 1.1 (available at <A
- href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</A>)
-
- <LI>Apache Software License 2.0 (available at <A
- href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</A>)
-
- <LI>IBM Public License 1.0 (available at <A
- href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</A>)
-
- <LI>Metro Link Public License 1.00 (available at <A
- href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</A>)
-
- <LI>Mozilla Public License Version 1.1 (available at <A
- href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</A>)
-
- <li>Common Development and Distribution License (CDDL) Version 1.0 (available at <A
- href="http://www.sun.com/cddl/cddl.html">http://www.sun.com/cddl/cddl.html)</A>
- </LI>
- </LI></UL>
-<P>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License is
-provided, please contact the Eclipse Foundation to determine what terms and
-conditions govern that particular Content.</P>
-<H3>Cryptography</H3>
-<P>Content may contain encryption software. The country in which you are
-currently may have restrictions on the import, possession, and use, and/or
-re-export to another country, of encryption software. BEFORE using any
-encryption software, please check the country's laws, regulations and policies
-concerning the import, possession, or use, and re-export of encryption software,
-to see if this is permitted.</P></BODY></HTML>
diff --git a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplateBundle/about.html b/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplateBundle/about.html
deleted file mode 100644
index fe81d46..0000000
--- a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplateBundle/about.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<P>June, 2008</P>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files ("Source Zips") that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in "about.html" files ("Abouts") located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplateBundle/about.ini b/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplateBundle/about.ini
deleted file mode 100644
index 2dee36a..0000000
--- a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplateBundle/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplateBundle/about.mappings b/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplateBundle/about.mappings
deleted file mode 100644
index a28390a..0000000
--- a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplateBundle/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplateBundle/about.properties b/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplateBundle/about.properties
deleted file mode 100644
index e3cbbc3..0000000
--- a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplateBundle/about.properties
+++ /dev/null
@@ -1,27 +0,0 @@
-###############################################################################
-# Copyright (c) 2005, 2007 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are 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:
-# Gerry Kessler - initial API and implementation
-###############################################################################
-# This file should be translated.
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Web Page Editor Source\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2007. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplateBundle/build.properties b/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplateBundle/build.properties
deleted file mode 100644
index 43309f0..0000000
--- a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplateBundle/build.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2007 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are 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:
-# Oracle Corporation - initial API and implementation
-###############################################################################
-
-bin.includes = about.html, about.ini, about.mappings, about.properties, eclipse32.gif, plugin.properties, plugin.xml, src/**, META-INF/
-sourcePlugin = true
diff --git a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplateBundle/eclipse32.gif b/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplateBundle/eclipse32.gif
deleted file mode 100644
index e6ad7cc..0000000
--- a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplateBundle/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplateBundle/eclipse32.png b/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplateBundle/eclipse32.png
deleted file mode 100644
index 50ae49d..0000000
--- a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplateBundle/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplateBundle/plugin.properties b/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplateBundle/plugin.properties
deleted file mode 100644
index 46b3449..0000000
--- a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplateBundle/plugin.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-###############################################################################
-# Copyright (c) 2005, 2007 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are 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:
-# Gerry Kessler - initial API and implementation
-###############################################################################
-# This file should be translated.
-# plugin.properties
-# contains externalized strings for manifest.mf
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-pluginName=Web Page Editor Source
-providerName=Eclipse.org
diff --git a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplateFeature/build.properties b/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplateFeature/build.properties
deleted file mode 100644
index 657ba1b..0000000
--- a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplateFeature/build.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-###############################################################################
-# Copyright (c) 2005, 2007 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are 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:
-# Gerry Kessler - initial API and implementation
-###############################################################################
-# This file should be NOT be translated.
-bin.includes =\
-epl-v10.html,\
-eclipse_update_120.jpg,\
-feature.xml,\
-feature.properties,\
-license.html
-
-
diff --git a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplateFeature/eclipse_update_120.jpg b/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplateFeature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708..0000000
--- a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplateFeature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplateFeature/epl-v10.html b/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplateFeature/epl-v10.html
deleted file mode 100644
index 022ad29..0000000
--- a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplateFeature/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>"Contribution" means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>"Contributor" means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>"Licensed Patents " mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>"Program" means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>"Recipient" means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor ("Commercial
-Contributor") hereby agrees to defend and indemnify every other
-Contributor ("Indemnified Contributor") against any losses, damages and
-costs (collectively "Losses") arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]> <![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
diff --git a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplateFeature/feature.properties b/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplateFeature/feature.properties
deleted file mode 100644
index bea5ceb..0000000
--- a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplateFeature/feature.properties
+++ /dev/null
@@ -1,147 +0,0 @@
-###############################################################################
-# Copyright (c) 2005, 2007 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are 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:
-# Gerry Kessler - initial API and implementation
-###############################################################################
-# This file should be translated.
-# feature.properties
-# contains externalized strings for feature.xml
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-#
-# "featureName" property - name of the feature
-featureName=Web Page Editor Source
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=Source code zips for Web Page Editor.
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-2007 Oracle Corporation and others.\
-All rights reserved. This program and the accompanying materials\
-are 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\
-\n\
-Contributors:\n\
- Oracle Corporation - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-licenseURL=license.html
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-license=\
-ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
-June 06, 2007\n\
-\n\
-Usage Of Content\n\
-\n\
-THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
-OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
-USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
-AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
-AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
-AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
-OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
-BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
-\n\
-Applicable Licenses\n\
-\n\
-Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
-is provided to you under the terms and conditions of the Eclipse Public\n\
-License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
-Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
-For purposes of the EPL, "Program" will mean the Content.\n\
-\n\
-Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse.org CVS\n\
-repository ("Repository") in CVS modules ("Modules") and made available\n\
-as downloadable archives ("Downloads").\n\
-\n\
- - Content may be structured and packaged into modules to facilitate delivering,\n\
- extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
- plug-in fragments ("Fragments"), and features ("Features").\n\
- - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
- in a directory named "plugins".\n\
- - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
- Each Feature may be packaged as a sub-directory in a directory named "features".\n\
- Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
- numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
- - Features may also include other Features ("Included Features"). Within a Feature, files\n\
- named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-Features may also include other Features ("Included Features"). Files named\n\
-"feature.xml" may contain a list of the names and version numbers of\n\
-Included Features.\n\
-\n\
-The terms and conditions governing Plug-ins and Fragments should be\n\
-contained in files named "about.html" ("Abouts"). The terms and\n\
-conditions governing Features and Included Features should be contained\n\
-in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
-Licenses may be located in any directory of a Download or Module\n\
-including, but not limited to the following locations:\n\
-\n\
- - The top-level (root) directory\n\
- - Plug-in and Fragment directories\n\
- - Inside Plug-ins and Fragments packaged as JARs\n\
- - Sub-directories of the directory named "src" of certain Plug-ins\n\
- - Feature directories\n\
-\n\
-Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Eclipse Update Manager, you must agree to a license ("Feature Update\n\
-License") during the installation process. If the Feature contains\n\
-Included Features, the Feature Update License should either provide you\n\
-with the terms and conditions governing the Included Features or inform\n\
-you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties". Such Abouts,\n\
-Feature Licenses and Feature Update Licenses contain the terms and\n\
-conditions (or references to such terms and conditions) that govern your\n\
-use of the associated Content in that directory.\n\
-\n\
-THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
-TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
-SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
-\n\
- - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
- - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
- - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
- - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
- - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
- - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
- - Common Development and Distribution License (CDDL) Version 1.0 (available at http://www.sun.com/cddl/cddl.html)\n\
-\n\
-IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
-is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
-govern that particular Content.\n\
-\n\
-Cryptography\n\
-\n\
-Content may contain encryption software. The country in which you are\n\
-currently may have restrictions on the import, possession, and use,\n\
-and/or re-export to another country, of encryption software. BEFORE\n\
-using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use,\n\
-and re-export of encryption software, to see if this is permitted.\n\
-\n\
-Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
-########### end of license property ##########################################
diff --git a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplateFeature/license.html b/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplateFeature/license.html
deleted file mode 100644
index fec4a48..0000000
--- a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplateFeature/license.html
+++ /dev/null
@@ -1,82 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>June 06, 2007</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- ("EPL"). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository ("Repository") in CVS
- modules ("Modules") and made available as downloadable archives ("Downloads").</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"), plug-in fragments ("Fragments"), and features ("Features").</li>
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named "features". Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features ("Included Features"). Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of Included Features.</li>
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named "about.html" ("Abouts"). The terms and conditions governing Features and
-Included Features should be contained in files named "license.html" ("Feature Licenses"). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named "src" of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license ("Feature Update License") during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the "license" property of files named "feature.properties" found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
- <LI>Common Development and Distribution License (CDDL) Version 1.0 (available at <A
- href="http://www.sun.com/cddl/cddl.html">http://www.sun.com/cddl/cddl.html)</A>
- </LI>
-</UL>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
-</body>
-</html>
diff --git a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplatePlugin/about.html b/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplatePlugin/about.html
deleted file mode 100644
index fe81d46..0000000
--- a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplatePlugin/about.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<P>June, 2008</P>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files ("Source Zips") that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in "about.html" files ("Abouts") located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplatePlugin/about.ini b/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplatePlugin/about.ini
deleted file mode 100644
index 2dee36a..0000000
--- a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplatePlugin/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplatePlugin/about.mappings b/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplatePlugin/about.mappings
deleted file mode 100644
index a28390a..0000000
--- a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplatePlugin/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplatePlugin/about.properties b/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplatePlugin/about.properties
deleted file mode 100644
index e3cbbc3..0000000
--- a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplatePlugin/about.properties
+++ /dev/null
@@ -1,27 +0,0 @@
-###############################################################################
-# Copyright (c) 2005, 2007 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are 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:
-# Gerry Kessler - initial API and implementation
-###############################################################################
-# This file should be translated.
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Web Page Editor Source\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2007. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplatePlugin/build.properties b/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplatePlugin/build.properties
deleted file mode 100644
index 43309f0..0000000
--- a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplatePlugin/build.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2007 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are 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:
-# Oracle Corporation - initial API and implementation
-###############################################################################
-
-bin.includes = about.html, about.ini, about.mappings, about.properties, eclipse32.gif, plugin.properties, plugin.xml, src/**, META-INF/
-sourcePlugin = true
diff --git a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplatePlugin/eclipse32.gif b/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplatePlugin/eclipse32.gif
deleted file mode 100644
index e6ad7cc..0000000
--- a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplatePlugin/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplatePlugin/eclipse32.png b/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplatePlugin/eclipse32.png
deleted file mode 100644
index 50ae49d..0000000
--- a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplatePlugin/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplatePlugin/plugin.properties b/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplatePlugin/plugin.properties
deleted file mode 100644
index 46b3449..0000000
--- a/jsf/features/org.eclipse.jst.webpageeditor.feature/sourceTemplatePlugin/plugin.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-###############################################################################
-# Copyright (c) 2005, 2007 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are 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:
-# Gerry Kessler - initial API and implementation
-###############################################################################
-# This file should be translated.
-# plugin.properties
-# contains externalized strings for manifest.mf
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-pluginName=Web Page Editor Source
-providerName=Eclipse.org
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/.classpath b/jsf/plugins/org.eclipse.jst.jsf.core/.classpath
deleted file mode 100644
index 304e861..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/.cvsignore b/jsf/plugins/org.eclipse.jst.jsf.core/.cvsignore
deleted file mode 100644
index 117a1fe..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-bin
-@dot*
-temp.folder
-build.xml
-javaCompiler...args
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/.options b/jsf/plugins/org.eclipse.jst.jsf.core/.options
deleted file mode 100644
index 9f678f4..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/.options
+++ /dev/null
@@ -1,15 +0,0 @@
-# Debugging options for the org.eclipse.jst.jsf.core
-
-# Turn on general debugging for the org.eclipse.jsf.core plugin.
-org.eclipse.jst.jsf.core/debug=false
-
-org.eclipse.jst.jsf.core/designtime/view/jsptagregistry=false
-org.eclipse.jst.jsf.core/designtime/view/jsptagregistry/changes=false
-org.eclipse.jst.jsf.core/designtime/view/jsptagregistry/perf=false
-
-org.eclipse.jst.jsf.core/designtime/view/tldregistrymanager=false
-
-org.eclipse.jst.jsf.core/designtime/view/jsptagpersistence=false
-
-org.eclipse.jst.jsf.core/designtime/view/jsptagintrospection=false
-org.eclipse.jst.jsf.core/designtime/view/jsptagintrospection/perf=false
\ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/.project b/jsf/plugins/org.eclipse.jst.jsf.core/.project
deleted file mode 100644
index 0cd3e27..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.jsf.core</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/.settings/org.eclipse.core.resources.prefs b/jsf/plugins/org.eclipse.jst.jsf.core/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 7a97ba4..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-#Mon Jun 04 13:52:01 PDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
-instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/.settings/org.eclipse.jdt.core.prefs b/jsf/plugins/org.eclipse.jst.jsf.core/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 42536dd..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,79 +0,0 @@
-#Tue Oct 23 12:04:38 PDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullReference=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=error
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=error
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/.settings/org.eclipse.jdt.ui.prefs b/jsf/plugins/org.eclipse.jst.jsf.core/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index 82eb6c1..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Fri Apr 06 18:25:15 PDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates/>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/.settings/org.eclipse.pde.prefs b/jsf/plugins/org.eclipse.jst.jsf.core/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index b6d2441..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,22 +0,0 @@
-#Fri May 30 11:46:47 PDT 2008
-compilers.f.unresolved-features=1
-compilers.f.unresolved-plugins=1
-compilers.incompatible-environment=1
-compilers.p.build=1
-compilers.p.deprecated=1
-compilers.p.discouraged-class=1
-compilers.p.internal=1
-compilers.p.missing-packages=0
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=0
-compilers.p.unknown-attribute=1
-compilers.p.unknown-class=1
-compilers.p.unknown-element=1
-compilers.p.unknown-identifier=1
-compilers.p.unknown-resource=1
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.s.create-docs=false
-compilers.s.doc-folder=doc
-compilers.s.open-tags=1
-eclipse.preferences.version=1
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/META-INF/MANIFEST.MF b/jsf/plugins/org.eclipse.jst.jsf.core/META-INF/MANIFEST.MF
deleted file mode 100644
index dee9295..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,120 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %plugin.name
-Bundle-SymbolicName: org.eclipse.jst.jsf.core; singleton:=true
-Bundle-Version: 1.1.100.qualifier
-Bundle-Activator: org.eclipse.jst.jsf.core.internal.JSFCorePlugin
-Bundle-Vendor: %plugin.provider
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.wst.common.project.facet.core;bundle-version="[1.2.0,2.0.0)",
- org.eclipse.jst.j2ee.web;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.jst.jsf.facesconfig;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.jst.j2ee;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.jst.j2ee.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.common.frameworks.ui;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.jst.jsp.core;bundle-version="[1.1.0,1.3.0)",
- org.eclipse.jst.jsf.common;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jface.text;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.html.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.validation;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.wst.sse.ui;bundle-version="[1.0.101,1.2.0)",
- org.eclipse.wst.common.emf;bundle-version="[1.1.103,2.0.0)",
- org.eclipse.jem.util;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.emf.common;bundle-version="[2.2.0,3.0.0)",
- org.eclipse.emf.ecore;bundle-version="[2.2.0,3.0.0)",
- org.eclipse.core.commands;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.swt;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.ui;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.emf.ecore.xmi;bundle-version="[2.2.0,3.0.0)",
- org.eclipse.emf.edit;bundle-version="[2.2.0,3.0.0)",
- org.eclipse.jst.common.project.facet.core;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.jst.jsf.common.runtime;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jem.proxy;bundle-version="[2.0.0,3.0.0)",
- javax.servlet;bundle-version="[2.4.0,3.0.0)",
- javax.servlet.jsp;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jst.common.frameworks;bundle-version="[1.1.102,1.2.0)",
- org.eclipse.wst.css.core;bundle-version="[1.1.200,1.2.0)"
-Bundle-ActivationPolicy: lazy
-Export-Package: org.eclipse.jst.jsf.core,
- org.eclipse.jst.jsf.core.internal;x-friends:="org.eclipse.jst.jsf.core.tests,org.eclipse.jst.jsf.ui,org.eclipse.jst.jsf.ui.tests",
- org.eclipse.jst.jsf.core.internal.contentassist.el;x-friends:="org.eclipse.jst.jsf.contentassist.tests",
- org.eclipse.jst.jsf.core.internal.jem;x-internal:=true,
- org.eclipse.jst.jsf.core.internal.jsflibraryconfig;x-friends:="org.eclipse.jst.jsf.core.tests,org.eclipse.jst.jsf.ui.tests,org.eclipse.jst.pagedesigner.tests",
- org.eclipse.jst.jsf.core.internal.jsflibraryregistry;
- x-friends:="org.eclipse.jst.jsf.core.tests,
- org.eclipse.jst.jsf.ui,
- org.eclipse.jst.jsf.ui.tests,
- org.eclipse.jst.pagedesigner.tests",
- org.eclipse.jst.jsf.core.internal.jsflibraryregistry.adapter;x-friends:="org.eclipse.jst.jsf.core.tests,org.eclipse.jst.jsf.ui,org.eclipse.jst.jsf.ui.tests",
- org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl;x-friends:="org.eclipse.jst.jsf.core.tests,org.eclipse.jst.jsf.ui,org.eclipse.jst.jsf.ui.tests",
- org.eclipse.jst.jsf.core.internal.jsflibraryregistry.util;x-friends:="org.eclipse.jst.jsf.core.tests,org.eclipse.jst.jsf.ui,org.eclipse.jst.jsf.ui.tests",
- org.eclipse.jst.jsf.core.internal.launch;x-internal:=true,
- org.eclipse.jst.jsf.core.internal.project.facet;x-friends:="org.eclipse.jst.jsf.core.tests,org.eclipse.jst.jsf.ui,org.eclipse.jst.jsf.ui.tests",
- org.eclipse.jst.jsf.core.internal.region;x-internal:=true,
- org.eclipse.jst.jsf.core.internal.tld;x-friends:="org.eclipse.jst.pagedesigner,org.eclipse.jst.jsf.core.tests",
- org.eclipse.jst.jsf.core.jsfappconfig,
- org.eclipse.jst.jsf.core.jsflibraryconfiguration,
- org.eclipse.jst.jsf.core.jsflibraryconfiguration.internal;x-friends:="org.eclipse.jst.jsf.core.tests",
- org.eclipse.jst.jsf.core.jsflibraryregistry,
- org.eclipse.jst.jsf.core.jsflibraryregistry.internal;x-friends:="org.eclipse.jst.jsf.core.tests",
- org.eclipse.jst.jsf.core.metadata.internal;x-internal:=true,
- org.eclipse.jst.jsf.core.set.constraint,
- org.eclipse.jst.jsf.core.set.mapping,
- org.eclipse.jst.jsf.core.tagmatcher,
- org.eclipse.jst.jsf.designtime,
- org.eclipse.jst.jsf.designtime.context,
- org.eclipse.jst.jsf.designtime.el,
- org.eclipse.jst.jsf.designtime.internal;x-internal:=true,
- org.eclipse.jst.jsf.designtime.internal.jsp;x-internal:=true,
- org.eclipse.jst.jsf.designtime.internal.resolver;x-internal:=true,
- org.eclipse.jst.jsf.designtime.internal.symbols;x-friends:="org.eclipse.jst.jsf.designtime.tests",
- org.eclipse.jst.jsf.designtime.internal.view;x-internal:=true,
- org.eclipse.jst.jsf.designtime.internal.view.mapping;x-internal:=true,
- org.eclipse.jst.jsf.designtime.internal.view.mapping.mappers;x-internal:=true,
- org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping;x-internal:=true,
- org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl;x-internal:=true,
- org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.util;x-internal:=true,
- org.eclipse.jst.jsf.designtime.internal.view.model;x-internal:=true,
- org.eclipse.jst.jsf.designtime.internal.view.model.jsp;x-internal:=true,
- org.eclipse.jst.jsf.designtime.internal.view.model.jsp.analyzer;x-friends:="org.eclipse.jst.jsf.designtime.tests",
- org.eclipse.jst.jsf.designtime.internal.view.model.jsp.persistence;x-internal:=true,
- org.eclipse.jst.jsf.designtime.internal.view.model.jsp.registry;x-friends:="org.eclipse.jst.jsf.designtime.tests",
- org.eclipse.jst.jsf.designtime.resolver,
- org.eclipse.jst.jsf.designtime.symbols,
- org.eclipse.jst.jsf.metadataprocessors,
- org.eclipse.jst.jsf.metadataprocessors.features,
- org.eclipse.jst.jsf.metadataprocessors.internal;x-friends:="org.eclipse.jst.jsf.metadata.tests",
- org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos;
- x-friends:="org.eclipse.jst.pagedesigner,
- org.eclipse.jst.pagedesigner.tests,
- org.eclipse.jst.jsf.metadata.tests,
- org.eclipse.jst.jsf.facelet.core,
- org.eclipse.jst.jsf.facelet.ui",
- org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl;
- x-friends:="org.eclipse.jst.pagedesigner,
- org.eclipse.jst.pagedesigner.tests,
- org.eclipse.jst.jsf.metadata.tests,
- org.eclipse.jst.jsf.facelet.core,
- org.eclipse.jst.jsf.facelet.ui",
- org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.util;
- x-friends:="org.eclipse.jst.pagedesigner,
- org.eclipse.jst.pagedesigner.tests,
- org.eclipse.jst.jsf.metadata.tests,
- org.eclipse.jst.jsf.facelet.core,
- org.eclipse.jst.jsf.facelet.ui",
- org.eclipse.jst.jsf.taglibprocessing.attributevalues,
- org.eclipse.jst.jsf.validation.internal;x-friends:="org.eclipse.jst.jsf.ui",
- org.eclipse.jst.jsf.validation.internal.appconfig;x-friends:="org.eclipse.jst.jsf.ui,org.eclipse.jst.jsf.core.tests",
- org.eclipse.jst.jsf.validation.internal.constraints;x-internal:=true,
- org.eclipse.jst.jsf.validation.internal.constraints.impl;x-internal:=true,
- org.eclipse.jst.jsf.validation.internal.constraints.util;x-internal:=true,
- org.eclipse.jst.jsf.validation.internal.el;x-friends:="org.eclipse.jst.jsf.ui,org.eclipse.jst.jsf.validation.el.tests",
- org.eclipse.jst.jsf.validation.internal.el.diagnostics;x-friends:="org.eclipse.jst.jsf.validation.el.tests",
- org.eclipse.jst.jsf.validation.internal.el.operators;x-internal:=true,
- org.eclipse.jst.jsf.validation.internal.strategy;x-internal:=true
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/about.html b/jsf/plugins/org.eclipse.jst.jsf.core/about.html
deleted file mode 100644
index 90bd74d..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/about.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June, 2008</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-</body>
-</html>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/build.properties b/jsf/plugins/org.eclipse.jst.jsf.core/build.properties
deleted file mode 100644
index 4802a7c..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/build.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-###############################################################################
-# Copyright (c) 2005 Oracle Corporation.
-# All rights reserved. This program and the accompanying materials
-# are 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:
-# Gerry Kessler - initial API and implementation
-###############################################################################
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.xml,\
- plugin.properties,\
- schema/,\
- about.html,\
- buildnotes_JSF.html,\
- .options,\
- jars/
-src.includes = buildnotes_JSF.html
-javacSource=1.5
-javacTarget=1.5
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/buildnotes_JSF.html b/jsf/plugins/org.eclipse.jst.jsf.core/buildnotes_JSF.html
deleted file mode 100644
index 6a7db49..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/buildnotes_JSF.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>JSF Tools Project Build Notes</title>
-</head>
-<body>
-<h1>JSF Tools Project Build Notes</h1>
-<h4>WTP-JSF 2.0 M5 build</h4>
-<h3>What's new in this drop?</h3>
-<ul>
- <li>Please see the New and Noteworthy section for a list of new
- features in the JSF Tools Project. Click on the link titled <b>"
- New for WTP 2.0 milestone build M4 (January 5, 2007)".</b></li>
-</ul>
-<h3>FAQ</h3>
-<ol>
- <b><i><li>How to make the Visual Page Designer the default editor for
- JSP pages?</li></i></b>
-<br>
- The JSF Tools Project-contributed Visual Page Designer (VPD) is NOT
- registered as the default editor for JSP files. You can make the VPD
- the default editor for JSP files by following these steps:
- <ul>
- <li>Navigate to "Window" -> "Preferences..." -> "General" ->
- "Editors" -> "File Associations"</li>
- <li>In the "File types" section, select "*.jsp"</li>
- <li>In the "Associated editors" section, select "Web Page Editor"</li>
- <li>Select the "Default" button</li>
- </ul>
-
-</ol>
-</body>
-</html>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/jars/fake_el.jar b/jsf/plugins/org.eclipse.jst.jsf.core/jars/fake_el.jar
deleted file mode 100644
index 78b04b1..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/jars/fake_el.jar
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/jars/fake_jsp_21.jar b/jsf/plugins/org.eclipse.jst.jsf.core/jars/fake_jsp_21.jar
deleted file mode 100644
index 66ce8d0..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/jars/fake_jsp_21.jar
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/model/PaletteInfos.ecore b/jsf/plugins/org.eclipse.jst.jsf.core/model/PaletteInfos.ecore
deleted file mode 100644
index ab8633b..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/model/PaletteInfos.ecore
+++ /dev/null
@@ -1,81 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ecore:EPackage xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="paletteinfos"
- nsURI="http://org.eclipse.jsf.pagedesigner/paletteInfos.ecore" nsPrefix="pi">
- <eClassifiers xsi:type="ecore:EClass" name="PaletteInfos">
- <eOperations name="findPaletteInfoById" eType="#//PaletteInfo">
- <eParameters name="id" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- </eOperations>
- <eStructuralFeatures xsi:type="ecore:EReference" name="infos" upperBound="-1"
- eType="#//PaletteInfo" containment="true">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="item"/>
- </eAnnotations>
- </eStructuralFeatures>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="PaletteInfo">
- <eOperations name="isExpert" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
- <eOperations name="isHidden" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="id" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="tag" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="displayLabel" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="display-label"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="description" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="expert" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="hidden" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="smallIcon" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="small-icon"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="largeIcon" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="large-icon"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EReference" name="tagCreation" eType="#//TagCreationInfo">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="tag-create"/>
- </eAnnotations>
- </eStructuralFeatures>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="TagCreationInfo">
- <eStructuralFeatures xsi:type="ecore:EReference" name="attributes" upperBound="-1"
- eType="#//TagCreationAttribute" containment="true">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="attribute"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="template" eType="ecore:EDataType ../../../plugin/org.eclipse.emf.ecore/model/XMLType.ecore#//AnySimpleType"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="TagCreationTemplate">
- <eStructuralFeatures xsi:type="ecore:EReference" name="template" eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EObject"
- containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="TagCreationAttribute">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="id" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- </eClassifiers>
-</ecore:EPackage>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/model/PaletteInfos.genmodel b/jsf/plugins/org.eclipse.jst.jsf.core/model/PaletteInfos.genmodel
deleted file mode 100644
index 44d5d22..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/model/PaletteInfos.genmodel
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<genmodel:GenModel xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" copyrightText="Copyright (c) 2007 Oracle Corporation"
- modelDirectory="/org.eclipse.jst.jsf.core/src" editDirectory="/org.eclipse.jst.jsf.core/src"
- editorDirectory="/org.eclipse.jst.jsf.core/src" modelPluginID="org.eclipse.jst.jsf.core"
- modelName="PaletteInfos" editPluginClass="org.eclipse.jst.jsf.core.internal.JSFCorePlugin"
- editorPluginClass="org.eclipse.jst.jsf.core.internal.JSFCorePlugin" testsDirectory="/org.eclipse.jst.jsf.core/src"
- testSuiteClass="org.eclipse.jst.jsf.core.internal.JSFCorePlugin" importerID="org.eclipse.emf.importer.ecore"
- editPluginID="org.eclipse.jst.jsf.core" usedGenPackages="platform:/plugin/org.eclipse.emf.ecore/model/XMLType.genmodel#//type">
- <foreignModel>PaletteInfos.ecore</foreignModel>
- <genPackages prefix="PaletteInfos" basePackage="org.eclipse.jst.jsf.tagdisplay.internal"
- disposableProviderFactory="true" generateExampleClass="false" multipleEditorPages="false"
- generateModelWizard="false" ecorePackage="PaletteInfos.ecore#/">
- <genClasses ecoreClass="PaletteInfos.ecore#//PaletteInfos">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference PaletteInfos.ecore#//PaletteInfos/infos"/>
- <genOperations ecoreOperation="PaletteInfos.ecore#//PaletteInfos/findPaletteInfoById">
- <genParameters ecoreParameter="PaletteInfos.ecore#//PaletteInfos/findPaletteInfoById/id"/>
- </genOperations>
- </genClasses>
- <genClasses ecoreClass="PaletteInfos.ecore#//PaletteInfo">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute PaletteInfos.ecore#//PaletteInfo/id"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute PaletteInfos.ecore#//PaletteInfo/tag"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute PaletteInfos.ecore#//PaletteInfo/displayLabel"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute PaletteInfos.ecore#//PaletteInfo/description"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute PaletteInfos.ecore#//PaletteInfo/expert"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute PaletteInfos.ecore#//PaletteInfo/hidden"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute PaletteInfos.ecore#//PaletteInfo/smallIcon"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute PaletteInfos.ecore#//PaletteInfo/largeIcon"/>
- <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference PaletteInfos.ecore#//PaletteInfo/tagCreation"/>
- <genOperations ecoreOperation="PaletteInfos.ecore#//PaletteInfo/isExpert"/>
- <genOperations ecoreOperation="PaletteInfos.ecore#//PaletteInfo/isHidden"/>
- </genClasses>
- <genClasses ecoreClass="PaletteInfos.ecore#//TagCreationInfo">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference PaletteInfos.ecore#//TagCreationInfo/attributes"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute PaletteInfos.ecore#//TagCreationInfo/template"/>
- </genClasses>
- <genClasses ecoreClass="PaletteInfos.ecore#//TagCreationTemplate">
- <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference PaletteInfos.ecore#//TagCreationTemplate/template"/>
- </genClasses>
- <genClasses ecoreClass="PaletteInfos.ecore#//TagCreationAttribute">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute PaletteInfos.ecore#//TagCreationAttribute/id"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute PaletteInfos.ecore#//TagCreationAttribute/value"/>
- </genClasses>
- </genPackages>
-</genmodel:GenModel>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/model/componentMapping.ecore b/jsf/plugins/org.eclipse.jst.jsf.core/model/componentMapping.ecore
deleted file mode 100644
index 1c882cf..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/model/componentMapping.ecore
+++ /dev/null
@@ -1,143 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ecore:EPackage xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="viewmapping"
- nsURI="http://org.eclipse.jst.jsf.core/componentMapping.ecore" nsPrefix="viewMap">
- <eClassifiers xsi:type="ecore:EClass" name="TagMapping">
- <eOperations name="findBestMapping">
- <eParameters name="jsfVersion" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eParameters name="libVersion" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- </eOperations>
- <eStructuralFeatures xsi:type="ecore:EReference" name="versionedTagToViewMappings"
- upperBound="-1" eType="#//TagToViewObjectMapping" containment="true">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="versionedTagToViewMappings"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="customConversionFactoryId"
- eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="customConversionFactoryId"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="beanMappedProperties" upperBound="-1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString" defaultValueLiteral="">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="beanMappedProperties"/>
- </eAnnotations>
- </eStructuralFeatures>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="TagToViewObjectMapping">
- <eStructuralFeatures xsi:type="ecore:EReference" name="typeInfo" eType="#//ClassTypeInfo_"
- containment="true">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="typeInfo"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="minJSFVersion" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
- defaultValueLiteral="1.1">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="minVersion"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="minLibraryVersion" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
- defaultValueLiteral="">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="minLibraryVersion"/>
- </eAnnotations>
- </eStructuralFeatures>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="ClassTypeInfo_">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="className" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="className"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="superClasses" upperBound="-1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="superClasses"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="interfaces" upperBound="-1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="interfaces"/>
- </eAnnotations>
- </eStructuralFeatures>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="ComponentTypeInfo_" eSuperTypes="#//ClassTypeInfo_">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="componentType" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="componentType"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="componentFamily" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="componentFamily"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="renderType" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="renderType"/>
- </eAnnotations>
- </eStructuralFeatures>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="ConverterTypeInfo_" eSuperTypes="#//ClassTypeInfo_">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="converterId" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="converterId"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="forClasses" upperBound="-1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="forClass"/>
- </eAnnotations>
- </eStructuralFeatures>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="ValidatorTypeInfo_" eSuperTypes="#//ClassTypeInfo_">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="validatorId" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="validatorId"/>
- </eAnnotations>
- </eStructuralFeatures>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="AttributeToPropertyMapping">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="propertyName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="propertyName"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="elAllowed" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
- defaultValueLiteral="true">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="elAllowed"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="customConversionFactoryId"
- eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="customConversionFactoryId"/>
- </eAnnotations>
- </eStructuralFeatures>
- </eClassifiers>
-</ecore:EPackage>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/model/componentMapping.genmodel b/jsf/plugins/org.eclipse.jst.jsf.core/model/componentMapping.genmodel
deleted file mode 100644
index 19135f6..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/model/componentMapping.genmodel
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<genmodel:GenModel xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.eclipse.jst.jsf.core/src"
- modelPluginID="org.eclipse.jst.jsf.core" modelName="ComponentMapping" importerID="org.eclipse.emf.importer.ecore"
- complianceLevel="5.0" language="">
- <foreignModel>componentMapping.ecore</foreignModel>
- <genPackages prefix="ComponentMapping" basePackage="org.eclipse.jst.jsf.designtime.internal.view.mapping"
- resource="XML" disposableProviderFactory="true" ecorePackage="componentMapping.ecore#/">
- <genClasses ecoreClass="componentMapping.ecore#//TagComponentMapping">
- <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference componentMapping.ecore#//TagComponentMapping/typeInfo"/>
- </genClasses>
- <genClasses ecoreClass="componentMapping.ecore#//ClassTypeInfo_">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute componentMapping.ecore#//ClassTypeInfo_/className"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute componentMapping.ecore#//ClassTypeInfo_/superClasses"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute componentMapping.ecore#//ClassTypeInfo_/interfaces"/>
- </genClasses>
- <genClasses ecoreClass="componentMapping.ecore#//ComponentTypeInfo_">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute componentMapping.ecore#//ComponentTypeInfo_/componentType"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute componentMapping.ecore#//ComponentTypeInfo_/componentFamily"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute componentMapping.ecore#//ComponentTypeInfo_/renderType"/>
- </genClasses>
- <genClasses ecoreClass="componentMapping.ecore#//ConverterTypeInfo_">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute componentMapping.ecore#//ConverterTypeInfo_/converterId"/>
- </genClasses>
- <genClasses ecoreClass="componentMapping.ecore#//ValidatorTypeInfo_">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute componentMapping.ecore#//ValidatorTypeInfo_/validatorId"/>
- </genClasses>
- </genPackages>
-</genmodel:GenModel>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/model/constraints.ecore b/jsf/plugins/org.eclipse.jst.jsf.core/model/constraints.ecore
deleted file mode 100644
index de5a6ff..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/model/constraints.ecore
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ecore:EPackage xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="constraints"
- nsURI="http://org.eclipse.jst.jsf.core/constraints.ecore" nsPrefix="cnst">
- <eClassifiers xsi:type="ecore:EClass" name="TagId">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="uri" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="uri"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="name"/>
- </eAnnotations>
- </eStructuralFeatures>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="TagSet">
- <eStructuralFeatures xsi:type="ecore:EReference" name="tags" upperBound="-1" eType="#//TagId">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="tagId"/>
- </eAnnotations>
- </eStructuralFeatures>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="ContainsTagConstraint">
- <eStructuralFeatures xsi:type="ecore:EReference" name="setGenerator" eType="ecore:EClass ../../org.eclipse.jst.jsf.common/model/metadataTraitTypes.ecore#//SetGenerator">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="set-generator"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EReference" name="satisfiesSet" eType="#//TagSet">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="satisfies-set"/>
- </eAnnotations>
- </eStructuralFeatures>
- </eClassifiers>
-</ecore:EPackage>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/model/constraints.genmodel b/jsf/plugins/org.eclipse.jst.jsf.core/model/constraints.genmodel
deleted file mode 100644
index e7ae676..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/model/constraints.genmodel
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<genmodel:GenModel xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.eclipse.jst.jsf.core/src"
- modelPluginID="org.eclipse.jst.jsf.core" modelName="Constraints" importerID="org.eclipse.emf.importer.ecore"
- usedGenPackages="../../org.eclipse.jst.jsf.common/model/metadataTraitTypes.genmodel#//traittypes">
- <foreignModel>constraints.ecore</foreignModel>
- <genPackages prefix="Constraints" basePackage="org.eclipse.jst.jsf.validation.internal"
- resource="XML" disposableProviderFactory="true" ecorePackage="constraints.ecore#/">
- <genClasses ecoreClass="constraints.ecore#//TagId">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute constraints.ecore#//TagId/uri"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute constraints.ecore#//TagId/name"/>
- </genClasses>
- <genClasses ecoreClass="constraints.ecore#//TagSet">
- <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference constraints.ecore#//TagSet/tags"/>
- </genClasses>
- <genClasses ecoreClass="constraints.ecore#//ContainsTagConstraint">
- <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference constraints.ecore#//ContainsTagConstraint/setGenerator"/>
- <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference constraints.ecore#//ContainsTagConstraint/satisfiesSet"/>
- </genClasses>
- </genPackages>
-</genmodel:GenModel>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/model/jsflibraryregistry.ecore b/jsf/plugins/org.eclipse.jst.jsf.core/model/jsflibraryregistry.ecore
deleted file mode 100644
index dfbc002..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/model/jsflibraryregistry.ecore
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ecore:EPackage xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="jsflibraryregistry"
- nsURI="http://www.eclipse.org/webtools/jsf/schema/jsflibraryregistry.xsd" nsPrefix="jsflibreg">
- <eClassifiers xsi:type="ecore:EClass" name="JSFLibraryRegistry">
- <eOperations name="getJSFLibraryByID" lowerBound="1" eType="#//JSFLibrary">
- <eParameters name="ID" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- </eOperations>
- <eOperations name="getJSFLibrariesByName" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EEList">
- <eParameters name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- </eOperations>
- <eOperations name="getImplJSFLibraries" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EEList"/>
- <eOperations name="getNonImplJSFLibraries" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EEList"/>
- <eOperations name="getAllJSFLibraries" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EEList"/>
- <eOperations name="addJSFLibrary" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
- <eParameters name="library" lowerBound="1" eType="#//JSFLibrary"/>
- </eOperations>
- <eOperations name="removeJSFLibrary" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
- <eParameters name="library" lowerBound="1" eType="#//JSFLibrary"/>
- </eOperations>
- <eOperations name="getDefaultImplementation" lowerBound="1" eType="#//JSFLibrary"/>
- <eOperations name="setDefaultImplementation" lowerBound="1">
- <eParameters name="implementation" lowerBound="1" eType="#//JSFLibrary"/>
- </eOperations>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="DefaultImplementationID"
- eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString" defaultValueLiteral=""/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="JSFLibraries" upperBound="-1"
- eType="#//JSFLibrary" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="PluginProvidedJSFLibraries"
- upperBound="-1" eType="#//PluginProvidedJSFLibrary" transient="true" containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="JSFLibrary">
- <eOperations name="containsArchiveFile" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
- <eParameters name="fullPath" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- </eOperations>
- <eOperations name="getWorkingCopy" lowerBound="1" eType="#//JSFLibrary"/>
- <eOperations name="updateValues" lowerBound="1">
- <eParameters name="otherLibrary" lowerBound="1" eType="#//JSFLibrary"/>
- </eOperations>
- <eOperations name="copyTo" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
- <eParameters name="baseDestLocation" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- </eOperations>
- <eOperations name="getLabel" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="ID" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
- changeable="false" transient="true" defaultValueLiteral="" derived="true"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="Name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="JSFVersion" lowerBound="1"
- eType="#//JSFVersion" defaultValueLiteral="UNKNOWN"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="Deployed" lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean" defaultValueLiteral="true"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="Implementation" lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean" defaultValueLiteral="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="ArchiveFiles" upperBound="-1"
- eType="#//ArchiveFile" containment="true" eOpposite="#//ArchiveFile/JSFLibrary"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="PluginProvidedJSFLibrary" eSuperTypes="#//JSFLibrary">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="pluginID" lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="Label" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="ArchiveFile">
- <eOperations name="getName" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eOperations name="getPath" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eOperations name="exists" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
- <eOperations name="equals" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
- <eParameters name="object" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EJavaObject"/>
- </eOperations>
- <eOperations name="hashCode" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
- <eOperations name="copyTo" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
- <eParameters name="baseDestLocation" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- </eOperations>
- <eOperations name="getResolvedSourceLocation" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="RelativeToWorkspace" lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean" defaultValueLiteral="true"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="SourceLocation" lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="RelativeDestLocation" lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="JSFLibrary" lowerBound="1"
- eType="#//JSFLibrary" eOpposite="#//JSFLibrary/ArchiveFiles"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="JSFVersion">
- <eLiterals name="UNKNOWN" value="-1"/>
- <eLiterals name="v1_1" value="1"/>
- <eLiterals name="v1_2" value="2"/>
- </eClassifiers>
-</ecore:EPackage>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/model/jsflibraryregistry.genmodel b/jsf/plugins/org.eclipse.jst.jsf.core/model/jsflibraryregistry.genmodel
deleted file mode 100644
index 2c7c455..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/model/jsflibraryregistry.genmodel
+++ /dev/null
@@ -1,82 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<genmodel:GenModel xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" copyrightText="Copyright (c) 2005 Oracle Corporation"
- modelDirectory="/org.eclipse.jst.jsf.core/src" editDirectory="/org.eclipse.jst.jsf.core.edit/src"
- editorDirectory="/org.eclipse.jst.jsf.core.editor/src" modelPluginID="org.eclipse.jst.jsf.core"
- templateDirectory="templates" dynamicTemplates="true" modelName="JSFLibraryRegistry"
- importerID="org.eclipse.emf.importer.ecore">
- <foreignModel>jsflibraryregistry.ecore</foreignModel>
- <genPackages prefix="JSFLibraryRegistry" basePackage="org.eclipse.jst.jsf.core.internal"
- resource="XML" disposableProviderFactory="true" ecorePackage="jsflibraryregistry.ecore#/">
- <genEnums ecoreEnum="jsflibraryregistry.ecore#//JSFVersion">
- <genEnumLiterals ecoreEnumLiteral="jsflibraryregistry.ecore#//JSFVersion/UNKNOWN"/>
- <genEnumLiterals ecoreEnumLiteral="jsflibraryregistry.ecore#//JSFVersion/v1_1"/>
- <genEnumLiterals ecoreEnumLiteral="jsflibraryregistry.ecore#//JSFVersion/v1_2"/>
- </genEnums>
- <genClasses ecoreClass="jsflibraryregistry.ecore#//JSFLibraryRegistry">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jsflibraryregistry.ecore#//JSFLibraryRegistry/DefaultImplementationID"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference jsflibraryregistry.ecore#//JSFLibraryRegistry/JSFLibraries"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference jsflibraryregistry.ecore#//JSFLibraryRegistry/PluginProvidedJSFLibraries"/>
- <genOperations ecoreOperation="jsflibraryregistry.ecore#//JSFLibraryRegistry/getJSFLibraryByID">
- <genParameters ecoreParameter="jsflibraryregistry.ecore#//JSFLibraryRegistry/getJSFLibraryByID/ID"/>
- </genOperations>
- <genOperations ecoreOperation="jsflibraryregistry.ecore#//JSFLibraryRegistry/getJSFLibrariesByName">
- <genParameters ecoreParameter="jsflibraryregistry.ecore#//JSFLibraryRegistry/getJSFLibrariesByName/name"/>
- </genOperations>
- <genOperations ecoreOperation="jsflibraryregistry.ecore#//JSFLibraryRegistry/getImplJSFLibraries"/>
- <genOperations ecoreOperation="jsflibraryregistry.ecore#//JSFLibraryRegistry/getNonImplJSFLibraries"/>
- <genOperations ecoreOperation="jsflibraryregistry.ecore#//JSFLibraryRegistry/getAllJSFLibraries"/>
- <genOperations ecoreOperation="jsflibraryregistry.ecore#//JSFLibraryRegistry/addJSFLibrary">
- <genParameters ecoreParameter="jsflibraryregistry.ecore#//JSFLibraryRegistry/addJSFLibrary/library"/>
- </genOperations>
- <genOperations ecoreOperation="jsflibraryregistry.ecore#//JSFLibraryRegistry/removeJSFLibrary">
- <genParameters ecoreParameter="jsflibraryregistry.ecore#//JSFLibraryRegistry/removeJSFLibrary/library"/>
- </genOperations>
- <genOperations ecoreOperation="jsflibraryregistry.ecore#//JSFLibraryRegistry/getDefaultImplementation"/>
- <genOperations ecoreOperation="jsflibraryregistry.ecore#//JSFLibraryRegistry/setDefaultImplementation">
- <genParameters ecoreParameter="jsflibraryregistry.ecore#//JSFLibraryRegistry/setDefaultImplementation/implementation"/>
- </genOperations>
- </genClasses>
- <genClasses ecoreClass="jsflibraryregistry.ecore#//JSFLibrary">
- <genFeatures property="Readonly" createChild="false" ecoreFeature="ecore:EAttribute jsflibraryregistry.ecore#//JSFLibrary/ID"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jsflibraryregistry.ecore#//JSFLibrary/Name"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jsflibraryregistry.ecore#//JSFLibrary/JSFVersion"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jsflibraryregistry.ecore#//JSFLibrary/Deployed"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jsflibraryregistry.ecore#//JSFLibrary/Implementation"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference jsflibraryregistry.ecore#//JSFLibrary/ArchiveFiles"/>
- <genOperations ecoreOperation="jsflibraryregistry.ecore#//JSFLibrary/containsArchiveFile">
- <genParameters ecoreParameter="jsflibraryregistry.ecore#//JSFLibrary/containsArchiveFile/fullPath"/>
- </genOperations>
- <genOperations ecoreOperation="jsflibraryregistry.ecore#//JSFLibrary/getWorkingCopy"/>
- <genOperations ecoreOperation="jsflibraryregistry.ecore#//JSFLibrary/updateValues">
- <genParameters ecoreParameter="jsflibraryregistry.ecore#//JSFLibrary/updateValues/otherLibrary"/>
- </genOperations>
- <genOperations ecoreOperation="jsflibraryregistry.ecore#//JSFLibrary/copyTo">
- <genParameters ecoreParameter="jsflibraryregistry.ecore#//JSFLibrary/copyTo/baseDestLocation"/>
- </genOperations>
- <genOperations ecoreOperation="jsflibraryregistry.ecore#//JSFLibrary/getLabel"/>
- </genClasses>
- <genClasses ecoreClass="jsflibraryregistry.ecore#//PluginProvidedJSFLibrary">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jsflibraryregistry.ecore#//PluginProvidedJSFLibrary/pluginID"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jsflibraryregistry.ecore#//PluginProvidedJSFLibrary/Label"/>
- </genClasses>
- <genClasses ecoreClass="jsflibraryregistry.ecore#//ArchiveFile">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jsflibraryregistry.ecore#//ArchiveFile/RelativeToWorkspace"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jsflibraryregistry.ecore#//ArchiveFile/SourceLocation"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute jsflibraryregistry.ecore#//ArchiveFile/RelativeDestLocation"/>
- <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference jsflibraryregistry.ecore#//ArchiveFile/JSFLibrary"/>
- <genOperations ecoreOperation="jsflibraryregistry.ecore#//ArchiveFile/getName"/>
- <genOperations ecoreOperation="jsflibraryregistry.ecore#//ArchiveFile/getPath"/>
- <genOperations ecoreOperation="jsflibraryregistry.ecore#//ArchiveFile/exists"/>
- <genOperations ecoreOperation="jsflibraryregistry.ecore#//ArchiveFile/equals">
- <genParameters ecoreParameter="jsflibraryregistry.ecore#//ArchiveFile/equals/object"/>
- </genOperations>
- <genOperations ecoreOperation="jsflibraryregistry.ecore#//ArchiveFile/hashCode"/>
- <genOperations ecoreOperation="jsflibraryregistry.ecore#//ArchiveFile/copyTo">
- <genParameters ecoreParameter="jsflibraryregistry.ecore#//ArchiveFile/copyTo/baseDestLocation"/>
- </genOperations>
- <genOperations ecoreOperation="jsflibraryregistry.ecore#//ArchiveFile/getResolvedSourceLocation"/>
- </genClasses>
- </genPackages>
-</genmodel:GenModel>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/model/templates/Header.javajetinc b/jsf/plugins/org.eclipse.jst.jsf.core/model/templates/Header.javajetinc
deleted file mode 100644
index aadfb40..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/model/templates/Header.javajetinc
+++ /dev/null
@@ -1,10 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/plugin.properties b/jsf/plugins/org.eclipse.jst.jsf.core/plugin.properties
deleted file mode 100644
index 1a5a435..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/plugin.properties
+++ /dev/null
@@ -1,37 +0,0 @@
-###############################################################################
-# Copyright (c) 2005 Oracle Corporation.
-# All rights reserved. This program and the accompanying materials
-# are 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:
-# Gerry Kessler - initial API and implementation
-###############################################################################
-plugin.name=JavaServer Faces Tools - Core
-plugin.provider=Eclipse.org
-plugin.facet.description=Enables the project to be deployed with JSF capabilities.
-
-JSFELValidator=JSP JSF EL Validator
-
-JSFv12Project=JavaServer Faces v1.2 Project
-JSFv12PresetDesc=Configures a Dynamic Web application to use JSF v1.2
-# ====================================================================
-
-pluginName = Constraints Model
-providerName = www.example.org
-
-plugin.facet.extension.name=JavaServer Faces
-
-JSP_TAG_REGISTRY_DESCRIPTION = JSP tag registry
-extension-point.name.0 = jsfLibraries
-extension-point.name.1 = pluginProvidedJsfLibraries
-extension-point.name.2 = Property Resolver Ext Point
-extension-point.name.3 = Method Resolver Ext Point
-extension-point.name.4 = External Context Ext Point
-extension-point.name.5 = MetaDataEnabledFeatures
-extension-point.name.6 = JSF View Handler Extension
-extension-point.name.7 = customViewMapper
-extension-point.name.8 = Variable Resolver Ext Point
-extension-point.name.9 = AttributeValueRuntimeTypes
-extension-point.name.10 = JSF Tag Library Registry
\ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/plugin.xml b/jsf/plugins/org.eclipse.jst.jsf.core/plugin.xml
deleted file mode 100644
index 1147025..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/plugin.xml
+++ /dev/null
@@ -1,375 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
- <extension-point id="jsfLibraries" name="%extension-point.name.0" schema="schema/jsfLibraries.exsd"/>
- <extension-point id="pluginProvidedJsfLibraries" name="%extension-point.name.1" schema="schema/pluginProvidedJsfLibraries.exsd"/>
- <extension-point id="variableresolver" name="%extension-point.name.8" schema="schema/variableresolver.exsd"/>
- <extension-point id="propertyresolver" name="%extension-point.name.2" schema="schema/propertyresolver.exsd"/>
- <extension-point id="methodresolver" name="%extension-point.name.3" schema="schema/methodresolver.exsd"/>
- <extension-point id="externalcontext" name="%extension-point.name.4" schema="schema/externalcontext.exsd"/>
- <extension-point id="AttributeValueRuntimeTypes" name="%extension-point.name.9" schema="schema/AttributeValueRuntimeTypes.exsd"/>
- <extension-point id="MetaDataEnabledFeatures" name="%extension-point.name.5" schema="schema/MetaDataEnabledFeatures.exsd"/>
- <extension-point id="tagregistry" name="%extension-point.name.10" schema="schema/tagregistry.exsd"/>
- <extension-point id="viewhandler" name="%extension-point.name.6" schema="schema/viewhandler.exsd"/>
- <extension-point id="customViewMapper" name="%extension-point.name.7" schema="schema/customViewMapper.exsd"/>
-
- <extension point="org.eclipse.emf.ecore.generated_package">
- <package
- uri = "http://org.eclipse.jst.jsf.core/constraints.ecore"
- class = "org.eclipse.jst.jsf.validation.internal.constraints.ConstraintsPackage"
- genModel = "model/constraints.genmodel" />
- <package
- uri = "http://org.eclipse.jsf.pagedesigner/paletteInfos.ecore"
- class = "org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfosPackage"
- genModel = "model/paletteInfos.genmodel" />
- <package
- uri = "http://org.eclipse.jst.jsf.core/componentMapping.ecore"
- class = "org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage"
- genModel = "model/componentMapping.genmodel" />
- </extension>
- <!-- JSF Project Facets -->
- <extension
- id="org.eclipse.jst.jsf.project.facet"
- name="%plugin.facet.extension.name"
- point="org.eclipse.wst.common.project.facet.core.facets">
-
- <project-facet id="jst.jsf">
- <label>JavaServer Faces</label>
- <description>%plugin.facet.description</description>
- <default-version
- provider="org.eclipse.jst.jsf.core.internal.project.facet.JSFFacetDefaultVersionProvider">
- </default-version>
- </project-facet>
-
- <project-facet-version facet="jst.jsf" version="1.1">
- <constraint>
- <and>
- <requires facet="jst.web" version="[2.3"/>
- </and>
- </constraint>
- </project-facet-version>
-
- <project-facet-version facet="jst.jsf" version="1.2">
- <constraint>
- <and>
- <requires facet="jst.web" version="[2.5"/>
- </and>
- </constraint>
- </project-facet-version>
-
- <action id="jst.jsf.v11.install" facet="jst.jsf" type="INSTALL" version="1.1">
- <delegate class="org.eclipse.jst.jsf.core.internal.project.facet.JSFFacetInstallDelegate"/>
- <config-factory class="org.eclipse.jst.jsf.core.internal.project.facet.JSFFacetInstallDataModelProvider"/>
- </action>
-
- <action id="jst.jsf.v11.uninstall" facet="jst.jsf" type="UNINSTALL" version="1.1" >
- <delegate
- class="org.eclipse.jst.jsf.core.internal.project.facet.JSFFacetUninstallDelegate"/>
- </action>
-
- <action id="jst.jsf.v12.install" facet="jst.jsf" type="INSTALL" version="[1.2">
- <delegate class="org.eclipse.jst.jsf.core.internal.project.facet.JSFFacetInstallDelegate"/>
- <config-factory class="org.eclipse.jst.jsf.core.internal.project.facet.JSFFacetInstallDataModelProvider"/>
- </action>
-
- <action id="jst.jsf.v12.uninstall" facet="jst.jsf" version="[1.2" type="UNINSTALL">
- <delegate
- class="org.eclipse.jst.jsf.core.internal.project.facet.JSFFacetUninstallDelegate"/>
- </action>
-
- </extension>
-
- <extension
- point="org.eclipse.wst.common.project.facet.core.listeners">
- <listener
- class="org.eclipse.jst.jsf.core.internal.project.facet.JSFFacetPrimaryRuntimeChangedListener"
- eventTypes="PRIMARY_RUNTIME_CHANGED">
- </listener>
- </extension>
-
- <extension
- point="org.eclipse.wst.common.project.facet.core.presets">
- <dynamic-preset id="preset.jst.jsf.v1_1">
- <factory class="org.eclipse.jst.jsf.core.internal.project.facet.JSFConfigurationPresetFactory11"/>
- </dynamic-preset>
- <static-preset
- id="preset.jst.jsf.v1_2">
- <label>%JSFv12Project</label>
- <facet id="jst.java" version="5.0" />
- <facet id="jst.web" version="2.5"/>
- <facet id="jst.jsf" version="1.2" />
- <description>
- %JSFv12PresetDesc
- </description>
- </static-preset>
- </extension>
-
- <extension point="org.eclipse.wst.common.project.facet.core.runtimes">
- <supported>
- <runtime-component any="true"/>
- <facet id="jst.jsf" version="1.1,1.2"/>
- </supported>
- </extension>
-
- <extension
- name="JSF JSP File URL"
- point="org.eclipse.jst.j2ee.web.fileURL">
- <fileURL id="jsfPage"><run class="org.eclipse.jst.jsf.core.internal.launch.JSFFileURL"/></fileURL>
- </extension>
-
- <extension
- point="org.eclipse.ui.startup">
- <startup class="org.eclipse.jst.jsf.designtime.internal.jsp.StartupHandler"/>
- <!--
- <startup
- class="org.eclipse.jst.jsf.core.internal.RegistryMigrationStartupHandler">
- </startup>
- -->
- </extension>
- <extension
- point="org.eclipse.jst.jsf.common.symbolSourceProvider">
- <symbolSourceId factory="org.eclipse.jst.jsf.designtime.internal.symbols.JSPTagVariableSymbolSourceProvider"/>
- </extension>
- <extension
- point="org.eclipse.jst.jsf.common.contextSymbolFactory">
- <contextSymbolFactory
- factory="org.eclipse.jst.jsf.designtime.internal.jsp.JSPDefaultSymbolFactory"
- factoryId="org.eclipse.jst.jsf.designtime.core.loadBundle"/>
- </extension>
- <extension
- point="org.eclipse.jst.jsf.core.variableresolver">
- <variableresolver
- class="org.eclipse.jst.jsf.designtime.internal.symbols.ConfigBasedDTVariableResolver"
- id="org.eclipse.jst.jsf.core.variableresolver.default.decorative"/>
- </extension>
- <extension
- point="org.eclipse.jst.jsf.core.variableresolver">
- <variableresolver
- class="org.eclipse.jst.jsf.designtime.el.DefaultDTVariableResolver"
- id="org.eclipse.jst.jsf.core.variableresolver.default"/>
- </extension>
- <extension
- point="org.eclipse.jst.jsf.core.propertyresolver">
- <propertyresolver
- class="org.eclipse.jst.jsf.designtime.el.DefaultDTPropertyResolver"
- id="org.eclipse.jst.jsf.core.propertyresolver.default"/>
- </extension>
- <extension
- point="org.eclipse.jst.jsf.core.propertyresolver">
- <propertyresolver
- class="org.eclipse.jst.jsf.designtime.internal.symbols.ConfigBasedDTPropertyResolver"
- id="org.eclipse.jst.jsf.core.propertyresolver.default.decorative"
- instancePerProject="true">
- </propertyresolver>
- </extension>
- <extension
- point="org.eclipse.jst.jsf.core.methodresolver">
- <methodresolver
- class="org.eclipse.jst.jsf.designtime.el.DefaultDTMethodResolver"
- id="org.eclipse.jst.jsf.core.methodresolver.default"/>
- </extension>
- <extension
- point="org.eclipse.jst.jsf.core.externalcontext">
- <externalcontext
- class="org.eclipse.jst.jsf.designtime.context.DefaultDTExternalContextFactory"
- id="org.eclipse.jst.jsf.core.externalcontext.default"/>
- </extension>
-
- <extension
- point="org.eclipse.jst.jsf.core.AttributeValueRuntimeTypes">
-
- <attributeValueRuntimeType
- class="org.eclipse.jst.jsf.metadataprocessors.AbstractRootTypeDescriptor"
- id="attributevalues.BaseType"/>
- <attributeValueRuntimeType
- class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.StringType"
- id="attributevalues.StringType"/>
- <attributeValueRuntimeType
- class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.BooleanType"
- id="attributevalues.BooleanType"/>
- <attributeValueRuntimeType
- class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.LongType"
- id="attributevalues.LongType"/>
- <attributeValueRuntimeType
- class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.IntegerType"
- id="attributevalues.IntegerType"/>
- <attributeValueRuntimeType
- class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.DoubleType"
- id="attributevalues.DoubleType"/>
- <attributeValueRuntimeType
- class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.JavaClassType"
- id="attributevalues.JavaClassType"/>
- <attributeValueRuntimeType
- class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.MethodBindingType"
- id="attributevalues.MethodBindingType"/>
- <attributeValueRuntimeType
- class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.ActionType"
- id="attributevalues.ActionType"/>
- <attributeValueRuntimeType
- class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.ValueBindingType"
- id="attributevalues.ValueBindingType"/>
- <attributeValueRuntimeType
- class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.ValueType"
- id="attributevalues.ValueType"/>
- <attributeValueRuntimeType
- class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.FacesConfigIdentifierType"
- id="attributevalues.FacesConfigIdentifierType"/>
- <attributeValueRuntimeType
- class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.FacesConfigValidatorIDType"
- id="attributevalues.FacesConfigValidatorIDType"/>
- <attributeValueRuntimeType
- class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.FacesConfigConverterIDType"
- id="attributevalues.FacesConfigConverterIDType"/>
- <attributeValueRuntimeType
- class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.ComponentBindingType"
- id="attributevalues.ComponentBindingType"/>
- <attributeValueRuntimeType
- class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.ComponentIDType"
- id="attributevalues.ComponentIDType"/>
- <attributeValueRuntimeType
- class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.LengthType"
- id="attributevalues.LengthType"/>
- <attributeValueRuntimeType
- class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.ColorType"
- id="attributevalues.ColorType"/>
- <attributeValueRuntimeType
- class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.ResourceBundleType"
- id="attributevalues.ResourceBundleType"/>
- <attributeValueRuntimeType
- class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.LanguageCodeType"
- id="attributevalues.LanguageCodeType"/>
- <attributeValueRuntimeType
- class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.RelativePathType"
- id="attributevalues.RelativePathType"/>
- <attributeValueRuntimeType
- class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.WebPathType"
- id="attributevalues.WebPathType"/>
- <attributeValueRuntimeType
- class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.CurrencyCodeType"
- id="attributevalues.CurrencyCodeType"/>
- <attributeValueRuntimeType
- class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.LocaleType"
- id="attributevalues.LocaleType"/>
- <attributeValueRuntimeType
- class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.TimeZoneType"
- id="attributevalues.TimeZoneType"/>
- <attributeValueRuntimeType
- class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.DateTimePatternType"
- id="attributevalues.DateTimePatternType"/>
- <attributeValueRuntimeType
- class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.NumberPatternType"
- id="attributevalues.NumberPatternType"/>
- <attributeValueRuntimeType
- class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.ScriptType"
- id="attributevalues.ScriptType"/>
- <attributeValueRuntimeType
- class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.CharacterType"
- id="attributevalues.CharacterType"/>
- <attributeValueRuntimeType
- class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.LinkType"
- id="attributevalues.LinkType"/>
- <attributeValueRuntimeType
- class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.ContentType"
- id="attributevalues.ContentType"/>
- <attributeValueRuntimeType
- class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.URIType"
- id="attributevalues.URIType"/>
- <attributeValueRuntimeType
- class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.CSSClassType"
- id="attributevalues.CSSClassType"/>
- <attributeValueRuntimeType
- class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.CSSIdType"
- id="attributevalues.CSSIdType"/>
- <attributeValueRuntimeType
- class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.CSSStyleType"
- id="attributevalues.CSSStyleType"/>
- </extension>
-
- <extension
- point="org.eclipse.jst.jsf.core.MetaDataEnabledFeatures">
- <MetaDataEnabledFeature
- class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.FacesConfigValidatorIDFeatures"
- typeid="org.eclipse.jst.jsf.core.attributevalues.FacesConfigValidatorIDType"/>
- <MetaDataEnabledFeature
- class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.FacesConfigConverterIDFeatures"
- typeid="org.eclipse.jst.jsf.core.attributevalues.FacesConfigConverterIDType"/>
- </extension>
-
- <extension
- point="org.eclipse.jst.jsf.common.symbolSourceProvider">
- <symbolSourceId
- factory="org.eclipse.jst.jsf.designtime.internal.symbols.ResourceBundleSymbolSourceProvider">
- </symbolSourceId>
- </extension>
- <extension
- point="org.eclipse.jst.jsf.common.domainSourceModelTypes">
- <domainSourceModelTypes
- domainId="TagLibraryDomain"
- domainSourceModelTypeId="TaglibContentModelHandler"
- locator="org.eclipse.jst.jsf.core.metadata.internal.TaglibMetaDataLocator"
- ordinal="0">
- </domainSourceModelTypes>
- </extension>
-
- <extension
- point="org.eclipse.jst.jsf.common.domainSourceModelTypeTranslators">
- <domainSourceModelTypeTranslator
- domainSourceModelTypeId="TaglibContentModelHandler"
- translatorClass="org.eclipse.jst.jsf.core.metadata.internal.HTMLContentModelMetaDataTranslator">
- </domainSourceModelTypeTranslator>
- <domainSourceModelTypeTranslator
- domainSourceModelTypeId="TaglibContentModelHandler"
- translatorClass="org.eclipse.jst.jsf.core.metadata.internal.JSPContentModelMetaDataTranslator">
- </domainSourceModelTypeTranslator>
- <domainSourceModelTypeTranslator
- domainSourceModelTypeId="TaglibContentModelHandler"
- translatorClass="org.eclipse.jst.jsf.core.metadata.internal.TaglibMetaDataTLDTranslator">
- </domainSourceModelTypeTranslator>
- </extension>
-
- <extension point="org.eclipse.jdt.core.classpathContainerInitializer">
- <classpathContainerInitializer
- class="org.eclipse.jst.jsf.core.internal.JSFLibrariesContainerInitializer"
- id="org.eclipse.jst.jsf.core.internal.jsflibrarycontainer"/>
- </extension>
- <extension
- point="org.eclipse.jst.jsf.core.tagregistry">
- <tagRegistry
- class="org.eclipse.jst.jsf.designtime.internal.view.model.jsp.registry.TLDRegistryManager$MyRegistryFactory"
- description="%JSP_TAG_REGISTRY_DESCRIPTION"
- id="default.jsp">
- <content-type
- contentTypeId="org.eclipse.jst.jsp.core.jspsource">
- </content-type>
- </tagRegistry>
- </extension>
- <extension
- point="org.eclipse.jst.jsf.core.viewhandler">
- <viewhandler
- class="org.eclipse.jst.jsf.designtime.internal.view.DefaultDTViewHandler"
- id="org.eclipse.jst.jsf.designtime.view.jspviewhandler">
- </viewhandler>
- </extension>
- <extension
- point="org.eclipse.jst.jsf.common.contextSymbolFactory">
- <contextSymbolFactory
- factory="org.eclipse.jst.jsf.designtime.internal.symbols.StaticJavaTypeSymbolFactory"
- factoryId="org.eclipse.jst.jsf.core.staticJavaTypeSymbol">
- </contextSymbolFactory>
- </extension>
- <extension
- point="org.eclipse.jst.jsf.common.contextSymbolFactory">
- <contextSymbolFactory
- factory="org.eclipse.jst.jsf.designtime.internal.symbols.ValueExpressionSymbolFactory"
- factoryId="org.eclipse.jst.jsf.core.valueExpressionSymbolFactory">
- </contextSymbolFactory>
- </extension>
- <extension
- point="org.eclipse.jst.jsf.core.customViewMapper">
- <customViewMapper
- class="org.eclipse.jst.jsf.designtime.internal.view.mapping.mappers.ValueHolderAttributeMapper"
- id="valueHolderAttributeMapper">
- </customViewMapper>
- </extension>
-
-</plugin>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/schema/AttributeValueRuntimeTypes.exsd b/jsf/plugins/org.eclipse.jst.jsf.core/schema/AttributeValueRuntimeTypes.exsd
deleted file mode 100644
index c06c1d4..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/schema/AttributeValueRuntimeTypes.exsd
+++ /dev/null
@@ -1,126 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jst.jsf.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.jst.jsf.core" id="AttributeValueRuntimeTypes" name="AttributeValueRuntimeTypes"/>
- </appInfo>
- <documentation>
- Defines a mapping between an implementing class and an AttributeValue Runtime type. By categorizing attribute values types in an CMAnnotation file, we can assign types and therefore processing of those types using the CMAnnotation file metadata and context information.
-
-<p><b>This extension point is provisional and subject to change</b></p>
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="attributeValueRuntimeType" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="attributeValueRuntimeType">
- <annotation>
- <documentation>
- The MetaDataEnabledRuntimeTypeProcessing framework will use the value found on the attribute-value-runtime-value property of a cm-attribute annoation to bind to a class that implements the type. That type may be able to provide processing for ContentAssist, Validation, Quick Fix/Quick Assist, or other context sensitive operations.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- unique id for the type within the extending plugin
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string">
- <annotation>
- <documentation>
- Class that will be used to implement the type. It must implement <code>org.eclipse.jst.jsf.metadataprocessors.IMetaDataEnabledFeature</code> and it is recommended that the user extend the <code>org.eclipse.jst.jsf.metadataprocessors.AbstractRootTypeDescriptor</code> or one of its subclasses.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.jst.jsf.metadataprocessors.AbstractRootTypeDescriptor:org.eclipse.jst.jsf.metadataprocessors.IMetaDataEnabledFeature"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 1.5
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- see org.eclipse.jst.jsf.taglibprocessing plugin for examples of usage
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- cm-attribute annotation elements can have an "attribute-value-runtime-type" property that maps to the id of this ext-pt. The property must be fully qualified with the extender's plugin id. i.e. if type is FooType, the property value must be com.foo.bar.FooType.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2006 Oracle Corporation.
-All rights reserved. This program and the accompanying materials
-are 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:
- Gerry Kessler/Oracle - initial API and implementation
- </documentation>
- </annotation>
-
-</schema>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/schema/MetaDataEnabledFeatures.exsd b/jsf/plugins/org.eclipse.jst.jsf.core/schema/MetaDataEnabledFeatures.exsd
deleted file mode 100644
index f0b6717..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/schema/MetaDataEnabledFeatures.exsd
+++ /dev/null
@@ -1,126 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jst.jsf.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.jst.jsf.core" id="MetaDataEnabledFeatures" name="MetaData Enabled Features"/>
- </appInfo>
- <documentation>
- Defines a mapping between a runtime type defined by a different plugin and an implementing class in the extenders plugin. This allows a provider to provide additional processing on an element or attribute instance that can be in addition to existing processing or a means to provide a new kind of processing of existing runtime types.
-
-<p><b>This extension point is provisional and subject to change</b></p>
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="MetaDataEnabledFeature" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="MetaDataEnabledFeature">
- <annotation>
- <documentation>
- mapping between an different extenders runtime type id, and a processing class from the extenders plugin
- </documentation>
- </annotation>
- <complexType>
- <attribute name="typeid" type="string" use="required">
- <annotation>
- <documentation>
- Fully qualified runtime type id
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- Fully qualified implementing class that must implement <code>org.eclipse.jst.jsf.metadataprocessors.IMetaDataEnabledFeature</code>.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.jst.jsf.metadataprocessors.AbstractMetaDataEnabledFeature:org.eclipse.jst.jsf.metadataprocessors.IMetaDataEnabledFeature"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 1.5
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2006 Oracle Corporation.
-All rights reserved. This program and the accompanying materials
-are 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:
- Gerry Kessler/Oracle - initial API and implementation
- </documentation>
- </annotation>
-
-</schema>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/schema/customViewMapper.exsd b/jsf/plugins/org.eclipse.jst.jsf.core/schema/customViewMapper.exsd
deleted file mode 100644
index 19cea3f..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/schema/customViewMapper.exsd
+++ /dev/null
@@ -1,104 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jst.jsf.core" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.eclipse.jst.jsf.core" id="customViewMapper" name="customViewMapper"/>
- </appinfo>
- <documentation>
- NOT API. CLIENTS SHOULD NOT USE. FUTURE COMPATABILITY IS EXPLICITLY NOT GUARANTEED.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="customViewMapper"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="customViewMapper">
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- Relative to the bundle name (actual id will be PLUGIN_ID + "." + $id).
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn="org.eclipse.jst.jsf.designtime.internal.view.mapping.AbstractCustomViewMapper:"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appinfo>
- <meta.section type="since"/>
- </appinfo>
- <documentation>
- [Enter the first release in which this extension point appears.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="examples"/>
- </appinfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="apiinfo"/>
- </appinfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="implementation"/>
- </appinfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
-
-</schema>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/schema/externalcontext.exsd b/jsf/plugins/org.eclipse.jst.jsf.core/schema/externalcontext.exsd
deleted file mode 100644
index cea6bd2..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/schema/externalcontext.exsd
+++ /dev/null
@@ -1,113 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jst.jsf.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.jst.jsf.core" id="externalcontext" name="External Context"/>
- </appInfo>
- <documentation>
- Contributes a new factory to create IDTExternalContext's. The id can then be set on a project to indicate that this factory should be used by DTFacesContext whenever an IDTExternalContext is requested.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="externalcontext"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="externalcontext">
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- The unique id of this external context provider.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- The factory class to be used to instantiate new IDTExternalContext instances.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.jst.jsf.designtime.context.AbstractDTExternalContextFactory"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 1.5
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright 2006 Oracle
-All rights reserved. This program and the accompanying materials are 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
- </documentation>
- </annotation>
-
-</schema>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/schema/grammar-annotations.xsd b/jsf/plugins/org.eclipse.jst.jsf.core/schema/grammar-annotations.xsd
deleted file mode 100644
index 8b4a47e..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/schema/grammar-annotations.xsd
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsd:schema
- targetNamespace="http://org.eclipse.jst.jsf.core/grammarAnnotationSchema"
- version="1.0"
- attributeFormDefault="unqualified"
- elementFormDefault="unqualified"
- xmlns="http://org.eclipse.jst.jsf.core/grammarAnnotationSchema"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-
- <xsd:element name="grammar-annotations"
- type="grammar-annotationType" />
-
- <xsd:complexType name="grammar-annotationType">
- <xsd:sequence>
- <xsd:element name="cm-element"
- type="cm-elementType" minOccurs="1" maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="caseSensitive" type="xsd:boolean" use="optional" default="true"/>
- </xsd:complexType>
- <xsd:complexType name="cm-elementType">
- <xsd:sequence>
- <xsd:element name="cm-attribute" type="cm-attributeType" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="property" type="propertyType" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
- <xsd:complexType name="cm-attributeType">
- <xsd:sequence>
- <xsd:element name="property"
- type="propertyType" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
- <xsd:complexType name="propertyType">
- <xsd:sequence>
- <xsd:element name="value" type="propertyValue" minOccurs="1" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
- <xsd:complexType name="propertyValue">
- <xsd:all></xsd:all>
- </xsd:complexType>
-</xsd:schema>
\ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/schema/jsfLibraries.exsd b/jsf/plugins/org.eclipse.jst.jsf.core/schema/jsfLibraries.exsd
deleted file mode 100644
index cfb5f58..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/schema/jsfLibraries.exsd
+++ /dev/null
@@ -1,161 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jst.jsf.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.jst.jsf.core" id="jsfLibraries" name="JSF Libraries"/>
- </appInfo>
- <documentation>
- This extension point allows clients to create named sets of jars for use with JavaServer Faces Applications.
-<b>Deprecated</b> - adopters should now use <code>org.eclipse.jst.jsf.core.pluginProvidedJsfLibraries</code>
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="jsfLibrary" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="jsfLibrary">
- <annotation>
- <documentation>
- A named collection of jars that will be added to the classpath as a classpath container to a project that references it.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
- A unique name for the library.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="isImplementation" type="boolean" use="required">
- <annotation>
- <documentation>
- Flag indicating that this libary is declared to be a JSF implementation and not just a JSF component library.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="maxVersionSupported">
- <annotation>
- <documentation>
- Used to declare which JSF specification this library will support.
- </documentation>
- </annotation>
- <simpleType>
- <restriction base="string">
- <enumeration value="v1_1">
- </enumeration>
- <enumeration value="v1_2">
- </enumeration>
- <enumeration value="UNKNOWN">
- </enumeration>
- </restriction>
- </simpleType>
- </attribute>
- <attribute name="archiveFilesDelegate" type="string" use="required">
- <annotation>
- <documentation>
- class that must extend org.eclipse.jst.jsf.core.jsflibraryregistry.JSFLibraryArchiveFilesDelegate to supply a collection of ArchiveFiles for the library
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.jst.jsf.core.jsflibraryregistry.JSFLibraryArchiveFilesDelegate"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 1.5
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of usage of pluginProvidedJsfLibraries extension point:
-
-<p>
-<pre>
- <extension point="org.eclipse.jst.jsf.core.jsfLibraries">
- <jsfLibrary
- name="MyComponentLib1"
- isImplementation="false"
- maxVersionSupported="v1_1"
- archiveFilesDelegate="com.acme.jsf.libraries.MyComponentLibraryFiles"/>
- </extension>
-</pre>
-</p>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- Value of the attribute class must be a fully qualified name of a Java class that extends the abstract class <code>org.eclipse.jst.jsf.core.jsflibraryregistry.JSFLibraryArchiveFilesDelegate</code> and has a public 0-arg constructor.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- none
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2005, 2007 Oracle Corporation.
-All rights reserved. This program and the accompanying materials
-are 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:
-Gerry Kessler - initial API and implementation
- </documentation>
- </annotation>
-
-</schema>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/schema/methodresolver.exsd b/jsf/plugins/org.eclipse.jst.jsf.core/schema/methodresolver.exsd
deleted file mode 100644
index 57b83d5..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/schema/methodresolver.exsd
+++ /dev/null
@@ -1,124 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jst.jsf.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.jst.jsf.core" id="methodresolver" name="Method Resolver"/>
- </appInfo>
- <documentation>
- Allows a third-party to define an alternative instance of the design time method resolver. This id can then be set on a project using DesignTimeApplicationManager.setMethodResolverProvider. Once set on a project this id will be used to load the active design time method resolver.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="methodresolver"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="methodresolver">
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- The id to be used to identify this method resolver.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- The class implementing the method resolver.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.jst.jsf.designtime.el.AbstractDTMethodResolver"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 1.5
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- <p>The following example defines a new method resolver implemented by CustomDTMethodResolver</p>
-
-<p>
-<pre>
- <extension
- point="org.eclipse.jst.jsf.designtime.methodresolver">
- <methodresolver
- class="org.eclipse.jst.jsf.dtresolver.test.resolvers.CustomDTMethodResolver"
- id="org.eclipse.jst.jsf.dtresolver.test.methodresolver2"/>
- </extension>
-</pre>
-</p>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright 2006 Oracle
-All rights reserved. This program and the accompanying materials are 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
- </documentation>
- </annotation>
-
-</schema>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/schema/pluginProvidedJsfLibraries.exsd b/jsf/plugins/org.eclipse.jst.jsf.core/schema/pluginProvidedJsfLibraries.exsd
deleted file mode 100644
index 802062f..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/schema/pluginProvidedJsfLibraries.exsd
+++ /dev/null
@@ -1,176 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jst.jsf.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.jst.jsf.core" id="pluginProvidedJsfLibraries" name="JSF Libraries"/>
- </appInfo>
- <documentation>
- This extension point allows clients to create named sets of jars for use with JavaServer Faces Applications.
-
-<p><b>This extension point is provisional and subject to change</b></p>
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="jsfLibrary" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="jsfLibrary">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name"/>
- </appInfo>
- <documentation>
- A named collection of jars that will be added to the classpath as a classpath container to a project that references it.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
- A unique, non-translatable, name for the library. The plugin developer is responsible for ensuring uniqueness within the plugin. This name, in combination with the plugin id, is used to identify the classpath container reference.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="label" type="string">
- <annotation>
- <documentation>
- Translatable string for displaying the library name.
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="isImplementation" type="boolean" use="required">
- <annotation>
- <documentation>
- Flag indicating that this libary is declared to be a JSF implementation and not just a JSF component library.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="maxVersionSupported">
- <annotation>
- <documentation>
- Used to declare which JSF specification this library will support.
- </documentation>
- </annotation>
- <simpleType>
- <restriction base="string">
- <enumeration value="v1_1">
- </enumeration>
- <enumeration value="v1_2">
- </enumeration>
- <enumeration value="UNKNOWN">
- </enumeration>
- </restriction>
- </simpleType>
- </attribute>
- <attribute name="archiveFilesDelegate" type="string" use="required">
- <annotation>
- <documentation>
- class that must extend org.eclipse.jst.jsf.core.jsflibraryregistry.JSFLibraryArchiveFilesDelegate to supply a collection of IPaths to jars in the library
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.jst.jsf.core.jsflibraryregistry.PluginProvidedJSFLibraryArchiveFilesDelegate"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 2.0
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of usage of pluginProvidedJsfLibraries extension point:
-
-<p>
-<pre>
- <extension point="org.eclipse.jst.jsf.core.pluginProvidedJsfLibraries">
- <jsfLibrary
- name="MyComponentLib1"
- label="%MyComponentLib1.translatableLabel"
- isImplementation="false"
- maxVersionSupported="v1_1"
- archiveFilesDelegate="com.acme.jsf.libraries.MyComponentLibraryFiles"/>
- </extension>
-</pre>
-</p>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- Value of the attribute class must be a fully qualified name of a Java class that extends the abstract class <code>org.eclipse.jst.jsf.core.jsflibraryregistry.PluginProvidedJSFLibraryJarFilesDelegate</code> and has a public 0-arg constructor.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- none
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2007 Oracle Corporation.
-All rights reserved. This program and the accompanying materials
-are 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:
-Gerry Kessler - initial API and implementation
- </documentation>
- </annotation>
-
-</schema>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/schema/propertyresolver.exsd b/jsf/plugins/org.eclipse.jst.jsf.core/schema/propertyresolver.exsd
deleted file mode 100644
index 2e51b28..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/schema/propertyresolver.exsd
+++ /dev/null
@@ -1,128 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jst.jsf.core" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.eclipse.jst.jsf.core" id="propertyresolver" name="Property Resolver"/>
- </appinfo>
- <documentation>
- Allows a third-party to define an alternative instance of the design time property resolver. This id can then be set on a project using DesignTimeApplicationManager.setPropertyResolverProvider. Once set on a project this id will be used to load the active design time property resolver.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="propertyresolver"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="propertyresolver">
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- The id to be used to identify this property resolver.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- The class implementing the property resolver.
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn="org.eclipse.jst.jsf.designtime.el.AbstractDTPropertyResolver"/>
- </appinfo>
- </annotation>
- </attribute>
- <attribute name="forRuntimeClass" type="string">
- <annotation>
- <documentation>
- Names a class (it need not be on the class path at designtime) that this designtime property resolver is intended to shadow.
-
-The instance of AbstractDTPropertyResolver provided by the 'class' attribute _must_ implement the IDecorativeResolver tagging interface in order to be used in this way.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="instancePerProject" type="boolean">
- <annotation>
- <documentation>
- Default if not specified is false. This is backward compatible with pre-3.0 behaviour for the propertyresolver extension point.
-
-If set to false (or not set) a single instance of the property resolver will be used for all design time managers in the workspace. If set to true, a new instance will be created on every time this property resolver becomes the active one on a design time application manager.
-
-If 'class' specifies a type that implements org.eclipse.jst.jsf.designtime.el.IInstancePerProjectResolver, then setProject will be called with the host project. Implementing this interface is optional.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appinfo>
- <meta.section type="since"/>
- </appinfo>
- <documentation>
- 1.5
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="examples"/>
- </appinfo>
- <documentation>
- <p>The following example defines a new property resolver implemented by CustomDTPropertyResolver</p>
-
-<p>
-<pre>
- <extension
- point="org.eclipse.jst.jsf.designtime.propertyresolver">
- <propertyresolver
- class="org.eclipse.jst.jsf.dtresolver.test.resolvers.CustomDTPropertyResolver"
- id="org.eclipse.jst.jsf.dtresolver.test.propertyresolver2"/>
- </extension>
-</pre>
-</p>
- </documentation>
- </annotation>
-
-
-
- <annotation>
- <appinfo>
- <meta.section type="copyright"/>
- </appinfo>
- <documentation>
- Copyright 2006 Oracle
-All rights reserved. This program and the accompanying materials are 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
- </documentation>
- </annotation>
-
-</schema>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/schema/tagregistry.exsd b/jsf/plugins/org.eclipse.jst.jsf.core/schema/tagregistry.exsd
deleted file mode 100644
index c343236..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/schema/tagregistry.exsd
+++ /dev/null
@@ -1,129 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jst.jsf.core" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.eclipse.jst.jsf.core" id="tagregistry" name="JSF Tag Library Registry"/>
- </appinfo>
- <documentation>
- Internal. Not for external use.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="tagRegistry"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="tagRegistry">
- <complexType>
- <choice>
- <element ref="content-type" minOccurs="1" maxOccurs="unbounded"/>
- </choice>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- The class implementing the registry. Must extend org.eclipse.jst.jsf.designtime.internal.view.model.AbstractTagRegistry.
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn="org.eclipse.jst.jsf.designtime.internal.view.model.TagRegistryFactory:"/>
- </appinfo>
- </annotation>
- </attribute>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- An identifier that is unique within the defining plugin for tagRegistries. The id will be prepended with the id of the defining plugin to ensure system uniqueness.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="description" type="string">
- <annotation>
- <documentation>
- Used as user viewable short name for this tag registry in the tag registry view, preference pages and other UI.
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="content-type">
- <complexType>
- <attribute name="contentTypeId" type="string" use="required">
- <annotation>
- <documentation>
- Content type identifier. This is an ID defined by the 'org.eclipse.core.runtime.contentTypes' extension point.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appinfo>
- <meta.section type="since"/>
- </appinfo>
- <documentation>
- 3.0
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="examples"/>
- </appinfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="apiinfo"/>
- </appinfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="implementation"/>
- </appinfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
-
-</schema>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/schema/variableresolver.exsd b/jsf/plugins/org.eclipse.jst.jsf.core/schema/variableresolver.exsd
deleted file mode 100644
index 4fe690d..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/schema/variableresolver.exsd
+++ /dev/null
@@ -1,128 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jst.jsf.core" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.eclipse.jst.jsf.core" id="variableresolver" name="Variable Resolver"/>
- </appinfo>
- <documentation>
- Allows a third-party to define an alternative instance of the design time variable resolver. This id can then be set on a project using DesignTimeApplicationManager.setVariableResolverProvider. Once set on a project this id will be used to load the active design time variable resolver.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="variableresolver"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="variableresolver">
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- The id to be used to identify this property resolver.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- The class implementing the property resolver.
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn="org.eclipse.jst.jsf.designtime.el.AbstractDTVariableResolver"/>
- </appinfo>
- </annotation>
- </attribute>
- <attribute name="forRuntimeClass" type="string">
- <annotation>
- <documentation>
- Names a class (it need not be on the class path at designtime) that this designtime variable resolver is intended to shadow.
-
-The instance of AbstractDTVariableResolver provided by the 'class' attribute _must_ implement the IDecorativeResolver tagging interface in order to be used in this way.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="instancePerProject" type="boolean">
- <annotation>
- <documentation>
- Default if not specified is false. This is backward compatible with pre-3.0 behaviour for the variableresolver extension point.
-
-If set to false (or not set) a single instance of the variable resolver will be used for all design time managers in the workspace. If set to true, a new instance will be created on every time this variable resolver becomes the active one on a design time application manager.
-
-If 'class' specifies a type that implements org.eclipse.jst.jsf.designtime.el.IInstancePerProjectResolver, then setProject will be called with the host project. Implementing this interface is optional.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appinfo>
- <meta.section type="since"/>
- </appinfo>
- <documentation>
- 1.5
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="examples"/>
- </appinfo>
- <documentation>
- <p>The following example defines a new variable resolver implemented by CustomDTVariableResolver</p>
-
-<p>
-<pre>
- <extension
- point="org.eclipse.jst.jsf.designtime.variableresolver">
- <variableresolver
- class="org.eclipse.jst.jsf.dtresolver.test.resolvers.CustomDTVariableResolver"
- id="org.eclipse.jst.jsf.dtresolver.test.variableresolver1"/>
- </extension>
-</pre>
-</p>
- </documentation>
- </annotation>
-
-
-
- <annotation>
- <appinfo>
- <meta.section type="copyright"/>
- </appinfo>
- <documentation>
- Copyright 2006 Oracle
-All rights reserved. This program and the accompanying materials are 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
- </documentation>
- </annotation>
-
-</schema>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/schema/viewhandler.exsd b/jsf/plugins/org.eclipse.jst.jsf.core/schema/viewhandler.exsd
deleted file mode 100644
index 999dfef..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/schema/viewhandler.exsd
+++ /dev/null
@@ -1,104 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jst.jsf.core" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.eclipse.jst.jsf.core" id="viewhandler" name="viewhandler"/>
- </appinfo>
- <documentation>
- Internal.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="viewhandler"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="viewhandler">
- <complexType>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- The view handler class.
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn="org.eclipse.jst.jsf.designtime.internal.view.AbstractDTViewHandler:"/>
- </appinfo>
- </annotation>
- </attribute>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- Idenifies the view handler. Value must be unique for view handlers defined within the scope of the defining plugin.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appinfo>
- <meta.section type="since"/>
- </appinfo>
- <documentation>
- 3.4
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="examples"/>
- </appinfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="apiinfo"/>
- </appinfo>
- <documentation>
- Not API.
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="implementation"/>
- </appinfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
-
-</schema>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/IJSFCoreConstants.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/IJSFCoreConstants.java
deleted file mode 100644
index 7e2d9c8..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/IJSFCoreConstants.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core;
-
-/**
- * JSF Core framework constants
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author cbateman
- *
- */
-public final class IJSFCoreConstants
-{
- /**
- * The global id for the JSF facet
- * TODO: align with extensioin point through plugin.properties
- */
- public static final String JSF_CORE_FACET_ID = "jst.jsf"; //$NON-NLS-1$
- /**
- * The facet version for a JSF 1.0 project
- * TODO: align with extensioin point through plugin.properties
- */
- public final static String FACET_VERSION_1_0 = "1.0"; //$NON-NLS-1$
- /**
- * The constant id for a JSF 1.0 project
- */
- public final static String JSF_VERSION_1_0 = FACET_VERSION_1_0;
- /**
- * The facet version for a JSF 1.1 project
- * TODO: align with extensioin point through plugin.properties
- */
- public final static String FACET_VERSION_1_1 = "1.1"; //$NON-NLS-1$
- /**
- * The constant id for a JSF 1.1 project
- */
- public final static String JSF_VERSION_1_1 = FACET_VERSION_1_1;
- /**
- * The facet version for a JSF 1.2 project
- * TODO: align with extensioin point through plugin.properties
- */
- public final static String FACET_VERSION_1_2 = "1.2";//$NON-NLS-1$
- /**
- * The constant id for a JSF 1.2 project
- */
- public final static String JSF_VERSION_1_2 = FACET_VERSION_1_2;
-
- private IJSFCoreConstants()
- {
- // no instantiation
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/JSFVersion.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/JSFVersion.java
deleted file mode 100644
index e1d3aaf..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/JSFVersion.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core;
-
-/**
- * @author gekessle
- *
- */
-public enum JSFVersion {
-
- /**
- * Unknown version support
- */
- UNKNOWN,
- /**
- * Supports JSF Version 1.0
- */
- V1_0,
- /**
- * Supports JSF Version 1.1
- */
- V1_1,
- /**
- * Supports JSF Version 1.1
- */
- V1_2;
-
- @Override
- public String toString() {
- switch(this)
- {
- case V1_0:
- return IJSFCoreConstants.JSF_VERSION_1_0;
- case V1_1:
- return IJSFCoreConstants.JSF_VERSION_1_1;
- case V1_2:
- return IJSFCoreConstants.JSF_VERSION_1_2;
- case UNKNOWN:
- return "unknown";
- default:
- throw new IllegalStateException("Missing string conversion: "+this.name());
- }
- }
-
- /**
- * @param valueAsString
- * @return the reverse mapping to an enum from toString() returns
- */
- public static JSFVersion valueOfString(String valueAsString)
- {
- if (IJSFCoreConstants.JSF_VERSION_1_0.equals(valueAsString))
- {
- return V1_0;
- }
- else if (IJSFCoreConstants.JSF_VERSION_1_1.equals(valueAsString))
- {
- return V1_1;
- }
- else if (IJSFCoreConstants.JSF_VERSION_1_2.equals(valueAsString))
- {
- return V1_2;
- }
- else if ("unknown".equals(valueAsString))
- {
- return UNKNOWN;
- }
- else
- {
- return null;
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/CompositeJSFPreferenceModel.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/CompositeJSFPreferenceModel.java
deleted file mode 100644
index 08dabf9..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/CompositeJSFPreferenceModel.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.preferences.IScopeContext;
-import org.eclipse.jface.preference.IPreferenceStore;
-
-/**
- * Composite of preference models
- *
- * @author cbateman
- *
- */
-public class CompositeJSFPreferenceModel implements IJSFPreferenceModel
-{
- private final List<IJSFPreferenceModel> _models;
-
- /**
- * @param models
- */
- public CompositeJSFPreferenceModel(final List<IJSFPreferenceModel> models)
- {
- _models = models;
- }
-
- /*
- * Commits all child instances
- */
- public void commit(final IPreferenceStore prefStore)
- {
- for (final IJSFPreferenceModel model : _models)
- {
- model.commit(prefStore);
- }
- }
-
- /**
- * Searches each child until it finds the value associated with key.
- * @return null if not found.
- */
- public Object getStoredValueByKey(final IScopeContext context, final String key)
- {
- Object value = null;
-
- SEARCH: for (final IJSFPreferenceModel model : _models)
- {
- value = model.getStoredValueByKey(context, key);
- if (value != null)
- {
- break SEARCH;
- }
- }
- return value;
- }
-
- /**
- * Same as getStoredValueByKey but using getValueByKey instead
- */
- public Object getValueByKey(final IScopeContext context, final String key)
- {
- Object value = null;
-
- SEARCH: for (final IJSFPreferenceModel model : _models)
- {
- value = model.getValueByKey(context, key);
- if (value != null)
- {
- break SEARCH;
- }
- }
- return value;
- }
-
- /**
- * Calls load on all children with prefStore
- */
- public void load(final IPreferenceStore prefStore)
- {
- for (final IJSFPreferenceModel model : _models)
- {
- model.load(prefStore);
- }
- }
-
- /**
- * Calls set defaults on all children
- */
- public void setDefaults()
- {
- for (final IJSFPreferenceModel model : _models)
- {
- model.setDefaults();
- }
- }
-
- public Object setValueByKey(final IScopeContext context, final String key, final Object value)
- {
- for (final IJSFPreferenceModel model : _models)
- {
- if (model.getValueByKey(context, key) != null)
- {
- return model.setValueByKey(context, key, value);
- }
- }
- return null;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/CompositeTagRegistryFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/CompositeTagRegistryFactory.java
deleted file mode 100644
index a7112b0..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/CompositeTagRegistryFactory.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jst.jsf.common.internal.policy.CanonicallyOrderedIteratorPolicy;
-import org.eclipse.jst.jsf.common.internal.policy.IIteratorPolicy;
-import org.eclipse.jst.jsf.common.internal.strategy.IIdentifiableStrategy;
-import org.eclipse.jst.jsf.common.internal.strategy.IteratorPolicyBasedStrategyComposite;
-import org.eclipse.jst.jsf.designtime.internal.view.model.ITagRegistry;
-import org.eclipse.jst.jsf.designtime.internal.view.model.TagRegistryFactory.TagRegistryFactoryException;
-
-/**
- * Employs a policy-based strategy to construct a TagRegistry for a particular
- * content-type in a particular project.
- *
- * @author cbateman
- *
- */
-public final class CompositeTagRegistryFactory
-{
- private static CompositeTagRegistryFactory INSTANCE;
-
- /**
- * @return the single instance of the registry factory
- */
- public static synchronized CompositeTagRegistryFactory getInstance()
- {
- if (INSTANCE == null)
- {
- INSTANCE = new CompositeTagRegistryFactory();
- }
- return INSTANCE;
- }
-
- private final Map<IContentType, Set<TagRegistryFactoryInfo>> _cachedExtensionsByType =
- new HashMap<IContentType, Set<TagRegistryFactoryInfo>>(4);
-
- private CompositeTagRegistryFactory()
- {
- // singleton: no external instantiation
- }
-
-
- /**
- * @param id
- * @return a tag registry for the id or null if there isn't one.
- */
- public final ITagRegistry getRegistry(final TagRegistryIdentifier id)
- {
- final Set<TagRegistryFactoryInfo> handlers = TagLibraryRegistryLoader
- .getAllHandlers();
-
- final Set<TagRegistryFactoryInfo> matchingHandlers = findMatchingExtensions(
- id, handlers);
-
- if (matchingHandlers.size() > 0)
- {
- // optimize: if there is only one handler, no need for strategy
- if (matchingHandlers.size() == 1)
- {
- try
- {
- return matchingHandlers.iterator().next().getTagRegistryFactory()
- .createTagRegistry(id.getProject());
- }
- catch (TagRegistryFactoryException e)
- {
- JSFCorePlugin.log(e, "While trying to acquire a registry");
- }
- }
- else
- {
- // for now, we will order by the canonical name of the extension
- // id in ascending order. Later, we may make this preference
- // based.
- final TagRegistrySelectionStrategy selectionStrategy = new TagRegistrySelectionStrategy(
- new CanonicallyOrderedIteratorPolicy<String>());
-
- for (final Iterator<TagRegistryFactoryInfo> it = matchingHandlers
- .iterator(); it.hasNext();)
- {
- selectionStrategy.addStrategy(it.next().getTagRegistryFactory());
- }
- return selectionStrategy.perform(id.getProject());
- }
- }
-
- return null;
- }
-
- /**
- * @return get all tag registry factories
- */
- public Set<TagRegistryFactoryInfo> getAllTagRegistryFactories()
- {
- return TagLibraryRegistryLoader.getAllHandlers();
- }
-
- private Set<TagRegistryFactoryInfo> findMatchingExtensions(
- TagRegistryIdentifier id, Set<TagRegistryFactoryInfo> handlers)
- {
- Set<TagRegistryFactoryInfo> matching = _cachedExtensionsByType.get(id
- .getContentType());
-
- if (matching == null)
- {
- matching = new HashSet<TagRegistryFactoryInfo>(4);
-
- for (final TagRegistryFactoryInfo handler : handlers)
- {
- if (handler.getContentTypes().contains(id.getContentType()))
- {
- matching.add(handler);
- }
- }
-
- // if there is nothing matching, just store the empty set and
- // discard
- // the extra memory
- if (matching.size() > 0)
- {
- _cachedExtensionsByType.put(id.getContentType(), matching);
- }
- else
- {
- _cachedExtensionsByType.put(id.getContentType(),
- Collections.EMPTY_SET);
- }
- }
- return matching;
- }
-
- /**
- * Identifies a content type/project context in which to request a tag
- * registry.
- *
- * @author cbateman
- *
- */
- public final static class TagRegistryIdentifier
- {
- private final IProject _project;
- private final IContentType _contentType;
-
- /**
- * @param project
- * @param contentType
- */
- public TagRegistryIdentifier(final IProject project,
- final IContentType contentType)
- {
- _project = project;
- _contentType = contentType;
- }
-
- IProject getProject()
- {
- return _project;
- }
-
- IContentType getContentType()
- {
- return _contentType;
- }
-
- }
-
- private static class TagRegistrySelectionStrategy
- extends
- IteratorPolicyBasedStrategyComposite<IProject, ITagRegistry, String, IIdentifiableStrategy<IProject, ITagRegistry, String>>
- {
- private static final ITagRegistry NO_RESULT = null;
-
- protected TagRegistrySelectionStrategy(IIteratorPolicy<String> policy)
- {
- super(policy);
- }
-
- @Override
- public ITagRegistry getNoResult()
- {
- return NO_RESULT;
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/IJSFPreferenceModel.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/IJSFPreferenceModel.java
deleted file mode 100644
index 13af43b..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/IJSFPreferenceModel.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman - initial implementation
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.core.internal;
-
-import org.eclipse.core.runtime.preferences.IScopeContext;
-import org.eclipse.jface.preference.IPreferenceStore;
-
-/**
- * Defines a generic JSF preferences model
- *
- * @author cbateman
- *
- */
-public interface IJSFPreferenceModel
-{
- /**
- * Loads the object from the preference store provided
- *
- * @param prefStore
- */
- public void load(IPreferenceStore prefStore);
-
- /**
- * Copies the object into the preference store but DOES NOT SAVE IT
- *
- * @param prefStore
- */
- public void commit(IPreferenceStore prefStore);
-
- /**
- * Reverts the model to it's defaults. Does not commit to pref store.
- */
- public void setDefaults();
-
- /**
- * @param context
- * @param key
- * @return the preference value in context with using key as the id
- */
- public Object getValueByKey(final IScopeContext context, final String key);
-
- /**
- * @param context
- * @param key
- * @return the preference value in context using key as the id and drawing
- * it directly from the preference store
- */
- public Object getStoredValueByKey(final IScopeContext context, final String key);
-
- /**
- * Set the preference value indicated by key in context to value. May
- * throw ClassCastException if value is not the type expected for the key
- * @param context
- * @param key
- * @param value
- * @return the old value
- */
- public Object setValueByKey(final IScopeContext context, final String key, final Object value);
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/JSFCorePlugin.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/JSFCorePlugin.java
deleted file mode 100644
index eb6ca1e..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/JSFCorePlugin.java
+++ /dev/null
@@ -1,370 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler - initial API and implementation
- * Ian Trimble - JSFLibraryRegistry work
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.ILog;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jst.jsf.context.IDelegatingFactory;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.internal.IStructuredDocumentContextResolverFactory2;
-import org.eclipse.jst.jsf.designtime.context.AbstractDTExternalContextFactory;
-import org.eclipse.jst.jsf.designtime.el.AbstractDTMethodResolver;
-import org.eclipse.jst.jsf.designtime.el.AbstractDTPropertyResolver;
-import org.eclipse.jst.jsf.designtime.el.AbstractDTVariableResolver;
-import org.eclipse.jst.jsf.designtime.internal.BasicExtensionFactory;
-import org.eclipse.jst.jsf.designtime.internal.DecoratableExtensionFactory;
-import org.eclipse.jst.jsf.designtime.internal.BasicExtensionFactory.ExtensionData;
-import org.eclipse.jst.jsf.designtime.internal.resolver.ViewBasedTaglibResolverFactory;
-import org.eclipse.jst.jsf.designtime.internal.view.AbstractDTViewHandler;
-import org.eclipse.ui.preferences.ScopedPreferenceStore;
-import org.eclipse.wst.common.frameworks.internal.WTPPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * JSF Core plugin.
- *
- * @author Gerry Kessler - Oracle, Ian Trimble - Oracle
- */
-public class JSFCorePlugin extends WTPPlugin
-{
- /**
- * The plugin id
- */
- public static final String PLUGIN_ID = "org.eclipse.jst.jsf.core"; // org.eclipse.jst.jsf.core.internal.JSFCorePlugin";
- // //$NON-NLS-1$
-
- // The shared instance.
- private static JSFCorePlugin plugin;
-
- private IPreferenceStore preferenceStore;
-
- private ViewBasedTaglibResolverFactory _tagLibResolverFactory;
-
- /**
- * The constructor.
- */
- public JSFCorePlugin()
- {
- plugin = this;
- }
-
- /**
- * This method is called upon plug-in activation
- *
- * @param context
- * @throws Exception
- */
- @Override
- public void start(final BundleContext context) throws Exception
- {
- super.start(context);
- final IStructuredDocumentContextResolverFactory2 factory = IStructuredDocumentContextResolverFactory2.INSTANCE;
- if (factory instanceof IDelegatingFactory)
- {
- _tagLibResolverFactory = new ViewBasedTaglibResolverFactory();
- ((IDelegatingFactory) factory)
- .addFactoryDelegate(_tagLibResolverFactory);
- }
- else
- {
- log("Error adding tag resolver delegate", new Throwable());
- }
- }
-
- /**
- * This method is called when the plug-in is stopped
- *
- * @param context
- * @throws Exception
- */
- @Override
- public void stop(final BundleContext context) throws Exception
- {
- super.stop(context);
-
- final IStructuredDocumentContextResolverFactory2 factory = IStructuredDocumentContextResolverFactory2.INSTANCE;
-
- if (factory instanceof IDelegatingFactory
- && _tagLibResolverFactory != null)
- {
- ((IDelegatingFactory) factory)
- .removeFactoryDelegate(_tagLibResolverFactory);
- }
- plugin = null;
- }
-
- /**
- * Returns the shared instance.
- *
- * @return the shared instance
- */
- public static JSFCorePlugin getDefault()
- {
- return plugin;
- }
-
- /**
- * @param e
- * @param msg
- */
- public static void log(final Exception e, final String msg)
- {
- final ILog log = getDefault().getLog();
-
- log.log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, msg, e));
- }
-
- /**
- * Logs using the default ILog implementation provided by getLog().
- *
- * @param severity
- * Severity (IStatus constant) of log entry
- * @param message
- * Human-readable message describing log entry
- * @param ex
- * Throwable instance (can be null)
- */
- public static void log(final int severity, final String message,
- final Throwable ex)
- {
- getDefault().getLog().log(
- new Status(severity, PLUGIN_ID, IStatus.OK, message, ex));
- }
-
- /**
- * Logs using the default ILog implementation provided by getLog().
- *
- * @param severity
- * Severity (IStatus constant) of log entry
- * @param message
- * Human-readable message describing log entry
- */
- public static void log(final int severity, final String message)
- {
- log(severity, message, null);
- }
-
- /**
- * Logs a message for this plugin
- *
- * @param message
- * @param t
- */
- public static void log(final String message, final Throwable t)
- {
- final ILog log = plugin.getLog();
- log.log(new Status(IStatus.ERROR, plugin.getBundle().getSymbolicName(),
- 0, message, t));
- }
-
- @Override
- public String getPluginID()
- {
- return PLUGIN_ID;
- }
-
- /**
- * @param id
- * @return all registered symbol source providers
- */
- public synchronized static ExtensionData<AbstractDTVariableResolver> getVariableResolvers(final String id)
- {
- checkAndInitVariableResolverFactory();
- return _variableResolverFactory.getExtensions().get(id);
- }
-
- /**
- * @param forName
- * @return the ids of variable resolvers for 'forName'.
- */
- public synchronized static List<String> getVariableResolversForName(
- final String forName)
- {
- checkAndInitVariableResolverFactory();
- return Collections.unmodifiableList(_variableResolverFactory
- .getIdsForName(forName));
- }
-
- /**
- * @return true if there any decorative resolvers in the system. This
- * is provided so that decorative variable resolvers can avoid expensive
- * calculations looking for these resolvers when there are none.
- */
- public synchronized static boolean hasDecorativeVariableResolvers()
- {
- checkAndInitVariableResolverFactory();
- return _variableResolverFactory.getNumDecorativeResolvers() > 0;
- }
-
- private synchronized static void checkAndInitVariableResolverFactory()
- {
- if (_variableResolverFactory == null)
- {
- _variableResolverFactory = new DecoratableExtensionFactory<AbstractDTVariableResolver>(
- getDefault().getBundle(), VARIABLE_RESOLVER_EXT_POINT_NAME,
- VARIABLE_RESOLVER_ELEMENT_NAME, false);
- }
- }
-
- private static DecoratableExtensionFactory<AbstractDTVariableResolver> _variableResolverFactory;
- private final static String VARIABLE_RESOLVER_EXT_POINT_NAME = "variableresolver"; //$NON-NLS-1$
- private final static String VARIABLE_RESOLVER_ELEMENT_NAME = "variableresolver"; //$NON-NLS-1$
-
- /**
- * @param id
- * @return a map of all registered property resolvers by id
- */
- public synchronized static ExtensionData<AbstractDTPropertyResolver> getPropertyResolver(final String id)
- {
- checkAndInitPropertyFactory();
- return _propertyResolverFactory.getExtensions().get(id);
- }
-
- private synchronized static void checkAndInitPropertyFactory()
- {
- if (_propertyResolverFactory == null)
- {
- _propertyResolverFactory = new DecoratableExtensionFactory<AbstractDTPropertyResolver>(
- getDefault().getBundle(), PROPERTY_RESOLVER_EXT_POINT_NAME,
- PROPERTY_RESOLVER_ELEMENT_NAME, false);
- }
- }
-
- /**
- * @param forName
- * @return the ids of variable resolvers for 'forName'.
- */
- public synchronized static List<String> getPropertyResolversForName(
- final String forName)
- {
- checkAndInitVariableResolverFactory();
- return Collections.unmodifiableList(_propertyResolverFactory
- .getIdsForName(forName));
- }
-
- /**
- * @return true if there an decorating resolvers
- */
- public synchronized static boolean hasDecorativePropertyResolvers()
- {
- checkAndInitVariableResolverFactory();
- return _propertyResolverFactory.getNumDecorativeResolvers() > 0;
- }
-
- private static DecoratableExtensionFactory<AbstractDTPropertyResolver> _propertyResolverFactory;
- private final static String PROPERTY_RESOLVER_EXT_POINT_NAME = "propertyresolver"; //$NON-NLS-1$
- private final static String PROPERTY_RESOLVER_ELEMENT_NAME = "propertyresolver"; //$NON-NLS-1$
-
- /**
- * @param id
- * @return a map of all registered method resolvers by id
- */
- public synchronized static ExtensionData<AbstractDTMethodResolver> getMethodResolvers(final String id)
- {
- checkAndInitMethodResolverFactory();
- return _methodResolverFactory.getExtensions().get(id);
- }
-
- private synchronized static void checkAndInitMethodResolverFactory()
- {
- if (_methodResolverFactory == null)
- {
- _methodResolverFactory = new BasicExtensionFactory<AbstractDTMethodResolver>(
- getDefault().getBundle(), METHOD_RESOLVER_EXT_POINT_NAME,
- METHOD_RESOLVER_ELEMENT_NAME, false);
- }
- }
- private static BasicExtensionFactory<AbstractDTMethodResolver> _methodResolverFactory;
- private final static String METHOD_RESOLVER_EXT_POINT_NAME = "methodresolver"; //$NON-NLS-1$
- private final static String METHOD_RESOLVER_ELEMENT_NAME = "methodresolver"; //$NON-NLS-1$
-
- /**
- * @param id
- * @return a map of all registered external context providers by id
- */
- public synchronized static ExtensionData<AbstractDTExternalContextFactory> getExternalContextProviders(final String id)
- {
- checkAndInitExternalContextFactory();
- return _externalContextResolverFactory.getExtensions().get(id);
- }
-
- private synchronized static void checkAndInitExternalContextFactory()
- {
- if (_externalContextResolverFactory == null)
- {
- _externalContextResolverFactory = new BasicExtensionFactory<AbstractDTExternalContextFactory>(
- getDefault().getBundle(), EXTERNAL_CONTEXT_EXT_POINT_NAME,
- EXTERNAL_CONTEXT_ELEMENT_NAME, false);
- }
- }
-
- private static BasicExtensionFactory<AbstractDTExternalContextFactory> _externalContextResolverFactory;
- private final static String EXTERNAL_CONTEXT_EXT_POINT_NAME = "externalcontext"; //$NON-NLS-1$
- private final static String EXTERNAL_CONTEXT_ELEMENT_NAME = "externalcontext"; //$NON-NLS-1$
-
- /**
- * @param id
- * @return a map of all registered external context providers by id
- */
- public synchronized static ExtensionData<AbstractDTViewHandler> getViewHandlers(final String id)
- {
- checkAndInitViewHandler();
- return _viewHandlerFactory.getExtensions().get(id);
- }
-
- private synchronized static void checkAndInitViewHandler()
- {
- if (_viewHandlerFactory == null)
- {
- _viewHandlerFactory = new BasicExtensionFactory<AbstractDTViewHandler>(
- getDefault().getBundle(), VIEWHANDLER_EXT_POINT_NAME,
- VIEWHANDLER_ELEMENT_NAME, true);
- }
- }
-
- private static BasicExtensionFactory<AbstractDTViewHandler> _viewHandlerFactory;
- private final static String VIEWHANDLER_EXT_POINT_NAME = "viewhandler"; //$NON-NLS-1$
- private final static String VIEWHANDLER_ELEMENT_NAME = "viewhandler"; //$NON-NLS-1$
-
- /**
- * @return the preference store for this bundle TODO: this is copied from
- * AbstractUIPlugin; need to upgrade to new IPreferencesService
- */
- public IPreferenceStore getPreferenceStore()
- {
- // Create the preference store lazily.
- if (this.preferenceStore == null)
- {
- this.preferenceStore = new ScopedPreferenceStore(
- new InstanceScope(), getBundle().getSymbolicName());
-
- }
- return this.preferenceStore;
- }
-
- /**
- * @param name
- * @return the extension point called name for this bundle
- */
- public IExtensionPoint getExtension(final String name)
- {
- return Platform.getExtensionRegistry().getExtensionPoint(
- plugin.getBundle().getSymbolicName(), name);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/JSFCoreTraceOptions.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/JSFCoreTraceOptions.java
deleted file mode 100644
index 0f27317..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/JSFCoreTraceOptions.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal;
-
-import org.eclipse.osgi.framework.debug.FrameworkDebugOptions;
-import org.eclipse.osgi.service.debug.DebugOptions;
-
-/**
- * Defines that standard runtime trace options for debugging. See .options file
- * for definitions.
- *
- * @author cbateman
- *
- */
-public final class JSFCoreTraceOptions
-{
- /**
- * True if debug tracing is enabled. Other tracing cannot be enabled unless
- * this is enabled.
- */
- public static final boolean ENABLED;
-
- /**
- * True if tag introspector tracing is enabled
- */
- public static final boolean TRACE_JSPTAGINTROSPECTOR;
- /**
- * True if tag introspector performance tracing is enabled
- */
- public static final boolean TRACE_JSPTAGINTROSPECTOR_PERF;
-
- /**
- * True if the JSP tag registry tracing is enabled
- */
- public static final boolean TRACE_JSPTAGREGISTRY;
-
- /**
- * True if handling of JSP TagIndex changes are being traced
- */
- public static final boolean TRACE_JSPTAGREGISTRY_CHANGES;
-
- /**
- * True if the JSP persistent jsp tag resolver strategy is being traced.
- */
- public static final boolean TRACE_JSPTAGPERSISTENCE;
-
- /**
- * True if the TLD registry manager tracing is enabled
- */
- public static final boolean TRACE_TLDREGISTRYMANAGER;
-
-
- /**
- * True if the TLD registry performance tracing is enabled
- */
- public static final boolean TRACE_JSPTAGREGISTRY_PERF;
-
- private static final String KEY_DEBUG_ENABLED = "/debug";
- private static final String KEY_DESIGNTIME = "/designtime";
- private static final String KEY_DESIGNTIME_VIEW = KEY_DESIGNTIME + "/view";
- private static final String KEY_VIEW_JSPTAGINTROSPECTOR = KEY_DESIGNTIME_VIEW
- + "/jsptagintrospection";
- private static final String KEY_VIEW_JSPTAGINTROSPECTOR_PERF =
- KEY_VIEW_JSPTAGINTROSPECTOR + "/perf";
- private static final String KEY_VIEW_JSPTAGREGISTRY = KEY_DESIGNTIME_VIEW
- + "/jsptagregistry";
- private static final String KEY_VIEW_JSPTAGPERSISTENCE = KEY_DESIGNTIME_VIEW
- + "/jsptagpersistence";
- private static final String KEY_VIEW_JSPTAGREGISTRY_CHANGES =
- KEY_VIEW_JSPTAGREGISTRY + "/changes";
- private static final String KEY_VIEW_JSPTAGREGISTRY_PERF =
- KEY_VIEW_JSPTAGREGISTRY + "/perf";
- private static final String KEY_VIEW_TLDREGISTRYMANAGER =
- KEY_DESIGNTIME_VIEW + "/tldregistrymanager";
-
-
- static
- {
- final DebugOptions debugOptions = FrameworkDebugOptions.getDefault();
-
- ENABLED = debugOptions != null
- && debugOptions.getBooleanOption(JSFCorePlugin.PLUGIN_ID
- + KEY_DEBUG_ENABLED, false);
-
- if (ENABLED)
- {
- TRACE_JSPTAGINTROSPECTOR = debugOptions.getBooleanOption(
- JSFCorePlugin.PLUGIN_ID + KEY_VIEW_JSPTAGINTROSPECTOR, false);
- TRACE_JSPTAGREGISTRY = debugOptions.getBooleanOption(
- JSFCorePlugin.PLUGIN_ID + KEY_VIEW_JSPTAGREGISTRY, false);
- TRACE_JSPTAGREGISTRY_CHANGES = debugOptions.getBooleanOption(
- JSFCorePlugin.PLUGIN_ID + KEY_VIEW_JSPTAGREGISTRY_CHANGES, false);
- TRACE_TLDREGISTRYMANAGER = debugOptions.getBooleanOption(
- JSFCorePlugin.PLUGIN_ID + KEY_VIEW_TLDREGISTRYMANAGER, false);
- TRACE_JSPTAGREGISTRY_PERF = debugOptions.getBooleanOption(
- JSFCorePlugin.PLUGIN_ID + KEY_VIEW_JSPTAGREGISTRY_PERF, false);
- TRACE_JSPTAGINTROSPECTOR_PERF = debugOptions.getBooleanOption(
- JSFCorePlugin.PLUGIN_ID + KEY_VIEW_JSPTAGINTROSPECTOR_PERF, false);
- TRACE_JSPTAGPERSISTENCE = debugOptions.getBooleanOption(
- JSFCorePlugin.PLUGIN_ID + KEY_VIEW_JSPTAGPERSISTENCE, false);
- }
- else
- {
- TRACE_JSPTAGINTROSPECTOR = false;
- TRACE_JSPTAGREGISTRY = false;
- TRACE_JSPTAGREGISTRY_CHANGES = false;
- TRACE_TLDREGISTRYMANAGER = false;
- TRACE_JSPTAGREGISTRY_PERF = false;
- TRACE_JSPTAGINTROSPECTOR_PERF = false;
- TRACE_JSPTAGPERSISTENCE = false;
- }
- }
-
- /**
- * @param message
- */
- public static void log(final String message)
- {
- System.out.println(message);
- }
-
- /**
- * @param msg A short label placed before the trace of t to show the source
- * @param t
- */
- public static void log(final String msg, final Throwable t)
- {
- System.out.printf("%s: Exception Trace:\n\n",msg);
- t.printStackTrace(System.out);
- System.out.print("\n\n\n");
- }
-
- private JSFCoreTraceOptions()
- {
- // no instantiation
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/JSFLibrariesContainerInitializer.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/JSFLibrariesContainerInitializer.java
deleted file mode 100644
index d8d443c..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/JSFLibrariesContainerInitializer.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.core.ClasspathContainerInitializer;
-import org.eclipse.jdt.core.IClasspathContainer;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jst.jsf.core.internal.jsflibraryconfig.JSFLibraryRegistryUtil;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary;
-import org.eclipse.jst.jsf.core.jsflibraryconfiguration.JSFLibraryConfigurationHelper;
-
-/**
- * Initialize JSF Libraries as classpath containers
- */
-public class JSFLibrariesContainerInitializer extends
- ClasspathContainerInitializer {
-
- private static final String MISSING_LIBRARY = Messages.JSFLibrariesContainerInitializer_missing_library;
-
- /**
- * Constructor
- */
- public JSFLibrariesContainerInitializer() {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.ClasspathContainerInitializer#initialize(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject)
- */
- public void initialize(IPath containerPath, IJavaProject project) throws CoreException {
- if (isJSFLibraryContainer(containerPath)) {
- String libId= containerPath.lastSegment();
-
- JSFLibrary ref= JSFLibraryRegistryUtil.getInstance().getJSFLibraryRegistry().getJSFLibraryByID(libId);
- if (ref != null) {
- JSFLibraryClasspathContainer container= new JSFLibraryClasspathContainer(ref);
- JavaCore.setClasspathContainer(containerPath, new IJavaProject[] { project }, new IClasspathContainer[] { container }, null);
- }
- }
- }
-
- private boolean isJSFLibraryContainer(IPath path) {
- return path != null && path.segmentCount() == 2 && JSFLibraryConfigurationHelper.JSF_LIBRARY_CP_CONTAINER_ID.equals(path.segment(0));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.ClasspathContainerInitializer#canUpdateClasspathContainer(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject)
- */
- public boolean canUpdateClasspathContainer(IPath containerPath, IJavaProject project) {
- return isJSFLibraryContainer(containerPath);
- }
-
- /**
- * @see org.eclipse.jdt.core.ClasspathContainerInitializer#getDescription(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject)
- */
- public String getDescription(IPath containerPath, IJavaProject project) {
- if (isJSFLibraryContainer(containerPath)) {
- String id = containerPath.lastSegment();
- JSFLibrary libref = JSFLibraryRegistryUtil.getInstance().getJSFLibraryRegistry().getJSFLibraryByID(id);
- String displayText = id;
-
- if (libref == null){
- displayText = displayText + " " + MISSING_LIBRARY; //$NON-NLS-1$
- }
-
- return displayText;
- }
- return super.getDescription(containerPath, project);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.ClasspathContainerInitializer#getComparisonID(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject)
- */
- public Object getComparisonID(IPath containerPath, IJavaProject project) {
- return containerPath;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/JSFLibraryClasspathContainer.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/JSFLibraryClasspathContainer.java
deleted file mode 100644
index ab3d50c..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/JSFLibraryClasspathContainer.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathContainer;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jst.jsf.core.internal.jsflibraryconfig.JSFLibraryRegistryUtil;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary;
-import org.eclipse.jst.jsf.core.jsflibraryconfiguration.JSFLibraryConfigurationHelper;
-
-
-/**
- * JSF Library classpath container
- */
-public class JSFLibraryClasspathContainer implements IClasspathContainer {
- private static final String NON_IMPL_DESC = Messages.JSFLibraryClasspathContainer_NON_IMPL_LIBRARY;
- private static final String IMPL_DESC = Messages.JSFLibraryClasspathContainer_IMPL_LIBRARY;
-
- private JSFLibrary lib;
-
- /**
- * @param lib
- */
- public JSFLibraryClasspathContainer(JSFLibrary lib) {
- this.lib = lib;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.IClasspathContainer#getClasspathEntries()
- */
- public IClasspathEntry[] getClasspathEntries() {
- return JSFLibraryRegistryUtil.getInstance().getClasspathEntries(lib);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.IClasspathContainer#getDescription()
- */
- public String getDescription() {
- StringBuffer buf = new StringBuffer(lib.getLabel());
- buf.append(" "); //$NON-NLS-1$
- if (lib.isImplementation())
- buf.append(IMPL_DESC);
- else
- buf.append(NON_IMPL_DESC);
-
- return buf.toString();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.IClasspathContainer#getKind()
- */
- public int getKind() {
- return IClasspathContainer.K_APPLICATION;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.IClasspathContainer#getPath()
- */
- public IPath getPath() {
- return new Path(JSFLibraryConfigurationHelper.JSF_LIBRARY_CP_CONTAINER_ID).append(this.lib.getID());
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/JSFRegistryVersionInfo.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/JSFRegistryVersionInfo.java
deleted file mode 100644
index 19fa696..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/JSFRegistryVersionInfo.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal;
-
-import org.osgi.framework.Version;
-
-/**
- * A value object the describes the current and expected state of the JSF Library
- * Registry
- *
- * @author cbateman
- *
- */
-final class JSFRegistryVersionInfo
-{
- private Version _curVersion; // the version of the current registry on disk
- private Version _expectedVersion; // the expected or required version of the registry
-
- JSFRegistryVersionInfo(Version oldVersion, Version expectedVersion)
- {
- super();
- _curVersion = oldVersion;
- _expectedVersion = expectedVersion;
- }
-
- /**
- * @return the version of the registry found in the current workspace
- */
- public Version getCurVersion() {
- return _curVersion;
- }
-
- /**
- * @return the version of the registry that is expected
- */
- public Version getExpectedVersion() {
- return _expectedVersion;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/Messages.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/Messages.java
deleted file mode 100644
index cc3689c..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/Messages.java
+++ /dev/null
@@ -1,273 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler - initial API and implementation
- * Ian Trimble - changed to work correctly with org.eclipse.osgi.util.NLS
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * String resource handler.
- *
- * @author Gerry Kessler - Oracle, Ian Trimble - Oracle
- */
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.jst.jsf.core.internal.messages"; //$NON-NLS-1$
-
- /**
- * see messages.properties
- */
- public static String JSFFacetInstallDataModelProvider_ClientImplValidationMsg;
-
- /**
- * see messages.properties
- */
- public static String JSFFacetInstallDataModelProvider_DupeJarValidation;
-
- /**
- * see messages.properties
- */
- public static String JSFFacetInstallDataModelProvider_INITIAL_VALIDATION_IMPL_TYPE;
-
-
- /**
- * see messages.properties
- */
- public static String JSFLibCfgDialogSettingData_Sticky_Component_Lib_Not_Exist;
-
- /**
- * see messages.properties
- */
- public static String JSFLibrariesContainerInitializer_missing_library;
-
- /**
- * see messages.properties
- */
- public static String JSFLibraryClasspathContainer_IMPL_LIBRARY;
-
- /**
- * see messages.properties
- */
- public static String JSFLibraryClasspathContainer_NON_IMPL_LIBRARY;
-
- /**
- * see messages.properties
- */
- public static String JSFLibraryConfigModel_Null_Data_Source;
-
- /**
- * see messages.properties
- */
- public static String JSFLibraryConfigPersistData_SAVED_COMPLIB_NOT_FOUND;
-
- /**
- * see messages.properties
- */
- public static String JSFLibraryConfigPersistData_SAVED_IMPLLIB_NOT_FOUND;
-
- /**
- * see messages.properties
- */
- public static String JSFLibraryRegistry_ErrorCreatingURL;
- /**
- * see messages.properties
- */
- public static String JSFLibraryRegistry_NoLoadCreatingNew;
- /**
- * see messages.properties
- */
- public static String JSFLibraryRegistry_ErrorSaving;
- /**
- * see messages.properties
- */
- public static String JSFLibraryRegistry_DEFAULT_IMPL_LABEL;
- /**
- * see messages.properties
- */
- public static String JSFLibraryRegistry_ErrorLoadingFromExtPt;
-
- /**
- * see messages.properties
- */
- public static String JSFFacetInstallDataModelProvider_ValidateServletName;
- /**
- * see messages.properties
- */
- public static String JSFFacetInstallDataModelProvider_ValidateJSFImpl;
- /**
- * see messages.properties
- */
- public static String JSFFacetInstallDataModelProvider_ValidateConfigFileEmpty;
- /**
- * see messages.properties
- */
- public static String JSFFacetInstallDataModelProvider_ValidateConfigFilePath;
- /**
- * see messages.properties
- */
- public static String JSFFacetInstallDataModelProvider_ValidateConfigFileRelative1;
- /**
- * see messages.properties
- */
- public static String JSFFacetInstallDataModelProvider_ValidateConfigFileRelative2;
- /**
- * see messages.properties
- */
- public static String JSFFacetInstallDataModelProvider_ValidateConfigFileXML;
- /**
- * see messages.properties
- */
- public static String JSFFacetInstallDataModelProvider_ValidateConfigFileSlashes;
-
- /**
- * see messages.properties
- */
- public static String ArchiveFileImpl_CannotCopyFile;
- /**
- * see messages.properties
- */
- public static String ArchiveFileImpl_CannotCloseFile;
- /**
- * see messages.properties
- */
- public static String ArchiveFileImpl_CannotLocatePluginRelativeFile;
-
- /**
- * see messages.properties
- */
- public static String JSFUtils_MissingJAR;
-
- /**
- * see messages.properties
- */
- public static String PluginProvidedJSFLibraryCreationHelper_ErrorCreating;
- /**
- * see messages.properties
- */
- public static String PluginProvidedJSFLibraryCreationHelper_ErrorMultipleDefinition;
-
- /**
- * see messages.properties
- */
- public static String JSFUtils_ErrorCreatingConfigFile;
- /**
- * see messages.properties
- */
- public static String JSFUtils_ErrorClosingConfigFile;
-
- /**
- * see messages.properties
- */
- public static String JSFAppConfigUtils_ErrorOpeningJarFile;
-
- /**
- * see messages.properties
- */
- public static String JARFileJSFAppConfigProvider_ErrorLoadingModel;
-
- /**
- * see messages.properties
- */
- public static String J2EEModuleDependencyDelegate_UpdatingJ2EEModuleDependencies;
- /**
- * see messages.properties
- */
- public static String J2EEModuleDependencyDelegate_UpdatingJ2EEModuleDependenciesForProject;
-
- /**
- * see messages.properties
- */
- public static String JSFRegistryMigration05_to_10_title;
- /**
- * see messages.properties
- */
- public static String JSFRegistryMigration05_to_10_message;
-
- /**
- * see messages.properties
- */
- public static String JSFRegistryMigration05_to_10_customMessage;
-
-
- /**
- * see messages.properties
- */
- public static String JSFRegistryMigrationCannot05_to_10_title;
- /**
- * see messages.properties
- */
- public static String JSFRegistryMigrationCannot05_to_10_message;
-
- /**
- * see messages.properties
- */
- public static String JSFRegistryMigrationCannot05_to_10_customMessage;
-
-
- /**
- * see messages.properties
- */
- public static String RegistryMigrationStartupHandler_Dialog_Abort_And_Exit_Migration;
-
- /**
- * see messages.properties
- */
- public static String RegistryMigrationStartupHandler_Dialog_Confirm_Migration;
-
- /**
- * see messages.properties
- */
- public static String RegistryMigrationStartupHandler_Error_committing_migration;
-
- /**
- * see messages.properties
- */
- public static String RegistryMigrationStartupHandler_Error_Rolling_Back_Migration;
-
- /**
- * see messages.properties
- */
- public static String RegistryMigrationStartupHandler_Launch_Migration_Doc_On_Confirm;
-
- /**
- * see messages.properties
- */
- public static String JSFFacet11_presetLabel;
-
- /**
- * see messages.properties
- */
- public static String JSFFacet11_presetDescription;
-
- /**
- * see messages.properties
- */
- public static String JSFFacetInstallDelegate_InternalErr;
- /**
- * see messages.properties
- */
- public static String JSFFacetInstallDelegate_ConfigErr;
- /**
- * see messages.properties
- */
- public static String JSFFacetInstallDelegate_NonUpdateableWebXML;
- /**
- * see messages.properties
- */
- public static String JSFFacetUninstallDelegate_ConfigErr;
- /**
- * see messages.properties
- */
- public static String JSFFacetUninstallDelegate_NonUpdateableWebXML;
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/RegistryUpgradeCommitHandler.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/RegistryUpgradeCommitHandler.java
deleted file mode 100644
index 8e3f0f7..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/RegistryUpgradeCommitHandler.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.util.JSFLibraryRegistryUpgradeUtil;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.util.UpgradeStatus;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
-
-/**
- * Commits registry migration
- * @author cbateman
- *
- */
-public class RegistryUpgradeCommitHandler
-{
-
- /**
- * handle migration
- */
- public static void commitMigrationIfNecessary()
- {
- JSFLibraryRegistryUpgradeUtil upgradeUtil =
- JSFLibraryRegistryUpgradeUtil.getInstance();
-
- UpgradeStatus status = upgradeUtil.getUpgradeStatus();
-
- if (status.getSeverity() == IStatus.OK)
- {
- if (status.isUpgradeOccurred())
- {
- handle05_to_10(status);
- }
- }
- else
- {
- handleErrorInMigration(status);
- }
- }
-
- private static void handle05_to_10(UpgradeStatus status)
- {
- PlatformUI.getWorkbench().getDisplay().asyncExec(new Handle05_to_10_migration(status));
- }
-
- private static void handleErrorInMigration(UpgradeStatus status)
- {
- PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable()
- {
- public void run()
- {
- final Shell shell = PlatformUI.getWorkbench().getDisplay().getActiveShell();
- MessageDialog.openError(shell, "Serious Error Encountered!", "An unrecoverable error occurred while trying to migrate your JSF Library Registry to a newer version. This may cause your library references to be broken in your JSF projects.");
- }
- });
- }
-
- private static class Handle05_to_10_migration implements Runnable
- {
- private final UpgradeStatus _status;
-
- Handle05_to_10_migration(UpgradeStatus status)
- {
- _status = status;
- }
-
- public void run()
- {
- // no prompting necessary. just commit.
- doConfirmed(false);
- }
-
- private void doConfirmed(boolean userWantsMigrationDocLaunch) {
- // delete V1 registry, leave backup file
- IStatus result = _status.commit();
-
- if (result.getSeverity() != IStatus.OK)
- {
- final Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
- MessageDialog.openError(shell, Messages.RegistryMigrationStartupHandler_Error_committing_migration, result.getMessage());
- }
-
- // if user confirmed, launch migration doc
- if (userWantsMigrationDocLaunch)
- try {
- IWorkbenchBrowserSupport browserSupport =
- PlatformUI.getWorkbench().getBrowserSupport();
- URL url = new URL("http://wiki.eclipse.org/index.php/JSF_Library_Migration"); //$NON-NLS-1$
- browserSupport.createBrowser("JSFMigrationDoc").openURL(url); //$NON-NLS-1$
- } catch (PartInitException e) {
- JSFCorePlugin.log(e,"Error handling migration"); //$NON-NLS-1$
- } catch (MalformedURLException e) {
- JSFCorePlugin.log(e,"Error handling migration"); //$NON-NLS-1$
- }
- }
-
-// private void doAbortAndExit()
-// {
-// // rollback
-// IStatus result = _status.rollback();
-//
-// if (result.getSeverity() != IStatus.OK)
-// {
-// final Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
-// MessageDialog.openError(shell, Messages.RegistryMigrationStartupHandler_Error_Rolling_Back_Migration, result.getMessage());
-// }
-// // close workbench
-// PlatformUI.getWorkbench().close();
-// }
-// }
-//
-// private static class ConfirmDialog extends MessageDialogWithToggle
-// {
-// final static int CONFIRMED = 0;
-// final static int ABORT_AND_EXIT = 1;
-//
-// /**
-// * @param parentShell
-// * @param dialogTitle
-// * @param dialogMessage
-// */
-// public ConfirmDialog(Shell parentShell, String dialogTitle,
-// String dialogMessage) {
-// super(parentShell
-// , dialogTitle
-// , null
-// , dialogMessage
-// , WARNING
-// , new String[] { Messages.RegistryMigrationStartupHandler_Dialog_Confirm_Migration, Messages.RegistryMigrationStartupHandler_Dialog_Abort_And_Exit_Migration }
-// , ABORT_AND_EXIT
-// , Messages.RegistryMigrationStartupHandler_Launch_Migration_Doc_On_Confirm, true);
-// }
-//
-// /**
-// * Override so that the button ids line up with the constants
-// * expected
-// * @param parent
-// */
-// protected void createButtonsForButtonBar(Composite parent) {
-// final String[] buttonLabels = getButtonLabels();
-// final Button[] buttons = new Button[buttonLabels.length];
-// final int defaultButtonIndex = getDefaultButtonIndex();
-//
-// for (int i = 0; i < buttonLabels.length; i++) {
-// String label = buttonLabels[i];
-// Button button = createButton(parent, i, label,
-// defaultButtonIndex == i);
-// buttons[i] = button;
-//
-// }
-// setButtons(buttons);
-// }
-//
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/TagLibraryRegistryLoader.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/TagLibraryRegistryLoader.java
deleted file mode 100644
index 8acca06..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/TagLibraryRegistryLoader.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal;
-
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-
-/**
- * Loads and caches extension for the tagRegistry extension point.
- *
- * @author cbateman
- *
- */
-/* package */class TagLibraryRegistryLoader
-{
- private final static String EXTENSION_ID = "tagregistry";
- private final static String ELEMENT_NAME = "tagRegistry";
-
- private static Set<TagRegistryFactoryInfo> _extensions;
-
- /**
- * @return the list of handlers. The list is not modifiable and will throw
- * exceptions if it is attempted.
- */
- public static synchronized Set<TagRegistryFactoryInfo> getAllHandlers()
- {
- if (_extensions == null)
- {
- _extensions = readAllHandlers();
- }
- return Collections.unmodifiableSet(_extensions);
-
- }
-
- private static Set<TagRegistryFactoryInfo> readAllHandlers()
- {
- Set<TagRegistryFactoryInfo> result = new HashSet<TagRegistryFactoryInfo>();
- IExtensionPoint extensionPoint = JSFCorePlugin.getDefault()
- .getExtension(EXTENSION_ID);
- IExtension[] extensions = extensionPoint.getExtensions();
-
- for (int i = 0; i < extensions.length; i++)
- {
- IExtension ext = extensions[i];
- IConfigurationElement[] configElements = ext
- .getConfigurationElements();
-
- for (int j = 0; j < configElements.length; j++)
- {
- final IConfigurationElement element = configElements[j];
- if (ELEMENT_NAME.equals(element.getName()))
- {
- try
- {
- final TagRegistryFactoryInfo extension = new TagRegistryFactoryInfo(
- element);
- result.add(extension);
- }
- catch (CoreException e)
- {
- JSFCorePlugin.log(e,
- "Error loading tag registry extension: "
- + element.getContributor().getName()
- + "." + element.getAttribute("id"));
- }
- }
- }
- }
- return result;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/TagRegistryFactoryInfo.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/TagRegistryFactoryInfo.java
deleted file mode 100644
index ba2901b..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/TagRegistryFactoryInfo.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal;
-
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.jst.jsf.designtime.internal.view.model.TagRegistryFactory;
-
-/**
- * Encapsulates information about tag registry extensions
- *
- */
-public final class TagRegistryFactoryInfo
-{
- private final String _description;
- private final String _id;
- private final TagRegistryFactory _tagRegistry;
- private final Set<IContentType> _contentTypes;
-
- /**
- * @param element
- * @throws CoreException
- */
- TagRegistryFactoryInfo(IConfigurationElement element)
- throws CoreException
- {
- // do this first since it has highest potential to fail
- _tagRegistry = (TagRegistryFactory) element
- .createExecutableExtension("class");
-
- final String localId = element.getAttribute("id");
- _id = element.getContributor().getName() + "." + localId;
-
- _description = element.getAttribute("description");
-
- final IConfigurationElement[] contentTypes = element
- .getChildren("content-type");
-
- final IContentTypeManager typeManager = Platform
- .getContentTypeManager();
- _contentTypes = new HashSet<IContentType>();
- for (IConfigurationElement contentTypeElement : contentTypes)
- {
- final String contentTypeId = contentTypeElement
- .getAttribute("contentTypeId");
-
- final IContentType contentType = typeManager
- .getContentType(contentTypeId);
- _contentTypes.add(contentType);
- }
- }
-
- /**
- * @return the user displyable description
- */
- public String getDescription()
- {
- return _description;
- }
-
- /**
- * @return the unique of the extension
- */
- public String getId()
- {
- return _id;
- }
-
- /**
- * @return the registry
- */
- public TagRegistryFactory getTagRegistryFactory()
- {
- return _tagRegistry;
- }
-
- /**
- * Set is immutable.
- *
- * @return the content types this registry is registered against.
- */
- public Set<IContentType> getContentTypes()
- {
- return Collections.unmodifiableSet(_contentTypes);
- }
-}
\ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/contentassist/el/ContentAssistParser.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/contentassist/el/ContentAssistParser.java
deleted file mode 100644
index c13b0e8..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/contentassist/el/ContentAssistParser.java
+++ /dev/null
@@ -1,378 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.core.internal.contentassist.el;
-
-import org.eclipse.jface.text.Region;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ASTAddExpression;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ASTAndExpression;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ASTChoiceExpression;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ASTEqualityExpression;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ASTExpression;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ASTFunctionInvocation;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ASTLiteral;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ASTMultiplyExpression;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ASTOrExpression;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ASTRelationalExpression;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ASTUnaryExpression;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ASTValue;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ASTValuePrefix;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ASTValueSuffix;
-import org.eclipse.jst.jsp.core.internal.java.jspel.JSPELParser;
-import org.eclipse.jst.jsp.core.internal.java.jspel.JSPELParserConstants;
-import org.eclipse.jst.jsp.core.internal.java.jspel.JSPELParserVisitor;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ParseException;
-import org.eclipse.jst.jsp.core.internal.java.jspel.SimpleNode;
-import org.eclipse.jst.jsp.core.internal.java.jspel.Token;
-
-/**
- * Consumes an EL expression and converts into a completion prefix
- *
- * @author cbateman
- *
- */
-public final class ContentAssistParser
-{
- /**
- * @param relativePosition -- 1-based position in elText (first position is 1)
- * @param elText
- * @return a content assist strategy for the given position and el expression
- * or null if one cannot be determined
- */
- public static ContentAssistStrategy getPrefix(final int relativePosition, final String elText)
- {
- if (elText == null)
- {
- return null;
- }
- else if ("".equals(elText.trim())) //$NON-NLS-1$
- {
- return new IdCompletionStrategy("", ""); //$NON-NLS-1$//$NON-NLS-2$
- }
-
- PrefixVisitor visitor = getVisitorForPosition(relativePosition, elText);
- return visitor != null? visitor.getPrefix() : null;
- }
-
- /**
- * Get symbol and symbol region at given position in el string
- * @param context - IStructuredDocumentContext
- * @param relativePosition - position in el string
- * @param elText - el string
- * @return SymbolInfo. May be null.
- */
- public static SymbolInfo getSymbolInfo(IStructuredDocumentContext context, final int relativePosition, final String elText) {
- if (elText == null || "".equals(elText.trim())) //$NON-NLS-1$
- {
- return null;
- }
- PrefixVisitor visitor = getVisitorForPosition(relativePosition, elText);
- if (visitor != null) {
- SymbolInfo symbolInfo = visitor.getSymbolInfo(context);
- if (symbolInfo != null) {
- Region r = symbolInfo.getRelativeRegion();
- if (relativePosition > r.getOffset() && relativePosition <= r.getOffset() + r.getLength()) {
- return symbolInfo;
- }
- }
- }
- return null;
- }
-
- private static PrefixVisitor getVisitorForPosition(final int relativePosition,
- final String elText) {
- final java.io.StringReader reader = new java.io.StringReader(elText);
- final JSPELParser parser = new JSPELParser(reader);
-
- try
- {
- final ASTExpression expr = parser.Expression();
- final PrefixVisitor visitor = new PrefixVisitor(relativePosition, elText);
- expr.jjtAccept(visitor, null);
- return visitor;
- }
- catch (ParseException pe)
- {
- // TODO: handle parser by using current and expected tokens
- return null;
- }
- }
-
- private static String substring(String s, Region r) {
- return s.substring(r.getOffset(), r.getOffset() + r.getLength());
- }
-
- private static class PrefixVisitor implements JSPELParserVisitor
- {
- private final int _relativePos;
- private final String _fullText;
-
- private String _symbolPrefix; // = null; initialized as tree is visited
- private int _prefixType;
- private boolean _prefixResolved; // = false; set to true when the prefix is resolved
- private int _symbolStartPos = 1; // first char has position 1
- private int _symbolEndPos = 0;
-
- PrefixVisitor(final int relativePos, final String fullText)
- {
- _relativePos = relativePos;
- _fullText = fullText;
- }
-
- /**
- * @return the prefix if resolved or null if not resolved
- */
- public ContentAssistStrategy getPrefix()
- {
- if (_prefixResolved)
- {
- switch(_prefixType)
- {
- case ContentAssistStrategy.PREFIX_TYPE_DOT_COMPLETION:
- return new FunctionCompletionStrategy(_symbolPrefix, getProposalStart());
-
- case ContentAssistStrategy.PREFIX_TYPE_ID_COMPLETION:
- return new IdCompletionStrategy(_symbolPrefix, getProposalStart());
-
- case ContentAssistStrategy.PREFIX_TYPE_EMPTY_EXPRESSION:
- return new IdCompletionStrategy("", getProposalStart()); //$NON-NLS-1$
-
- default:
- // do nothing; fall-through to return null
- }
- }
-
- return null;
- }
-
- /**
- * @param context - IStructuredDocumentContext
- * @return symbol and symbol region if resolved, null otherwise
- */
- public SymbolInfo getSymbolInfo(IStructuredDocumentContext context) {
- if (_prefixResolved && _symbolStartPos < _symbolEndPos) {
- Region region = new Region(_symbolStartPos - 1, _symbolEndPos - _symbolStartPos + 1);
- ISymbol symbol = null;
- switch (_prefixType) {
- case ContentAssistStrategy.PREFIX_TYPE_ID_COMPLETION:
- symbol = SymbolResolveUtil.getSymbolForVariable(context, substring(_fullText, region));
- break;
- case ContentAssistStrategy.PREFIX_TYPE_DOT_COMPLETION:
- symbol = SymbolResolveUtil.getSymbolForVariableSuffixExpr(context, _symbolPrefix + "." + substring(_fullText, region), _symbolEndPos == _fullText.length()); //$NON-NLS-1$
- break;
- }
- if (symbol != null) {
- return new SymbolInfo(symbol, region);
- }
- }
- return null;
- }
-
- private String getProposalStart() {
- if (_symbolStartPos <= _relativePos) {
- return _fullText.substring(_symbolStartPos - 1, _relativePos - 1);
- }
- return ""; //$NON-NLS-1$
- }
-
- public Object visit(ASTAddExpression node, Object data)
- {
- return node.childrenAccept(this, data);
- }
-
- public Object visit(ASTAndExpression node, Object data)
- {
- return node.childrenAccept(this, data);
- }
-
- public Object visit(ASTChoiceExpression node, Object data)
- {
- return node.childrenAccept(this, data);
- }
-
- public Object visit(ASTEqualityExpression node, Object data)
- {
- return node.childrenAccept(this, data);
- }
-
- public Object visit(ASTExpression node, Object data)
- {
- return node.childrenAccept(this, data);
- }
-
- public Object visit(ASTFunctionInvocation node, Object data)
- {
- return node.childrenAccept(this, data);
- }
-
- public Object visit(ASTLiteral node, Object data)
- {
- return node.childrenAccept(this, data);
- }
-
- public Object visit(ASTMultiplyExpression node, Object data)
- {
- return node.childrenAccept(this, data);
- }
-
- public Object visit(ASTOrExpression node, Object data)
- {
- return node.childrenAccept(this, data);
- }
-
- public Object visit(ASTRelationalExpression node, Object data)
- {
- return node.childrenAccept(this, data);
- }
-
- public Object visit(ASTUnaryExpression node, Object data)
- {
- return node.childrenAccept(this, data);
- }
-
- public Object visit(ASTValue node, Object data)
- {
- // we're only in this value expr if it contains the cursor
- if (testContainsCursor(node))
- {
- return node.childrenAccept(this, data);
- }
-
- return null;
- }
-
- public Object visit(ASTValuePrefix node, Object data)
- {
- // for now, only concern ourselves with simple (identifier) prefixes
- if (!_prefixResolved
- && node.jjtGetNumChildren() == 0
- && node.getFirstToken().kind == JSPELParserConstants.IDENTIFIER)
- {
- _symbolPrefix = node.getFirstToken().image;
-
- if (testContainsCursor(node))
- {
- // if the cursor is on this id, we don't need to visit
- // further since we know both the prefix -- the id -- and
- // the type -- it's an id completion
- _prefixType = ContentAssistStrategy.PREFIX_TYPE_ID_COMPLETION;
- _symbolStartPos = node.getFirstToken().beginColumn;
- _symbolEndPos = node.getFirstToken().endColumn;
- _prefixResolved = true;
- }
- }
- return node.childrenAccept(this, data);
- }
-
- public Object visit(ASTValueSuffix node, Object data)
- {
- // for now, only deal with the simple .id suffix
- Token lastToken = node.getLastToken();
- if (node.jjtGetNumChildren() == 0)
- {
- if (!_prefixResolved
- && node.getFirstToken().kind == JSPELParserConstants.DOT)
- {
- if (lastToken.kind == JSPELParserConstants.IDENTIFIER)
- {
- if (testContainsCursor(node))
- {
- _prefixType = ContentAssistStrategy.PREFIX_TYPE_DOT_COMPLETION;
- int proposalStartLength = _relativePos - lastToken.beginColumn;
- if (proposalStartLength < 0) { // Cursor after firstToken start but before lastToken start?
- proposalStartLength = 0;
- }
- _symbolStartPos = lastToken.beginColumn;
- _symbolEndPos = lastToken.endColumn;
- _prefixResolved = true;
- }
- // only include this suffix on the path if the cursor is
- // further to the right. Thus for x.^y we get a prefix "x"
- // and for x.y.^z we get "x.y" since this the part we must
- // resolve the prefix for
- else
- {
- _symbolPrefix += node.getFirstToken().image + lastToken.image;
- }
- }
- else if (lastToken == node.getFirstToken())
- {
- if (testCursorImmediatelyAfter(node))
- {
- _prefixType = ContentAssistStrategy.PREFIX_TYPE_DOT_COMPLETION;
- _symbolStartPos = lastToken.endColumn + 1;
- _symbolEndPos = lastToken.endColumn;
- _prefixResolved = true;
- }
- }
- }
-
- return null;
- }
-
- if (node.getFirstToken().kind == JSPELParserConstants.LBRACKET)
- {
- // try to support ca inside the brackets
- node.childrenAccept(this, data);
- }
-
- Object retValue = node.childrenAccept(this, data);
-
- if (!_prefixResolved)
- {
- // if we haven't resolved the prefix yet, then we need
- // to append this suffix value
- _symbolPrefix += _fullText.substring(node.getFirstToken().beginColumn-1, node.getLastToken().endColumn);
- }
-
- return retValue;
- }
-
- public Object visit(SimpleNode node, Object data)
- {
- return node.childrenAccept(this, data);
- }
-
- private boolean testCursorImmediatelyAfter(SimpleNode node)
- {
- return node.getLastToken().endColumn == _relativePos-1;
- }
-
- /**
- * "Containing a cursor" here is deemed to mean that current cursor
- * position as indicated by _relativePos, is either directly before, on or
- * directly after an expression. For example, in a Value expression like
- *
- * x x x . y y y . z z z
- * ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
- * 1 2 3 4 5 6 7 8 9 0 1 2
- *
- * Position's 1-4 are on xxx, 5-8 are on yyy and 9-12 are on zzz
- *
- * @param node
- * @return true if the node "contains the cursor" (see above)
- */
- private boolean testContainsCursor(SimpleNode node)
- {
- return (node.getFirstToken().beginColumn <= _relativePos
- && node.getLastToken().endColumn+1 >= _relativePos);
-
- }
- }
-
- private ContentAssistParser()
- {
- // utility class; not instantiable
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/contentassist/el/ContentAssistStrategy.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/contentassist/el/ContentAssistStrategy.java
deleted file mode 100644
index 1e7d43c..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/contentassist/el/ContentAssistStrategy.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.core.internal.contentassist.el;
-
-import java.util.List;
-
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-
-/**
- * Encapsulates an EL content assist completion prefix
- *
- * @author cbateman
- *
- */
-public abstract class ContentAssistStrategy
-{
- /**
- * ContentAssistStrategy type for a dot content assist completion
- */
- public final static int PREFIX_TYPE_DOT_COMPLETION = 0;
- /**
- * ContentAssistStrategy type for an id content assist completion
- */
- public final static int PREFIX_TYPE_ID_COMPLETION = 1;
- /**
- * Completions for an empty expression
- */
- public final static int PREFIX_TYPE_EMPTY_EXPRESSION = 2;
-
- private final int type;
- private final String value;
- private final String proposalStart;
-
- /**
- * @param type
- * @param value
- * @param proposalStart
- */
- public ContentAssistStrategy(final int type, final String value, final String proposalStart)
- {
- super();
- this.type = type;
- this.value = value;
- this.proposalStart = proposalStart;
- }
-
- /**
- * @return the type of this completion prefix as defined by
- * one of the PREFIX_TYPE constants
- */
- public final int getType()
- {
- return type;
- }
-
- /**
- * @return the token which this prefix is for
- */
- public final String getValue()
- {
- return value;
- }
-
- /**
- * @param context
- * @return the list of proposals for this strategy. Contents of the list
- * must be of type ICompletionProposal. List should be considered immutable.
- */
- public abstract List<ICompletionProposal> getProposals(IStructuredDocumentContext context);
-
- /**
- * @return the part of the proposal which was already typed when user invoked autocomplete
- */
- public String getProposalStart() {
- return proposalStart;
- }
-
- /**
- * @param completionList
- * @param proposal
- */
- protected void addProposalsMatchingProposalStart(final List completionList, final ICompletionProposal[] proposal) {
- final String start = getProposalStart();
- for (int j = 0; j < proposal.length; j++) {
- final String proposalString = proposal[j].getDisplayString();
- //TODO Should use "real" proposal replacement instead of displayString:
- if (proposalString.length() >= start.length() &&
- proposalString.substring(0, start.length()).equalsIgnoreCase(start))
- {
- completionList.add(proposal[j]);
- }
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/contentassist/el/FunctionCompletionStrategy.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/contentassist/el/FunctionCompletionStrategy.java
deleted file mode 100644
index 1be8de4..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/contentassist/el/FunctionCompletionStrategy.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.core.internal.contentassist.el;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.internal.ITextRegionContextResolver;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.symbol.IMethodSymbol;
-import org.eclipse.jst.jsf.context.symbol.IObjectSymbol;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.context.symbol.provider.IContentProposalProvider;
-import org.eclipse.jst.jsf.context.symbol.provider.ProposalCreationFactoryAdapter;
-import org.eclipse.jst.jsf.context.symbol.provider.IContentProposalProvider.IProposalCreationFactory;
-import org.eclipse.jst.jsf.designtime.resolver.ISymbolContextResolver;
-import org.eclipse.jst.jsf.designtime.resolver.StructuredDocumentSymbolResolverFactory;
-import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * A completion strategy for function completions like:
- *
- * v a r .
- * ^
- *
- * @author cbateman
- *
- */
-public class FunctionCompletionStrategy extends ContentAssistStrategy
-{
- /**
- * @param value
- * @param proposalStart
- */
- public FunctionCompletionStrategy(final String value, final String proposalStart)
- {
- super(ContentAssistStrategy.PREFIX_TYPE_DOT_COMPLETION, value, proposalStart);
- }
-
- @Override
- public List<ICompletionProposal> getProposals(final IStructuredDocumentContext context)
- {
- List<ICompletionProposal> completionList = Collections.EMPTY_LIST;
- final ISymbolContextResolver symbolResolver =
- StructuredDocumentSymbolResolverFactory.getInstance().
- getSymbolContextResolver(context);
-
- final ISymbol symbol = SymbolResolveUtil.getSymbolForVariableSuffixExpr(context, getValue(), false);
-
- // if we get a completion symbol, get it's proposals
- if (symbol instanceof IObjectSymbol)
- {
- final List expectedMethodBindings = new ArrayList();
- final ISymbol[] suffixes = getSymbols((IObjectSymbol) symbol,
- context,
- symbolResolver,
- expectedMethodBindings);
-
- final ComposedAdapterFactory factory =
- new ComposedAdapterFactory(
- ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
- final IProposalCreationFactory creationInfo =
- new MyProposalFactory(context, getProposalStart().length(),
- expectedMethodBindings);
-
- completionList = new ArrayList<ICompletionProposal>();
- for (final ISymbol propSymbol : suffixes) {
- final Object provider =
- factory.adapt(propSymbol, IContentProposalProvider.class);
-
- if (provider instanceof IContentProposalProvider)
- {
- final ICompletionProposal[] proposal =
- ((IContentProposalProvider) provider).
- getProposals(propSymbol, creationInfo);
- if (proposal != null)
- {
- addProposalsMatchingProposalStart(completionList,
- proposal);
- }
- }
- }
- }
-
- return Collections.unmodifiableList(completionList);
- }
-
- private ISymbol[] getSymbols(final IObjectSymbol symbol,
- final IStructuredDocumentContext context,
- final ISymbolContextResolver symbolResolver,
- final List expectedMethodBindings)
- {
- final List symbols = new ArrayList();
-
- if (SymbolResolveUtil.isMethodBindingExpected(context, expectedMethodBindings))
- {
- symbols.addAll(Arrays.asList(
- symbolResolver.getMethods(symbol)));
- }
-
- symbols.addAll(Arrays.asList(symbolResolver.getProperties(symbol)));
-
- return (ISymbol[]) symbols.toArray(ISymbol.EMPTY_SYMBOL_ARRAY);
- }
-
- private static class MyProposalFactory extends ProposalCreationFactoryAdapter
- {
- private final static int DEFAULT_RELEVANCE = 1;
-
- private final static int HIGH_RELEVANCE = 2;
- private final static int NORMAL_RELEVANCE = 1;
- private final static int LOW_RELEVANCE = 0;
-
- private final List _expectedMethodBindings;
- private final IStructuredDocumentContext _context;
-
- /**
- * @param context
- * @param replacementLength
- * @param expectedMethodBindings
- */
- public MyProposalFactory(final IStructuredDocumentContext context, final int replacementLength,
- final List expectedMethodBindings) {
- super(context.getDocumentPosition() - replacementLength, replacementLength);
- _context = context;
- _expectedMethodBindings = expectedMethodBindings;
- }
-
- @Override
- public ICompletionProposal createProposal(final String replacementText,
- final String displayText,
- final String additionalText,
- final Image displayImage,
- final Object target)
- {
- int replacementOffset = _replacementOffset;
- int replacementLength = _replacementLength;
-
- // TODO: I regard this as a bit of hack, but until we write our
- // proposal implementation, it's basically the only way I can
- // see to do this
- // if it's an array, we must check if we need to replace a
- // preceding '.'
- if (replacementText.startsWith("["))
- {
- ITextRegionContextResolver textResolver =
- IStructuredDocumentContextResolverFactory.INSTANCE.getTextRegionResolver(_context);
-
- if (textResolver.getRegionType().equals(DOMJSPRegionContexts.JSP_VBL_CLOSE))
- {
- textResolver =
- IStructuredDocumentContextResolverFactory.
- INSTANCE.getTextRegionResolver(textResolver.getPreviousContext());
- }
-
- final String regionText = textResolver.getRegionText();
- final int regionStart = textResolver.getStartOffset();
-
- if (DOMJSPRegionContexts.JSP_VBL_CONTENT.equals(textResolver.getRegionType())
- && regionText != null
- && regionStart != -1
- && regionStart < _context.getDocumentPosition())
- {
- final int relativeOffset = _context.getDocumentPosition() - regionStart - 1;
-
- if (regionText.charAt(relativeOffset) == '.')
- {
- // we must replace a length of 1 (the dot)
- // at an offset on prior
- replacementOffset--;
- replacementLength = 1;
- }
- }
- }
-
- return createDefaultProposal(replacementText,
- replacementOffset,
- replacementLength,
- replacementText.length(),
- displayImage,
- displayText,
- null,
- additionalText,
- getRelevance(target, DEFAULT_RELEVANCE));
- }
-
- private int getRelevance(final Object target, final int defaultRelevance)
- {
- // if method bindings are expected, then list exact signature
- // matches top most. Still list non-matching methods, but put
- // them at the bottom
- if (_expectedMethodBindings.size() > 0)
- {
- if (target instanceof IMethodSymbol)
- {
- final IMethodSymbol methodSymbol = (IMethodSymbol) target;
-
- for (final Iterator it = _expectedMethodBindings.iterator();
- it.hasNext();)
- {
- final String methodType = (String) it.next();
-
- // we have a match, so push to the top
- if (methodType.equals(methodSymbol.getSignature()))
- {
- return HIGH_RELEVANCE;
- }
- }
-
- // if we get out of the loop, then this method doesn't
- // match the expected signature
- return LOW_RELEVANCE;
- }
-
- // non-method targets have normal relevance when mb expected
- return NORMAL_RELEVANCE;
- }
-
- // otherwise, simply return the default for all
- return defaultRelevance;
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/contentassist/el/IdCompletionStrategy.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/contentassist/el/IdCompletionStrategy.java
deleted file mode 100644
index f965d8c..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/contentassist/el/IdCompletionStrategy.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.core.internal.contentassist.el;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IWorkspaceContextResolver;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.symbol.ERuntimeSource;
-import org.eclipse.jst.jsf.context.symbol.IInstanceSymbol;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.context.symbol.provider.IContentProposalProvider;
-import org.eclipse.jst.jsf.context.symbol.provider.ProposalCreationFactoryAdapter;
-import org.eclipse.jst.jsf.context.symbol.provider.IContentProposalProvider.IProposalCreationFactory;
-import org.eclipse.jst.jsf.designtime.resolver.ISymbolContextResolver;
-import org.eclipse.jst.jsf.designtime.resolver.StructuredDocumentSymbolResolverFactory;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * A strategy for getting completions for EL id completions like:
- *
- * var
- * ^
- *
- * @author cbateman
- *
- */
-class IdCompletionStrategy extends ContentAssistStrategy
-{
-
- /**
- * Construct a strategy for completing an ID completion
- *
- * @param prefixValue
- * @param proposalStart - the part of the proposal which was already typed when user invoked autocomplete
- */
- public IdCompletionStrategy(final String prefixValue, String proposalStart)
- {
- super(ContentAssistStrategy.PREFIX_TYPE_ID_COMPLETION, prefixValue, proposalStart);
- }
-
- /**
- * @see org.eclipse.jst.jsf.core.internal.contentassist.el.ContentAssistStrategy#getProposals(org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext)
- */
- public List<ICompletionProposal> getProposals(IStructuredDocumentContext context)
- {
- final List<ICompletionProposal> completionList = new ArrayList<ICompletionProposal>();
- final IWorkspaceContextResolver workspaceResolver =
- IStructuredDocumentContextResolverFactory.INSTANCE.
- getWorkspaceContextResolver(context);
-
- final IFile iFile = (IFile) workspaceResolver.getResource();
-
- ISymbol[] symbols = null;
-
- if (iFile != null)
- {
- final ISymbolContextResolver symbolResolver =
- StructuredDocumentSymbolResolverFactory.getInstance().
- getSymbolContextResolver(context);
-
- symbols = symbolResolver.getAllVariables();
- }
-
- final ComposedAdapterFactory factory =
- new ComposedAdapterFactory(ComposedAdapterFactory.
- Descriptor.Registry.INSTANCE);
-
- final IProposalCreationFactory creationInfo =
- new MyProposalFactory(context.getDocumentPosition(), getProposalStart().length());
-
- for (int i = 0; symbols != null && i < symbols.length; i++)
- {
- final ISymbol symbol = symbols[i];
-
- final Object adapter =
- factory.adapt(symbol, IContentProposalProvider.class);
-
- if (adapter instanceof IContentProposalProvider)
- {
- final IContentProposalProvider provider =
- (IContentProposalProvider) adapter;
- final ICompletionProposal[] proposal =
- provider.getProposals(symbol, creationInfo);
- if (proposal != null)
- {
- addProposalsMatchingProposalStart(completionList, proposal);
- }
- }
- }
-
- return Collections.unmodifiableList(completionList);
- }
-
- private static class MyProposalFactory extends ProposalCreationFactoryAdapter
- {
- private final static int HIGH_RELEVANCE = 2;
- private final static int NORMAL_RELEVANCE = 1;
- private final static int LOW_RELEVANCE = 0;
-
- /**
- * @param replacementOffset
- * @param replacementLength
- */
- public MyProposalFactory(int replacementOffset, int replacementLength)
- {
- /*TODO I changed the meaning of "replacementLength" from "number of chars AFTER cursor to be
- * replaced" to "number of chars BEFORE cursor to be replaced. Since "replacementLength"
- * has always been 0 (constructor is only called by IdCompletionStrategy.getProposals()),
- * this should not change anything, but I don't know if there have been different plans
- * for "replacementLength".
- * TODO Maybe this change should be done in the super class instead?
- */
- super(replacementOffset - replacementLength, replacementLength);
- }
-
- public ICompletionProposal createProposal(final String replacementText,
- final String displayText,
- final String additionalText,
- final Image displayImage,
- final Object targetObject)
- {
- return createDefaultProposal(replacementText, _replacementOffset,
- _replacementLength,
- replacementText.length(), displayImage,
- displayText, null, additionalText,
- getRelevance(targetObject));
- }
-
- private int getRelevance(Object target)
- {
- // put tag vars at top, followed by beans, then implicits and other
- if (target instanceof IInstanceSymbol)
- {
- final IInstanceSymbol symbol = (IInstanceSymbol) target;
-
- switch (symbol.getRuntimeSource().getValue())
- {
- case ERuntimeSource.TAG_INSTANTIATED_SYMBOL:
- return HIGH_RELEVANCE;
- case ERuntimeSource.MANAGED_BEAN_SYMBOL:
- return NORMAL_RELEVANCE;
- case ERuntimeSource.BUILT_IN_SYMBOL:
- case ERuntimeSource.OTHER:
- return LOW_RELEVANCE;
- }
- }
-
- // if none of the above, return low relevance
- return LOW_RELEVANCE;
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/contentassist/el/SymbolInfo.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/contentassist/el/SymbolInfo.java
deleted file mode 100644
index dc7652b..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/contentassist/el/SymbolInfo.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.contentassist.el;
-
-import org.eclipse.jface.text.Region;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-
-/**
- * class contains a symbol and it's region
- *
- */
-public class SymbolInfo {
-
- private final ISymbol symbol;
- private final Region relativeRegion;
-
- /**
- * @param symbol
- * @param relativeRegion
- */
- public SymbolInfo(ISymbol symbol, Region relativeRegion) {
- super();
- this.symbol = symbol;
- this.relativeRegion = relativeRegion;
- }
-
- /**
- * @return the symbol
- */
- public ISymbol getSymbol() {
- return symbol;
- }
-
- /**
- * @return the relative region
- */
- public Region getRelativeRegion() {
- return relativeRegion;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/contentassist/el/SymbolResolveUtil.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/contentassist/el/SymbolResolveUtil.java
deleted file mode 100644
index 29b1518..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/contentassist/el/SymbolResolveUtil.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.contentassist.el;
-
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jst.jsf.common.internal.types.CompositeType;
-import org.eclipse.jst.jsf.common.internal.types.IAssignable;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IDOMContextResolver;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.ITaglibContextResolver;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.symbol.IInstanceSymbol;
-import org.eclipse.jst.jsf.context.symbol.IObjectSymbol;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.designtime.resolver.ISymbolContextResolver;
-import org.eclipse.jst.jsf.designtime.resolver.StructuredDocumentSymbolResolverFactory;
-import org.eclipse.jst.jsf.metadataprocessors.MetaDataEnabledProcessingFactory;
-import org.eclipse.jst.jsf.metadataprocessors.features.ELIsNotValidException;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * Utility class for resolving symbols for a IStructuredDocumentContext.
- */
-public class SymbolResolveUtil {
-
- private SymbolResolveUtil() {
- // utility class; not instantiable
- }
-
- /**
- * Get symbol for a variable (managed bean name, bundle name)
- *
- * @param context
- * @param name
- * @return ISymbol
- */
- public static ISymbol getSymbolForVariable(
- final IStructuredDocumentContext context, final String name) {
- final ISymbolContextResolver symbolResolver = StructuredDocumentSymbolResolverFactory
- .getInstance().getSymbolContextResolver(context);
-
- return symbolResolver.getVariable(name);
- }
-
- /**
- * Get symbol for a variable suffix (e. g. bean property/method, bundle
- * property). Takes into account whether method bindings are expected for
- * the given context.
- *
- * @param context -
- * the IStructuredDocumentContext
- * @param fullName -
- * full name of the suffix (e. g. bean.property1.property2)
- * @param isLastSuffix -
- * set true if there follows no other suffix. Method names will
- * only be considered if true
- * @return ISymbol. May be null.
- */
- public static ISymbol getSymbolForVariableSuffixExpr(
- final IStructuredDocumentContext context, final String fullName,
- final boolean isLastSuffix) {
- String[] ids = fullName.split("\\."); //$NON-NLS-1$
-
- // if no suffixes, only one id
- if (ids.length < 1) {
- ids = new String[] { fullName };
- }
-
- final ISymbolContextResolver symbolResolver = StructuredDocumentSymbolResolverFactory
- .getInstance().getSymbolContextResolver(context);
- if (symbolResolver != null) {
- ISymbol symbol = symbolResolver.getVariable(ids[0]);
- if (symbol instanceof IInstanceSymbol
- && ((IInstanceSymbol) symbol).isTypeResolved()) {
- for (int curSuffixIdx = 1; curSuffixIdx < ids.length; curSuffixIdx++) {
- if (isLastSuffix && curSuffixIdx == ids.length - 1
- && isMethodBindingExpected(context)) {
- /*
- * TODO Take into acount required method signature,
- * since there may be different methods with the same
- * name
- */
- return symbolResolver.getMethod((IObjectSymbol) symbol,
- ids[curSuffixIdx]);
- }
-
- final ISymbol property = symbolResolver.getProperty(symbol,
- ids[curSuffixIdx]);
-
- if (property == null) {
- return null;
- }
- symbol = property;
- }
- return symbol;
- }
- }
- return null;
- }
-
- /**
- * Tells whether method bindings are expected for the given context.
- *
- * @param context -
- * the IStructuredDocumentContext
- * @return true, if method bindings expected
- */
- public static boolean isMethodBindingExpected(
- final IStructuredDocumentContext context) {
- return isMethodBindingExpected(context, null);
- }
-
- /**
- * Tells whether method bindings are expected for the given context. Will
- * add signatures of expected method bindings to a given list.
- *
- * @param context -
- * the IStructuredDocumentContext
- * @param expectedBindings -
- * a list. If not null, signatures of expected method bindings
- * will be appended to this list.
- * @return true, if method bindings expected
- */
- public static boolean isMethodBindingExpected(
- final IStructuredDocumentContext context,
- final List expectedBindings) {
- final IDOMContextResolver domResolver = IStructuredDocumentContextResolverFactory.INSTANCE
- .getDOMContextResolver(context);
-
- final Node curNode = domResolver.getNode();
-
- if (curNode instanceof Attr) {
- final Attr attr = (Attr) curNode;
- final Element element = attr.getOwnerElement();
-
- final ITaglibContextResolver taglibResolver = IStructuredDocumentContextResolverFactory.INSTANCE
- .getTaglibContextResolver(context);
-
- final String uri = taglibResolver.getTagURIForNodeName(element);
-
- final List elVals = MetaDataEnabledProcessingFactory.getInstance()
- .getAttributeValueRuntimeTypeFeatureProcessors(
- IValidELValues.class, context, uri,
- element.getLocalName(), attr.getLocalName());
-
- boolean methodBindingExpected = false;
- for (final Iterator it = elVals.iterator(); it.hasNext();) {
- final IValidELValues validValues = (IValidELValues) it.next();
-
- try {
- final CompositeType type = validValues
- .getExpectedRuntimeType();
- if (type != null
- && type.getAssignmentTypeMask() == IAssignable.ASSIGNMENT_TYPE_NONE) {
- methodBindingExpected = true;
- if (expectedBindings != null) {
- expectedBindings.addAll(Arrays.asList(validValues
- .getExpectedRuntimeType().getSignatures()));
- } else {
- // if we don't need the method signatures, *one*
- // expected method binding is sufficient.
- return true;
- }
- }
- } catch (final ELIsNotValidException e) {
- // do nothing
- }
- }
- return methodBindingExpected;
- }
- // default condition is no method binding
- return false;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jem/BeanProxyUtil.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jem/BeanProxyUtil.java
deleted file mode 100644
index ec26cac..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jem/BeanProxyUtil.java
+++ /dev/null
@@ -1,352 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.jem;
-
-import org.eclipse.jem.internal.proxy.core.IBeanProxy;
-import org.eclipse.jem.internal.proxy.core.IBeanTypeProxy;
-import org.eclipse.jem.internal.proxy.core.IFieldProxy;
-import org.eclipse.jem.internal.proxy.core.IIntegerBeanProxy;
-import org.eclipse.jem.internal.proxy.core.IMethodProxy;
-import org.eclipse.jem.internal.proxy.core.IStringBeanProxy;
-import org.eclipse.jem.internal.proxy.core.ThrowableProxy;
-
-/**
- * Convenience methods for using bean proxies
- *
- * @author cbateman
- *
- */
-public final class BeanProxyUtil
-{
-
- /**
- * A convenience wrapper for manipulating JEM proxy types
- *
- */
- public static class BeanProxyWrapper
- {
- private final static IBeanProxy[] NO_ARGS = new IBeanProxy[0];
- private final static IBeanTypeProxy[] NO_ARG_TYPES = new IBeanTypeProxy[0];
-
- private final IBeanTypeProxy _typeProxy;
- private IBeanProxy _instance;
-
- /**
- * @param typeProxy
- */
- public BeanProxyWrapper(final IBeanTypeProxy typeProxy)
- {
- super();
- _typeProxy = typeProxy;
- }
-
- /**
- * Initialize a proxied instance of the type referred to by typeProxy.
- *
- * @throws ProxyException
- */
- public void init() throws ProxyException
- {
- if (_instance == null)
- {
- try
- {
- _instance = _typeProxy.newInstance();
- }
- catch (final ThrowableProxy e)
- {
- throw new ProxyException(e);
- }
- catch (final NoClassDefFoundError ndfe)
- {
- throw new ProxyException(ndfe);
- }
- catch (final ExceptionInInitializerError e)
- {
- throw new ProxyException(e);
- }
- }
- }
-
- /**
- * Re-initialize the proxied instance of typeProxy.
- *
- * @throws ProxyException
- */
- public void reinit() throws ProxyException
- {
- _instance = null;
- init();
- }
-
-
-
- /**
- * @return the instance proxy
- */
- public IBeanProxy getInstance()
- {
- return _instance;
- }
-
- /**
- * <p>
- * Call the method called methodName on the proxied instance. If
- * args.length is 0 then the zero-argument method is found and called.
- * </p>
- *
- * @param methodName
- * @param args
- * @param argTypes
- * @return the result of calling the method or null if there is no such
- * method.
- * @throws ProxyException
- */
- public IBeanProxy call(final String methodName,
- final IBeanProxy[] args, final IBeanTypeProxy[] argTypes)
- throws ProxyException
- {
- try
- {
- final IMethodProxy method = (argTypes.length == 0) ? _typeProxy
- .getMethodProxy(methodName) : _typeProxy
- .getMethodProxy(methodName, argTypes);
-
- if (method != null)
- {
- return method.invoke(_instance, args);
- }
- }
- catch (final ThrowableProxy tp)
- {
- throw new ProxyException(tp);
- }
- catch (final NoClassDefFoundError ndfe)
- {
- throw new ProxyException(ndfe);
- }
-
- return null;
- }
-
- /**
- * Convenience method for call(methodName, new {@link IBeanProxy}[0],
- * new {@link IBeanTypeProxy}[0])
- *
- * @param methodName
- * @return the proxied return value
- * @throws ProxyException
- */
- public IBeanProxy call(final String methodName) throws ProxyException
- {
- return call(methodName, NO_ARGS, NO_ARG_TYPES);
- }
-
- /**
- * <p>
- * Calls the zero-argument method called 'methodName' on the proxied
- * instance and if it results in a String return value, returns it. If
- * the method does not return a String value, then null is returned.
- * </p>
- *
- * @param methodName
- * @return the string value or null.
- * @throws ProxyException
- */
- public String callStringMethod(final String methodName)
- throws ProxyException
- {
- final IBeanProxy result = call(methodName);
-
- if (result instanceof IStringBeanProxy)
- {
- return ((IStringBeanProxy) result).stringValue();
- }
-
- return null;
- }
-
- /**
- * <p>
- * Calls the zero-argument method called 'methodName' on the proxied
- * instance and if it results in an Integer value, returns it. If the
- * method does not return an integer value, then null is returned.
- * </p>
- *
- * @param methodName
- * @return the integer value or null.
- * @throws ProxyException
- */
- public Integer callIntMethod(final String methodName)
- throws ProxyException
- {
- final IBeanProxy result = call(methodName, NO_ARGS, NO_ARG_TYPES);
-
- if (result instanceof IIntegerBeanProxy)
- {
- return Integer.valueOf(((IIntegerBeanProxy) result).intValue());
- }
-
- return null;
- }
-
- /**
- * Use the typeProxy for the proxied instance to try to acquire the
- * field called fieldName of type String. Note that this won't find
- * private fields on supertypes.
- *
- * Equivalent to getStringFieldValue(fieldName, _typeProxy);
- *
- * @param fieldName
- * @return the String value of fieldName on the proxied instance or
- * null.
- * @throws ProxyException
- */
- public String getStringFieldValue(final String fieldName)
- throws ProxyException
- {
- return getStringFieldValue(fieldName, _typeProxy);
- }
-
- /**
- * Use the provided typeProxy to acquire the field proxy for the field
- * proxy called fieldName. Normally, you would use the type proxy of the
- * instance bean, however there are cases such as acquiring the value a
- * private field on a supertype where you need the type proxy for the
- * super type.
- *
- * @param fieldName
- * @param typeProxy
- * @return the string value or null.
- * @throws ProxyException
- */
- public String getStringFieldValue(final String fieldName,
- final IBeanTypeProxy typeProxy) throws ProxyException
- {
- final IBeanProxy value = getFieldValue(fieldName, typeProxy);
-
- if (value instanceof IStringBeanProxy)
- {
- return ((IStringBeanProxy) value).stringValue();
- }
-
- return null;
- }
-
- /**
- * @param fieldName
- * @param typeProxy
- * @return the declared field value on the proxied instance called
- * fieldName or null.
- * @throws ProxyException
- */
- public IBeanProxy getFieldValue(final String fieldName,
- final IBeanTypeProxy typeProxy) throws ProxyException
- {
- try
- {
- final IFieldProxy fieldProxy = typeProxy
- .getDeclaredFieldProxy(fieldName);
-
- if (fieldProxy != null)
- {
- fieldProxy.setAccessible(true);
- return fieldProxy.get(_instance);
- }
- }
- catch (final ThrowableProxy e)
- {
- throw new ProxyException(e);
- }
- catch (final NoClassDefFoundError ndfe)
- {
- throw new ProxyException(ndfe);
- }
-
- return null;
- }
-
- /**
- * Same as {@link #getFieldValue(String, IBeanTypeProxy)} except it will
- * climb the parent hierarchy looking for the first field called
- * fieldName.
- *
- * @param fieldName
- * @param typeProxy
- * @return the proxied value or null
- * @throws ProxyException
- */
- public IBeanProxy getFieldValueIncludeParents(final String fieldName,
- final IBeanTypeProxy typeProxy) throws ProxyException
- {
- IBeanTypeProxy curType = typeProxy;
-
- while (curType != null)
- {
- final IBeanProxy field = getFieldValue(fieldName, curType);
- if (field != null)
- {
- return field;
- }
-
- try
- {
- curType = curType.getSuperBeanTypeProxy();
- }
- catch (final NullPointerException npe)
- {
- // suppress npe caused by getSuperBeanTypeProxy
- // not doing a null check on getSuperType()
- curType = null;
- }
- }
-
- // have got to the top of hierarchy and not found the field
- return null;
- }
-
- /**
- * @return the proxied instance
- */
- public final IBeanProxy getBeanProxy()
- {
- return _instance;
- }
- }
-
- /**
- * Checked exception the wraps problems thrown by JEM proxying into a single
- * exception
- *
- */
- public static class ProxyException extends Exception
- {
- private static final long serialVersionUID = -1526057761795574331L;
-
- /**
- * @param message
- * @param cause
- */
- public ProxyException(final String message, final Throwable cause)
- {
- super(message, cause);
- }
-
- /**
- * @param cause
- */
- public ProxyException(final Throwable cause)
- {
- super(cause);
- }
-
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryconfig/JSFLibraryConfigDialogSettingData.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryconfig/JSFLibraryConfigDialogSettingData.java
deleted file mode 100644
index 90a04c8..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryconfig/JSFLibraryConfigDialogSettingData.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Justin Chen
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.jsflibraryconfig;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jst.jsf.core.internal.project.facet.IJSFFacetInstallDataModelProperties;
-import org.eclipse.jst.jsf.core.internal.project.facet.IJSFFacetInstallDataModelProperties.IMPLEMENTATION_TYPE;
-
-/**
- * To construct implementation library and component libraries from sticky values
- * in DialogSettings as saved libraries.
- *
- * @author Justin Chen - Oracle
- */
-public class JSFLibraryConfigDialogSettingData implements JSFLibraryConfiglModelSource {
- /**
- * Delimintor for parsing a persistent property string.
- */
- final protected static String SEPARATOR =":"; //$NON-NLS-1$
-
- final private JSFLibraryRegistryUtil jsfLibReg;
- final private boolean dftImplLibDeployFlag;
- private String[] savedCompLibs;
- private JSFLibraryInternalReference selJSFLibImpl; // lazy initialized
- private List selJSFLibComp; // lazy initialized
-
- private IMPLEMENTATION_TYPE implType;
-
-
- /**
- * Constructor where implementation type was chosen to be USER_SPECIFIED. Created for backwards compatibilty when server supplied was not an option.
- * @param implLibDeployFlag
- * @param compLibs
- */
- public JSFLibraryConfigDialogSettingData(boolean implLibDeployFlag, String[] compLibs) {
- this(IMPLEMENTATION_TYPE.USER_SPECIFIED, implLibDeployFlag, compLibs);
- }
-
- /**
- * Constructor
- * @param implType {@link IMPLEMENTATION_TYPE}
- * @param implLibDeployFlag String valid options are "true" or "false"
- * @param compLibs String[] saved component library settings in string array
- *
- public JSFLibraryConfigDialogSettingData(String implLibDeployFlag, String[] compLibs) {
- this.jsfLibReg = JSFLibraryRegistryUtil.getInstance();
- this.dftImplLibDeployFlag = implLibDeployFlag;
- this.savedCompLibs = compLibs;
-
- // Verify and log a message if a saved component library no longer exists.
- verifySavedLibAvailability();
- }
- */
- public JSFLibraryConfigDialogSettingData(IMPLEMENTATION_TYPE implType, boolean implLibDeployFlag, String[] compLibs) {
-
- this.jsfLibReg = JSFLibraryRegistryUtil.getInstance();
- this.dftImplLibDeployFlag = implLibDeployFlag;
- this.savedCompLibs = compLibs;
- this.implType = implType;
-
- // Verify and log a message if a saved component library no longer exists.
- verifySavedLibAvailability();
- }
-
- /**
- * There is no saved JSFImplLibrary per se if initializing from DialogSettings
- * since default implementation library is always selected and only the
- * deployment flag is saved.
- *
- * A null is returned when there is no default
- * implementation library in registry.
- *
- * @return selJSFLibImpl JSFLibraryInternalReference return default implementation library with updated deployment flag
- */
- public JSFLibraryInternalReference getJSFImplementationLibrary() {
- if (selJSFLibImpl == null) {
- // To instanciate a JSFLibraryReferenceUserSpecified object from default impl lib as the saved library.
- JSFLibraryInternalReference dftImplLib = jsfLibReg.getDefaultJSFImplementationLibrary();
- if (dftImplLib != null) {
- selJSFLibImpl = new JSFLibraryInternalReference(dftImplLib.getLibrary(),
- true, // selected
- dftImplLibDeployFlag);
- }
- }
- return selJSFLibImpl;
- }
-
- /**
- * Return the list of saved component libraries and their deployment settings.
- *
- * @return selJSFLibComp List
- */
- public List getJSFComponentLibraries() {
- if (selJSFLibComp == null) {
- selJSFLibComp = new ArrayList();
-
- if (savedCompLibs != null && savedCompLibs.length > 0) {
- JSFLibraryInternalReference lib = null;
- String item;
- String[] attributes;
- String id;
- boolean deploy = false;
-
- for (int i = 0; i < savedCompLibs.length; i++) {
- item = savedCompLibs[i];
- attributes = item.split(SEPARATOR);
-
- id = attributes[0];
- deploy = Boolean.valueOf(attributes[1]).booleanValue();
-
- lib = jsfLibReg.getJSFLibraryReferencebyID(id);
- if (lib != null) {
- selJSFLibComp.add(new JSFLibraryInternalReference(lib.getLibrary(), true, deploy));
- } /*else {
- // already logged if a saved component library is no longer available.
- }*/
- }
- }
- }
- return selJSFLibComp;
- }
-
- /**
- * Only need to verify component library availability from sticky settings.
- */
- private void verifySavedLibAvailability() {
- List validLibs = new ArrayList();
- if (savedCompLibs != null && savedCompLibs.length > 0) {
- String item = null;
- String[] attributes;
- boolean invalidRefs = false;
- for (int i = 0; i < savedCompLibs.length; i++) {
- item = savedCompLibs[i];
- attributes = item.split(SEPARATOR);
-
- if (jsfLibReg.getJSFLibraryReferencebyID(attributes[0]) != null) {
- validLibs.add(item);
- } else {
- invalidRefs = true;
-// JSFCorePlugin.log(IStatus.INFO, Messages.JSFLibCfgDialogSettingData_Sticky_Component_Lib_Not_Exist);
- }
- }
- if (invalidRefs){
- String [] validCompLibs = (String[])validLibs.toArray(new String[validLibs.size()]);
- if (validCompLibs.length > 0)
- System.arraycopy(validCompLibs, 0, savedCompLibs, 0, validCompLibs.length);
- else
- savedCompLibs = new String[]{};
- }
- }
-
-
- }
-
- /**
- * @return {@link IMPLEMENTATION_TYPE}
- */
- public IJSFFacetInstallDataModelProperties.IMPLEMENTATION_TYPE getImplementationType(){
- return implType;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryconfig/JSFLibraryConfigModel.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryconfig/JSFLibraryConfigModel.java
deleted file mode 100644
index 6321353..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryconfig/JSFLibraryConfigModel.java
+++ /dev/null
@@ -1,266 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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: Oracle
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.jsflibraryconfig;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.jsf.core.internal.Messages;
-import org.eclipse.jst.jsf.core.internal.project.facet.IJSFFacetInstallDataModelProperties.IMPLEMENTATION_TYPE;
-
-/**
- * Model for the custom control <b>JSFLibraryConfigControl</b>.
- * A JSFLibraryConfigModel object is initialized from a source and updated with
- * selected implementation and component libraries when selections are changed.
- *
- * @author Justin Chen - Oracle
- */
-public class JSFLibraryConfigModel {
- final private JSFLibraryConfiglModelSource data;
- final private JSFLibraryRegistryUtil jsfLibReg;
- private List colJSFImplLib;
- private List colJSFCompLib;
-
- /**
- * Private constructor.
- * @param data
- */
- private JSFLibraryConfigModel(JSFLibraryConfiglModelSource data) {
- this.data = data;
- this.jsfLibReg = JSFLibraryRegistryUtil.getInstance();
- }
-
- /**
- * @return IMPLEMENTATION_TYPE
- */
- public IMPLEMENTATION_TYPE getImplementationType() {
- return data.getImplementationType();
- }
- /**
- * Return JSF implementation libraries.
- *
- * This list is initialized from JSF library registry and updated with persistent configuration data.
- *
- * @return List
- * see also org.eclipse.jst.jsf.ui.properties.IJSFLibraryDecoratorProvider#getProjectJSFImplementationLibraries()
- */
- public List getJSFImplementationLibraries() {
- if (colJSFImplLib == null) {
- /* To initialze an implementation library list from registry
- * and then update the list with saved implementation library.
- */
- colJSFImplLib = jsfLibReg.getJSFImplementationLibraries();
-// colJSFImplLib.add(JSFLibraryRegistryUtil.getInstance().getServerSuppliedJSFLibrary());
- JSFLibraryInternalReference targetLib = data.getJSFImplementationLibrary();
- if (targetLib == null) {
- // no saved implementation, get default implementation library
- targetLib = jsfLibReg.getDefaultJSFImplementationLibrary();
- }
- if (targetLib != null) {
- JSFLibraryInternalReference srcLib = jsfLibReg.getJSFLibraryReferencebyID(targetLib.getID());
- if (srcLib != null) {
- srcLib.setSelected(true);
- srcLib.setToBeDeployed(targetLib.isCheckedToBeDeployed());
- }
- }
- }
- return colJSFImplLib;
- }
-
- /**
- * Return JSF component libraries.
- *
- * This list is initialized from JSF library registry and updated with persistent
- * configuration data.
- *
- * @return List
- * see also org.eclipse.jst.jsf.ui.properties.IJSFLibraryDecoratorProvider#getProjectJSFComponentLibraries()
- */
- public List getJSFComponentLibraries() {
- if (colJSFCompLib == null) {
- /* To initialize a component library list from registry and then
- * update list with saved component libraries.
- */
- colJSFCompLib = jsfLibReg.getJSFComponentLibraries();
- Iterator it = data.getJSFComponentLibraries().iterator();
- JSFLibraryInternalReference targetItem = null;
- JSFLibraryInternalReference srcItem = null;
- while (it.hasNext()) {
- targetItem = (JSFLibraryInternalReference) it.next();
- srcItem = jsfLibReg.getJSFLibraryReferencebyID(targetItem.getID());
- if (srcItem != null) {
- srcItem.setSelected(true);
- srcItem.setToBeDeployed(targetItem.isCheckedToBeDeployed());
- }
- }
- }
- return colJSFCompLib;
- }
-
- /**
- * Return the selected JSF implementation library currently.
- * A null is returned if none is selected.
- *
- * @return JSFLibraryInternalReference
- */
- public JSFLibraryInternalReference getCurrentJSFImplementationLibrarySelection() {
- Iterator it = getJSFImplementationLibraries().iterator();
- JSFLibraryInternalReference crtItem = null;
- while (it.hasNext()) {
- crtItem = (JSFLibraryInternalReference) it.next();
- if (crtItem.isSelected()) {
- return crtItem;
- }
- }
- return null;
- }
-
- /**
- * Return the selected JSF component libraries currently.
- * An empty list is returned when no component libraries are selected.
- *
- * @return list List
- */
- public List getCurrentJSFComponentLibrarySelection() {
- List list = new ArrayList();
-
- Iterator it = getJSFComponentLibraries().iterator();
- JSFLibraryInternalReference crtItem = null;
- while (it.hasNext()) {
- crtItem = (JSFLibraryInternalReference) it.next();
- if (crtItem.isSelected()) {
- list.add(crtItem);
- }
- }
- return list;
- }
-
- /**
- * Returned a saved implementation library which was persisted as
- * DialogSettings or as project properties.
- *
- * @return JSFLibraryInternalReference
- */
- public JSFLibraryInternalReference getSavedJSFImplementationLibrary() {
- return data.getJSFImplementationLibrary();
- }
-
- /**
- * Returned saved component libraries which were persisted as
- * DialogSettings or project persistent properties.
- *
- * @return List
- */
- public List getSavedJSFComponentLibraries() {
- return data.getJSFComponentLibraries();
- }
-
- /**
- * Update the selected JSF implementation library.
- *
- * Note: The library parameter won't be not added into the collection
- * if it does not exist already.
- *
- * @param library JSFLibraryInternalReference
- */
- public void setCurrentJSFImplementationLibrarySelection(final JSFLibraryInternalReference library) {
- if (library != null) {
- Iterator it = getJSFImplementationLibraries().iterator();
- JSFLibraryInternalReference crtjsflib = null;
- while (it.hasNext()) {
- crtjsflib = (JSFLibraryInternalReference) it.next();
- if (crtjsflib.getID().equals(library.getID())) {
- crtjsflib.setSelected(true);
- crtjsflib.setToBeDeployed(library.isCheckedToBeDeployed());
- } else {
- crtjsflib.setSelected(false);
- }
- }
- }
- }
-
- /**
- * Update the JSF library component libraries selection.
- *
- * @param libraries List
- */
- public void setCurrentJSFComponentLibrarySelection(final List libraries) {
- if (libraries != null) {
- /* Reset all item in component library list to unselect first.
- * Then, update each item in cmponent libraries to the provided list.
- */
- setJSFLibrariesSelection(getJSFComponentLibraries(), false);
-
- Iterator it = libraries.iterator();
- JSFLibraryInternalReference crtItem;
- JSFLibraryInternalReference srcItem = null;
- while (it.hasNext()) {
- crtItem = (JSFLibraryInternalReference) it.next();
- srcItem = jsfLibReg.getJSFLibraryReferencebyID(crtItem.getID());
-
- if (srcItem != null) {
- srcItem.setSelected(true);
- srcItem.setToBeDeployed(crtItem.isCheckedToBeDeployed());
- }
- }
- }
- }
-
- /**
- * To save current configuration of implementation and component libraries
- * as project properties.
- *
- * @param project IProject
- */
- public void saveData(final IProject project) {
- // Instantiate one to make sure it is for a project.
- JSFLibraryConfigProjectData data_ = new JSFLibraryConfigProjectData(project);
- List implLibs = new ArrayList();
- implLibs.add(getCurrentJSFImplementationLibrarySelection());
- data_.saveData(implLibs, getCurrentJSFComponentLibrarySelection(), getImplementationType());
- }
-
- /**
- * Set selection state to given state to each libray in the collection.
- *
- * @param libs List
- * @param state boolean
- */
- private void setJSFLibrariesSelection(final List libs, final boolean state) {
- Iterator it = libs.iterator();
- JSFLibraryInternalReference crtjsflib;
- while (it.hasNext()) {
- crtjsflib = (JSFLibraryInternalReference) it.next();
- crtjsflib.setSelected(state);
- }
- }
-
- /**
- * Factory class to create new JSFLibraryConfigModel instances
- */
- public static final class JSFLibraryConfigModelFactory {
- /**
- * To create a new instance of JSFLibraryConfigModel object.
- * A NullPointerException is raised if source is null.
- *
- * @param source JSFLibraryConfiglModelSource
- * @return JSFLibraryConfigModel
- */
- public static JSFLibraryConfigModel createInstance(final JSFLibraryConfiglModelSource source) {
- if (source == null) {
- throw new NullPointerException(Messages.JSFLibraryConfigModel_Null_Data_Source);
- }
- return new JSFLibraryConfigModel(source);
- }
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryconfig/JSFLibraryConfigProjectData.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryconfig/JSFLibraryConfigProjectData.java
deleted file mode 100644
index 70d36dc..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryconfig/JSFLibraryConfigProjectData.java
+++ /dev/null
@@ -1,305 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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: Oracle
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.jsflibraryconfig;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-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.QualifiedName;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.core.internal.Messages;
-import org.eclipse.jst.jsf.core.internal.project.facet.JSFUtils;
-import org.eclipse.jst.jsf.core.internal.project.facet.IJSFFacetInstallDataModelProperties.IMPLEMENTATION_TYPE;
-import org.eclipse.osgi.util.NLS;
-
-/**
- * To construct implementation library and component libraries
- * from persistent project properties as saved libraries.
- *
- * @author Justin Chen - Oracle
- */
-public class JSFLibraryConfigProjectData implements JSFLibraryConfiglModelSource {
- final static String QUALIFIEDNAME = "org.eclipse.jst.jsf.core.internal.jsflibraryconfig.JSFLibraryConfigProjectData";
- /**
- * Parsing delimnitor for elements in a tuple.
- */
- final protected static String SPTR_TUPLE = ":"; //$NON-NLS-1$
- /**
- * Parsing delimintor for tuples in a persistent property string.
- */
- final protected static String EO_TUPLE = ";"; //$NON-NLS-1$
-
- final private IProject project;
- final private JSFLibraryRegistryUtil jsfLibReg;
- private JSFLibraryInternalReference selJSFLibImpl;
- private List selJSFLibComp;
-
- /**
- * Constructor
- * @param project
- */
- public JSFLibraryConfigProjectData(IProject project) {
- this.project = project;
- this.jsfLibReg = JSFLibraryRegistryUtil.getInstance();
-
- /* logging message when object is instantiated instead of at method call to
- * reduce log entries.
- */
- if (!isProjectFirstCreated()) {
- verifySavedLibAvailability();
- }
- }
-
- public IMPLEMENTATION_TYPE getImplementationType() {
- try {
- String type = ((IResource)project).getPersistentProperty(new QualifiedName(QUALIFIEDNAME,
- JSFUtils.PP_JSF_IMPLEMENTATION_TYPE));
- return IMPLEMENTATION_TYPE.getValue(type);
- } catch (CoreException e) {//
- }
- return IMPLEMENTATION_TYPE.UNKNOWN;
- }
-
- /**
- * Return the previously selected JSF implementation library from project persistent properties.
- * Return null if none exists.
- *
- * @return selJSFLibImpl JSFLibraryDecorator
- */
- public JSFLibraryInternalReference getJSFImplementationLibrary() {
- try {
- if (!isProjectFirstCreated() &&
- selJSFLibImpl == null ) {
- String strImplLibs = ((IResource)project).getPersistentProperty(new QualifiedName(QUALIFIEDNAME,
- JSFUtils.PP_JSF_IMPLEMENTATION_LIBRARIES));
- selJSFLibImpl = getJSFImplLibfromPersistentProperties(getTuples(strImplLibs));
- }
- } catch (CoreException e) {
- JSFCorePlugin.log(e, "Exception occured while returning reference to the JSF implementation library");
- }
- return selJSFLibImpl;
- }
-
- /**
- * Return the selected JSF component libraries from project persistent properties.
- * An empty List is returned if no JSF component libraries were saved or
- * if the project is newly created.
- *
- * @return selJSFLibComp List
- */
- public List getJSFComponentLibraries() {
- try {
- if (!isProjectFirstCreated()) {
- if ( selJSFLibComp == null ) {
- selJSFLibComp = new ArrayList();
-
- String strCompLibs = ((IResource)project).getPersistentProperty(new QualifiedName(QUALIFIEDNAME, JSFUtils.PP_JSF_COMPONENT_LIBRARIES));
- List savedList = getTuples(strCompLibs);
-
- Iterator it = savedList.iterator();
- Tuple crtTuple = null;
- JSFLibraryInternalReference srcItem = null;
- while (it.hasNext()) {
- crtTuple = (Tuple) it.next();
-
- srcItem = jsfLibReg.getJSFLibraryReferencebyID(crtTuple.getID());
- if (srcItem != null) {
- selJSFLibComp.add( new JSFLibraryInternalReference(srcItem.getLibrary(),
- true,
- crtTuple.needDeploy()) );
- } /*else {
- // already logged a message for a missing library
- }*/
- }
- }
- } else {
- selJSFLibComp = new ArrayList(0);
- }
- } catch (CoreException e) {
- JSFCorePlugin.log(e, "Exception occured while returning references to the JSF component libraries.");
- }
- return selJSFLibComp;
- }
-
- /**
- * To save configuration data as a project persistent properties.
- *
- * @param implementation
- * @param component
- */
- void saveData(final List implementation, final List component, final IMPLEMENTATION_TYPE implType) {
- try {
- ((IResource)project).setPersistentProperty(new QualifiedName(QUALIFIEDNAME, JSFUtils.PP_JSF_IMPLEMENTATION_LIBRARIES), generatePersistString(implementation));
- ((IResource)project).setPersistentProperty(new QualifiedName(QUALIFIEDNAME, JSFUtils.PP_JSF_COMPONENT_LIBRARIES), generatePersistString(component));
- ((IResource)project).setPersistentProperty(new QualifiedName(QUALIFIEDNAME, JSFUtils.PP_JSF_IMPLEMENTATION_TYPE), IMPLEMENTATION_TYPE.getStringValue(implType));
-
- /* Flush the selection so that they can be reconstructed from
- * persistent properties when getSavedJSFImplLib and getSavedJSFCompLibs
- * called next time.
- */
- selJSFLibImpl = null;
- selJSFLibComp = null;
-
- } catch (CoreException e) {
- JSFCorePlugin.log(e, "Exception occured while persisting the JSF Library preferences");
- }
- }
-
- /**
- * Check if a project is just created by inspecting persistent properties
- * if there is any. ?
- */
- private boolean isProjectFirstCreated() {
- boolean isNew = false;
- try {
- ((IResource)project).getPersistentProperty(new QualifiedName(QUALIFIEDNAME,
- JSFUtils.PP_JSF_IMPLEMENTATION_LIBRARIES));
- } catch (CoreException e) {
- isNew = true;
- }
- return isNew;
- }
-
- private void verifySavedLibAvailability() {
- try {
- String strImplLibs = ((IResource)project).getPersistentProperty(new QualifiedName(QUALIFIEDNAME, JSFUtils.PP_JSF_IMPLEMENTATION_LIBRARIES));
- String strCompLibs = ((IResource)project).getPersistentProperty(new QualifiedName(QUALIFIEDNAME, JSFUtils.PP_JSF_COMPONENT_LIBRARIES));
-
- logMissingLib(getTuples(strImplLibs), true);
- logMissingLib(getTuples(strCompLibs), false);
-
- } catch (CoreException e) {
- JSFCorePlugin.log(e, "Exception occured while verifying saved JSF Library preferences");
- }
- }
-
- private void logMissingLib(final List jsfLibTuples, final boolean isVerifyImpl) {
- if (jsfLibReg != null) {
- Iterator itTuple = jsfLibTuples.iterator();
- while(itTuple.hasNext()) {
- Tuple tuple = (Tuple)itTuple.next();
- JSFLibraryInternalReference jsfLib = jsfLibReg.getJSFLibraryReferencebyID(tuple.getID());
- /* Information logged when saved JSF lib is removed from registry.
- * One log entry is created for each missing library.
- */
- if (jsfLib == null) {
- String prjName = project.getName();
- String msg = (isVerifyImpl) ?
- Messages.JSFLibraryConfigPersistData_SAVED_IMPLLIB_NOT_FOUND :
- Messages.JSFLibraryConfigPersistData_SAVED_COMPLIB_NOT_FOUND;
- JSFCorePlugin.log(IStatus.INFO, NLS.bind(msg, prjName));
- }
- }
- }
- }
-
- private JSFLibraryInternalReference getJSFImplLibfromPersistentProperties(final List jsfLibTuples) {
- if (jsfLibReg != null) {
- Tuple tuple = null;
- JSFLibraryInternalReference lib = null;
- Iterator itTuple = jsfLibTuples.iterator();
- while(itTuple.hasNext()) {
- tuple = (Tuple) itTuple.next();
- lib = jsfLibReg.getJSFLibraryReferencebyID(tuple.id);
- if (lib != null) {
- return new JSFLibraryInternalReference(lib.getLibrary(),
- tuple.selected,
- tuple.deploy);
- } /*else {
- // already logged a message for a missing library
- }*/
- }
- }
- return null;
- }
-
- private String generatePersistString(List list) {
- JSFLibraryInternalReference jsfLibItem;
- StringBuffer sb = new StringBuffer();
- for (int i = 0; i < list.size(); i++) {
- jsfLibItem = (JSFLibraryInternalReference)list.get(i);
- sb = sb.append(jsfLibItem.generatePersistString());
- sb.append(JSFLibraryConfigProjectData.EO_TUPLE);
- }
- return sb.toString();
- }
-
- private List getTuples(String strJSFLibs) {
- List list = new ArrayList();
-
- if (strJSFLibs != null) {
- String patternStr = JSFLibraryConfigProjectData.EO_TUPLE;
- String[] fields = strJSFLibs.split(patternStr);
- if (strJSFLibs.length() > 0) {
- Tuple tuple;
- for (int i = 0; i < fields.length; i++) {
- tuple = new Tuple(fields[i]);
- list.add(tuple);
- }
- }
- }
- return list;
- }
-
- /**
- * Inner class for parsing project persistent properties.
- *
- * To Do: Take out selected attribute since it is not needed.
- * Add the library name as an attribute.
- * Provide code path to migrate earlier project.
- *
- * NOTE: this class should no longer be used except to support
- * legacy (pre-2.0M6 library registries)
- */
- static class Tuple {
- final private String id;
- final private boolean selected;
- final private boolean deploy;
-
- Tuple(String id, boolean selected, boolean deploy) {
- this.id = id;
- this.selected = selected;
- this.deploy = deploy;
- }
- // parse tuple = ID:selected:deploy
- Tuple(String tuple) {
- String[] fields = tuple.split(JSFLibraryConfigProjectData.SPTR_TUPLE);
-
- if (fields.length >= 3)
- {
- this.id = fields[0];
- this.selected = Boolean.valueOf(fields[1]).booleanValue();
- this.deploy = Boolean.valueOf(fields[2]).booleanValue();
- }
- else
- {
- throw new IllegalStateException("Library registry is corrupt");
- }
- }
-
- String getID() {
- return id;
- }
-
- boolean isSelected() {
- return selected;
- }
-
- boolean needDeploy() {
- return deploy;
- }
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryconfig/JSFLibraryConfiglModelSource.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryconfig/JSFLibraryConfiglModelSource.java
deleted file mode 100644
index 5575835..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryconfig/JSFLibraryConfiglModelSource.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Justin Chen
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.jsflibraryconfig;
-
-import java.util.List;
-
-import org.eclipse.jst.jsf.core.internal.project.facet.IJSFFacetInstallDataModelProperties.IMPLEMENTATION_TYPE;
-
-/**
- * Interface for data source to instanciate a <b>JSFLibraryConfigModel</b> object.
- *
- * @author Justin Chen - Oracle
- */
-public interface JSFLibraryConfiglModelSource {
- /**
- * Return a saved JSF implementation library.
- * Depends on the model source, it could be sticky values from DialogSettings or
- * project property values.
- *
- * A null could be returned when creating first web project in a new workspace.
- *
- * @return JSFLibraryInternalReference
- */
- public JSFLibraryInternalReference getJSFImplementationLibrary();
-
- /**
- * Return a list of saved JSF component libraries.
- * Otheriwse, return an empty list.
- *
- * @return List
- */
- public List getJSFComponentLibraries();
-
- /**
- * Return type of implementation
- *
- * @return {@link IMPLEMENTATION_TYPE}
- */
- public IMPLEMENTATION_TYPE getImplementationType();
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryconfig/JSFLibraryInternalReference.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryconfig/JSFLibraryInternalReference.java
deleted file mode 100644
index aca5bf5..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryconfig/JSFLibraryInternalReference.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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: Oracle
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.jsflibraryconfig;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary;
-
-/**
- * Attach additonal attributes such as selection and deployment
- * to a JSF library when it is referenced by a project.
- *
- * @author Justin Chen - Oracle
- */
-public class JSFLibraryInternalReference {
- final private JSFLibrary jsfLib;
- private boolean check4Deploy; // Initialized from default in workspace
- private boolean selected; // selected for project
-
- /**
- * Constructor
- * @param jsfLib JSFLibrary instance embedded inside.
- * @param selected boolean true if selected, otherwise, not selected.
- * @param deploy boolean true if needs to be deployed, otherwise, won't be deployed.
- */
- public JSFLibraryInternalReference(JSFLibrary jsfLib, boolean selected, boolean deploy) {
- this.jsfLib = jsfLib;
- this.selected = selected;
- this.check4Deploy = deploy;
- }
-
- /**
- * Return the embedded JSFLibrary instance.
- *
- * @return jsfLib JSFLibrary
- */
- public JSFLibrary getLibrary() {
- return jsfLib;
- }
-
- /**
- * Set the to be deployed flag.
- *
- * @param deploy boolean
- */
- public void setToBeDeployed(final boolean deploy) {
- check4Deploy = deploy;
- }
-
- /**
- * Return true if the JSF library needs to be deployed.
- * Otheriwse, return false.
- *
- * @return boolean
- */
- public boolean isCheckedToBeDeployed() {
- return check4Deploy;
- }
-
- /**
- * Set the selected attribute to a JSFLibraryLibraryReference object.
- *
- * @param selected boolean
- */
- public void setSelected(final boolean selected) {
- this.selected = selected;
- }
-
- /**
- * Return true if the JSF library is referenced by a project.
- * Otherwise, return false.
- *
- * @return selected boolean
- */
- public boolean isSelected() {
- return selected;
- }
-
- /**
- * To generate a string that represents the JSFLibraryLibraryReference
- * object for persistence.
- *
- * @return String
- */
- protected String generatePersistString() {
- return (getID() + JSFLibraryConfigProjectData.SPTR_TUPLE +
- String.valueOf(isSelected()) + JSFLibraryConfigProjectData.SPTR_TUPLE +
- String.valueOf(isCheckedToBeDeployed()));
- }
-
- /**
- * Helper method to return the library ID from the embedded
- * JSFLibrary instance.
- *
- * @return id String
- */
- public String getID() {
- return jsfLib.getID();
- }
-
- /**
- * Helper method to return the library name from the embedded
- * JSFLibrary instance.
- *
- * @return name String
- */
- public String getName() {
- return jsfLib.getName();
- }
-
- /**
- * Helper method to return the label for the library from the embedded
- * JSFLibrary instance.
- *
- * @return name String
- */
- public String getLabel() {
- return jsfLib.getLabel();
- }
-
- /**
- * Return true if the embedded JSF library instance i implementation.
- * Otherwise, return false.
- *
- * @return boolean
- */
- public boolean isImplementation() {
- return jsfLib.isImplementation();
- }
-
- /**
- * Help method to return a list of Archive files from
- * the embedded JSFLibrary instance.
- *
- * @return boolean
- */
- public EList getArchiveFiles() {
- return jsfLib.getArchiveFiles();
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryconfig/JSFLibraryRegistryUtil.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryconfig/JSFLibraryRegistryUtil.java
deleted file mode 100644
index 131e6d3..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryconfig/JSFLibraryRegistryUtil.java
+++ /dev/null
@@ -1,604 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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: Oracle
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.jsflibraryconfig;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.InvalidRegistryObjectException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.xmi.XMLResource;
-import org.eclipse.jdt.core.IClasspathContainer;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.core.internal.JSFLibraryClasspathContainer;
-import org.eclipse.jst.jsf.core.internal.Messages;
-import org.eclipse.jst.jsf.core.internal.RegistryUpgradeCommitHandler;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistry;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryFactory;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.adapter.MaintainDefaultImplementationAdapter;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryRegistryPackageImpl;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.util.JSFLibraryRegistryResourceFactoryImpl;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.util.JSFLibraryRegistryResourceImpl;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.util.JSFLibraryRegistryUpgradeUtil;
-import org.eclipse.jst.jsf.core.internal.project.facet.JSFUtils;
-import org.eclipse.jst.jsf.core.jsflibraryconfiguration.JSFLibraryConfigurationHelper;
-import org.eclipse.jst.jsf.core.jsflibraryregistry.PluginProvidedJSFLibraryCreationHelper;
-import org.eclipse.jst.jsf.core.jsflibraryregistry.internal.PluginProvidedJSFLibraryCreationHelper2;
-
-/**
- * A singleton maintains lists of implementation and component libraries
- * in registry.
- *
- * Each item in the lists contains a workingcopy of a JSF library and
- * decorates with usage information such selection and deployment.
- *
- * The lists are updated when there are changes in JSF library registry.
- *
- * @author Justin Chen, etc. - Oracle
- */
-@SuppressWarnings("deprecation")
-public class JSFLibraryRegistryUtil {
- private static JSFLibraryRegistryUtil instance = null;
-
- private List implLibs = null;
- private List compLibs = null;
-
-
- // The NS URI of the JSF Library Registry's Ecore package. (Must match
- // setting on package in Ecore model.)
- private static final String JSF_LIBRARY_REGISTRY_NSURI = "http://www.eclipse.org/webtools/jsf/schema/jsflibraryregistry.xsd"; //$NON-NLS-1$
-
- private static final String LIB_EXT_PT = "pluginProvidedJsfLibraries"; //$NON-NLS-1$
- //deprecated ext-pt
- private static final String OLD_LIB_EXT_PT = "jsfLibraries"; //$NON-NLS-1$
-
- // The JSF Library Registry EMF resource instance.
- private static JSFLibraryRegistryResourceImpl jsfLibraryRegistryResource = null;
-
- //JSFLibraryRegistry singleton
- private JSFLibraryRegistry jsfLibraryRegistry;
-
- /**
- * Private constructor
- */
- private JSFLibraryRegistryUtil() {
- //nothing to do
- }
-
- /**
- * Return the singleton instance of JSFLibraryRegistryUtil.
- *
- * @return JSFLibraryRegistryUtil
- */
- public synchronized static JSFLibraryRegistryUtil getInstance() {
- if ( instance == null ) {
- instance = new JSFLibraryRegistryUtil();
- instance.loadJSFLibraryRegistry();
- }
- return instance;
- }
-
- /**
- * Convenience method to return the JSFLibraryRegistry instance.
- *
- * @return jsfLibReg JSFLibraryRegistry
- */
- public JSFLibraryRegistry getJSFLibraryRegistry() {
- return jsfLibraryRegistry;
- }
-
- /**
- * Get the default JSF implementation library instance.
- * A null is returned when there is no libraries in the registry.
- *
- * @return JSFLibraryInternalReference
- */
- public JSFLibraryInternalReference getDefaultJSFImplementationLibrary() {
- JSFLibrary dftImplLib = getJSFLibraryRegistry().getDefaultImplementation();
-
- return ((dftImplLib != null) ?
- getJSFLibraryReferencebyID(dftImplLib.getID()) :
- null);
- }
-
- /**
- * Get the working copy of JSF implementation libraries.
- * The list is updated when there are changes in registry.
- *
- * @return List
- */
- List getJSFImplementationLibraries() {
- if (implLibs == null) {
- implLibs = wrapJSFLibraries(getJSFLibraryRegistry().getImplJSFLibraries());
- } else {
- if (implLibs.size() != getJSFLibraryRegistry().getImplJSFLibraries().size() ||
- isAnyLibraryChanged(implLibs)) {
- implLibs.clear();
- implLibs = wrapJSFLibraries(getJSFLibraryRegistry().getImplJSFLibraries());
- }
- }
- return implLibs;
- }
-
- /**
- * Get the working copy of JSF component libraries.
- * The list is updated when there are changes in registry.
- *
- * @return List
- */
- List getJSFComponentLibraries() {
- if (compLibs == null) {
- compLibs = wrapJSFLibraries(getJSFLibraryRegistry().getNonImplJSFLibraries());
- } else {
- if (compLibs.size() != getJSFLibraryRegistry().getNonImplJSFLibraries().size() ||
- isAnyLibraryChanged(compLibs)) {
- compLibs.clear();
- compLibs = wrapJSFLibraries(getJSFLibraryRegistry().getNonImplJSFLibraries());
- }
- }
- return compLibs;
- }
-
- /**
- * Get the JSFLibraryDecorator object from the provided ID.
- * A null is returned no library matches the ID.
- *
- * @param id String
- * @return JSFLibraryDecorator
- */
- public JSFLibraryInternalReference getJSFLibraryReferencebyID(final String id) {
- Iterator it = getJSFImplementationLibraries().iterator();
- JSFLibraryInternalReference crtItem = null;
-
- // search implementation libraries
- while(it.hasNext()) {
- crtItem = (JSFLibraryInternalReference)it.next();
- if (id.equals(crtItem.getID())) {
- return crtItem;
- }
- }
- // search component libraries
- it = getJSFComponentLibraries().iterator();
- while(it.hasNext()) {
- crtItem = (JSFLibraryInternalReference)it.next();
- if (id.equals(crtItem.getID())) {
- return crtItem;
- }
- }
- return null;
- }
-
- /**
- * Add a JSF Library into collection for either
- * JSF implementation libraries or component libraries.
- * The decision is based on if a JSF library is an implementation.
- *
- * @param library JSFLibraryLibraryReference
- */
- public void addJSFLibrary(final JSFLibraryInternalReference library) {
- // Library is added only if it does not exist in registry
- if (library != null && getJSFLibraryRegistry().getJSFLibraryByID(library.getID()) == null) {
- // Add the library working copy into workspace registry.
- JSFLibrary jsfLib = library.getLibrary();
- getJSFLibraryRegistry().addJSFLibrary(jsfLib.getWorkingCopy());
-
- // Add library into the collection depends on its type.
- List list = (library.isImplementation() ?
- getJSFImplementationLibraries() :
- getJSFComponentLibraries());
- list.add(library);
- }
- }
-
- private List wrapJSFLibraries(final EList libs) {
- List list = new ArrayList();
- if (libs != null) {
- JSFLibrary jsfLib;
- JSFLibraryInternalReference jsfLibDctr;
-
- Iterator it = libs.iterator();
- while (it.hasNext()) {
- jsfLib = (JSFLibrary) it.next();
- // Set unselected and undeployed initially.
- jsfLibDctr = new JSFLibraryInternalReference(jsfLib, //.getWorkingCopy(),
- false,
- false);
- list.add(jsfLibDctr);
- }
- }
- return list;
- }
-
- private boolean isAnyLibraryChanged(final List list) {
- Iterator it = list.iterator();
- JSFLibraryInternalReference wclib = null; // working copy library
- JSFLibrary lib = null;
-
- while(it.hasNext()) {
- wclib = (JSFLibraryInternalReference)it.next();
- lib = getJSFLibraryRegistry().getJSFLibraryByID(wclib.getID());
- if (lib == null) { // removed. Hence, changed.
- return true;
- }
- if (wclib.getArchiveFiles().size() !=
- lib.getArchiveFiles().size()) { // Archives changed..
- return true;
- }
- if (isAnyArchiveFileChanged(wclib.getArchiveFiles(),
- lib.getArchiveFiles())) { // Check archive file changes. I.e., name and location
- return true;
- }
- }
- return false;
- }
-
- private boolean isAnyArchiveFileChanged(final EList source, EList target) {
- ArchiveFile arSrc = null;
- Iterator it = source.iterator();
- while (it.hasNext()) {
- arSrc = (ArchiveFile) it.next();
- if (!findMatchedArchive(arSrc, target)) {
- return true;
- }
- }
- return false;
- }
-
- private boolean findMatchedArchive(ArchiveFile source, EList list) {
- ArchiveFile target = null;
- Iterator it = list.iterator();
- while (it.hasNext()) {
- target = (ArchiveFile) it.next();
- if (target.equals(source)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Get the classpath entries for a JSF Library
- * @param lib
- * @return IClasspathEntry[]
- */
- public IClasspathEntry[] getClasspathEntries(JSFLibrary lib){
- //TODO: cache to optimize. probably belongs inside JSFLibrary model.
- ArrayList res= new ArrayList(lib.getArchiveFiles().size());
- for (Iterator it=lib.getArchiveFiles().iterator();it.hasNext();) {
- ArchiveFile jar= (ArchiveFile)it.next();
- if (jar != null && jar.exists()) {
- IClasspathEntry entry = getClasspathEntry(jar);
- if (entry != null)
- res.add(entry);
- }
- }
- IClasspathEntry[] entries= (IClasspathEntry[]) res.toArray(new IClasspathEntry[res.size()]);
- return entries;
- }
-
- /**
- * Create IClasspathEntry for ArchiveFile
- * @param jar
- * @return IClasspathEntry
- */
- public IClasspathEntry getClasspathEntry(ArchiveFile jar){
- IClasspathEntry entry = null;
- if (jar !=null && jar.exists()){
- entry = JavaCore.newLibraryEntry(new Path(jar.getResolvedSourceLocation()), null, null);//, nu, sourceAttachRoot, accessRules, extraAttributes, false/*not exported*/);
- }
- return entry;
- }
-
- /**
- * Binds JSF Libraries to classpath containers when the library changes.
- *
- * This method will deal with library/cp container renames by removing the old classpath container and then adding.
- *
- * @param oldId
- * @param newId
- * @param monitor
- * @throws JavaModelException
- */
- public static void rebindClasspathContainerEntries(String oldId, String newId, IProgressMonitor monitor) throws JavaModelException {
- IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot();
- IJavaProject[] projects= JavaCore.create(root).getJavaProjects();
- IPath containerPath= new Path(JSFLibraryConfigurationHelper.JSF_LIBRARY_CP_CONTAINER_ID).append(newId);
- IPath oldContainerPath = new Path(JSFLibraryConfigurationHelper.JSF_LIBRARY_CP_CONTAINER_ID).append(oldId);
-
- JSFLibrary lib = JSFLibraryRegistryUtil.getInstance().getJSFLibraryRegistry().getJSFLibraryByID(newId);
- List affectedProjects= new ArrayList();
- boolean removeAndAddBecauseOfRename = (!oldId.equals(newId));
- // find all projects using the old container name...
- for (int i= 0; i < projects.length; i++) {
- IJavaProject project= projects[i];
- IClasspathEntry[] entries= project.getRawClasspath();
- for (int k= 0; k < entries.length; k++) {
- IClasspathEntry curr= entries[k];
- if (curr.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
- if (oldContainerPath.equals(curr.getPath())) {
- affectedProjects.add(project);
- break;
- }
- }
- }
- }
-
- if (!affectedProjects.isEmpty()) {
- IJavaProject[] affected= (IJavaProject[]) affectedProjects.toArray(new IJavaProject[affectedProjects.size()]);
- IClasspathContainer[] containers= new IClasspathContainer[affected.length];
- removeAndAddBecauseOfRename = (!oldId.equals(newId));
- if (removeAndAddBecauseOfRename){//not very pretty... remove and add new container
- IClasspathEntry newEntry = JavaCore.newContainerEntry(containerPath);
- for (int i= 0; i < affected.length; i++) {
- IJavaProject project= affected[i];
- IClasspathEntry[] entries= project.getRawClasspath();
- List keptEntries = new ArrayList();
- //keep all entries except the old one
- for (int k= 0; k < entries.length; k++) {
- IClasspathEntry curr= entries[k];
- if (curr.getEntryKind() == IClasspathEntry.CPE_CONTAINER){
- if( ! oldContainerPath.equals(curr.getPath()))
- keptEntries.add(curr);
- }
- else {
- keptEntries.add(curr);
- }
- }
- // add new container entry
- keptEntries.add(newEntry);
- setRawClasspath(project, keptEntries, monitor);
- }
-
- }
- else {//rebind
-
- JSFLibraryClasspathContainer container= new JSFLibraryClasspathContainer(lib);
- containers[0] = container;
-
- JavaCore.setClasspathContainer(containerPath, affected, containers, monitor);
- }
- } else {
- if (monitor != null) {
- monitor.done();
- }
- }
- }
-
- /**
- * Sets the raw classpath on a project and logs an error if it when a JavaModelException occurs
- * @param project
- * @param cpEntries
- * @param monitor
- */
- public static void setRawClasspath(IJavaProject project, List cpEntries, IProgressMonitor monitor) {
- IClasspathEntry[] entries = (IClasspathEntry[])cpEntries.toArray(new IClasspathEntry[0]);
- try {
- project.setRawClasspath(entries, monitor);
- } catch (JavaModelException e) {
- JSFCorePlugin.log(e, "Unable to set classpath for: "+project.getProject().getName());
- }
- }
-
- /**
- * @param iproject
- * @return true if iproject has persistent properties indicating that it may still
- * be using V1 JSF Library references
- */
- public static boolean doesProjectHaveV1JSFLibraries(IProject iproject)
- {
- if (iproject == null || !iproject.isAccessible())
- {
- return false; // won't be able to get reading on a null or closed project
- }
-
- try
- {
- Object compLib = iproject.getPersistentProperty(new QualifiedName(JSFLibraryConfigProjectData.QUALIFIEDNAME, JSFUtils.PP_JSF_COMPONENT_LIBRARIES));
- Object implLib = iproject.getPersistentProperty(new QualifiedName(JSFLibraryConfigProjectData.QUALIFIEDNAME, JSFUtils.PP_JSF_IMPLEMENTATION_LIBRARIES));
-
- if (compLib != null || implLib != null)
- {
- return true;
- }
- }
- catch(CoreException ce)
- {
- JSFCorePlugin.log(ce, "Error checking age of project");
- }
- // by default, fall through to false
- return false;
- }
-
- /**
- * Removes the persistent property from JSF projects tagged with
- * V1 JSF libraries.
- * @param projects
- */
- public static void removeV1JSFLibraryProperty(List<IProject> projects)
- {
- for (final Iterator<IProject> it = projects.iterator(); it.hasNext();)
- {
- IProject project = it.next();
- try {
- if (project.isAccessible())
- {
- project.setPersistentProperty(new QualifiedName(JSFLibraryConfigProjectData.QUALIFIEDNAME, JSFUtils.PP_JSF_COMPONENT_LIBRARIES), null);
- project.setPersistentProperty(new QualifiedName(JSFLibraryConfigProjectData.QUALIFIEDNAME, JSFUtils.PP_JSF_IMPLEMENTATION_LIBRARIES), null);
- }
- } catch (CoreException e) {
- JSFCorePlugin.log(e, "Error removing JSF library persistent property");
- }
- }
- }
-
- /**
- * Loads the JSFLibraryRegistry EMF object from plugin-specfic workspace
- * settings location.
- */
- private void loadJSFLibraryRegistry() {
- try {
-
- EPackage.Registry.INSTANCE.put(JSF_LIBRARY_REGISTRY_NSURI, JSFLibraryRegistryPackageImpl.init());
- URI jsfLibRegURI = JSFLibraryRegistryUpgradeUtil.getRegistryURI(JSFLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_LATESTVERSION_URL);
- JSFLibraryRegistryUpgradeUtil.getInstance().upgradeRegistryIfNecessary(JSFLibraryRegistryUpgradeUtil.LATESTVERSION);
-
- JSFLibraryRegistryResourceFactoryImpl resourceFactory = new JSFLibraryRegistryResourceFactoryImpl();
- jsfLibraryRegistryResource = (JSFLibraryRegistryResourceImpl)resourceFactory.createResource(jsfLibRegURI);
- try {
- Map options = new HashMap();
- //disable notifications during load to avoid changing stored default implementation
- options.put(XMLResource.OPTION_DISABLE_NOTIFY, Boolean.TRUE);
- jsfLibraryRegistryResource.load(options);
- jsfLibraryRegistry = (JSFLibraryRegistry)jsfLibraryRegistryResource.getContents().get(0);
-
- loadJSFLibraryExtensions();
- loadDeprecatedJSFLibraryExtensions();//to be removed
-
- } catch(IOException ioe) {
- //Create a new Registry instance
- jsfLibraryRegistry = JSFLibraryRegistryFactory.eINSTANCE.createJSFLibraryRegistry();
- jsfLibraryRegistryResource = (JSFLibraryRegistryResourceImpl)resourceFactory.createResource(jsfLibRegURI);
- jsfLibraryRegistryResource.getContents().add(jsfLibraryRegistry);
- loadJSFLibraryExtensions();
- loadDeprecatedJSFLibraryExtensions();//to be removed
- saveJSFLibraryRegistry();
- }
- //add adapter to maintain default implementation
- if (jsfLibraryRegistry != null) {
- //check that a default impl is set. if not pick first one if available.
- JSFLibrary defLib = jsfLibraryRegistry.getDefaultImplementation();
- if (defLib == null && jsfLibraryRegistry.getImplJSFLibraries().size() > 0){
- jsfLibraryRegistry.setDefaultImplementation((JSFLibrary)jsfLibraryRegistry.getImplJSFLibraries().get(0));
- saveJSFLibraryRegistry();
- }
- jsfLibraryRegistry.eAdapters().add(MaintainDefaultImplementationAdapter.getInstance());
-
- //commit
- RegistryUpgradeCommitHandler.commitMigrationIfNecessary();
- }
- } catch(MalformedURLException mue) {
- JSFCorePlugin.log(IStatus.ERROR, Messages.JSFLibraryRegistry_ErrorCreatingURL, mue);
- }
- }
-///////////////////////////////// Load and Save JSF Library Registry ////////////////////////////////////////////////
-
- /**
- * Creates library registry items from extension points.
- */
- private void loadJSFLibraryExtensions() {
- try {
- IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(JSFCorePlugin.PLUGIN_ID, LIB_EXT_PT);
- IExtension[] extensions = point.getExtensions();
- for (int i=0;i < extensions.length;i++){
- IExtension ext = extensions[i];
- for (int j=0;j < ext.getConfigurationElements().length;j++){
- PluginProvidedJSFLibraryCreationHelper2 newLibCreator = new PluginProvidedJSFLibraryCreationHelper2(ext.getConfigurationElements()[j]);
- JSFLibrary newLib = newLibCreator.create();
-
- /**
- * Additional check on if a plug-in contributes jsflibraries is an expanded folder.
- * Fix related to bug 144954.
- *
- * It would be ideal to check if a plug-in is distributed as a JAR
- * before a JSFLibrary is created.
- *
- * This is a temporary solution since JARs in a JAR case is not
- * supported in this release. Bug 14496.
- */
- if (newLib != null) //&& isJSFLibinExpandedFolder(newLib))
- jsfLibraryRegistry.addJSFLibrary(newLib);
- }
- }
- } catch (InvalidRegistryObjectException e) {
- JSFCorePlugin.log(IStatus.ERROR, Messages.JSFLibraryRegistry_ErrorLoadingFromExtPt, e);
- }
- }
-
- /**
- * Creates deprecated library registry items from extension points.
- * TO BE REMOVED
- */
- private void loadDeprecatedJSFLibraryExtensions() {
- try {
- IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(JSFCorePlugin.PLUGIN_ID, OLD_LIB_EXT_PT);
- IExtension[] extensions = point.getExtensions();
- for (int i=0;i < extensions.length;i++){
- IExtension ext = extensions[i];
- for (int j=0;j < ext.getConfigurationElements().length;j++){
- PluginProvidedJSFLibraryCreationHelper newLibCreator = new PluginProvidedJSFLibraryCreationHelper(ext.getConfigurationElements()[j]);
- JSFLibrary newLib = newLibCreator.create();
-
- /**
- * Additional check on if a plug-in contributes jsflibraries is an expanded folder.
- * Fix related to bug 144954.
- *
- * It would be ideal to check if a plug-in is distributed as a JAR
- * before a JSFLibrary is created.
- *
- * This is a temporary solution since JARs in a JAR case is not
- * supported in this release. Bug 14496.
- */
- if (newLib != null ) //&& isJSFLibinExpandedFolder(newLib))
- jsfLibraryRegistry.addJSFLibrary(newLib);
- }
- }
- } catch (InvalidRegistryObjectException e) {
- JSFCorePlugin.log(IStatus.ERROR, Messages.JSFLibraryRegistry_ErrorLoadingFromExtPt, e);
- }
- }
-
- /**
- * Saves the JSFLibraryRegistry EMF object from plugin-specfic workspace
- * settings location. (Called from stop(BundleContext).)
- * @return true if save is successful
- */
- public boolean saveJSFLibraryRegistry() {
- boolean saved = false;
- if (jsfLibraryRegistryResource != null) {
- try {
- jsfLibraryRegistryResource.save(Collections.EMPTY_MAP);
- saved = true;
- } catch(IOException ioe) {
- JSFCorePlugin.log(IStatus.ERROR, Messages.JSFLibraryRegistry_ErrorSaving, ioe);
- }
- } else {
- JSFCorePlugin.log(IStatus.ERROR, Messages.JSFLibraryRegistry_ErrorSaving);
- }
- return saved;
- }
-
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/ArchiveFile.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/ArchiveFile.java
deleted file mode 100644
index 01941ea..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/ArchiveFile.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.jsflibraryregistry;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Archive File</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile#isRelativeToWorkspace <em>Relative To Workspace</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile#getSourceLocation <em>Source Location</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile#getRelativeDestLocation <em>Relative Dest Location</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile#getJSFLibrary <em>JSF Library</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryPackage#getArchiveFile()
- * @model
- * @generated
- */
-public interface ArchiveFile extends EObject{
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String copyright = "Copyright (c) 2005 Oracle Corporation";
-
- /**
- * Returns the value of the '<em><b>Source Location</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Source Location</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Source Location</em>' attribute.
- * @see #setSourceLocation(String)
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryPackage#getArchiveFile_SourceLocation()
- * @model required="true"
- * @generated
- */
- String getSourceLocation();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile#getSourceLocation <em>Source Location</em>}' attribute.
- * <!-- begin-user-doc -->
- * If the value passed is found to be relative to the workspace, a
- * workspace-relative location is stored; to prevent this behaviour, call
- * isRelativeToWorkspace(false) before calling this method.
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Source Location</em>' attribute.
- * @see #getSourceLocation()
- * @generated
- */
- void setSourceLocation(String value);
-
- /**
- * Returns the value of the '<em><b>Relative To Workspace</b></em>' attribute.
- * The default value is <code>"true"</code>.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Relative To Workspace</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Relative To Workspace</em>' attribute.
- * @see #setRelativeToWorkspace(boolean)
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryPackage#getArchiveFile_RelativeToWorkspace()
- * @model default="true" required="true"
- * @generated
- */
- boolean isRelativeToWorkspace();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile#isRelativeToWorkspace <em>Relative To Workspace</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Relative To Workspace</em>' attribute.
- * @see #isRelativeToWorkspace()
- * @generated
- */
- void setRelativeToWorkspace(boolean value);
-
- /**
- * Returns the value of the '<em><b>Relative Dest Location</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Relative Dest Location</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Relative Dest Location</em>' attribute.
- * @see #setRelativeDestLocation(String)
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryPackage#getArchiveFile_RelativeDestLocation()
- * @model required="true"
- * @generated
- */
- String getRelativeDestLocation();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile#getRelativeDestLocation <em>Relative Dest Location</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Relative Dest Location</em>' attribute.
- * @see #getRelativeDestLocation()
- * @generated
- */
- void setRelativeDestLocation(String value);
-
- /**
- * Returns the value of the '<em><b>JSF Library</b></em>' container reference.
- * It is bidirectional and its opposite is '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary#getArchiveFiles <em>Archive Files</em>}'.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>JSF Library</em>' container reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>JSF Library</em>' container reference.
- * @see #setJSFLibrary(JSFLibrary)
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryPackage#getArchiveFile_JSFLibrary()
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary#getArchiveFiles
- * @model opposite="ArchiveFiles" required="true"
- * @generated
- */
- JSFLibrary getJSFLibrary();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile#getJSFLibrary <em>JSF Library</em>}' container reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>JSF Library</em>' container reference.
- * @see #getJSFLibrary()
- * @generated
- */
- void setJSFLibrary(JSFLibrary value);
-
- /**
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Path</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * @return the path
- * <!-- end-user-doc -->
- * @model kind="operation" required="true"
- * @generated
- */
- String getPath();
-
- /**
- * <!-- begin-user-doc -->
- * @return the name
- * <!-- end-user-doc -->
- * @model kind="operation" required="true"
- * @generated
- */
- String getName();
-
- /**
- * <!-- begin-user-doc -->
- * @return true if exists
- * <!-- end-user-doc -->
- * @model required="true"
- * @generated
- */
- boolean exists();
-
- /**
- * <!-- begin-user-doc -->
- * @param object
- * @return true if equal
- * <!-- end-user-doc -->
- * @model required="true" objectRequired="true"
- * @generated
- */
- boolean equals(Object object);
-
- /**
- * <!-- begin-user-doc -->
- * @return the hashCode
- * <!-- end-user-doc -->
- * @model required="true"
- * @generated
- */
- int hashCode();
-
- /**
- * <!-- begin-user-doc -->
- * @param baseDestLocation
- * @return true if copied succeeds
- * <!-- end-user-doc -->
- * @model required="true" baseDestLocationRequired="true"
- * @generated
- */
- boolean copyTo(String baseDestLocation);
-
- /**
- * <!-- begin-user-doc -->
- * @return the resolved source location
- * <!-- end-user-doc -->
- * @model kind="operation" required="true"
- * @generated
- */
- String getResolvedSourceLocation();
-
-} // ArchiveFile
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/JSFLibrary.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/JSFLibrary.java
deleted file mode 100644
index a50d990..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/JSFLibrary.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.jsflibraryregistry;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>JSF Library</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary#getID <em>ID</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary#getJSFVersion <em>JSF Version</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary#isDeployed <em>Deployed</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary#isImplementation <em>Implementation</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary#getArchiveFiles <em>Archive Files</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryPackage#getJSFLibrary()
- * @model
- * @generated
- */
-public interface JSFLibrary extends EObject{
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String copyright = "Copyright (c) 2005 Oracle Corporation";
-
- /**
- * Returns the value of the '<em><b>ID</b></em>' attribute.
- * The default value is <code>""</code>.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>ID</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>ID</em>' attribute.
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryPackage#getJSFLibrary_ID()
- * @model default="" transient="true" changeable="false" derived="true"
- * @generated
- */
- String getID();
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryPackage#getJSFLibrary_Name()
- * @model required="true"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-
- /**
- * Returns the value of the '<em><b>JSF Version</b></em>' attribute.
- * The default value is <code>"UNKNOWN"</code>.
- * The literals are from the enumeration {@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFVersion}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>JSF Version</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>JSF Version</em>' attribute.
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFVersion
- * @see #setJSFVersion(JSFVersion)
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryPackage#getJSFLibrary_JSFVersion()
- * @model default="UNKNOWN" required="true"
- * @generated
- */
- JSFVersion getJSFVersion();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary#getJSFVersion <em>JSF Version</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>JSF Version</em>' attribute.
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFVersion
- * @see #getJSFVersion()
- * @generated
- */
- void setJSFVersion(JSFVersion value);
-
- /**
- * Returns the value of the '<em><b>Deployed</b></em>' attribute.
- * The default value is <code>"true"</code>.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Deployed</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Deployed</em>' attribute.
- * @see #setDeployed(boolean)
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryPackage#getJSFLibrary_Deployed()
- * @model default="true" required="true"
- * @generated
- */
- boolean isDeployed();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary#isDeployed <em>Deployed</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Deployed</em>' attribute.
- * @see #isDeployed()
- * @generated
- */
- void setDeployed(boolean value);
-
- /**
- * Returns the value of the '<em><b>Implementation</b></em>' attribute.
- * The default value is <code>"false"</code>.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Implementation</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Implementation</em>' attribute.
- * @see #setImplementation(boolean)
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryPackage#getJSFLibrary_Implementation()
- * @model default="false" required="true"
- * @generated
- */
- boolean isImplementation();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary#isImplementation <em>Implementation</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Implementation</em>' attribute.
- * @see #isImplementation()
- * @generated
- */
- void setImplementation(boolean value);
-
- /**
- * Returns the value of the '<em><b>Archive Files</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile}.
- * It is bidirectional and its opposite is '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile#getJSFLibrary <em>JSF Library</em>}'.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Archive Files</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Archive Files</em>' containment reference list.
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryPackage#getJSFLibrary_ArchiveFiles()
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile#getJSFLibrary
- * @model type="org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile" opposite="JSFLibrary" containment="true"
- * @generated
- */
- EList getArchiveFiles();
-
- /**
- * <!-- begin-user-doc -->
- * @param fullPath
- * @return true if fullPath contains archive file
- * <!-- end-user-doc -->
- * @model required="true" fullPathRequired="true"
- * @generated
- */
- boolean containsArchiveFile(String fullPath);
-
- /**
- * <!-- begin-user-doc -->
- * @return the working copy
- * <!-- end-user-doc -->
- * @model kind="operation" required="true"
- * @generated
- */
- JSFLibrary getWorkingCopy();
-
- /**
- * <!-- begin-user-doc -->
- * @param otherLibrary
- * <!-- end-user-doc -->
- * @model otherLibraryRequired="true"
- * @generated
- */
- void updateValues(JSFLibrary otherLibrary);
-
- /**
- * <!-- begin-user-doc -->
- * @param baseDestLocation
- * @return true if copy succeeds
- * <!-- end-user-doc -->
- * @model required="true" baseDestLocationRequired="true"
- * @generated
- */
- boolean copyTo(String baseDestLocation);
-
- /**
- * <!-- begin-user-doc -->
- * @return label
- * <!-- end-user-doc -->
- * @model kind="operation" required="true"
- * @generated
- */
- String getLabel();
-
-} // JSFLibrary
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/JSFLibraryRegistry.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/JSFLibraryRegistry.java
deleted file mode 100644
index 73b7057..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/JSFLibraryRegistry.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.jsflibraryregistry;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jst.jsf.core.internal.Messages;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>JSF Library Registry</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistry#getDefaultImplementationID <em>Default Implementation ID</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistry#getJSFLibraries <em>JSF Libraries</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistry#getPluginProvidedJSFLibraries <em>Plugin Provided JSF Libraries</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryPackage#getJSFLibraryRegistry()
- * @model
- * @generated
- */
-public interface JSFLibraryRegistry extends EObject{
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String copyright = "Copyright (c) 2005 Oracle Corporation";
-
- /**
- * Returns the value of the '<em><b>Default Implementation ID</b></em>' attribute.
- * The default value is <code>""</code>.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Default Implementation ID</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Default Implementation ID</em>' attribute.
- * @see #setDefaultImplementationID(String)
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryPackage#getJSFLibraryRegistry_DefaultImplementationID()
- * @model default=""
- * @generated
- */
- String getDefaultImplementationID();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistry#getDefaultImplementationID <em>Default Implementation ID</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Default Implementation ID</em>' attribute.
- * @see #getDefaultImplementationID()
- * @generated
- */
- void setDefaultImplementationID(String value);
-
- /**
- *The default implementation message string
- */
- public static final String DEFAULT_IMPL_LABEL = Messages.JSFLibraryRegistry_DEFAULT_IMPL_LABEL;
-
- /**
- * Returns the value of the '<em><b>JSF Libraries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>JSF Libraries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>JSF Libraries</em>' containment reference list.
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryPackage#getJSFLibraryRegistry_JSFLibraries()
- * @model type="org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary" containment="true"
- * @generated
- */
- EList getJSFLibraries();
-
- /**
- * Returns the value of the '<em><b>Plugin Provided JSF Libraries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.PluginProvidedJSFLibrary}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Plugin Provided JSF Libraries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Plugin Provided JSF Libraries</em>' containment reference list.
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryPackage#getJSFLibraryRegistry_PluginProvidedJSFLibraries()
- * @model type="org.eclipse.jst.jsf.core.internal.jsflibraryregistry.PluginProvidedJSFLibrary" containment="true" transient="true"
- * @generated
- */
- EList getPluginProvidedJSFLibraries();
-
- /**
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Default Implementation</em>' reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * @return the default implementation
- * <!-- end-user-doc -->
- * @model kind="operation" required="true"
- * @generated
- */
- JSFLibrary getDefaultImplementation();
-
- /**
- * <!-- begin-user-doc -->
- * @param implementation
- * <!-- end-user-doc -->
- * @model implementationRequired="true"
- * @generated
- */
- void setDefaultImplementation(JSFLibrary implementation);
-
- /**
- * <!-- begin-user-doc -->
- * @param ID
- * @return the jsf library
- * <!-- end-user-doc -->
- * @model required="true" IDRequired="true"
- * @generated
- */
- JSFLibrary getJSFLibraryByID(String ID);
-
- /**
- * <!-- begin-user-doc -->
- * @param name
- * @return the jsf libraries matching name
- * <!-- end-user-doc -->
- * @model required="true" many="false" nameRequired="true"
- * @generated
- */
- EList getJSFLibrariesByName(String name);
-
- /**
- * <!-- begin-user-doc -->
- * @return the implementation JSF libraries
- * <!-- end-user-doc -->
- * @model kind="operation" required="true" many="false"
- * @generated
- */
- EList getImplJSFLibraries();
-
- /**
- * <!-- begin-user-doc -->
- * @return the non-implementation JSF libraries
- * <!-- end-user-doc -->
- * @model kind="operation" required="true" many="false"
- * @generated
- */
- EList getNonImplJSFLibraries();
-
- /**
- * <!-- begin-user-doc -->
- * @return all the JSF libraries
- * <!-- end-user-doc -->
- * @model kind="operation" required="true" many="false"
- * @generated
- */
- EList getAllJSFLibraries();
-
- /**
- * <!-- begin-user-doc -->
- * @param library
- * @return true if add succeeds
- * <!-- end-user-doc -->
- * @model required="true" libraryRequired="true"
- * @generated
- */
- boolean addJSFLibrary(JSFLibrary library);
-
- /**
- * <!-- begin-user-doc -->
- * @param library
- * @return true if remove succeeds
- * <!-- end-user-doc -->
- * @model required="true" libraryRequired="true"
- * @generated
- */
- boolean removeJSFLibrary(JSFLibrary library);
-
-} // JSFLibraryRegistry
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/JSFLibraryRegistryFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/JSFLibraryRegistryFactory.java
deleted file mode 100644
index 77560bd..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/JSFLibraryRegistryFactory.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.jsflibraryregistry;
-
-import org.eclipse.emf.ecore.EFactory;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Factory</b> for the model.
- * It provides a create method for each non-abstract class of the model.
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryPackage
- * @generated
- */
-public interface JSFLibraryRegistryFactory extends EFactory{
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String copyright = "Copyright (c) 2005 Oracle Corporation";
-
- /**
- * The singleton instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- JSFLibraryRegistryFactory eINSTANCE = org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryRegistryFactoryImpl.init();
-
- /**
- * Returns a new object of class '<em>JSF Library Registry</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>JSF Library Registry</em>'.
- * @generated
- */
- JSFLibraryRegistry createJSFLibraryRegistry();
-
- /**
- * Returns a new object of class '<em>JSF Library</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>JSF Library</em>'.
- * @generated
- */
- JSFLibrary createJSFLibrary();
-
- /**
- * Returns a new object of class '<em>Archive File</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Archive File</em>'.
- * @generated
- */
- ArchiveFile createArchiveFile();
-
- /**
- * Returns a new object of class '<em>Plugin Provided JSF Library</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Plugin Provided JSF Library</em>'.
- * @generated
- */
- PluginProvidedJSFLibrary createPluginProvidedJSFLibrary();
-
- /**
- * Returns the package supported by this factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the package supported by this factory.
- * @generated
- */
- JSFLibraryRegistryPackage getJSFLibraryRegistryPackage();
-
-} //JSFLibraryRegistryFactory
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/JSFLibraryRegistryPackage.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/JSFLibraryRegistryPackage.java
deleted file mode 100644
index 07ba32e..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/JSFLibraryRegistryPackage.java
+++ /dev/null
@@ -1,780 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.jsflibraryregistry;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Package</b> for the model.
- * It contains accessors for the meta objects to represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryFactory
- * @model kind="package"
- * @generated
- */
-@SuppressWarnings("hiding")
-public interface JSFLibraryRegistryPackage extends EPackage{
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String copyright = "Copyright (c) 2005 Oracle Corporation";
-
- /**
- * The package name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String eNAME = "jsflibraryregistry";
-
- /**
- * The package namespace URI.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String eNS_URI = "http://www.eclipse.org/webtools/jsf/schema/jsflibraryregistry.xsd";
-
- /**
- * The package namespace name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String eNS_PREFIX = "jsflibreg";
-
- /**
- * The singleton instance of the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- JSFLibraryRegistryPackage eINSTANCE = org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryRegistryPackageImpl.init();
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryRegistryImpl <em>JSF Library Registry</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryRegistryImpl
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryRegistryPackageImpl#getJSFLibraryRegistry()
- * @generated
- */
- int JSF_LIBRARY_REGISTRY = 0;
-
- /**
- * The feature id for the '<em><b>Default Implementation ID</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int JSF_LIBRARY_REGISTRY__DEFAULT_IMPLEMENTATION_ID = 0;
-
- /**
- * The feature id for the '<em><b>JSF Libraries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int JSF_LIBRARY_REGISTRY__JSF_LIBRARIES = 1;
-
- /**
- * The feature id for the '<em><b>Plugin Provided JSF Libraries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int JSF_LIBRARY_REGISTRY__PLUGIN_PROVIDED_JSF_LIBRARIES = 2;
-
- /**
- * The number of structural features of the '<em>JSF Library Registry</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int JSF_LIBRARY_REGISTRY_FEATURE_COUNT = 3;
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryImpl <em>JSF Library</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryImpl
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryRegistryPackageImpl#getJSFLibrary()
- * @generated
- */
- int JSF_LIBRARY = 1;
-
- /**
- * The feature id for the '<em><b>ID</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int JSF_LIBRARY__ID = 0;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int JSF_LIBRARY__NAME = 1;
-
- /**
- * The feature id for the '<em><b>JSF Version</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int JSF_LIBRARY__JSF_VERSION = 2;
-
- /**
- * The feature id for the '<em><b>Deployed</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int JSF_LIBRARY__DEPLOYED = 3;
-
- /**
- * The feature id for the '<em><b>Implementation</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int JSF_LIBRARY__IMPLEMENTATION = 4;
-
- /**
- * The feature id for the '<em><b>Archive Files</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int JSF_LIBRARY__ARCHIVE_FILES = 5;
-
- /**
- * The number of structural features of the '<em>JSF Library</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int JSF_LIBRARY_FEATURE_COUNT = 6;
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.ArchiveFileImpl <em>Archive File</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.ArchiveFileImpl
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryRegistryPackageImpl#getArchiveFile()
- * @generated
- */
- int ARCHIVE_FILE = 3;
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.PluginProvidedJSFLibraryImpl <em>Plugin Provided JSF Library</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.PluginProvidedJSFLibraryImpl
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryRegistryPackageImpl#getPluginProvidedJSFLibrary()
- * @generated
- */
- int PLUGIN_PROVIDED_JSF_LIBRARY = 2;
-
- /**
- * The feature id for the '<em><b>ID</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int PLUGIN_PROVIDED_JSF_LIBRARY__ID = JSF_LIBRARY__ID;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int PLUGIN_PROVIDED_JSF_LIBRARY__NAME = JSF_LIBRARY__NAME;
-
- /**
- * The feature id for the '<em><b>JSF Version</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int PLUGIN_PROVIDED_JSF_LIBRARY__JSF_VERSION = JSF_LIBRARY__JSF_VERSION;
-
- /**
- * The feature id for the '<em><b>Deployed</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int PLUGIN_PROVIDED_JSF_LIBRARY__DEPLOYED = JSF_LIBRARY__DEPLOYED;
-
- /**
- * The feature id for the '<em><b>Implementation</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int PLUGIN_PROVIDED_JSF_LIBRARY__IMPLEMENTATION = JSF_LIBRARY__IMPLEMENTATION;
-
- /**
- * The feature id for the '<em><b>Archive Files</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int PLUGIN_PROVIDED_JSF_LIBRARY__ARCHIVE_FILES = JSF_LIBRARY__ARCHIVE_FILES;
-
- /**
- * The feature id for the '<em><b>Plugin ID</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int PLUGIN_PROVIDED_JSF_LIBRARY__PLUGIN_ID = JSF_LIBRARY_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Label</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int PLUGIN_PROVIDED_JSF_LIBRARY__LABEL = JSF_LIBRARY_FEATURE_COUNT + 1;
-
- /**
- * The number of structural features of the '<em>Plugin Provided JSF Library</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int PLUGIN_PROVIDED_JSF_LIBRARY_FEATURE_COUNT = JSF_LIBRARY_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Relative To Workspace</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int ARCHIVE_FILE__RELATIVE_TO_WORKSPACE = 0;
-
- /**
- * The feature id for the '<em><b>Source Location</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int ARCHIVE_FILE__SOURCE_LOCATION = 1;
-
- /**
- * The feature id for the '<em><b>Relative Dest Location</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int ARCHIVE_FILE__RELATIVE_DEST_LOCATION = 2;
-
- /**
- * The feature id for the '<em><b>JSF Library</b></em>' container reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int ARCHIVE_FILE__JSF_LIBRARY = 3;
-
- /**
- * The number of structural features of the '<em>Archive File</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int ARCHIVE_FILE_FEATURE_COUNT = 4;
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFVersion <em>JSF Version</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFVersion
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryRegistryPackageImpl#getJSFVersion()
- * @generated
- */
- int JSF_VERSION = 4;
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistry <em>JSF Library Registry</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>JSF Library Registry</em>'.
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistry
- * @generated
- */
- EClass getJSFLibraryRegistry();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistry#getDefaultImplementationID <em>Default Implementation ID</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Default Implementation ID</em>'.
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistry#getDefaultImplementationID()
- * @see #getJSFLibraryRegistry()
- * @generated
- */
- EAttribute getJSFLibraryRegistry_DefaultImplementationID();
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistry#getJSFLibraries <em>JSF Libraries</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>JSF Libraries</em>'.
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistry#getJSFLibraries()
- * @see #getJSFLibraryRegistry()
- * @generated
- */
- EReference getJSFLibraryRegistry_JSFLibraries();
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistry#getPluginProvidedJSFLibraries <em>Plugin Provided JSF Libraries</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Plugin Provided JSF Libraries</em>'.
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistry#getPluginProvidedJSFLibraries()
- * @see #getJSFLibraryRegistry()
- * @generated
- */
- EReference getJSFLibraryRegistry_PluginProvidedJSFLibraries();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary <em>JSF Library</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>JSF Library</em>'.
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary
- * @generated
- */
- EClass getJSFLibrary();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary#getID <em>ID</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>ID</em>'.
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary#getID()
- * @see #getJSFLibrary()
- * @generated
- */
- EAttribute getJSFLibrary_ID();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary#getName()
- * @see #getJSFLibrary()
- * @generated
- */
- EAttribute getJSFLibrary_Name();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary#getJSFVersion <em>JSF Version</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>JSF Version</em>'.
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary#getJSFVersion()
- * @see #getJSFLibrary()
- * @generated
- */
- EAttribute getJSFLibrary_JSFVersion();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary#isDeployed <em>Deployed</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Deployed</em>'.
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary#isDeployed()
- * @see #getJSFLibrary()
- * @generated
- */
- EAttribute getJSFLibrary_Deployed();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary#isImplementation <em>Implementation</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Implementation</em>'.
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary#isImplementation()
- * @see #getJSFLibrary()
- * @generated
- */
- EAttribute getJSFLibrary_Implementation();
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary#getArchiveFiles <em>Archive Files</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Archive Files</em>'.
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary#getArchiveFiles()
- * @see #getJSFLibrary()
- * @generated
- */
- EReference getJSFLibrary_ArchiveFiles();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile <em>Archive File</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Archive File</em>'.
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile
- * @generated
- */
- EClass getArchiveFile();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile#getSourceLocation <em>Source Location</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Source Location</em>'.
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile#getSourceLocation()
- * @see #getArchiveFile()
- * @generated
- */
- EAttribute getArchiveFile_SourceLocation();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile#isRelativeToWorkspace <em>Relative To Workspace</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Relative To Workspace</em>'.
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile#isRelativeToWorkspace()
- * @see #getArchiveFile()
- * @generated
- */
- EAttribute getArchiveFile_RelativeToWorkspace();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile#getRelativeDestLocation <em>Relative Dest Location</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Relative Dest Location</em>'.
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile#getRelativeDestLocation()
- * @see #getArchiveFile()
- * @generated
- */
- EAttribute getArchiveFile_RelativeDestLocation();
-
- /**
- * Returns the meta object for the container reference '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile#getJSFLibrary <em>JSF Library</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the container reference '<em>JSF Library</em>'.
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile#getJSFLibrary()
- * @see #getArchiveFile()
- * @generated
- */
- EReference getArchiveFile_JSFLibrary();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.PluginProvidedJSFLibrary <em>Plugin Provided JSF Library</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Plugin Provided JSF Library</em>'.
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.PluginProvidedJSFLibrary
- * @generated
- */
- EClass getPluginProvidedJSFLibrary();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.PluginProvidedJSFLibrary#getPluginID <em>Plugin ID</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Plugin ID</em>'.
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.PluginProvidedJSFLibrary#getPluginID()
- * @see #getPluginProvidedJSFLibrary()
- * @generated
- */
- EAttribute getPluginProvidedJSFLibrary_PluginID();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.PluginProvidedJSFLibrary#getLabel <em>Label</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Label</em>'.
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.PluginProvidedJSFLibrary#getLabel()
- * @see #getPluginProvidedJSFLibrary()
- * @generated
- */
- EAttribute getPluginProvidedJSFLibrary_Label();
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFVersion <em>JSF Version</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>JSF Version</em>'.
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFVersion
- * @generated
- */
- EEnum getJSFVersion();
-
- /**
- * Returns the factory that creates the instances of the model.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the factory that creates the instances of the model.
- * @generated
- */
- JSFLibraryRegistryFactory getJSFLibraryRegistryFactory();
-
- /**
- * <!-- begin-user-doc -->
- * Defines literals for the meta objects that represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @generated
- */
- interface Literals {
- /**
- * The meta object literal for the '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryRegistryImpl <em>JSF Library Registry</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryRegistryImpl
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryRegistryPackageImpl#getJSFLibraryRegistry()
- * @generated
- */
-// @SuppressWarnings("hiding")
- EClass JSF_LIBRARY_REGISTRY = eINSTANCE.getJSFLibraryRegistry();
-
- /**
- * The meta object literal for the '<em><b>Default Implementation ID</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-// @SuppressWarnings("hiding")
- EAttribute JSF_LIBRARY_REGISTRY__DEFAULT_IMPLEMENTATION_ID = eINSTANCE.getJSFLibraryRegistry_DefaultImplementationID();
-
- /**
- * The meta object literal for the '<em><b>JSF Libraries</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-// @SuppressWarnings("hiding")
- EReference JSF_LIBRARY_REGISTRY__JSF_LIBRARIES = eINSTANCE.getJSFLibraryRegistry_JSFLibraries();
-
- /**
- * The meta object literal for the '<em><b>Plugin Provided JSF Libraries</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-// @SuppressWarnings("hiding")
- EReference JSF_LIBRARY_REGISTRY__PLUGIN_PROVIDED_JSF_LIBRARIES = eINSTANCE.getJSFLibraryRegistry_PluginProvidedJSFLibraries();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryImpl <em>JSF Library</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryImpl
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryRegistryPackageImpl#getJSFLibrary()
- * @generated
- */
-// @SuppressWarnings("hiding")
- EClass JSF_LIBRARY = eINSTANCE.getJSFLibrary();
-
- /**
- * The meta object literal for the '<em><b>ID</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-// @SuppressWarnings("hiding")
- EAttribute JSF_LIBRARY__ID = eINSTANCE.getJSFLibrary_ID();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-// @SuppressWarnings("hiding")
- EAttribute JSF_LIBRARY__NAME = eINSTANCE.getJSFLibrary_Name();
-
- /**
- * The meta object literal for the '<em><b>JSF Version</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-// @SuppressWarnings("hiding")
- EAttribute JSF_LIBRARY__JSF_VERSION = eINSTANCE.getJSFLibrary_JSFVersion();
-
- /**
- * The meta object literal for the '<em><b>Deployed</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-// @SuppressWarnings("hiding")
- EAttribute JSF_LIBRARY__DEPLOYED = eINSTANCE.getJSFLibrary_Deployed();
-
- /**
- * The meta object literal for the '<em><b>Implementation</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-// @SuppressWarnings("hiding")
- EAttribute JSF_LIBRARY__IMPLEMENTATION = eINSTANCE.getJSFLibrary_Implementation();
-
- /**
- * The meta object literal for the '<em><b>Archive Files</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-// @SuppressWarnings("hiding")
- EReference JSF_LIBRARY__ARCHIVE_FILES = eINSTANCE.getJSFLibrary_ArchiveFiles();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.ArchiveFileImpl <em>Archive File</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.ArchiveFileImpl
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryRegistryPackageImpl#getArchiveFile()
- * @generated
- */
-// @SuppressWarnings("hiding")
- EClass ARCHIVE_FILE = eINSTANCE.getArchiveFile();
-
- /**
- * The meta object literal for the '<em><b>Relative To Workspace</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-// @SuppressWarnings("hiding")
- EAttribute ARCHIVE_FILE__RELATIVE_TO_WORKSPACE = eINSTANCE.getArchiveFile_RelativeToWorkspace();
-
- /**
- * The meta object literal for the '<em><b>Source Location</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-// @SuppressWarnings("hiding")
- EAttribute ARCHIVE_FILE__SOURCE_LOCATION = eINSTANCE.getArchiveFile_SourceLocation();
-
- /**
- * The meta object literal for the '<em><b>Relative Dest Location</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-// @SuppressWarnings("hiding")
- EAttribute ARCHIVE_FILE__RELATIVE_DEST_LOCATION = eINSTANCE.getArchiveFile_RelativeDestLocation();
-
- /**
- * The meta object literal for the '<em><b>JSF Library</b></em>' container reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-// @SuppressWarnings("hiding")
- EReference ARCHIVE_FILE__JSF_LIBRARY = eINSTANCE.getArchiveFile_JSFLibrary();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.PluginProvidedJSFLibraryImpl <em>Plugin Provided JSF Library</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.PluginProvidedJSFLibraryImpl
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryRegistryPackageImpl#getPluginProvidedJSFLibrary()
- * @generated
- */
-// @SuppressWarnings("hiding")
- EClass PLUGIN_PROVIDED_JSF_LIBRARY = eINSTANCE.getPluginProvidedJSFLibrary();
-
- /**
- * The meta object literal for the '<em><b>Plugin ID</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-// @SuppressWarnings("hiding")
- EAttribute PLUGIN_PROVIDED_JSF_LIBRARY__PLUGIN_ID = eINSTANCE.getPluginProvidedJSFLibrary_PluginID();
-
- /**
- * The meta object literal for the '<em><b>Label</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-// @SuppressWarnings("hiding")
- EAttribute PLUGIN_PROVIDED_JSF_LIBRARY__LABEL = eINSTANCE.getPluginProvidedJSFLibrary_Label();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFVersion <em>JSF Version</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFVersion
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryRegistryPackageImpl#getJSFVersion()
- * @generated
- */
-// @SuppressWarnings("hiding")
- EEnum JSF_VERSION = eINSTANCE.getJSFVersion();
-
- }
-
-} //JSFLibraryRegistryPackage
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/JSFVersion.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/JSFVersion.java
deleted file mode 100644
index ad9f7f6..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/JSFVersion.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.jsflibraryregistry;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.emf.common.util.AbstractEnumerator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the literals of the enumeration '<em><b>JSF Version</b></em>',
- * and utility methods for working with them.
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryPackage#getJSFVersion()
- * @model
- * @generated
- */
-public final class JSFVersion extends AbstractEnumerator {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2005 Oracle Corporation";
-
- /**
- * The '<em><b>UNKNOWN</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>UNKNOWN</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #UNKNOWN_LITERAL
- * @model
- * @generated
- * @ordered
- */
- public static final int UNKNOWN = -1;
-
- /**
- * The '<em><b>V1 1</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>V1 1</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #V1_1_LITERAL
- * @model name="v1_1"
- * @generated
- * @ordered
- */
- public static final int V1_1 = 1;
-
- /**
- * The '<em><b>V1 2</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>V1 2</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #V1_2_LITERAL
- * @model name="v1_2"
- * @generated
- * @ordered
- */
- public static final int V1_2 = 2;
-
- /**
- * The '<em><b>UNKNOWN</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #UNKNOWN
- * @generated
- * @ordered
- */
- public static final JSFVersion UNKNOWN_LITERAL = new JSFVersion(UNKNOWN, "UNKNOWN", "UNKNOWN");
-
- /**
- * The '<em><b>V1 1</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #V1_1
- * @generated
- * @ordered
- */
- public static final JSFVersion V1_1_LITERAL = new JSFVersion(V1_1, "v1_1", "v1_1");
-
- /**
- * The '<em><b>V1 2</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #V1_2
- * @generated
- * @ordered
- */
- public static final JSFVersion V1_2_LITERAL = new JSFVersion(V1_2, "v1_2", "v1_2");
-
- /**
- * An array of all the '<em><b>JSF Version</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final JSFVersion[] VALUES_ARRAY =
- new JSFVersion[] {
- UNKNOWN_LITERAL,
- V1_1_LITERAL,
- V1_2_LITERAL,
- };
-
- /**
- * A public read-only list of all the '<em><b>JSF Version</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>JSF Version</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * @param literal value
- * @return the JSF version for name value
- * <!-- end-user-doc -->
- * @generated
- */
- public static JSFVersion get(String literal) {
- for (int i = 0; i < VALUES_ARRAY.length; ++i) {
- JSFVersion result = VALUES_ARRAY[i];
- if (result.toString().equals(literal)) {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>JSF Version</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * @param name
- * @return JSFVersion
- * <!-- end-user-doc -->
- * @generated
- */
- public static JSFVersion getByName(String name) {
- for (int i = 0; i < VALUES_ARRAY.length; ++i) {
- JSFVersion result = VALUES_ARRAY[i];
- if (result.getName().equals(name)) {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>JSF Version</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * @param value
- * @return the JSFVersion for the integer 'value'
- * <!-- end-user-doc -->
- * @generated
- */
- public static JSFVersion get(int value) {
- switch (value) {
- case UNKNOWN: return UNKNOWN_LITERAL;
- case V1_1: return V1_1_LITERAL;
- case V1_2: return V1_2_LITERAL;
- }
- return null;
- }
-
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private JSFVersion(int value, String name, String literal) {
- super(value, name, literal);
- }
-
- /**
- * Returns the '<em><b>JSF Version</b></em>' literal with the specified
- * name like the get(String) method does, but will return UNKNOWN instead
- * of null if the name is not recognized.
- * <!-- begin-user-doc -->
- * @param name
- * @return the JSFVersion
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public static JSFVersion getJSFVersion(String name) {
- JSFVersion version = get(name);
- if (version == null) {
- version = UNKNOWN_LITERAL;
- }
- return version;
- }
-
-} //JSFVersion
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/PluginProvidedJSFLibrary.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/PluginProvidedJSFLibrary.java
deleted file mode 100644
index 89722da..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/PluginProvidedJSFLibrary.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.jsflibraryregistry;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Plugin Provided JSF Library</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.PluginProvidedJSFLibrary#getPluginID <em>Plugin ID</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.PluginProvidedJSFLibrary#getLabel <em>Label</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryPackage#getPluginProvidedJSFLibrary()
- * @model
- * @generated
- */
-public interface PluginProvidedJSFLibrary extends JSFLibrary{
- /**
- * Separator between plugin id and JSF Library name
- */
- public static final String ID_SEPARATOR = "$$";
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String copyright = "Copyright (c) 2005 Oracle Corporation";
-
- /**
- * Returns the value of the '<em><b>Plugin ID</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Plugin ID</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Plugin ID</em>' attribute.
- * @see #setPluginID(String)
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryPackage#getPluginProvidedJSFLibrary_PluginID()
- * @model required="true"
- * @generated
- */
- String getPluginID();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.PluginProvidedJSFLibrary#getPluginID <em>Plugin ID</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Plugin ID</em>' attribute.
- * @see #getPluginID()
- * @generated
- */
- void setPluginID(String value);
-
- /**
- * Returns the value of the '<em><b>Label</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Label</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Label</em>' attribute.
- * @see #setLabel(String)
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryPackage#getPluginProvidedJSFLibrary_Label()
- * @model required="true"
- * @generated
- */
- String getLabel();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.PluginProvidedJSFLibrary#getLabel <em>Label</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Label</em>' attribute.
- * @see #getLabel()
- * @generated
- */
- void setLabel(String value);
-
-} // PluginProvidedJSFLibrary
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/adapter/MaintainDefaultImplementationAdapter.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/adapter/MaintainDefaultImplementationAdapter.java
deleted file mode 100644
index f1c76ad..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/adapter/MaintainDefaultImplementationAdapter.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.jsflibraryregistry.adapter;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jst.jsf.core.internal.jsflibraryconfig.JSFLibraryRegistryUtil;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistry;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryPackage;
-
-/**
- * EMF adapter that attempts to always maintain a default implementation
- * JSFLibrary upon addition and removal of JSFLibrary instances and upon
- * changing of a JSFLibrary instance's implementation property.
- *
- * @author Ian Trimble - Oracle
- */
-public class MaintainDefaultImplementationAdapter extends AdapterImpl {
-
- private static MaintainDefaultImplementationAdapter INSTANCE =
- new MaintainDefaultImplementationAdapter();
-
- /**
- * Gets the single instance of this adapter.
- *
- * @return The single instance of this adapter.
- */
- public static MaintainDefaultImplementationAdapter getInstance() {
- return INSTANCE;
- }
-
- /**
- * Called to notify this adapter that a change has occured.
- *
- * @param notification EMF Notification instance
- */
- public void notifyChanged(Notification notification) {
- Object objNotifier = notification.getNotifier();
- if (objNotifier instanceof JSFLibraryRegistry) {
- int eventType = notification.getEventType();
- switch (eventType) {
- case Notification.ADD:
- Object objNewValue = notification.getNewValue();
- if (objNewValue instanceof JSFLibrary) {
- libraryAdded((JSFLibrary)objNewValue);
- }
- break;
- case Notification.REMOVE:
- Object objOldValue = notification.getOldValue();
- if (objOldValue instanceof JSFLibrary) {
- libraryRemoved((JSFLibrary)objOldValue);
- }
- break;
- }
- } else if (objNotifier instanceof JSFLibrary) {
- if (notification.getFeatureID(JSFLibrary.class) == JSFLibraryRegistryPackage.JSF_LIBRARY__IMPLEMENTATION) {
- implementationFlagSet((JSFLibrary)objNotifier);
- }
- }
- }
-
- /**
- * Checks if the library added is an implementation and, if so, makes it
- * the default implementation if it is the only implementation.
- *
- * @param library JSFLibrary instance
- */
- protected void libraryAdded(JSFLibrary library) {
- if (library != null && library.isImplementation()) {
- JSFLibraryRegistry jsfLibReg = JSFLibraryRegistryUtil.getInstance().getJSFLibraryRegistry();
- EList impls = jsfLibReg.getImplJSFLibraries();
- if (impls.size() == 1) {
- jsfLibReg.setDefaultImplementation(library);
- }
- }
- }
-
- /**
- * Checks if the library removed is the default implementation and, if so,
- * makes the first remaining implementation the new default or nulls out
- * the default implementation if no other implementation remains.
- *
- * @param library JSFLibrary instance
- */
- protected void libraryRemoved(JSFLibrary library) {
- if (library != null && library.isImplementation()) {
- JSFLibraryRegistry jsfLibReg = JSFLibraryRegistryUtil.getInstance().getJSFLibraryRegistry();
- JSFLibrary defaultImpl = jsfLibReg.getDefaultImplementation();
- if (defaultImpl == null || library.getID().equals(defaultImpl.getID())) {
- setNewDefaultImplementation();
- }
- }
- }
-
- /**
- * Checks if the implementation flag of the JSFLibrary has been changed
- * such that it is now eligible to become the default implementation or
- * such that it is no longer eligible as the default implementation and
- * sets the default implementation appropriately. Note that the passed
- * JSFLibrary instance must have been added to the model before calling
- * this method for it to have any effect.
- *
- * @param library JSFLibrary instance
- */
- private void implementationFlagSet(JSFLibrary library) {
- JSFLibraryRegistry jsfLibReg = JSFLibraryRegistryUtil.getInstance().getJSFLibraryRegistry();
- if (jsfLibReg != null) {
- JSFLibrary defaultImpl = jsfLibReg.getDefaultImplementation();
- if (
- library.isImplementation() &&
- defaultImpl == null
- ) {
- jsfLibReg.setDefaultImplementation(library);
- } else if (
- !library.isImplementation() &&
- (defaultImpl != null && library.getID().equals(defaultImpl.getID())))
- {
- setNewDefaultImplementation();
- }
- }
- }
-
- /**
- * Sets the first available JSFLibrary marked as an implementation as the
- * default implementation or sets the default implementation to null if no
- * JSFLibrary is marked as an implementation.
- */
- protected void setNewDefaultImplementation() {
- JSFLibraryRegistry jsfLibReg = JSFLibraryRegistryUtil.getInstance().getJSFLibraryRegistry();
- EList impls = jsfLibReg.getImplJSFLibraries();
- if (impls.size() > 0) {
- jsfLibReg.setDefaultImplementation((JSFLibrary)impls.get(0));
- } else {
- jsfLibReg.setDefaultImplementation(null);
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/impl/ArchiveFileImpl.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/impl/ArchiveFileImpl.java
deleted file mode 100644
index 6242abe..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/impl/ArchiveFileImpl.java
+++ /dev/null
@@ -1,705 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.URL;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.core.internal.Messages;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryPackage;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.PluginProvidedJSFLibrary;
-import org.eclipse.osgi.util.NLS;
-import org.osgi.framework.Bundle;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Archive File</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.ArchiveFileImpl#isRelativeToWorkspace <em>Relative To Workspace</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.ArchiveFileImpl#getSourceLocation <em>Source Location</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.ArchiveFileImpl#getRelativeDestLocation <em>Relative Dest Location</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.ArchiveFileImpl#getJSFLibrary <em>JSF Library</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class ArchiveFileImpl extends EObjectImpl implements ArchiveFile {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2005 Oracle Corporation";
-
- /**
- * The default value of the '{@link #isRelativeToWorkspace() <em>Relative To Workspace</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isRelativeToWorkspace()
- * @generated
- * @ordered
- */
- protected static final boolean RELATIVE_TO_WORKSPACE_EDEFAULT = true;
-
- /**
- * The cached value of the '{@link #isRelativeToWorkspace() <em>Relative To Workspace</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isRelativeToWorkspace()
- * @generated
- * @ordered
- */
- protected boolean relativeToWorkspace = RELATIVE_TO_WORKSPACE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getSourceLocation() <em>Source Location</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSourceLocation()
- * @generated
- * @ordered
- */
- protected static final String SOURCE_LOCATION_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getSourceLocation() <em>Source Location</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSourceLocation()
- * @generated
- * @ordered
- */
- protected String sourceLocation = SOURCE_LOCATION_EDEFAULT;
-
- /**
- * The default value of the '{@link #getRelativeDestLocation() <em>Relative Dest Location</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRelativeDestLocation()
- * @generated
- * @ordered
- */
- protected static final String RELATIVE_DEST_LOCATION_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getRelativeDestLocation() <em>Relative Dest Location</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRelativeDestLocation()
- * @generated
- * @ordered
- */
- protected String relativeDestLocation = RELATIVE_DEST_LOCATION_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected ArchiveFileImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the static eClass
- * <!-- end-user-doc -->
- * @generated
- */
- protected EClass eStaticClass() {
- return JSFLibraryRegistryPackage.Literals.ARCHIVE_FILE;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the source location
- * <!-- end-user-doc -->
- * @generated
- */
- public String getSourceLocation() {
- return sourceLocation;
- }
-
- /**
- * <!-- begin-user-doc -->
- * Enhanced to not only set the location but also to attempt to determine
- * if the location passed is relative to the current workspace. If so, only
- * the relative location is stored. If not, the full location as passed is
- * stored and the relativeToWorkspace property is set to false. To override
- * this behaviour and set the absolute location as passed regardless, call
- * setRelativeToWorkspace(false) BEFORE calling this method.
- *
- * @param newSourceLocation
- *
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public void setSourceLocation(String newSourceLocation) {
- String oldSourceLocation = sourceLocation;
- if (relativeToWorkspace) {
- IWorkspaceRoot workspaceRoot = getWorkspaceRoot();
- if (workspaceRoot != null) {
- IPath wsRootPath = workspaceRoot.getLocation();
- IPath srcPath = new Path(newSourceLocation);
- if (workspaceRoot.findMember(srcPath) != null) {
- sourceLocation = newSourceLocation;
- } else if (wsRootPath.isPrefixOf(srcPath)) {
- int segmentsMatched = wsRootPath.matchingFirstSegments(srcPath);
- srcPath = srcPath.removeFirstSegments(segmentsMatched).setDevice(null);
- sourceLocation = srcPath.toOSString();
- } else {
- sourceLocation = newSourceLocation;
- relativeToWorkspace = false;
- }
- }
- } else {
- sourceLocation = newSourceLocation;
- }
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, JSFLibraryRegistryPackage.ARCHIVE_FILE__SOURCE_LOCATION, oldSourceLocation, sourceLocation));
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return true if file is relative to workspace
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean isRelativeToWorkspace() {
- return relativeToWorkspace;
- }
-
- /**
- * <!-- begin-user-doc -->
- * To override workspace-relative recognition behaviour, be sure to call
- * this method with a false value BEFORE calling setLocation(String).
- * @param newRelativeToWorkspace
- * <!-- end-user-doc -->
- * @generated
- */
- public void setRelativeToWorkspace(boolean newRelativeToWorkspace) {
- boolean oldRelativeToWorkspace = relativeToWorkspace;
- relativeToWorkspace = newRelativeToWorkspace;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, JSFLibraryRegistryPackage.ARCHIVE_FILE__RELATIVE_TO_WORKSPACE, oldRelativeToWorkspace, relativeToWorkspace));
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the relative destination location
- * <!-- end-user-doc -->
- * @generated
- */
- public String getRelativeDestLocation() {
- return relativeDestLocation;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @param newRelativeDestLocation
- * <!-- end-user-doc -->
- * @generated
- */
- public void setRelativeDestLocation(String newRelativeDestLocation) {
- String oldRelativeDestLocation = relativeDestLocation;
- relativeDestLocation = newRelativeDestLocation;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, JSFLibraryRegistryPackage.ARCHIVE_FILE__RELATIVE_DEST_LOCATION, oldRelativeDestLocation, relativeDestLocation));
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the jsf library instance
- * <!-- end-user-doc -->
- * @generated
- */
- public JSFLibrary getJSFLibrary() {
- if (eContainerFeatureID != JSFLibraryRegistryPackage.ARCHIVE_FILE__JSF_LIBRARY) return null;
- return (JSFLibrary)eContainer();
- }
-
- /**
- * <!-- begin-user-doc -->
- * @param newJSFLibrary
- * @param msgs
- * @return NotificationChain
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetJSFLibrary(JSFLibrary newJSFLibrary, NotificationChain msgs) {
- msgs = eBasicSetContainer((InternalEObject)newJSFLibrary, JSFLibraryRegistryPackage.ARCHIVE_FILE__JSF_LIBRARY, msgs);
- return msgs;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @param newJSFLibrary
- * <!-- end-user-doc -->
- * @generated
- */
- public void setJSFLibrary(JSFLibrary newJSFLibrary) {
- if (newJSFLibrary != eInternalContainer() || (eContainerFeatureID != JSFLibraryRegistryPackage.ARCHIVE_FILE__JSF_LIBRARY && newJSFLibrary != null)) {
- if (EcoreUtil.isAncestor(this, newJSFLibrary))
- throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
- NotificationChain msgs = null;
- if (eInternalContainer() != null)
- msgs = eBasicRemoveFromContainer(msgs);
- if (newJSFLibrary != null)
- msgs = ((InternalEObject)newJSFLibrary).eInverseAdd(this, JSFLibraryRegistryPackage.JSF_LIBRARY__ARCHIVE_FILES, JSFLibrary.class, msgs);
- msgs = basicSetJSFLibrary(newJSFLibrary, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, JSFLibraryRegistryPackage.ARCHIVE_FILE__JSF_LIBRARY, newJSFLibrary, newJSFLibrary));
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the path
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public String getPath() {
- String path = null;
- String resolvedSourceLocation = getResolvedSourceLocation();
- if (resolvedSourceLocation != null) {
- int iPos = resolvedSourceLocation.lastIndexOf('/');
- if (iPos < 0) {
- iPos = resolvedSourceLocation.lastIndexOf('\\');
- }
- if (iPos < 1) {
- path = ""; //$NON-NLS-1$
- } else {
- path = resolvedSourceLocation.substring(0, iPos);
- }
- }
- return path;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the name
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public String getName() {
- String name = null;
- String resolvedSourceLocation = getResolvedSourceLocation();
- if (resolvedSourceLocation != null) {
- int iPos = resolvedSourceLocation.lastIndexOf('/');
- if (iPos < 0) {
- iPos = resolvedSourceLocation.lastIndexOf('\\');
- }
- if (iPos < 0 || iPos == resolvedSourceLocation.length() - 1) {
- name = resolvedSourceLocation;
- } else {
- name = resolvedSourceLocation.substring(iPos + 1);
- }
- }
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return true if the archive file exists in the bundle
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public boolean exists() {
- boolean exists = false;
- if (getJSFLibrary() instanceof PluginProvidedJSFLibrary) {
- Bundle bundle = getBundle();
- if (bundle != null) {
- exists = bundle.getEntry(sourceLocation) != null;
- }
- } else {
- String resolvedSourceLocation = getResolvedSourceLocation();
- if (resolvedSourceLocation != null) {
- exists = new File(resolvedSourceLocation).exists();
- }
- }
- return exists;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @param object
- * @return true if equal
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public boolean equals(Object object) {
- boolean equal = false;
- if (object instanceof ArchiveFile) {
- String resolvedSourceLocation = getResolvedSourceLocation();
- String objResolvedSourceLocation = ((ArchiveFile)object).getResolvedSourceLocation();
- if (resolvedSourceLocation == null && objResolvedSourceLocation == null) {
- equal = true;
- } else if (resolvedSourceLocation != null) {
- equal = resolvedSourceLocation.equals(objResolvedSourceLocation);
- }
- }
- return equal;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return a the resolved source location hash or 0 if it is null
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public int hashCode() {
- return getResolvedSourceLocation() != null ? getResolvedSourceLocation().hashCode() : 0;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @param baseDestLocation
- * @return true if the copy is successful
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public boolean copyTo(String baseDestLocation) {
- boolean copied = false;
- InputStream in = null;
- OutputStream out = null;
- IPath outPath = new Path(baseDestLocation);
- if (relativeDestLocation != null) {
- outPath = outPath.append(relativeDestLocation);
- }
- outPath = outPath.append(getName());
- try {
- if (!outPath.toFile().exists()) {
- out = new FileOutputStream(outPath.toOSString());
- } else {
- return copied;
- }
- if (getJSFLibrary() instanceof PluginProvidedJSFLibrary) {
- Bundle bundle = getBundle();
- URL inURL = bundle.getEntry(sourceLocation);
- if (inURL != null) {
- in = inURL.openStream();
- } else {
- JSFCorePlugin.log(
- IStatus.ERROR,
- NLS.bind(Messages.ArchiveFileImpl_CannotLocatePluginRelativeFile,
- sourceLocation));
- return copied;
- }
- } else {
- in = new FileInputStream(getResolvedSourceLocation());
- }
- byte[] buf = new byte[1024];
- int len = 0;
- while ((len = in.read(buf)) > 0) {
- out.write(buf, 0, len);
- }
- copied = true;
- } catch(FileNotFoundException fnfe) {
- JSFCorePlugin.log(IStatus.ERROR, Messages.ArchiveFileImpl_CannotCopyFile, fnfe);
- } catch(IOException ioe) {
- JSFCorePlugin.log(IStatus.ERROR, Messages.ArchiveFileImpl_CannotCopyFile, ioe);
- } finally {
- try {
- if (in != null) {
- in.close();
- }
- if (out != null) {
- out.close();
- }
- } catch(IOException ioe) {
- JSFCorePlugin.log(IStatus.WARNING, Messages.ArchiveFileImpl_CannotCloseFile, ioe);
- }
- }
- return copied;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the resolved source location
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public String getResolvedSourceLocation() {
- String resolvedSourceLocation = null;
- /**
- * The implementation to support PluginProvidedJSFLibrary assume the following.
- * 1. Plugin provided JSF library needs to be distributed as an expanded folder.
- * 2. JARs for plugin provided JSF library need to reside inside the folder mentioned in item 1 above.
- * 3. Each JAR needs to specify a relative path for the folder mentioned in item 1 above.
- *
- * Fix for bug 144954.
- */
- if (getJSFLibrary() instanceof PluginProvidedJSFLibrary) {
- Bundle bundle = getBundle();
- if (bundle != null) {
- //resolvedSourceLocation = appendSeparator(bundleLocation) + sourceLocation;
- try {
- Path srcPath = new Path(sourceLocation);
- URL fileURL = FileLocator.find(bundle, srcPath, null);
- if (fileURL != null){
- URL url = FileLocator.resolve(fileURL);
- resolvedSourceLocation = url.getPath();
- }
- else
- resolvedSourceLocation = sourceLocation;
- } catch (IOException e) {
- resolvedSourceLocation = sourceLocation;
- }
- } else {
- resolvedSourceLocation = sourceLocation;
- }
- } else {
- if (isRelativeToWorkspace()) {
- IWorkspaceRoot workspaceRoot = getWorkspaceRoot();
- if (workspaceRoot != null) {
- String workspaceLocation = workspaceRoot.getLocation().toOSString();
- if (workspaceLocation != null) {
- resolvedSourceLocation = appendSeparator(workspaceLocation) + sourceLocation;
- } else {
- resolvedSourceLocation = sourceLocation;
- }
- } else {
- resolvedSourceLocation = sourceLocation;
- }
- } else {
- resolvedSourceLocation = sourceLocation;
- }
- }
- return resolvedSourceLocation;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case JSFLibraryRegistryPackage.ARCHIVE_FILE__JSF_LIBRARY:
- if (eInternalContainer() != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return basicSetJSFLibrary((JSFLibrary)otherEnd, msgs);
- }
- return super.eInverseAdd(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case JSFLibraryRegistryPackage.ARCHIVE_FILE__JSF_LIBRARY:
- return basicSetJSFLibrary(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * @param msgs
- * @return NotificationChain
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
- switch (eContainerFeatureID) {
- case JSFLibraryRegistryPackage.ARCHIVE_FILE__JSF_LIBRARY:
- return eInternalContainer().eInverseRemove(this, JSFLibraryRegistryPackage.JSF_LIBRARY__ARCHIVE_FILES, JSFLibrary.class, msgs);
- }
- return super.eBasicRemoveFromContainerFeature(msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * @param featureID
- * @param resolve
- * @param coreType
- * @return
- * <!-- end-user-doc -->
- * @generated
- */
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case JSFLibraryRegistryPackage.ARCHIVE_FILE__RELATIVE_TO_WORKSPACE:
- return isRelativeToWorkspace() ? Boolean.TRUE : Boolean.FALSE;
- case JSFLibraryRegistryPackage.ARCHIVE_FILE__SOURCE_LOCATION:
- return getSourceLocation();
- case JSFLibraryRegistryPackage.ARCHIVE_FILE__RELATIVE_DEST_LOCATION:
- return getRelativeDestLocation();
- case JSFLibraryRegistryPackage.ARCHIVE_FILE__JSF_LIBRARY:
- return getJSFLibrary();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * @param featureID
- * @param newValue
- * <!-- end-user-doc -->
- * @generated
- */
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case JSFLibraryRegistryPackage.ARCHIVE_FILE__RELATIVE_TO_WORKSPACE:
- setRelativeToWorkspace(((Boolean)newValue).booleanValue());
- return;
- case JSFLibraryRegistryPackage.ARCHIVE_FILE__SOURCE_LOCATION:
- setSourceLocation((String)newValue);
- return;
- case JSFLibraryRegistryPackage.ARCHIVE_FILE__RELATIVE_DEST_LOCATION:
- setRelativeDestLocation((String)newValue);
- return;
- case JSFLibraryRegistryPackage.ARCHIVE_FILE__JSF_LIBRARY:
- setJSFLibrary((JSFLibrary)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eUnset(int featureID) {
- switch (featureID) {
- case JSFLibraryRegistryPackage.ARCHIVE_FILE__RELATIVE_TO_WORKSPACE:
- setRelativeToWorkspace(RELATIVE_TO_WORKSPACE_EDEFAULT);
- return;
- case JSFLibraryRegistryPackage.ARCHIVE_FILE__SOURCE_LOCATION:
- setSourceLocation(SOURCE_LOCATION_EDEFAULT);
- return;
- case JSFLibraryRegistryPackage.ARCHIVE_FILE__RELATIVE_DEST_LOCATION:
- setRelativeDestLocation(RELATIVE_DEST_LOCATION_EDEFAULT);
- return;
- case JSFLibraryRegistryPackage.ARCHIVE_FILE__JSF_LIBRARY:
- setJSFLibrary((JSFLibrary)null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case JSFLibraryRegistryPackage.ARCHIVE_FILE__RELATIVE_TO_WORKSPACE:
- return relativeToWorkspace != RELATIVE_TO_WORKSPACE_EDEFAULT;
- case JSFLibraryRegistryPackage.ARCHIVE_FILE__SOURCE_LOCATION:
- return SOURCE_LOCATION_EDEFAULT == null ? sourceLocation != null : !SOURCE_LOCATION_EDEFAULT.equals(sourceLocation);
- case JSFLibraryRegistryPackage.ARCHIVE_FILE__RELATIVE_DEST_LOCATION:
- return RELATIVE_DEST_LOCATION_EDEFAULT == null ? relativeDestLocation != null : !RELATIVE_DEST_LOCATION_EDEFAULT.equals(relativeDestLocation);
- case JSFLibraryRegistryPackage.ARCHIVE_FILE__JSF_LIBRARY:
- return getJSFLibrary() != null;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * Gets the Bundle instance by parent PluginProvidedJSFLibrary instance's
- * pluginID property, if and only if the parent JSFLibrary instance IS a
- * PluginProvidedJSFLibrary, else returns null.
- * @return Bundle instance, or null if not located or applicable
- */
- protected Bundle getBundle() {
- Bundle bundle = null;
- if (getJSFLibrary() instanceof PluginProvidedJSFLibrary) {
- String pluginID = ((PluginProvidedJSFLibrary)getJSFLibrary()).getPluginID();
- if (pluginID != null) {
- bundle = Platform.getBundle(pluginID);
- }
- }
- return bundle;
- }
-
- /**
- * Gets the IWorkspaceRoot instance.
- * @return IWorkspaceRoot instance
- */
- protected IWorkspaceRoot getWorkspaceRoot() {
- IWorkspaceRoot workspaceRoot = null;
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- if (workspace != null) {
- workspaceRoot = workspace.getRoot();
- }
- return workspaceRoot;
- }
-
- /**
- * @param path
- * @return the the path string with invalid path separators correctly fixed
- */
- protected String appendSeparator(String path) {
- String newPath = null;
- if (!path.endsWith("\\") && !path.endsWith("/")) { //$NON-NLS-1$ //$NON-NLS-2$
- newPath = path + System.getProperty("file.separator"); //$NON-NLS-1$
- } else {
- newPath = path;
- }
- return newPath;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the string representation of this archive file
- * <!-- end-user-doc -->
- * @generated
- */
- public String toString() {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (RelativeToWorkspace: ");
- result.append(relativeToWorkspace);
- result.append(", SourceLocation: ");
- result.append(sourceLocation);
- result.append(", RelativeDestLocation: ");
- result.append(relativeDestLocation);
- result.append(')');
- return result.toString();
- }
-
-} //ArchiveFileImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/impl/JSFLibraryImpl.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/impl/JSFLibraryImpl.java
deleted file mode 100644
index 2187da7..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/impl/JSFLibraryImpl.java
+++ /dev/null
@@ -1,557 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryFactory;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryPackage;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFVersion;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.adapter.MaintainDefaultImplementationAdapter;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>JSF Library</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryImpl#getID <em>ID</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryImpl#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryImpl#getJSFVersion <em>JSF Version</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryImpl#isDeployed <em>Deployed</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryImpl#isImplementation <em>Implementation</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryImpl#getArchiveFiles <em>Archive Files</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class JSFLibraryImpl extends EObjectImpl implements JSFLibrary {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2005 Oracle Corporation";
-
- /**
- * The default value of the '{@link #getID() <em>ID</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getID()
- * @generated
- * @ordered
- */
- protected static final String ID_EDEFAULT = "";
-
- /**
- * The cached value of the '{@link #getID() <em>ID</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getID()
- * @generated
- * @ordered
- */
- protected String id = ID_EDEFAULT;
-
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * The default value of the '{@link #getJSFVersion() <em>JSF Version</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJSFVersion()
- * @generated
- * @ordered
- */
- protected static final JSFVersion JSF_VERSION_EDEFAULT = JSFVersion.UNKNOWN_LITERAL;
-
- /**
- * The cached value of the '{@link #getJSFVersion() <em>JSF Version</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJSFVersion()
- * @generated
- * @ordered
- */
- protected JSFVersion jsfVersion = JSF_VERSION_EDEFAULT;
-
- /**
- * The default value of the '{@link #isDeployed() <em>Deployed</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isDeployed()
- * @generated
- * @ordered
- */
- protected static final boolean DEPLOYED_EDEFAULT = true;
-
- /**
- * The cached value of the '{@link #isDeployed() <em>Deployed</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isDeployed()
- * @generated
- * @ordered
- */
- protected boolean deployed = DEPLOYED_EDEFAULT;
-
- /**
- * The default value of the '{@link #isImplementation() <em>Implementation</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isImplementation()
- * @generated
- * @ordered
- */
- protected static final boolean IMPLEMENTATION_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isImplementation() <em>Implementation</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isImplementation()
- * @generated
- * @ordered
- */
- protected boolean implementation = IMPLEMENTATION_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getArchiveFiles() <em>Archive Files</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getArchiveFiles()
- * @generated
- * @ordered
- */
- protected EList archiveFiles;
-
- /**
- * <!-- begin-user-doc -->
- * Enhanced to not only create an instance but also to set an initial ID
- * (which can be reset later) and to add the
- * MaintainDefaultImplementationAdapter to the list of adapters.
- * <!-- end-user-doc -->
- * @generated NOT
- */
- protected JSFLibraryImpl() {
- super();
-// //set initial ID; will be overwritten from XML if already persisted
-// setID(String.valueOf(System.currentTimeMillis()));
- //add adapter to maintain a default implementation
- eAdapters().add(MaintainDefaultImplementationAdapter.getInstance());
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the static eClass
- * <!-- end-user-doc -->
- * @generated
- */
- protected EClass eStaticClass() {
- return JSFLibraryRegistryPackage.Literals.JSF_LIBRARY;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public String getID() {
- return getName();
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the name
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName() {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @param newName
- * <!-- end-user-doc -->
- * @generated
- */
- public void setName(String newName) {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, JSFLibraryRegistryPackage.JSF_LIBRARY__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the jsf version
- * <!-- end-user-doc -->
- * @generated
- */
- public JSFVersion getJSFVersion() {
- return jsfVersion;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @param newJSFVersion
- * <!-- end-user-doc -->
- * @generated
- */
- public void setJSFVersion(JSFVersion newJSFVersion) {
- JSFVersion oldJSFVersion = jsfVersion;
- jsfVersion = newJSFVersion == null ? JSF_VERSION_EDEFAULT : newJSFVersion;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, JSFLibraryRegistryPackage.JSF_LIBRARY__JSF_VERSION, oldJSFVersion, jsfVersion));
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return true if library is to be deployed
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean isDeployed() {
- return deployed;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @param newDeployed
- * <!-- end-user-doc -->
- * @generated
- */
- public void setDeployed(boolean newDeployed) {
- boolean oldDeployed = deployed;
- deployed = newDeployed;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, JSFLibraryRegistryPackage.JSF_LIBRARY__DEPLOYED, oldDeployed, deployed));
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return true if implementation
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean isImplementation() {
- return implementation;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @param newImplementation
- * <!-- end-user-doc -->
- * @generated
- */
- public void setImplementation(boolean newImplementation) {
- boolean oldImplementation = implementation;
- implementation = newImplementation;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, JSFLibraryRegistryPackage.JSF_LIBRARY__IMPLEMENTATION, oldImplementation, implementation));
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the list of archive files
- * <!-- end-user-doc -->
- * @generated
- */
- public EList getArchiveFiles() {
- if (archiveFiles == null) {
- archiveFiles = new EObjectContainmentWithInverseEList(ArchiveFile.class, this, JSFLibraryRegistryPackage.JSF_LIBRARY__ARCHIVE_FILES, JSFLibraryRegistryPackage.ARCHIVE_FILE__JSF_LIBRARY);
- }
- return archiveFiles;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @param fullPath
- * @return the true if the fullPath contains an archive file
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public boolean containsArchiveFile(String fullPath) {
- boolean contains = false;
- if (fullPath != null) {
- Iterator itArchiveFiles = getArchiveFiles().iterator();
- while (itArchiveFiles.hasNext()) {
- ArchiveFile archiveFile = (ArchiveFile)itArchiveFiles.next();
- if (fullPath.equals(archiveFile.getResolvedSourceLocation())) {
- contains = true;
- break;
- }
- }
- }
- return contains;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the working copy
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public JSFLibrary getWorkingCopy() {
- JSFLibrary workingCopyLib = JSFLibraryRegistryFactory.eINSTANCE.createJSFLibrary();
-// workingCopyLib.setID(getID());
- workingCopyLib.setName(getName());
- workingCopyLib.setJSFVersion(getJSFVersion());
- workingCopyLib.setDeployed(isDeployed());
- workingCopyLib.setImplementation(isImplementation());
- Iterator itArchiveFiles = getArchiveFiles().iterator();
- while (itArchiveFiles.hasNext()) {
- ArchiveFile srcArchiveFile = (ArchiveFile)itArchiveFiles.next();
- ArchiveFile destArchiveFile = JSFLibraryRegistryFactory.eINSTANCE.createArchiveFile();
- destArchiveFile.setRelativeToWorkspace(srcArchiveFile.isRelativeToWorkspace());
- destArchiveFile.setSourceLocation(srcArchiveFile.getSourceLocation());
- destArchiveFile.setRelativeDestLocation(srcArchiveFile.getRelativeDestLocation());
- workingCopyLib.getArchiveFiles().add(destArchiveFile);
- }
- return workingCopyLib;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @param otherLibrary
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public void updateValues(JSFLibrary otherLibrary) {
- if (otherLibrary != null) {
-// setID(otherLibrary.getID());
- setName(otherLibrary.getName());
- setJSFVersion(otherLibrary.getJSFVersion());
- setDeployed(otherLibrary.isDeployed());
- setImplementation(otherLibrary.isImplementation());
- Iterator itArchiveFiles = otherLibrary.getArchiveFiles().iterator();
- getArchiveFiles().clear();
- while (itArchiveFiles.hasNext()) {
- ArchiveFile srcArchiveFile = (ArchiveFile)itArchiveFiles.next();
- ArchiveFile destArchiveFile = JSFLibraryRegistryFactory.eINSTANCE.createArchiveFile();
- destArchiveFile.setRelativeToWorkspace(srcArchiveFile.isRelativeToWorkspace());
- destArchiveFile.setSourceLocation(srcArchiveFile.getSourceLocation());
- destArchiveFile.setRelativeDestLocation(srcArchiveFile.getRelativeDestLocation());
- getArchiveFiles().add(destArchiveFile);
- }
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * @param baseDestLocation
- * @return the base destination location
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public boolean copyTo(String baseDestLocation) {
- boolean allCopied = true;
- Iterator itFiles = getArchiveFiles().iterator();
- while (itFiles.hasNext()) {
- ArchiveFile archiveFile = (ArchiveFile)itFiles.next();
- boolean copied = archiveFile.copyTo(baseDestLocation);
- allCopied = allCopied && copied;
- }
- return allCopied;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public String getLabel() {
- return getName();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case JSFLibraryRegistryPackage.JSF_LIBRARY__ARCHIVE_FILES:
- return ((InternalEList)getArchiveFiles()).basicAdd(otherEnd, msgs);
- }
- return super.eInverseAdd(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case JSFLibraryRegistryPackage.JSF_LIBRARY__ARCHIVE_FILES:
- return ((InternalEList)getArchiveFiles()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case JSFLibraryRegistryPackage.JSF_LIBRARY__ID:
- return getID();
- case JSFLibraryRegistryPackage.JSF_LIBRARY__NAME:
- return getName();
- case JSFLibraryRegistryPackage.JSF_LIBRARY__JSF_VERSION:
- return getJSFVersion();
- case JSFLibraryRegistryPackage.JSF_LIBRARY__DEPLOYED:
- return isDeployed() ? Boolean.TRUE : Boolean.FALSE;
- case JSFLibraryRegistryPackage.JSF_LIBRARY__IMPLEMENTATION:
- return isImplementation() ? Boolean.TRUE : Boolean.FALSE;
- case JSFLibraryRegistryPackage.JSF_LIBRARY__ARCHIVE_FILES:
- return getArchiveFiles();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case JSFLibraryRegistryPackage.JSF_LIBRARY__NAME:
- setName((String)newValue);
- return;
- case JSFLibraryRegistryPackage.JSF_LIBRARY__JSF_VERSION:
- setJSFVersion((JSFVersion)newValue);
- return;
- case JSFLibraryRegistryPackage.JSF_LIBRARY__DEPLOYED:
- setDeployed(((Boolean)newValue).booleanValue());
- return;
- case JSFLibraryRegistryPackage.JSF_LIBRARY__IMPLEMENTATION:
- setImplementation(((Boolean)newValue).booleanValue());
- return;
- case JSFLibraryRegistryPackage.JSF_LIBRARY__ARCHIVE_FILES:
- getArchiveFiles().clear();
- getArchiveFiles().addAll((Collection)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eUnset(int featureID) {
- switch (featureID) {
- case JSFLibraryRegistryPackage.JSF_LIBRARY__NAME:
- setName(NAME_EDEFAULT);
- return;
- case JSFLibraryRegistryPackage.JSF_LIBRARY__JSF_VERSION:
- setJSFVersion(JSF_VERSION_EDEFAULT);
- return;
- case JSFLibraryRegistryPackage.JSF_LIBRARY__DEPLOYED:
- setDeployed(DEPLOYED_EDEFAULT);
- return;
- case JSFLibraryRegistryPackage.JSF_LIBRARY__IMPLEMENTATION:
- setImplementation(IMPLEMENTATION_EDEFAULT);
- return;
- case JSFLibraryRegistryPackage.JSF_LIBRARY__ARCHIVE_FILES:
- getArchiveFiles().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case JSFLibraryRegistryPackage.JSF_LIBRARY__ID:
- return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
- case JSFLibraryRegistryPackage.JSF_LIBRARY__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case JSFLibraryRegistryPackage.JSF_LIBRARY__JSF_VERSION:
- return jsfVersion != JSF_VERSION_EDEFAULT;
- case JSFLibraryRegistryPackage.JSF_LIBRARY__DEPLOYED:
- return deployed != DEPLOYED_EDEFAULT;
- case JSFLibraryRegistryPackage.JSF_LIBRARY__IMPLEMENTATION:
- return implementation != IMPLEMENTATION_EDEFAULT;
- case JSFLibraryRegistryPackage.JSF_LIBRARY__ARCHIVE_FILES:
- return archiveFiles != null && !archiveFiles.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the string representation
- * <!-- end-user-doc -->
- * @generated
- */
- public String toString() {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (ID: ");
- result.append(id);
- result.append(", Name: ");
- result.append(name);
- result.append(", JSFVersion: ");
- result.append(jsfVersion);
- result.append(", Deployed: ");
- result.append(deployed);
- result.append(", Implementation: ");
- result.append(implementation);
- result.append(')');
- return result.toString();
- }
-
-} //JSFLibraryImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/impl/JSFLibraryRegistryFactoryImpl.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/impl/JSFLibraryRegistryFactoryImpl.java
deleted file mode 100644
index 0b4846a..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/impl/JSFLibraryRegistryFactoryImpl.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.impl.EFactoryImpl;
-import org.eclipse.emf.ecore.plugin.EcorePlugin;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistry;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryFactory;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryPackage;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFVersion;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.PluginProvidedJSFLibrary;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model <b>Factory</b>.
- * <!-- end-user-doc -->
- * @generated
- */
-public class JSFLibraryRegistryFactoryImpl extends EFactoryImpl implements JSFLibraryRegistryFactory {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2005 Oracle Corporation";
-
- /**
- * Creates the default factory implementation.
- * <!-- begin-user-doc -->
- * @return the initialized factory
- * <!-- end-user-doc -->
- * @generated
- */
- public static JSFLibraryRegistryFactory init() {
- try {
- JSFLibraryRegistryFactory theJSFLibraryRegistryFactory = (JSFLibraryRegistryFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.eclipse.org/webtools/jsf/schema/jsflibraryregistry.xsd");
- if (theJSFLibraryRegistryFactory != null) {
- return theJSFLibraryRegistryFactory;
- }
- }
- catch (Exception exception) {
- EcorePlugin.INSTANCE.log(exception);
- }
- return new JSFLibraryRegistryFactoryImpl();
- }
-
- /**
- * Creates an instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public JSFLibraryRegistryFactoryImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * @param eClass
- * @return the static eclass
- * <!-- end-user-doc -->
- * @generated
- */
- public EObject create(EClass eClass) {
- switch (eClass.getClassifierID()) {
- case JSFLibraryRegistryPackage.JSF_LIBRARY_REGISTRY: return createJSFLibraryRegistry();
- case JSFLibraryRegistryPackage.JSF_LIBRARY: return createJSFLibrary();
- case JSFLibraryRegistryPackage.PLUGIN_PROVIDED_JSF_LIBRARY: return createPluginProvidedJSFLibrary();
- case JSFLibraryRegistryPackage.ARCHIVE_FILE: return createArchiveFile();
- default:
- throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * @param eDataType
- * @param initialValue
- * @return an instance of eDataType for initialValue
- * <!-- end-user-doc -->
- * @generated
- */
- public Object createFromString(EDataType eDataType, String initialValue) {
- switch (eDataType.getClassifierID()) {
- case JSFLibraryRegistryPackage.JSF_VERSION:
- return createJSFVersionFromString(eDataType, initialValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * @param eDataType
- * @param instanceValue
- * @return the string created from instanceValue from eDataType
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertToString(EDataType eDataType, Object instanceValue) {
- switch (eDataType.getClassifierID()) {
- case JSFLibraryRegistryPackage.JSF_VERSION:
- return convertJSFVersionToString(eDataType, instanceValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the jsf library registry
- * <!-- end-user-doc -->
- * @generated
- */
- public JSFLibraryRegistry createJSFLibraryRegistry() {
- JSFLibraryRegistryImpl jsfLibraryRegistry = new JSFLibraryRegistryImpl();
- return jsfLibraryRegistry;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the jsf library
- * <!-- end-user-doc -->
- * @generated
- */
- public JSFLibrary createJSFLibrary() {
- JSFLibraryImpl jsfLibrary = new JSFLibraryImpl();
- return jsfLibrary;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the archive file
- * <!-- end-user-doc -->
- * @generated
- */
- public ArchiveFile createArchiveFile() {
- ArchiveFileImpl archiveFile = new ArchiveFileImpl();
- return archiveFile;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the plugin provided JSF library
- * <!-- end-user-doc -->
- * @generated
- */
- public PluginProvidedJSFLibrary createPluginProvidedJSFLibrary() {
- PluginProvidedJSFLibraryImpl pluginProvidedJSFLibrary = new PluginProvidedJSFLibraryImpl();
- return pluginProvidedJSFLibrary;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @param eDataType
- * @param initialValue
- * @return the jsfVersion the dataType
- * <!-- end-user-doc -->
- * @generated
- */
- public JSFVersion createJSFVersionFromString(EDataType eDataType, String initialValue) {
- JSFVersion result = JSFVersion.get(initialValue);
- if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @param eDataType
- * @param instanceValue
- * @return the string version of the data type
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertJSFVersionToString(EDataType eDataType, Object instanceValue) {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the registry package
- * <!-- end-user-doc -->
- * @generated
- */
- public JSFLibraryRegistryPackage getJSFLibraryRegistryPackage() {
- return (JSFLibraryRegistryPackage)getEPackage();
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the package
- * <!-- end-user-doc -->
- * @deprecated
- * @generated
- */
- public static JSFLibraryRegistryPackage getPackage() {
- return JSFLibraryRegistryPackage.eINSTANCE;
- }
-
-} //JSFLibraryRegistryFactoryImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/impl/JSFLibraryRegistryImpl.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/impl/JSFLibraryRegistryImpl.java
deleted file mode 100644
index 6d2964f..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/impl/JSFLibraryRegistryImpl.java
+++ /dev/null
@@ -1,433 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.BasicEList;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistry;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryPackage;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.PluginProvidedJSFLibrary;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>JSF Library Registry</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryRegistryImpl#getDefaultImplementationID <em>Default Implementation ID</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryRegistryImpl#getJSFLibraries <em>JSF Libraries</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryRegistryImpl#getPluginProvidedJSFLibraries <em>Plugin Provided JSF Libraries</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class JSFLibraryRegistryImpl extends EObjectImpl implements JSFLibraryRegistry {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2005 Oracle Corporation";
-
- /**
- * The default value of the '{@link #getDefaultImplementationID() <em>Default Implementation ID</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDefaultImplementationID()
- * @generated
- * @ordered
- */
- protected static final String DEFAULT_IMPLEMENTATION_ID_EDEFAULT = "";
-
- /**
- * The cached value of the '{@link #getDefaultImplementationID() <em>Default Implementation ID</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDefaultImplementationID()
- * @generated
- * @ordered
- */
- protected String defaultImplementationID = DEFAULT_IMPLEMENTATION_ID_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getJSFLibraries() <em>JSF Libraries</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJSFLibraries()
- * @generated
- * @ordered
- */
- protected EList jsfLibraries;
-
- /**
- * The cached value of the '{@link #getPluginProvidedJSFLibraries() <em>Plugin Provided JSF Libraries</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPluginProvidedJSFLibraries()
- * @generated
- * @ordered
- */
- protected EList pluginProvidedJSFLibraries;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected JSFLibraryRegistryImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the static eClass
- * <!-- end-user-doc -->
- * @generated
- */
- protected EClass eStaticClass() {
- return JSFLibraryRegistryPackage.Literals.JSF_LIBRARY_REGISTRY;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the default implementation id
- * <!-- end-user-doc -->
- * @generated
- */
- public String getDefaultImplementationID() {
- return defaultImplementationID;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @param newDefaultImplementationID
- * <!-- end-user-doc -->
- * @generated
- */
- public void setDefaultImplementationID(String newDefaultImplementationID) {
- String oldDefaultImplementationID = defaultImplementationID;
- defaultImplementationID = newDefaultImplementationID;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, JSFLibraryRegistryPackage.JSF_LIBRARY_REGISTRY__DEFAULT_IMPLEMENTATION_ID, oldDefaultImplementationID, defaultImplementationID));
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the list of jsf libraries
- * <!-- end-user-doc -->
- * @generated
- */
- public EList getJSFLibraries() {
- if (jsfLibraries == null) {
- jsfLibraries = new EObjectContainmentEList(JSFLibrary.class, this, JSFLibraryRegistryPackage.JSF_LIBRARY_REGISTRY__JSF_LIBRARIES);
- }
- return jsfLibraries;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the list of plugin provided JSF libraries
- * <!-- end-user-doc -->
- * @generated
- */
- public EList getPluginProvidedJSFLibraries() {
- if (pluginProvidedJSFLibraries == null) {
- pluginProvidedJSFLibraries = new EObjectContainmentEList(PluginProvidedJSFLibrary.class, this, JSFLibraryRegistryPackage.JSF_LIBRARY_REGISTRY__PLUGIN_PROVIDED_JSF_LIBRARIES);
- }
- return pluginProvidedJSFLibraries;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the default implemention JSF library
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public JSFLibrary getDefaultImplementation() {
- return getJSFLibraryByID(getDefaultImplementationID());
- }
-
- /**
- * <!-- begin-user-doc -->
- * @param implementation
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public void setDefaultImplementation(JSFLibrary implementation) {
- if (implementation != null) {
- setDefaultImplementationID(implementation.getID());
- } else {
- setDefaultImplementationID(null);
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case JSFLibraryRegistryPackage.JSF_LIBRARY_REGISTRY__JSF_LIBRARIES:
- return ((InternalEList)getJSFLibraries()).basicRemove(otherEnd, msgs);
- case JSFLibraryRegistryPackage.JSF_LIBRARY_REGISTRY__PLUGIN_PROVIDED_JSF_LIBRARIES:
- return ((InternalEList)getPluginProvidedJSFLibraries()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case JSFLibraryRegistryPackage.JSF_LIBRARY_REGISTRY__DEFAULT_IMPLEMENTATION_ID:
- return getDefaultImplementationID();
- case JSFLibraryRegistryPackage.JSF_LIBRARY_REGISTRY__JSF_LIBRARIES:
- return getJSFLibraries();
- case JSFLibraryRegistryPackage.JSF_LIBRARY_REGISTRY__PLUGIN_PROVIDED_JSF_LIBRARIES:
- return getPluginProvidedJSFLibraries();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case JSFLibraryRegistryPackage.JSF_LIBRARY_REGISTRY__DEFAULT_IMPLEMENTATION_ID:
- setDefaultImplementationID((String)newValue);
- return;
- case JSFLibraryRegistryPackage.JSF_LIBRARY_REGISTRY__JSF_LIBRARIES:
- getJSFLibraries().clear();
- getJSFLibraries().addAll((Collection)newValue);
- return;
- case JSFLibraryRegistryPackage.JSF_LIBRARY_REGISTRY__PLUGIN_PROVIDED_JSF_LIBRARIES:
- getPluginProvidedJSFLibraries().clear();
- getPluginProvidedJSFLibraries().addAll((Collection)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eUnset(int featureID) {
- switch (featureID) {
- case JSFLibraryRegistryPackage.JSF_LIBRARY_REGISTRY__DEFAULT_IMPLEMENTATION_ID:
- setDefaultImplementationID(DEFAULT_IMPLEMENTATION_ID_EDEFAULT);
- return;
- case JSFLibraryRegistryPackage.JSF_LIBRARY_REGISTRY__JSF_LIBRARIES:
- getJSFLibraries().clear();
- return;
- case JSFLibraryRegistryPackage.JSF_LIBRARY_REGISTRY__PLUGIN_PROVIDED_JSF_LIBRARIES:
- getPluginProvidedJSFLibraries().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case JSFLibraryRegistryPackage.JSF_LIBRARY_REGISTRY__DEFAULT_IMPLEMENTATION_ID:
- return DEFAULT_IMPLEMENTATION_ID_EDEFAULT == null ? defaultImplementationID != null : !DEFAULT_IMPLEMENTATION_ID_EDEFAULT.equals(defaultImplementationID);
- case JSFLibraryRegistryPackage.JSF_LIBRARY_REGISTRY__JSF_LIBRARIES:
- return jsfLibraries != null && !jsfLibraries.isEmpty();
- case JSFLibraryRegistryPackage.JSF_LIBRARY_REGISTRY__PLUGIN_PROVIDED_JSF_LIBRARIES:
- return pluginProvidedJSFLibraries != null && !pluginProvidedJSFLibraries.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * @param ID
- * @return the jsf library of ID or null if none
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public JSFLibrary getJSFLibraryByID(String ID) {
- JSFLibrary library = null;
- if (ID != null) {
- Iterator itLibs = getAllJSFLibraries().iterator();
- while (itLibs.hasNext()) {
- JSFLibrary curLib = (JSFLibrary)itLibs.next();
- if (ID.equals(curLib.getID())) {
- library = curLib;
- break;
- }
- }
- }
- return library;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @param name
- * @return the list of libraries named 'name'
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public EList getJSFLibrariesByName(String name) {
- EList libraries = new BasicEList();
- if (name != null) {
- Iterator itLibs = getAllJSFLibraries().iterator();
- while(itLibs.hasNext()) {
- JSFLibrary curLib = (JSFLibrary)itLibs.next();
- if (name.equals(curLib.getName())) {
- libraries.add(curLib);
- }
- }
- }
- return libraries;
- }
-
- /**
- * <!-- begin-user-doc -->
- * This is a convenience method to return an EList of JSFLibrary instances
- * that are marked as JSF implementations; while all instances are valid
- * references, the returned EList should not be used for additions and/or
- * removals of instances (use the EList returned by getJSFLibraries()).
- * @return the list of implemention jsf libraries
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public EList getImplJSFLibraries() {
- EList implementations = new BasicEList();
- Iterator itLibs = getAllJSFLibraries().iterator();
- while (itLibs.hasNext()) {
- JSFLibrary lib = (JSFLibrary)itLibs.next();
- if (lib.isImplementation()) {
- implementations.add(lib);
- }
- }
- return implementations;
- }
-
- /**
- * <!-- begin-user-doc -->
- * This is a convenience method to return an EList of JSFLibrary instances
- * that are not marked as JSF implementations; while all instances are
- * valid references, the returned EList should not be used for additions
- * and/or removals of instances (use the EList returned by
- * getJSFLibraries()).
- * @return the non-implemention JSF libraries
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public EList getNonImplJSFLibraries() {
- EList nonImplementations = new BasicEList();
- Iterator itLibs = getAllJSFLibraries().iterator();
- while (itLibs.hasNext()) {
- JSFLibrary lib = (JSFLibrary)itLibs.next();
- if (!lib.isImplementation()) {
- nonImplementations.add(lib);
- }
- }
- return nonImplementations;
- }
-
- /**
- * <!-- begin-user-doc -->
- * This is a convenience method to return an EList of JSFLibrary instances
- * and PluginProvidedJSFLibrary instances; while all instances are valid
- * references, the returned EList should not be used for additions and/or
- * removals of instances (use the EList returned by getJSFLibraries()).
- * @return all JSF libraries
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public EList getAllJSFLibraries() {
- EList allLibs = new BasicEList();
- allLibs.addAll(getJSFLibraries());
- allLibs.addAll(getPluginProvidedJSFLibraries());
- return allLibs;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @param library
- * @return true if library is successfully added
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public boolean addJSFLibrary(JSFLibrary library) {
- boolean added = false;
- if (library instanceof PluginProvidedJSFLibrary) {
- added = getPluginProvidedJSFLibraries().add(library);
- } else {
- added = getJSFLibraries().add(library);
- }
- return added;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @param library
- * @return true if library is successfully removed
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public boolean removeJSFLibrary(JSFLibrary library) {
- boolean removed = false;
- if (library instanceof PluginProvidedJSFLibrary) {
- removed = getPluginProvidedJSFLibraries().remove(library);
- } else {
- removed = getJSFLibraries().remove(library);
- }
- return removed;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the string representation
- * <!-- end-user-doc -->
- * @generated
- */
- public String toString() {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (DefaultImplementationID: ");
- result.append(defaultImplementationID);
- result.append(')');
- return result.toString();
- }
-
-
-} //JSFLibraryRegistryImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/impl/JSFLibraryRegistryPackageImpl.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/impl/JSFLibraryRegistryPackageImpl.java
deleted file mode 100644
index 0532ca9..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/impl/JSFLibraryRegistryPackageImpl.java
+++ /dev/null
@@ -1,514 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EOperation;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistry;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryFactory;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryPackage;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFVersion;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.PluginProvidedJSFLibrary;
-
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model <b>Package</b>.
- * <!-- end-user-doc -->
- * @generated
- */
-public class JSFLibraryRegistryPackageImpl extends EPackageImpl implements JSFLibraryRegistryPackage {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2005 Oracle Corporation";
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass jsfLibraryRegistryEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass jsfLibraryEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass archiveFileEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass pluginProvidedJSFLibraryEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum jsfVersionEEnum = null;
-
- /**
- * Creates an instance of the model <b>Package</b>, registered with
- * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
- * package URI value.
- * <p>Note: the correct way to create the package is via the static
- * factory method {@link #init init()}, which also performs
- * initialization of the package, or returns the registered package,
- * if one already exists.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.emf.ecore.EPackage.Registry
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryPackage#eNS_URI
- * @see #init()
- * @generated
- */
- private JSFLibraryRegistryPackageImpl() {
- super(eNS_URI, JSFLibraryRegistryFactory.eINSTANCE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static boolean isInited = false;
-
- /**
- * Creates, registers, and initializes the <b>Package</b> for this
- * model, and for any others upon which it depends. Simple
- * dependencies are satisfied by calling this method on all
- * dependent packages before doing anything else. This method drives
- * initialization for interdependent packages directly, in parallel
- * with this package, itself.
- * <p>Of this package and its interdependencies, all packages which
- * have not yet been registered by their URI values are first created
- * and registered. The packages are then initialized in two steps:
- * meta-model objects for all of the packages are created before any
- * are initialized, since one package's meta-model objects may refer to
- * those of another.
- * <p>Invocation of this method will not affect any packages that have
- * already been initialized.
- * <!-- begin-user-doc -->
- * @return the JSF library registry package
- * <!-- end-user-doc -->
- * @see #eNS_URI
- * @see #createPackageContents()
- * @see #initializePackageContents()
- * @generated
- */
- public static JSFLibraryRegistryPackage init() {
- if (isInited) return (JSFLibraryRegistryPackage)EPackage.Registry.INSTANCE.getEPackage(JSFLibraryRegistryPackage.eNS_URI);
-
- // Obtain or create and register package
- JSFLibraryRegistryPackageImpl theJSFLibraryRegistryPackage = (JSFLibraryRegistryPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof JSFLibraryRegistryPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new JSFLibraryRegistryPackageImpl());
-
- isInited = true;
-
- // Create package meta-data objects
- theJSFLibraryRegistryPackage.createPackageContents();
-
- // Initialize created meta-data
- theJSFLibraryRegistryPackage.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- theJSFLibraryRegistryPackage.freeze();
-
- return theJSFLibraryRegistryPackage;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the eclass
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getJSFLibraryRegistry() {
- return jsfLibraryRegistryEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the eattribute
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getJSFLibraryRegistry_DefaultImplementationID() {
- return (EAttribute)jsfLibraryRegistryEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the ereference
- * <!-- end-user-doc -->
- * @generated
- */
- public EReference getJSFLibraryRegistry_JSFLibraries() {
- return (EReference)jsfLibraryRegistryEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the ereference
- * <!-- end-user-doc -->
- * @generated
- */
- public EReference getJSFLibraryRegistry_PluginProvidedJSFLibraries() {
- return (EReference)jsfLibraryRegistryEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the eclass
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getJSFLibrary() {
- return jsfLibraryEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the eattribute
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getJSFLibrary_ID() {
- return (EAttribute)jsfLibraryEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the eattribute
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getJSFLibrary_Name() {
- return (EAttribute)jsfLibraryEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the eattribute
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getJSFLibrary_JSFVersion() {
- return (EAttribute)jsfLibraryEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the eattribute
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getJSFLibrary_Deployed() {
- return (EAttribute)jsfLibraryEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the eattribute
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getJSFLibrary_Implementation() {
- return (EAttribute)jsfLibraryEClass.getEStructuralFeatures().get(4);
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the ereference
- * <!-- end-user-doc -->
- * @generated
- */
- public EReference getJSFLibrary_ArchiveFiles() {
- return (EReference)jsfLibraryEClass.getEStructuralFeatures().get(5);
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the eclass
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getArchiveFile() {
- return archiveFileEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the eattribute
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getArchiveFile_SourceLocation() {
- return (EAttribute)archiveFileEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the eattribute
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getArchiveFile_RelativeToWorkspace() {
- return (EAttribute)archiveFileEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the eattribute
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getArchiveFile_RelativeDestLocation() {
- return (EAttribute)archiveFileEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the ereference
- * <!-- end-user-doc -->
- * @generated
- */
- public EReference getArchiveFile_JSFLibrary() {
- return (EReference)archiveFileEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the eclass
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getPluginProvidedJSFLibrary() {
- return pluginProvidedJSFLibraryEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the eattribute
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getPluginProvidedJSFLibrary_PluginID() {
- return (EAttribute)pluginProvidedJSFLibraryEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getPluginProvidedJSFLibrary_Label() {
- return (EAttribute)pluginProvidedJSFLibraryEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the eenum
- * <!-- end-user-doc -->
- * @generated
- */
- public EEnum getJSFVersion() {
- return jsfVersionEEnum;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the jsf library registry factory
- * <!-- end-user-doc -->
- * @generated
- */
- public JSFLibraryRegistryFactory getJSFLibraryRegistryFactory() {
- return (JSFLibraryRegistryFactory)getEFactoryInstance();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isCreated = false;
-
- /**
- * Creates the meta-model objects for the package. This method is
- * guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void createPackageContents() {
- if (isCreated) return;
- isCreated = true;
-
- // Create classes and their features
- jsfLibraryRegistryEClass = createEClass(JSF_LIBRARY_REGISTRY);
- createEAttribute(jsfLibraryRegistryEClass, JSF_LIBRARY_REGISTRY__DEFAULT_IMPLEMENTATION_ID);
- createEReference(jsfLibraryRegistryEClass, JSF_LIBRARY_REGISTRY__JSF_LIBRARIES);
- createEReference(jsfLibraryRegistryEClass, JSF_LIBRARY_REGISTRY__PLUGIN_PROVIDED_JSF_LIBRARIES);
-
- jsfLibraryEClass = createEClass(JSF_LIBRARY);
- createEAttribute(jsfLibraryEClass, JSF_LIBRARY__ID);
- createEAttribute(jsfLibraryEClass, JSF_LIBRARY__NAME);
- createEAttribute(jsfLibraryEClass, JSF_LIBRARY__JSF_VERSION);
- createEAttribute(jsfLibraryEClass, JSF_LIBRARY__DEPLOYED);
- createEAttribute(jsfLibraryEClass, JSF_LIBRARY__IMPLEMENTATION);
- createEReference(jsfLibraryEClass, JSF_LIBRARY__ARCHIVE_FILES);
-
- pluginProvidedJSFLibraryEClass = createEClass(PLUGIN_PROVIDED_JSF_LIBRARY);
- createEAttribute(pluginProvidedJSFLibraryEClass, PLUGIN_PROVIDED_JSF_LIBRARY__PLUGIN_ID);
- createEAttribute(pluginProvidedJSFLibraryEClass, PLUGIN_PROVIDED_JSF_LIBRARY__LABEL);
-
- archiveFileEClass = createEClass(ARCHIVE_FILE);
- createEAttribute(archiveFileEClass, ARCHIVE_FILE__RELATIVE_TO_WORKSPACE);
- createEAttribute(archiveFileEClass, ARCHIVE_FILE__SOURCE_LOCATION);
- createEAttribute(archiveFileEClass, ARCHIVE_FILE__RELATIVE_DEST_LOCATION);
- createEReference(archiveFileEClass, ARCHIVE_FILE__JSF_LIBRARY);
-
- // Create enums
- jsfVersionEEnum = createEEnum(JSF_VERSION);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isInitialized = false;
-
- /**
- * Complete the initialization of the package and its meta-model. This
- * method is guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void initializePackageContents() {
- if (isInitialized) return;
- isInitialized = true;
-
- // Initialize package
- setName(eNAME);
- setNsPrefix(eNS_PREFIX);
- setNsURI(eNS_URI);
-
- // Add supertypes to classes
- pluginProvidedJSFLibraryEClass.getESuperTypes().add(this.getJSFLibrary());
-
- // Initialize classes and features; add operations and parameters
- initEClass(jsfLibraryRegistryEClass, JSFLibraryRegistry.class, "JSFLibraryRegistry", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getJSFLibraryRegistry_DefaultImplementationID(), ecorePackage.getEString(), "DefaultImplementationID", "", 0, 1, JSFLibraryRegistry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getJSFLibraryRegistry_JSFLibraries(), this.getJSFLibrary(), null, "JSFLibraries", null, 0, -1, JSFLibraryRegistry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getJSFLibraryRegistry_PluginProvidedJSFLibraries(), this.getPluginProvidedJSFLibrary(), null, "PluginProvidedJSFLibraries", null, 0, -1, JSFLibraryRegistry.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- EOperation op = addEOperation(jsfLibraryRegistryEClass, this.getJSFLibrary(), "getJSFLibraryByID", 1, 1);
- addEParameter(op, ecorePackage.getEString(), "ID", 1, 1);
-
- op = addEOperation(jsfLibraryRegistryEClass, ecorePackage.getEEList(), "getJSFLibrariesByName", 1, 1);
- addEParameter(op, ecorePackage.getEString(), "name", 1, 1);
-
- addEOperation(jsfLibraryRegistryEClass, ecorePackage.getEEList(), "getImplJSFLibraries", 1, 1);
-
- addEOperation(jsfLibraryRegistryEClass, ecorePackage.getEEList(), "getNonImplJSFLibraries", 1, 1);
-
- addEOperation(jsfLibraryRegistryEClass, ecorePackage.getEEList(), "getAllJSFLibraries", 1, 1);
-
- op = addEOperation(jsfLibraryRegistryEClass, ecorePackage.getEBoolean(), "addJSFLibrary", 1, 1);
- addEParameter(op, this.getJSFLibrary(), "library", 1, 1);
-
- op = addEOperation(jsfLibraryRegistryEClass, ecorePackage.getEBoolean(), "removeJSFLibrary", 1, 1);
- addEParameter(op, this.getJSFLibrary(), "library", 1, 1);
-
- addEOperation(jsfLibraryRegistryEClass, this.getJSFLibrary(), "getDefaultImplementation", 1, 1);
-
- op = addEOperation(jsfLibraryRegistryEClass, null, "setDefaultImplementation");
- addEParameter(op, this.getJSFLibrary(), "implementation", 1, 1);
-
- initEClass(jsfLibraryEClass, JSFLibrary.class, "JSFLibrary", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getJSFLibrary_ID(), ecorePackage.getEString(), "ID", "", 0, 1, JSFLibrary.class, IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
- initEAttribute(getJSFLibrary_Name(), ecorePackage.getEString(), "Name", null, 1, 1, JSFLibrary.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getJSFLibrary_JSFVersion(), this.getJSFVersion(), "JSFVersion", "UNKNOWN", 1, 1, JSFLibrary.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getJSFLibrary_Deployed(), ecorePackage.getEBoolean(), "Deployed", "true", 1, 1, JSFLibrary.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getJSFLibrary_Implementation(), ecorePackage.getEBoolean(), "Implementation", "false", 1, 1, JSFLibrary.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getJSFLibrary_ArchiveFiles(), this.getArchiveFile(), this.getArchiveFile_JSFLibrary(), "ArchiveFiles", null, 0, -1, JSFLibrary.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- op = addEOperation(jsfLibraryEClass, ecorePackage.getEBoolean(), "containsArchiveFile", 1, 1);
- addEParameter(op, ecorePackage.getEString(), "fullPath", 1, 1);
-
- addEOperation(jsfLibraryEClass, this.getJSFLibrary(), "getWorkingCopy", 1, 1);
-
- op = addEOperation(jsfLibraryEClass, null, "updateValues");
- addEParameter(op, this.getJSFLibrary(), "otherLibrary", 1, 1);
-
- op = addEOperation(jsfLibraryEClass, ecorePackage.getEBoolean(), "copyTo", 1, 1);
- addEParameter(op, ecorePackage.getEString(), "baseDestLocation", 1, 1);
-
- addEOperation(jsfLibraryEClass, ecorePackage.getEString(), "getLabel", 1, 1);
-
- initEClass(pluginProvidedJSFLibraryEClass, PluginProvidedJSFLibrary.class, "PluginProvidedJSFLibrary", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getPluginProvidedJSFLibrary_PluginID(), ecorePackage.getEString(), "pluginID", null, 1, 1, PluginProvidedJSFLibrary.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getPluginProvidedJSFLibrary_Label(), ecorePackage.getEString(), "Label", null, 1, 1, PluginProvidedJSFLibrary.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(archiveFileEClass, ArchiveFile.class, "ArchiveFile", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getArchiveFile_RelativeToWorkspace(), ecorePackage.getEBoolean(), "RelativeToWorkspace", "true", 1, 1, ArchiveFile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getArchiveFile_SourceLocation(), ecorePackage.getEString(), "SourceLocation", null, 1, 1, ArchiveFile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getArchiveFile_RelativeDestLocation(), ecorePackage.getEString(), "RelativeDestLocation", null, 1, 1, ArchiveFile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getArchiveFile_JSFLibrary(), this.getJSFLibrary(), this.getJSFLibrary_ArchiveFiles(), "JSFLibrary", null, 1, 1, ArchiveFile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- addEOperation(archiveFileEClass, ecorePackage.getEString(), "getName", 1, 1);
-
- addEOperation(archiveFileEClass, ecorePackage.getEString(), "getPath", 1, 1);
-
- addEOperation(archiveFileEClass, ecorePackage.getEBoolean(), "exists", 1, 1);
-
- op = addEOperation(archiveFileEClass, ecorePackage.getEBoolean(), "equals", 1, 1);
- addEParameter(op, ecorePackage.getEJavaObject(), "object", 1, 1);
-
- addEOperation(archiveFileEClass, ecorePackage.getEInt(), "hashCode", 1, 1);
-
- op = addEOperation(archiveFileEClass, ecorePackage.getEBoolean(), "copyTo", 1, 1);
- addEParameter(op, ecorePackage.getEString(), "baseDestLocation", 1, 1);
-
- addEOperation(archiveFileEClass, ecorePackage.getEString(), "getResolvedSourceLocation", 1, 1);
-
- // Initialize enums and add enum literals
- initEEnum(jsfVersionEEnum, JSFVersion.class, "JSFVersion");
- addEEnumLiteral(jsfVersionEEnum, JSFVersion.UNKNOWN_LITERAL);
- addEEnumLiteral(jsfVersionEEnum, JSFVersion.V1_1_LITERAL);
- addEEnumLiteral(jsfVersionEEnum, JSFVersion.V1_2_LITERAL);
-
- // Create resource
- createResource(eNS_URI);
- }
-
-} //JSFLibraryRegistryPackageImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/impl/PluginProvidedJSFLibraryImpl.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/impl/PluginProvidedJSFLibraryImpl.java
deleted file mode 100644
index a7b1e37..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/impl/PluginProvidedJSFLibraryImpl.java
+++ /dev/null
@@ -1,271 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl;
-
-import java.util.Iterator;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryFactory;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryPackage;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.PluginProvidedJSFLibrary;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Plugin Provided JSF Library</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.PluginProvidedJSFLibraryImpl#getPluginID <em>Plugin ID</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.PluginProvidedJSFLibraryImpl#getLabel <em>Label</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class PluginProvidedJSFLibraryImpl extends JSFLibraryImpl implements PluginProvidedJSFLibrary {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("hiding")
- public static final String copyright = "Copyright (c) 2005 Oracle Corporation";
-
- /**
- * The default value of the '{@link #getPluginID() <em>Plugin ID</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPluginID()
- * @generated
- * @ordered
- */
- protected static final String PLUGIN_ID_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getPluginID() <em>Plugin ID</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPluginID()
- * @generated
- * @ordered
- */
- protected String pluginID = PLUGIN_ID_EDEFAULT;
-
- /**
- * The default value of the '{@link #getLabel() <em>Label</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getLabel()
- * @generated
- * @ordered
- */
- protected static final String LABEL_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getLabel() <em>Label</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getLabel()
- * @generated
- * @ordered
- */
- protected String label = LABEL_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected PluginProvidedJSFLibraryImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the static eclass
- * <!-- end-user-doc -->
- * @generated
- */
- protected EClass eStaticClass() {
- return JSFLibraryRegistryPackage.Literals.PLUGIN_PROVIDED_JSF_LIBRARY;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the plugin id
- * <!-- end-user-doc -->
- * @generated
- */
- public String getPluginID() {
- return pluginID;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @param newPluginID
- * <!-- end-user-doc -->
- * @generated
- */
- public void setPluginID(String newPluginID) {
- String oldPluginID = pluginID;
- pluginID = newPluginID;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, JSFLibraryRegistryPackage.PLUGIN_PROVIDED_JSF_LIBRARY__PLUGIN_ID, oldPluginID, pluginID));
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return translatable label
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public String getLabel() {
- if (label == null)
- return super.getLabel();
- return label;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setLabel(String newLabel) {
- String oldLabel = label;
- label = newLabel;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, JSFLibraryRegistryPackage.PLUGIN_PROVIDED_JSF_LIBRARY__LABEL, oldLabel, label));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case JSFLibraryRegistryPackage.PLUGIN_PROVIDED_JSF_LIBRARY__PLUGIN_ID:
- return getPluginID();
- case JSFLibraryRegistryPackage.PLUGIN_PROVIDED_JSF_LIBRARY__LABEL:
- return getLabel();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case JSFLibraryRegistryPackage.PLUGIN_PROVIDED_JSF_LIBRARY__PLUGIN_ID:
- setPluginID((String)newValue);
- return;
- case JSFLibraryRegistryPackage.PLUGIN_PROVIDED_JSF_LIBRARY__LABEL:
- setLabel((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eUnset(int featureID) {
- switch (featureID) {
- case JSFLibraryRegistryPackage.PLUGIN_PROVIDED_JSF_LIBRARY__PLUGIN_ID:
- setPluginID(PLUGIN_ID_EDEFAULT);
- return;
- case JSFLibraryRegistryPackage.PLUGIN_PROVIDED_JSF_LIBRARY__LABEL:
- setLabel(LABEL_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case JSFLibraryRegistryPackage.PLUGIN_PROVIDED_JSF_LIBRARY__PLUGIN_ID:
- return PLUGIN_ID_EDEFAULT == null ? pluginID != null : !PLUGIN_ID_EDEFAULT.equals(pluginID);
- case JSFLibraryRegistryPackage.PLUGIN_PROVIDED_JSF_LIBRARY__LABEL:
- return LABEL_EDEFAULT == null ? label != null : !LABEL_EDEFAULT.equals(label);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public String getID() {
- return getPluginID() + ID_SEPARATOR + getName();
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the working copy
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public JSFLibrary getWorkingCopy() {
- PluginProvidedJSFLibrary workingCopyLib = JSFLibraryRegistryFactory.eINSTANCE.createPluginProvidedJSFLibrary();
-// workingCopyLib.setID(getID());
- workingCopyLib.setName(getName());
- if (label != null) workingCopyLib.setLabel(getLabel());
- workingCopyLib.setJSFVersion(getJSFVersion());
- workingCopyLib.setDeployed(isDeployed());
- workingCopyLib.setImplementation(isImplementation());
- workingCopyLib.setPluginID(getPluginID());
- Iterator itArchiveFiles = getArchiveFiles().iterator();
- while (itArchiveFiles.hasNext()) {
- ArchiveFile srcArchiveFile = (ArchiveFile)itArchiveFiles.next();
- ArchiveFile destArchiveFile = JSFLibraryRegistryFactory.eINSTANCE.createArchiveFile();
- destArchiveFile.setRelativeToWorkspace(srcArchiveFile.isRelativeToWorkspace());
- destArchiveFile.setSourceLocation(srcArchiveFile.getSourceLocation());
- destArchiveFile.setRelativeDestLocation(srcArchiveFile.getRelativeDestLocation());
- workingCopyLib.getArchiveFiles().add(destArchiveFile);
- }
- return workingCopyLib;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the string representation
- * <!-- end-user-doc -->
- * @generated
- */
- public String toString() {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (pluginID: ");
- result.append(pluginID);
- result.append(", Label: ");
- result.append(label);
- result.append(')');
- return result.toString();
- }
-
-} //PluginProvidedJSFLibraryImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/util/JSFLibraryRegistryAdapterFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/util/JSFLibraryRegistryAdapterFactory.java
deleted file mode 100644
index 9972980..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/util/JSFLibraryRegistryAdapterFactory.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.jsflibraryregistry.util;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistry;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryPackage;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.PluginProvidedJSFLibrary;
-
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Adapter Factory</b> for the model.
- * It provides an adapter <code>createXXX</code> method for each class of the model.
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryPackage
- * @generated
- */
-public class JSFLibraryRegistryAdapterFactory extends AdapterFactoryImpl {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2005 Oracle Corporation";
-
- /**
- * The cached model package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected static JSFLibraryRegistryPackage modelPackage;
-
- /**
- * Creates an instance of the adapter factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public JSFLibraryRegistryAdapterFactory() {
- if (modelPackage == null) {
- modelPackage = JSFLibraryRegistryPackage.eINSTANCE;
- }
- }
-
- /**
- * Returns whether this factory is applicable for the type of the object.
- * <!-- begin-user-doc -->
- * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
- * @param object
- * <!-- end-user-doc -->
- * @return whether this factory is applicable for the type of the object.
- * @generated
- */
- public boolean isFactoryForType(Object object) {
- if (object == modelPackage) {
- return true;
- }
- if (object instanceof EObject) {
- return ((EObject)object).eClass().getEPackage() == modelPackage;
- }
- return false;
- }
-
- /**
- * The switch the delegates to the <code>createXXX</code> methods.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected JSFLibraryRegistrySwitch modelSwitch =
- new JSFLibraryRegistrySwitch() {
- public Object caseJSFLibraryRegistry(JSFLibraryRegistry object) {
- return createJSFLibraryRegistryAdapter();
- }
- public Object caseJSFLibrary(JSFLibrary object) {
- return createJSFLibraryAdapter();
- }
- public Object casePluginProvidedJSFLibrary(PluginProvidedJSFLibrary object) {
- return createPluginProvidedJSFLibraryAdapter();
- }
- public Object caseArchiveFile(ArchiveFile object) {
- return createArchiveFileAdapter();
- }
- public Object defaultCase(EObject object) {
- return createEObjectAdapter();
- }
- };
-
- /**
- * Creates an adapter for the <code>target</code>.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param target the object to adapt.
- * @return the adapter for the <code>target</code>.
- * @generated
- */
- public Adapter createAdapter(Notifier target) {
- return (Adapter)modelSwitch.doSwitch((EObject)target);
- }
-
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistry <em>JSF Library Registry</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistry
- * @generated
- */
- public Adapter createJSFLibraryRegistryAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary <em>JSF Library</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary
- * @generated
- */
- public Adapter createJSFLibraryAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile <em>Archive File</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile
- * @generated
- */
- public Adapter createArchiveFileAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.jst.jsf.core.internal.jsflibraryregistry.PluginProvidedJSFLibrary <em>Plugin Provided JSF Library</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.PluginProvidedJSFLibrary
- * @generated
- */
- public Adapter createPluginProvidedJSFLibraryAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for the default case.
- * <!-- begin-user-doc -->
- * This default implementation returns null.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @generated
- */
- public Adapter createEObjectAdapter() {
- return null;
- }
-
-} //JSFLibraryRegistryAdapterFactory
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/util/JSFLibraryRegistryResourceFactoryImpl.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/util/JSFLibraryRegistryResourceFactoryImpl.java
deleted file mode 100644
index c865f2b..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/util/JSFLibraryRegistryResourceFactoryImpl.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.jsflibraryregistry.util;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Resource Factory</b> associated with the package.
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.util.JSFLibraryRegistryResourceImpl
- * @generated
- */
-public class JSFLibraryRegistryResourceFactoryImpl extends ResourceFactoryImpl {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2005 Oracle Corporation";
-
- /**
- * Creates an instance of the resource factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public JSFLibraryRegistryResourceFactoryImpl() {
- super();
- }
-
- /**
- * Creates an instance of the resource.
- * <!-- begin-user-doc -->
- * @param uri
- * @return the Resource
- * <!-- end-user-doc -->
- * @generated
- */
- public Resource createResource(URI uri) {
- Resource result = new JSFLibraryRegistryResourceImpl(uri);
- return result;
- }
-
-} //JSFLibraryRegistryResourceFactoryImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/util/JSFLibraryRegistryResourceImpl.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/util/JSFLibraryRegistryResourceImpl.java
deleted file mode 100644
index 1bff4c3..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/util/JSFLibraryRegistryResourceImpl.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.jsflibraryregistry.util;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Resource </b> associated with the package.
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.util.JSFLibraryRegistryResourceFactoryImpl
- * @generated
- */
-public class JSFLibraryRegistryResourceImpl extends XMLResourceImpl {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2005 Oracle Corporation";
-
- /**
- * Creates an instance of the resource.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param uri the URI of the new resource.
- * @generated
- */
- public JSFLibraryRegistryResourceImpl(URI uri) {
- super(uri);
- }
-
-} //JSFLibraryRegistryResourceImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/util/JSFLibraryRegistrySwitch.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/util/JSFLibraryRegistrySwitch.java
deleted file mode 100644
index b8ccb5f..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/util/JSFLibraryRegistrySwitch.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.jsflibraryregistry.util;
-
-import java.util.List;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistry;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryPackage;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.PluginProvidedJSFLibrary;
-
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Switch</b> for the model's inheritance hierarchy.
- * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
- * to invoke the <code>caseXXX</code> method for each class of the model,
- * starting with the actual class of the object
- * and proceeding up the inheritance hierarchy
- * until a non-null result is returned,
- * which is the result of the switch.
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryPackage
- * @generated
- */
-public class JSFLibraryRegistrySwitch {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2005 Oracle Corporation";
-
- /**
- * The cached model package
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected static JSFLibraryRegistryPackage modelPackage;
-
- /**
- * Creates an instance of the switch.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public JSFLibraryRegistrySwitch() {
- if (modelPackage == null) {
- modelPackage = JSFLibraryRegistryPackage.eINSTANCE;
- }
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc -->
- * @param theEObject
- * <!-- end-user-doc -->
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * @generated
- */
- public Object doSwitch(EObject theEObject) {
- return doSwitch(theEObject.eClass(), theEObject);
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc -->
- * @param theEClass
- * @param theEObject
- * <!-- end-user-doc -->
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * @generated
- */
- protected Object doSwitch(EClass theEClass, EObject theEObject) {
- if (theEClass.eContainer() == modelPackage) {
- return doSwitch(theEClass.getClassifierID(), theEObject);
- }
- List eSuperTypes = theEClass.getESuperTypes();
- return
- eSuperTypes.isEmpty() ?
- defaultCase(theEObject) :
- doSwitch((EClass)eSuperTypes.get(0), theEObject);
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc -->
- * @param classifierID
- * @param theEObject
- * <!-- end-user-doc -->
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * @generated
- */
- protected Object doSwitch(int classifierID, EObject theEObject) {
- switch (classifierID) {
- case JSFLibraryRegistryPackage.JSF_LIBRARY_REGISTRY: {
- JSFLibraryRegistry jsfLibraryRegistry = (JSFLibraryRegistry)theEObject;
- Object result = caseJSFLibraryRegistry(jsfLibraryRegistry);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case JSFLibraryRegistryPackage.JSF_LIBRARY: {
- JSFLibrary jsfLibrary = (JSFLibrary)theEObject;
- Object result = caseJSFLibrary(jsfLibrary);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case JSFLibraryRegistryPackage.PLUGIN_PROVIDED_JSF_LIBRARY: {
- PluginProvidedJSFLibrary pluginProvidedJSFLibrary = (PluginProvidedJSFLibrary)theEObject;
- Object result = casePluginProvidedJSFLibrary(pluginProvidedJSFLibrary);
- if (result == null) result = caseJSFLibrary(pluginProvidedJSFLibrary);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case JSFLibraryRegistryPackage.ARCHIVE_FILE: {
- ArchiveFile archiveFile = (ArchiveFile)theEObject;
- Object result = caseArchiveFile(archiveFile);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- default: return defaultCase(theEObject);
- }
- }
-
- /**
- * Returns the result of interpretting the object as an instance of '<em>JSF Library Registry</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpretting the object as an instance of '<em>JSF Library Registry</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public Object caseJSFLibraryRegistry(JSFLibraryRegistry object) {
- return null;
- }
-
- /**
- * Returns the result of interpretting the object as an instance of '<em>JSF Library</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpretting the object as an instance of '<em>JSF Library</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public Object caseJSFLibrary(JSFLibrary object) {
- return null;
- }
-
- /**
- * Returns the result of interpretting the object as an instance of '<em>Archive File</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpretting the object as an instance of '<em>Archive File</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public Object caseArchiveFile(ArchiveFile object) {
- return null;
- }
-
- /**
- * Returns the result of interpretting the object as an instance of '<em>Plugin Provided JSF Library</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpretting the object as an instance of '<em>Plugin Provided JSF Library</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public Object casePluginProvidedJSFLibrary(PluginProvidedJSFLibrary object) {
- return null;
- }
-
- /**
- * Returns the result of interpretting the object as an instance of '<em>EObject</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch, but this is the last case anyway.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpretting the object as an instance of '<em>EObject</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject)
- * @generated
- */
- public Object defaultCase(EObject object) {
- return null;
- }
-
-} //JSFLibraryRegistrySwitch
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/util/JSFLibraryRegistryUpgradeUtil.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/util/JSFLibraryRegistryUpgradeUtil.java
deleted file mode 100644
index f086212..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/util/JSFLibraryRegistryUpgradeUtil.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.jsflibraryregistry.util;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-
-/**
- * Utility for checking for, and upgrading the JSF Library Registry when the EMF model changes.
- */
-public class JSFLibraryRegistryUpgradeUtil {
- static String v1Tov2UpgradeURL = "http://www.eclipse.org/JSFxxxxxxxxxxxxxxxxxxxxxx";
-
- /**
- * default state is OK, no upgrade
- */
- private UpgradeStatus upgradeStatus;
-
- /**
- * The workspace-relative part of the URL of the JSF Library Registry
- * persistence store. (version 1)
- */
- public static final String JSF_LIBRARY_REGISTRY_V1_URL = ".metadata/.plugins/org.eclipse.jst.jsf.core/JSFLibraryRegistry.xml"; //$NON-NLS-1$
-
- /**
- * The workspace-relative part of the URL of the JSF Library Registry
- * persistence store. (version 2)
- */
- public static final String JSF_LIBRARY_REGISTRY_V2_URL = ".metadata/.plugins/org.eclipse.jst.jsf.core/JSFLibraryRegistryV2.xml"; //$NON-NLS-1$
-
- /**
- * The LATEST VERSION of the workspace-relative part of the URL of the JSF Library Registry
- * persistence store.
- */
- public static final String JSF_LIBRARY_REGISTRY_LATESTVERSION_URL = JSF_LIBRARY_REGISTRY_V2_URL;
- /**
- * The latest version value.
- */
- public static final int LATESTVERSION = 2;
-
- private static final int NO_VERSION = 0;
-
- private static JSFLibraryRegistryUpgradeUtil INSTANCE;
-
- /**
- * @return the stateful runtime singleton
- */
- public static synchronized JSFLibraryRegistryUpgradeUtil getInstance(){
- if (INSTANCE == null){
- INSTANCE = new JSFLibraryRegistryUpgradeUtil();
- }
- return INSTANCE;
- }
-
- /**
- * Return the URI for the specified JSF Library Registry
- * @param registryVersion
- * @return URI
- * @throws MalformedURLException
- */
- public static URI getRegistryURI(String registryVersion) throws MalformedURLException {
- URL jsfLibRegURL = new URL(Platform.getInstanceLocation().getURL(), registryVersion);
- return URI.createURI(jsfLibRegURL.toString());
- }
-
- /**
- * @param originalFile
- * @return the backup file name for a file
- */
- public static String getBackupFileName(final String originalFile)
- {
- return originalFile.concat(".bkp");
- }
-
- /**
- * Upgrades the JSF Library registry from oldest to newest
- * @param expectedVersion
- */
- public void upgradeRegistryIfNecessary(int expectedVersion) {
- //when adding upgrades, the upgrades should progress from oldest to newest
- try
- {
- int curVersion = getCurVersion();
-
- if (curVersion < expectedVersion && curVersion != NO_VERSION)
- {
- UpgradeOperation op = getUpgradeOperation(curVersion);
-
- if (op.canExecute())
- {
- try
- {
- // TODO: when move to Java 5, use co-variant return
- upgradeStatus = (UpgradeStatus)
- op.execute(new NullProgressMonitor(), null);
- upgradeStatus.setUpgradeOperation(op);
- }
- catch (ExecutionException e)
- {
- // should never happen since we control the URL's
- JSFCorePlugin.log(IStatus.ERROR, "Error during loading JSF Library registry", e);
- //TODO: flag failure in status
- upgradeStatus =
- new UpgradeStatus(IStatus.ERROR, true, "Error detected during upgrade!");
- }
- }
- else
- {
- // TODO: what if can't execute?
- upgradeStatus =
- new UpgradeStatus(IStatus.ERROR, false, "Error detected during upgrade!");
- }
- }
- else
- {
- // everything ok, not upgrade
- upgradeStatus = new UpgradeStatus();
- }
- }
- catch (MalformedURLException e) {
- // should never happen since we control the URL's
- JSFCorePlugin.log(IStatus.ERROR, "Error during loading JSF Library registry", e);
- }
- }
-
- private int getCurVersion() throws MalformedURLException
- {
- // TODO: need generalized algorithm here
- URI v2File = getRegistryURI(JSF_LIBRARY_REGISTRY_V2_URL);
- File file = new File(v2File.toFileString());
- if (file.exists())
- {
- return 2;
- }
-
- URI v1File = getRegistryURI(JSF_LIBRARY_REGISTRY_V1_URL);
- file = new File(v1File.toFileString());
- if (file.exists())
- {
- return 1;
- }
- return NO_VERSION;
- }
-
- /**
- * @param curVersion
- * @return the upgrade operation to move from curVersion to the latest
- * @throws MalformedURLException
- */
- protected UpgradeOperation getUpgradeOperation(int curVersion) throws MalformedURLException
- {
- UpgradeOperation op = new UpgradeOperation("JSF Registry Upgrade");
- switch(curVersion)
- {
- case 1:
- op.addVersionUpgrade(
- new MigrateV1toV2Operation("Upgrade v1 to v2"
- ,getRegistryURI(JSF_LIBRARY_REGISTRY_V1_URL)
- , getRegistryURI(JSF_LIBRARY_REGISTRY_V2_URL)));
- }
-
- return op;
- }
-
-
- /**
- * @return array of {@link UpgradeStatus}s. There can be more than one if the registry has been upgraded by more than one version.
- * Will not be null.
- */
- public UpgradeStatus getUpgradeStatus(){
- return this.upgradeStatus;
- }
-
- static void deleteFile(String fileName) {
- File f = new File(fileName);
- if (f.exists()){
- f.delete();
- if (f.exists())
- f.deleteOnExit();
- }
- }
-
- static void copyFile(String srcFileName, String destFileName) {
-
- File srcFile = new File(srcFileName);
- File destFile = new File(destFileName);
- FileInputStream from = null;
- FileOutputStream to = null;
- try {
- from = new FileInputStream(srcFile);
- to = new FileOutputStream(destFile);
- byte[] buffer = new byte[4096];
- int bytesRead;
-
- while ((bytesRead = from.read(buffer)) != -1)
- to.write(buffer, 0, bytesRead); // write
- } catch (IOException ioe){
- JSFCorePlugin.log(ioe, "Error during file copy");
- } finally {
- if (from != null)
- try {
- from.close();
- } catch (IOException e) {
- JSFCorePlugin.log(e, "Error during file close");
- }
- if (to != null)
- try {
- to.close();
- } catch (IOException e) {
- JSFCorePlugin.log(e, "Error during file close");
- }
- }
-
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/util/JSFLibraryRegistryXMLProcessor.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/util/JSFLibraryRegistryXMLProcessor.java
deleted file mode 100644
index 5607893..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/util/JSFLibraryRegistryXMLProcessor.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: JSFLibraryRegistryXMLProcessor.java,v 1.2 2007/04/04 18:50:17 cbateman Exp $
- */
-package org.eclipse.jst.jsf.core.internal.jsflibraryregistry.util;
-
-import java.util.Map;
-
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.xmi.util.XMLProcessor;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryPackage;
-
-/**
- * This class contains helper methods to serialize and deserialize XML documents
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-public class JSFLibraryRegistryXMLProcessor extends XMLProcessor {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2005 Oracle Corporation";
-
-
- /**
- * Public constructor to instantiate the helper.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public JSFLibraryRegistryXMLProcessor() {
- super((EPackage.Registry.INSTANCE));
- JSFLibraryRegistryPackage.eINSTANCE.eClass();
- }
-
- /**
- * Register for "*" and "xml" file extensions the JSFLibraryRegistryResourceFactoryImpl factory.
- * <!-- begin-user-doc -->
- * @return Map of registrations
- * <!-- end-user-doc -->
- * @generated
- */
- protected Map getRegistrations() {
- if (registrations == null) {
- super.getRegistrations();
- registrations.put(XML_EXTENSION, new JSFLibraryRegistryResourceFactoryImpl());
- registrations.put(STAR_EXTENSION, new JSFLibraryRegistryResourceFactoryImpl());
- }
- return registrations;
- }
-
-} //JSFLibraryRegistryXMLProcessor
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/util/MigrateV1toV2Operation.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/util/MigrateV1toV2Operation.java
deleted file mode 100644
index 7ea6339..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/util/MigrateV1toV2Operation.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.jsflibraryregistry.util;
-
-import java.io.IOException;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.xmi.XMLResource;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.core.internal.Messages;
-import org.eclipse.jst.jsf.core.internal.jsflibraryconfig.JSFLibraryRegistryUtil;
-
-class MigrateV1toV2Operation extends VersionUpgradeOperation {
-
- private final URI _v1Registry;
- private final URI _v2Registry;
-
- /**
- * @param label
- * @param v1Registry
- * @param v2Registry
- */
- public MigrateV1toV2Operation(String label, URI v1Registry, URI v2Registry) {
- super(label, 1, 2);
- _v1Registry = v1Registry;
- _v2Registry = v2Registry;
- }
-
- public IStatus doCommit() {
- JSFLibraryRegistryUpgradeUtil.deleteFile(_v1Registry.toFileString());
- return Status.OK_STATUS;
- }
-
- public IStatus doExecute(IProgressMonitor monitor, IAdaptable info)
- {
- JSFLibraryRegistryUpgradeUtil.copyFile
- (_v1Registry.toFileString(), JSFLibraryRegistryUpgradeUtil.getBackupFileName(_v1Registry.toFileString()));
- JSFLibraryRegistryResourceFactoryImpl resourceFactory = new JSFLibraryRegistryResourceFactoryImpl();
- JSFLibraryRegistryResourceImpl res = (JSFLibraryRegistryResourceImpl)resourceFactory.createResource(_v1Registry);
- try {
- URI newRegURI =
- JSFLibraryRegistryUpgradeUtil.getRegistryURI
- (JSFLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_V2_URL);
- Map options = new HashMap();
- //disable notifications during load to avoid changing stored default implementation
- options.put(XMLResource.OPTION_DISABLE_NOTIFY, Boolean.TRUE);
- res.load(options);
- //if we got this far then the registry was empty
- //"upgrade" to v2 and then delete old. no point in upgrade status being sent
- JSFLibraryRegistryUtil.getInstance().saveJSFLibraryRegistry();
- JSFLibraryRegistryUpgradeUtil.copyFile(_v1Registry.toFileString(), newRegURI.toFileString());//save as v2 file
- JSFLibraryRegistryUpgradeUtil.deleteFile(_v1Registry.toFileString());
-
- return new UpgradeStatus();//all is ok and no need to alert user
-
- } catch(IOException ioe) {
- //this was expected... if there was actual v1 contents in the regsistry... upgrade by saving
- //perform save which will lose the ID
- try {
- res.save(Collections.EMPTY_MAP);
- //create v2 xml file
- URI newRegURI =
- JSFLibraryRegistryUpgradeUtil.getRegistryURI
- (JSFLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_V2_URL);
- JSFLibraryRegistryUpgradeUtil.copyFile(_v1Registry.toFileString(), newRegURI.toFileString());
- //delete upgraded v1
- JSFLibraryRegistryUpgradeUtil.deleteFile(_v1Registry.toFileString());
- //restore backup to v1 name
- JSFLibraryRegistryUpgradeUtil.copyFile(_v1Registry.toFileString().concat(".bkp"), _v1Registry.toFileString());
- //Alert end user
- return new UpgradeStatus(IStatus.OK, true, Messages.JSFRegistryMigration05_to_10_customMessage);
- } catch(IOException e) {
- JSFCorePlugin.log(IStatus.ERROR, "Error during repository upgrade from v1 to v2", e);
- return new UpgradeStatus(IStatus.ERROR, false,
- Messages.JSFRegistryMigrationCannot05_to_10_customMessage);
- }
- }
- //return ;
- }
-
- public IStatus doRedo(IProgressMonitor monitor, IAdaptable info)
- throws ExecutionException {
- return doExecute(monitor, info);
- }
-
-
- public boolean canUndo() {
- // commit is undoable for this operation
- return super.canUndo() && !hasCommitted();
- }
-
- public IStatus doUndo(IProgressMonitor monitor, IAdaptable info)
- throws ExecutionException
- {
- //restore backup to v1 name
- JSFLibraryRegistryUpgradeUtil.copyFile(_v1Registry.toFileString().concat(".bkp"), _v1Registry.toFileString());
-
- // delete the new registry
- JSFLibraryRegistryUpgradeUtil.deleteFile(_v2Registry.toFileString());
-
- //and the backup
- JSFLibraryRegistryUpgradeUtil.deleteFile(_v1Registry.toFileString().concat(".bkp"));
-
- return Status.OK_STATUS;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/util/UpgradeOperation.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/util/UpgradeOperation.java
deleted file mode 100644
index 130a358..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/util/UpgradeOperation.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.jsflibraryregistry.util;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.operations.AbstractOperation;
-import org.eclipse.core.commands.operations.IUndoableOperation;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-
-/**
- * Encapsulates a chain of one or more version steps into a full upgrade.
- *
- * @author cbateman
- *
- */
-public class UpgradeOperation extends AbstractOperation {
-
- private final List/*<VersionUpgradeOperation*/ _stepOperations;
-
- /**
- * @param label
- */
- public UpgradeOperation(String label) {
- super(label);
- _stepOperations = new ArrayList();
- }
-
- /**
- * Add upgrade operation to the list of operations.
- * Execute, undo and redo call each operation's corresponding
- * method in the order they are added to the list.
- * @param operation
- */
- public void addVersionUpgrade(VersionUpgradeOperation operation)
- {
- _stepOperations.add(operation);
- }
-
- /**
- * @param monitor
- * @param info
- * @return an OK status if all goes well. The status for the first op
- * that fails otherwise.
- * @throws ExecutionException
- */
- public IStatus execute(IProgressMonitor monitor, IAdaptable info)
- throws ExecutionException {
-
- boolean upgraded = false;
-
- for (final Iterator it = _stepOperations.iterator(); it.hasNext();)
- {
- VersionUpgradeOperation op = (VersionUpgradeOperation) it.next();
- // TODO: move to covariant
- UpgradeStatus status = (UpgradeStatus) op.execute(monitor, info);
-
- // fail fast
- if (status.getSeverity() != IStatus.OK)
- {
- return status;
- }
-
- // once an upgrade is flagged, set flag
- if (status.isUpgradeOccurred())
- {
- upgraded = true;
- }
- }
-
- return new UpgradeStatus(IStatus.OK, upgraded, "Upgrade succeeded");
- }
-
- /**
- * @param monitor
- * @param info
- * @return an OK status if all goes well. The status for the first op
- * that fails otherwise.
- * @throws ExecutionException
- */
- public IStatus redo(IProgressMonitor monitor, IAdaptable info)
- throws ExecutionException {
- for (final Iterator it = _stepOperations.iterator(); it.hasNext();)
- {
- VersionUpgradeOperation op = (VersionUpgradeOperation) it.next();
- IStatus status = op.redo(monitor, info);
-
- // fail fast
- if (status.getSeverity() != IStatus.OK)
- {
- return status;
- }
- }
-
- return new UpgradeStatus(IStatus.OK, true, "Upgrade succeeded");
- }
-
- /**
- * @param monitor
- * @param info
- * @return an OK status if all goes well. The status for the first op
- * that fails otherwise.
- * @throws ExecutionException
- */
- public IStatus undo(IProgressMonitor monitor, IAdaptable info)
- throws ExecutionException {
- for (final Iterator it = _stepOperations.iterator(); it.hasNext();)
- {
- VersionUpgradeOperation op = (VersionUpgradeOperation) it.next();
- IStatus status = op.undo(monitor, info);
-
- // fail fast
- if (status.getSeverity() != IStatus.OK)
- {
- return status;
- }
- }
-
- return Status.OK_STATUS;
- }
-
- /**
- * @return an OK status if all goes well. The status for the first op
- * that fails otherwise.
- * @throws ExecutionException
- */
- public IStatus commit() throws ExecutionException
- {
- for (final Iterator it = _stepOperations.iterator(); it.hasNext();)
- {
- VersionUpgradeOperation op = (VersionUpgradeOperation) it.next();
-
- if (op.canCommit())
- {
- IStatus status = op.commit();
-
- // fail fast
- if (status.getSeverity() != IStatus.OK)
- {
- return status;
- }
- }
- }
-
- return Status.OK_STATUS;
- }
-
- public boolean canExecute()
- {
- for (final Iterator it = _stepOperations.iterator(); it.hasNext();)
- {
- IUndoableOperation op = (IUndoableOperation) it.next();
-
- // fail fast
- if (!op.canExecute())
- {
- return false;
- }
- }
-
- return true;
- }
-
- public boolean canRedo() {
- for (final Iterator it = _stepOperations.iterator(); it.hasNext();)
- {
- IUndoableOperation op = (IUndoableOperation) it.next();
-
- // fail fast
- if (!op.canRedo())
- {
- return false;
- }
- }
-
- return true;
- }
-
- public boolean canUndo() {
- for (final Iterator it = _stepOperations.iterator(); it.hasNext();)
- {
- IUndoableOperation op = (IUndoableOperation) it.next();
-
- // fail fast
- if (!op.canUndo())
- {
- return false;
- }
- }
-
- return true;
- }
-
- public void dispose()
- {
- for (final Iterator it = _stepOperations.iterator(); it.hasNext();)
- {
- IUndoableOperation op = (IUndoableOperation) it.next();
- op.dispose();
- }
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/util/UpgradeStatus.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/util/UpgradeStatus.java
deleted file mode 100644
index 4a75a1d..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/util/UpgradeStatus.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.jsflibraryregistry.util;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-
-/**
- * Communicates the status of the JSF Library Registry
- *
- */
-public class UpgradeStatus extends Status
-{
- private final boolean upgradeOccurred;
- private UpgradeOperation upgradeOperation;
-
- /**
- * All-is-well UpgradeStatus constructor
- */
- public UpgradeStatus(){
- super(IStatus.OK, JSFCorePlugin.getDefault().getPluginID(), "OK");
- this.upgradeOccurred = false;
- }
-
- /**
- * Constructor when registry upgrade has occured or there is a problem during upgrade
- * @param severity
- * @param upgradeOccurred flag
- * @param message
- *
- */
- public UpgradeStatus(int severity, boolean upgradeOccurred, String message){
- super(severity, JSFCorePlugin.getDefault().getPluginID(), message);
- this.upgradeOccurred = upgradeOccurred;
- }
-
- /**
- * @return true if a registry upgrade occurred
- */
- public boolean isUpgradeOccurred() {
- return upgradeOccurred;
- }
-
- /**
- * @return the operation used to do the upgrade.
- */
- protected UpgradeOperation getUpgradeOperation() {
- return upgradeOperation;
- }
-
- void setUpgradeOperation(UpgradeOperation upgradeOperation)
- {
- this.upgradeOperation = upgradeOperation;
- }
-
- /**
- * Commits any upgrade that has occurred
- * @return the result of the commit
- */
- public IStatus commit()
- {
- if (upgradeOperation != null)
- {
- try
- {
- return upgradeOperation.commit();
- }
- catch (ExecutionException e)
- {
- return new Status(IStatus.ERROR, JSFCorePlugin.getDefault().getPluginID(), "Error committing status", e);
- }
- }
- return Status.OK_STATUS;
- }
-
- /**
- * @return the result of rolling back any changes
- */
- public IStatus rollback()
- {
- if (upgradeOperation != null)
- {
- try
- {
- return upgradeOperation.undo(new NullProgressMonitor(), null);
- }
- catch (ExecutionException e)
- {
- return new Status(IStatus.ERROR, JSFCorePlugin.getDefault().getPluginID(), "Error committing status", e);
- }
- }
- return Status.OK_STATUS;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/util/VersionUpgradeOperation.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/util/VersionUpgradeOperation.java
deleted file mode 100644
index bd8f1c2..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/jsflibraryregistry/util/VersionUpgradeOperation.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.jsflibraryregistry.util;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.operations.AbstractOperation;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-
-/**
- * Implements a single step (vX -> v(X+1)) version upgrade as an
- * Eclipse operation. Adds an additional "commit" abstract method. This
- * can be called after execute in situations where further actions require
- * user approval etc. See the javadocs for the method, it contains important
- * API rules
- *
- * @author cbateman
- *
- */
-public abstract class VersionUpgradeOperation extends AbstractOperation
-{
- /**
- * the version being upgraded from
- */
- protected final int _oldVersion;
- /**
- * the version being upgraded to
- */
- protected final int _newVersion;
-
- private boolean _hasExecuted;
- private boolean _hasCommitted;
- private boolean _hasCleanState = true;
-
- /**
- * @param label
- * @param oldVersion
- * @param newVersion
- */
- public VersionUpgradeOperation(String label, int oldVersion, int newVersion) {
- super(label);
- _oldVersion = oldVersion;
- _newVersion = newVersion;
- }
-
- /**
- * Allows selected functionality to be called after execute is called.
- * Commit must conform to following contract:
- *
- * 1) should do nothing if execute() has not been called.
- * 2) must do nothing if canCommit == false
- * 3) once executed, undo should undo commit() first, then execute()
- * 4) once undone, redo should call commit only if it was called before undo()
- * @return must conform to same contract as execute()
- * @throws ExecutionException
- *
- */
- public final IStatus commit() throws ExecutionException
- {
- if (canCommit())
- {
- IStatus result = doCommit();
- if (result.getSeverity() == IStatus.OK)
- {
- _hasCommitted = true;
- }
- else
- {
- _hasCommitted = false;
- _hasCleanState = false;
- }
- return result;
- }
- throw new ExecutionException("Cannot execute");
- }
-
- /**
- * @return the result of the actual commit
- * @throws ExecutionException
- */
- protected abstract IStatus doCommit() throws ExecutionException;
-
- /**
- * @return true if the operation can be committed
- */
- public boolean canCommit()
- {
- return _hasExecuted && !_hasCommitted && _hasCleanState;
- }
-
- public final IStatus execute(IProgressMonitor monitor, IAdaptable info)
- throws ExecutionException
- {
- if (canExecute())
- {
- IStatus result = doExecute(monitor, info);
- if (result.getSeverity() == IStatus.OK)
- {
- _hasExecuted = true;
- }
- else
- {
- _hasExecuted = false;
- _hasCleanState = false;
- }
- return result;
- }
- throw new ExecutionException("Cannot execute");
- }
-
- /**
- * @param monitor
- * @param info
- * @return the status of the real execution
- * @throws ExecutionException
- */
- protected abstract IStatus doExecute(IProgressMonitor monitor, IAdaptable info)throws ExecutionException;
-
- public final IStatus redo(IProgressMonitor monitor, IAdaptable info)
- throws ExecutionException {
- if (canRedo())
- {
- IStatus result = doRedo(monitor, info);
- if (result.getSeverity() == IStatus.OK)
- {
- _hasExecuted = true;
- }
- else
- {
- _hasExecuted = false;
- _hasCleanState = false;
- }
- return result;
- }
- throw new ExecutionException("Cannot redo");
- }
-
- /**
- * @param monitor
- * @param info
- * @return the status of the real redo
- * @throws ExecutionException
- */
- protected abstract IStatus doRedo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException;
-
- public final IStatus undo(IProgressMonitor monitor, IAdaptable info)
- throws ExecutionException {
- if (canUndo())
- {
- IStatus result = doUndo(monitor, info);
- if (result.getSeverity() == IStatus.OK)
- {
- _hasExecuted = false;
- }
- else
- {
- _hasExecuted = true;
- _hasCleanState = false;
- }
- return result;
- }
- throw new ExecutionException("Cannot redo");
- }
-
- /**
- * @param monitor
- * @param info
- * @return the status of the real redo
- * @throws ExecutionException
- */
- protected abstract IStatus doUndo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException;
-
- public boolean canExecute() {
- return !_hasExecuted && _hasCleanState;
- }
-
- public boolean canRedo() {
- return canExecute();
- }
-
- public boolean canUndo() {
- return _hasExecuted && _hasCleanState;
- }
-
- /**
- * @param executed
- */
- protected void setHasExecuted(boolean executed) {
- _hasExecuted = executed;
- }
-
- /**
- * @param committed
- */
- protected void setHasCommitted(boolean committed) {
- _hasCommitted = committed;
- }
-
- /**
- * @param cleanState
- */
- protected void setHasCleanState(boolean cleanState) {
- _hasCleanState = cleanState;
- }
-
- /**
- * @return true if has executed
- */
- protected boolean hasExecuted() {
- return _hasExecuted;
- }
-
- /**
- * @return true if has committed
- */
- protected boolean hasCommitted() {
- return _hasCommitted;
- }
-
- /**
- * @return true if has clean state
- */
- protected boolean hasCleanState() {
- return _hasCleanState;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/launch/JSFFileURL.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/launch/JSFFileURL.java
deleted file mode 100644
index bb3192d..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/launch/JSFFileURL.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.core.internal.launch;
-
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jst.j2ee.internal.web.jfaces.extension.FileURL;
-import org.eclipse.jst.j2ee.model.IModelProvider;
-import org.eclipse.jst.j2ee.model.ModelProviderManager;
-import org.eclipse.jst.j2ee.webapplication.Servlet;
-import org.eclipse.jst.j2ee.webapplication.ServletMapping;
-import org.eclipse.jst.j2ee.webapplication.WebApp;
-import org.eclipse.jst.jsf.core.internal.project.facet.JSFUtils11;
-import org.eclipse.jst.jsf.core.internal.project.facet.JSFUtils12;
-
-/**
- * Extends the FileURL extension-point so that a JSF JSP page
- * can have it's URL mapped to the Faces Servlet using the servlet-mapping
- * specified in the web.xml file
- *
- * @author Gerry Kessler - Oracle
- *
- */
-public class JSFFileURL implements FileURL {
-
- /**
- * If this is a JSP page, this will return a URL using the first valid servlet-mapping to the Faces Servlet
- * if found. If the faces servlet is not defined in the web.xml or there is no servlet-mapping, this will return null.
- *
- * The resource's file extension is compared with the javax.faces.DEFAULT_SUFFIX context-param if set. If the same, then
- * extension mapping will be used if found in the web.xml. If not set, "jsp" default is assumed. If resource does not have the default
- * file extension, then it must have either: jsp,jspx, or jsf file extensions in order to be considered for launch.
- *
- * This will not guarentee a page to be run. The user will still need a properly configured server with valid URL mappings and
- * context-params.
- *
- * TODO: We could detect and insert or just warn for context-params and url mappings to run. However, this would better detected during a JSF App validation step.
- *
- * @see org.eclipse.jst.j2ee.internal.web.jfaces.extension.FileURL#getFileURL(org.eclipse.core.resources.IResource, org.eclipse.core.runtime.IPath)
- */
- public IPath getFileURL(IResource resource, IPath existingURL) {
-
- //is this is a Faces Project with a Faces Servlet?
- //we will not check to see if facet is installed.
- // check to see if this resource is a JSF page (currently always true) and then,
- //if servlet is present, we will change the url based on first mapping found
- IModelProvider provider = ModelProviderManager.getModelProvider(resource.getProject());
- Object webAppObj = provider.getModelObject();
- if (webAppObj != null){
- //methods below returning the path are identical except for the APIs required
- if (JSFUtils12.isWebApp25(webAppObj)){
- return getJavaEEFileURLPath(webAppObj, resource, existingURL);
- }
- else if (JSFUtils11.isWebApp24(webAppObj) || JSFUtils11.isWebApp23(webAppObj)) {
- return getJ2EEFileURLPath(webAppObj, resource, existingURL);
- }
- }
- return null;
- }
-
- private IPath getJ2EEFileURLPath(Object webAppObj, IResource resource,
- IPath existingURL) {
- WebApp webApp = (WebApp)webAppObj;
- if (webApp != null){
- Servlet servlet = JSFUtils11.findJSFServlet(webApp);
- if (servlet == null)//if no faces servlet, do nothing
- return null;
-
- //if not a JSF page, do nothing
- if (!isJSFPage(resource))
- return null;
-
- String defaultSuffix = JSFUtils11.getDefaultSuffix(webApp);
- //is the resource using default_suffix
- boolean canUseExtensionMapping = resource.getFileExtension().equalsIgnoreCase(defaultSuffix);
-
- //if not using default extension and is not a known file extension, then we will abort
- if (! canUseExtensionMapping && ! isValidKnownExtension(resource.getFileExtension()))
- return null;
-
- Iterator mappings = servlet.getMappings().iterator();
- ServletMapping map = null;
- String foundFileExtension = null;
- String foundPrefixMapping = null;
- while (mappings.hasNext()){
- map = (ServletMapping)mappings.next();
-
- foundFileExtension = JSFUtils11.getFileExtensionFromMap(map);
- if (foundFileExtension != null && canUseExtensionMapping) {
- return existingURL.removeFileExtension().addFileExtension(foundFileExtension);
- }
-
- if (foundPrefixMapping == null){
- foundPrefixMapping = JSFUtils11.getPrefixMapping(map);
- }
-
- }
- if (foundPrefixMapping != null)
- return new Path(foundPrefixMapping).append(existingURL);
-
- if (! canUseExtensionMapping && foundFileExtension != null){
- //we could prompt user that this may not work...
- //for now we will return the extension mapping
- return existingURL.removeFileExtension().addFileExtension(foundFileExtension);
- }
-
- //we could, at this point, add a url mapping to the faces servlet, or prompt user that it may be a good idea to add one... ;-
- }
- return null;
- }
-
- private IPath getJavaEEFileURLPath(Object webAppObj, IResource resource,
- IPath existingURL) {
- org.eclipse.jst.javaee.web.WebApp webApp = (org.eclipse.jst.javaee.web.WebApp )webAppObj;
- if (webApp != null){
- org.eclipse.jst.javaee.web.Servlet servlet = JSFUtils12.findJSFServlet(webApp);
- if (servlet == null)//if no faces servlet, do nothing
- return null;
-
- //if not a JSF page, do nothing
- if (!isJSFPage(resource))
- return null;
-
- String defaultSuffix = JSFUtils12.getDefaultSuffix(webApp);
- //is the resource using default_suffix
- boolean canUseExtensionMapping = resource.getFileExtension().equalsIgnoreCase(defaultSuffix);
-
- //if not using default extension and is not a known file extension, then we will abort
- if (! canUseExtensionMapping && ! isValidKnownExtension(resource.getFileExtension()))
- return null;
-
- Iterator mappings = webApp.getServletMappings().iterator();
- org.eclipse.jst.javaee.web.ServletMapping map = null;
- String foundFileExtension = null;
- while (mappings.hasNext()){
- map = (org.eclipse.jst.javaee.web.ServletMapping)mappings.next();
- if (map.getServletName().equals(servlet.getServletName())){
- foundFileExtension = JSFUtils12.getFileExtensionFromMap(map);
- if (foundFileExtension != null && canUseExtensionMapping) {
- return existingURL.removeFileExtension().addFileExtension(foundFileExtension);
- }
-
- String foundPrefixMapping = JSFUtils12.getPrefixMapping(map);
- if (foundPrefixMapping != null){
- return new Path(foundPrefixMapping).append(existingURL);
- }
- }
- }
-
- if (! canUseExtensionMapping && foundFileExtension != null){
- //we could prompt user that this may not work...
- //for now we will return the extension mapping
- return existingURL.removeFileExtension().addFileExtension(foundFileExtension);
- }
-
- //we could, at this point, add a url mapping to the faces servlet, or prompt user that it may be a good idea to add one... ;-
- }
-
- return null;
- }
-
- private boolean isValidKnownExtension(String fileExtension) {
- if (( fileExtension.equalsIgnoreCase("jsp") || //$NON-NLS-1$
- fileExtension.equalsIgnoreCase("jspx") || //$NON-NLS-1$
- fileExtension.equalsIgnoreCase("jsf") || //$NON-NLS-1$
- fileExtension.equalsIgnoreCase("xhtml"))) //$NON-NLS-1$
- return true;
-
- return false;
- }
-
-
- private boolean isJSFPage(IResource resource) {
- // currently always return true.
- // need to find quick way of determining whether this is a JSF JSP Page
- return true;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/messages.properties b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/messages.properties
deleted file mode 100644
index 86d55d0..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/messages.properties
+++ /dev/null
@@ -1,84 +0,0 @@
-###############################################################################
-# Copyright (c) 2005 Oracle Corporation.
-# All rights reserved. This program and the accompanying materials
-# are 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:
-# Gerry Kessler - initial API and implementation
-# Ian Trimble - change key names for use with org.eclipse.osgi.util.NLS
-###############################################################################
-JSFLibraryRegistry_ErrorCreatingURL=Error creating URL for JSF Library Registry
-JSFLibraryRegistry_NoLoadCreatingNew=Could not load JSF Library Registry; creating new registry
-JSFLibraryRegistry_ErrorSaving=Error saving JSF Library Registry
-JSFLibraryRegistry_DEFAULT_IMPL_LABEL=<Default>
-JSFLibraryConfigModel_Null_Data_Source=Data Source is not provided.
-JSFLibraryRegistry_ErrorLoadingFromExtPt=Error while loading JSF Libaries from extension points
-JSFLibraryClasspathContainer_IMPL_LIBRARY=[JSF Library - implementation]
-
-JSFFacetInstallDataModelProvider_ValidateServletName=Specify a servlet name to use
-JSFLibraryConfigPersistData_SAVED_IMPLLIB_NOT_FOUND=Saved JSF implementation library in {0} is unavailable in JSF Library Registry
-JSFLibraryConfigPersistData_SAVED_COMPLIB_NOT_FOUND=Saved JSF component library in {0} is unavailable in JSF Library Registry
-JSFLibraryClasspathContainer_NON_IMPL_LIBRARY=[JSF Library]
-JSFLibrariesContainerInitializer_missing_library=[missing JSF Library]
-JSFFacetInstallDataModelProvider_ValidateJSFImpl=A JSF implementation library has not been chosen
-JSFFacetInstallDataModelProvider_DupeJarValidation=Duplicated jar on classpath: {0}
-JSFFacetInstallDataModelProvider_ValidateConfigFilePath=The configuration file path is not valid
-JSFFacetInstallDataModelProvider_ValidateConfigFileEmpty=Specify a valid name and location for JSF configuration file
-JSFFacetInstallDataModelProvider_ClientImplValidationMsg=JSF Implementation library must be specified.
-JSFFacetInstallDataModelProvider_ValidateConfigFileRelative1=Configuration file must be specified relative to the project''s {0} folder
-JSFFacetInstallDataModelProvider_ValidateConfigFileRelative2=Configuration file must be located in the project''s {0} folder
-JSFFacetInstallDataModelProvider_INITIAL_VALIDATION_IMPL_TYPE=Select an implementation library. If a server supplied library is chosen , the chosen server adapter must be capable of providing the JSF Implementation jars, or the application will not validate or compile.
-JSFFacetInstallDataModelProvider_ValidateConfigFileXML=JSF configuration file must be an XML file
-JSFFacetInstallDataModelProvider_ValidateConfigFileSlashes=Configuration file path must not contain "\\"s. Use "/" instead.
-JSFLibCfgDialogSettingData_Sticky_Component_Lib_Not_Exist=A sticky component library selection no longer exists.
-
-JSFFacetInstallDelegate_InternalErr=Internal Error creating JSF Facet. Missing configuration.
-JSFFacetInstallDelegate_ConfigErr=''{0}'' : unable to configure web module for JavaServer Faces
-JSFFacetInstallDelegate_NonUpdateableWebXML=JSF Facet was not installed on ''{0}''. The web.xml file needs to be updateable.
-JSFFacetUninstallDelegate_ConfigErr=''{0}'' : unable to de-configure web module for JavaServer Faces
-JSFFacetUninstallDelegate_NonUpdateableWebXML=JSF Facet was not un-installed from ''{0}''. The web.xml file needs to be updateable.
-
-ArchiveFileImpl_CannotCopyFile=Cannot copy file
-ArchiveFileImpl_CannotCloseFile=Cannot close file
-ArchiveFileImpl_CannotLocatePluginRelativeFile=Cannot locate plugin-relative file "{0}"
-
-PluginProvidedJSFLibraryCreationHelper_ErrorCreating=Unable to create JSF Library: {0}
-PluginProvidedJSFLibraryCreationHelper_ErrorMultipleDefinition={0} defined multiple times in {1}
-
-JSFUtils_ErrorCreatingConfigFile=Error creating config file
-JSFUtils_ErrorClosingConfigFile=Error closing config file
-
-JSFAppConfigUtils_ErrorOpeningJarFile=Error opening JarFile "{0}"
-
-JARFileJSFAppConfigProvider_ErrorLoadingModel=Error loading model for file "{0}"
-JSFUtils_MissingJAR= Missing JSF Library Jar: {0} in {1}
-
-J2EEModuleDependencyDelegate_UpdatingJ2EEModuleDependencies=Updating J2EE Module Dependencies
-J2EEModuleDependencyDelegate_UpdatingJ2EEModuleDependenciesForProject=Updating J2EE Module Dependencies for project "{0}"
-
-JSFRegistryMigration05_to_10_title=User Intervention Required
-JSFRegistryMigration05_to_10_message=IMPORTANT! Please read below:
-JSFRegistryMigration05_to_10_customMessage=You have loaded a workspace created with a previous \
-version of JSF Tools.\nYour JSF Library Registry is out of date and needs to be migrated forward to continue.\n\
-If you choose to proceed, be aware of the following consequences:\n\
-\n\
-1) Projects in this workspace will need to be manually migrated by you to work in this version of JSF Tools.\n\
-2) Once migrated, this workspace will no longer work in older versions of JSF Tools.\n\
-\n\
-If this is not what you want, exit immediately and your workspace will still load in older versions.
-
-JSFRegistryMigrationCannot05_to_10_title=Error During Registry Upgrade
-JSFRegistryMigrationCannot05_to_10_message=IMPORTANT! Please read below:
-JSFRegistryMigrationCannot05_to_10_customMessage=You a loaded a workspace created with a previous \
-version of JSF Tools.\nYour JSF Library Registry is out of date and needs to be migrated forward to continue.\n\
-However, the existing registry has a problem and cannot be upgraded.
-RegistryMigrationStartupHandler_Error_committing_migration=Error committing migration\!
-RegistryMigrationStartupHandler_Error_Rolling_Back_Migration=Error rolling back migration\!
-RegistryMigrationStartupHandler_Dialog_Confirm_Migration=Confirm
-RegistryMigrationStartupHandler_Dialog_Abort_And_Exit_Migration=Abort and Exit
-RegistryMigrationStartupHandler_Launch_Migration_Doc_On_Confirm=Launch Migration Doc on Confirm
-
-JSFFacet11_presetLabel = JavaServer Faces v1.1 Project
-JSFFacet11_presetDescription = Configures a Dynamic Web application to use JSF v1.1
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/IJSFFacetInstallDataModelProperties.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/IJSFFacetInstallDataModelProperties.java
deleted file mode 100644
index 8667868..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/IJSFFacetInstallDataModelProperties.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.project.facet;
-
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetInstallDataModelProperties;
-
-/**
- * Defines properties used by the JSF facet install data model.
- *
- * @author Gerry Kessler - Oracle
- */
-public interface IJSFFacetInstallDataModelProperties extends
- IFacetInstallDataModelProperties {
-
- /**
- * TODO:
- */
- public static final String IMPLEMENTATION_TYPE_PROPERTY_NAME = "IJSFFacetInstallDataModelProperties.IMPLEMENTATION_TYPE_PROPERTY_NAME"; //$NON-NLS-1$
-
- /**
- * TODO:
- */
- public static final String IMPLEMENTATION = "IJSFFacetInstallDataModelProperties.IMPLEMENTATION"; //$NON-NLS-1$
-
- /**
- * TODO:
- */
- public static final String DEPLOY_IMPLEMENTATION = "IJSFFacetInstallDataModelProperties.DEPLOY_IMPLEMENTATION"; //$NON-NLS-1$
-
- /**
- * TODO:
- */
- public static final String CONFIG_PATH = "IJSFFacetInstallDataModelProperties.CONFIG_PATH"; //$NON-NLS-1$
-
- /**
- * TODO:
- */
- public static final String SERVLET_NAME = "IJSFFacetInstallDataModelProperties.SERVLET_NAME"; //$NON-NLS-1$
-
- /**
- * TODO:
- */
- public static final String SERVLET_CLASSNAME = "IJSFFacetInstallDataModelProperties.SERVLET_CLASSNAME"; //$NON-NLS-1$
-
- /**
- * TODO:
- */
- public static final String SERVLET_URL_PATTERNS = "IJSFFacetInstallDataModelProperties.SERVLET_URL_PATTERNS"; //$NON-NLS-1$
-
- /**
- * TODO:
- */
- public static final String WEBCONTENT_DIR = "IJSFFacetInstallDataModelProperties.WEBCONTENT_DIR"; //$NON-NLS-1$
-
- /**
- * TODO:
- */
- public static final String DEFAULT_IMPLEMENTATION_LIBRARY = "IJSFFacetInstallDataModelProperties.DEFAULT_IMPLEMENTATION_LIBRARY"; //$NON-NLS-1$
-
- /**
- * TODO:
- */
- public static final String IMPLEMENTATION_LIBRARIES = "IJSFFacetInstallDataModelProperties.IMPLEMENTATION_LIBRARIES"; //$NON-NLS-1$
-
- /**
- * TODO:
- */
- public static final String COMPONENT_LIBRARIES = "IJSFFacetInstallDataModelProperties.COMPONENT_LIBRARIES"; //$NON-NLS-1$
-
- /**
- * Enumeration of implementation types
- */
- public enum IMPLEMENTATION_TYPE {
-
- /**
- * Unknown
- */
- UNKNOWN,
- /**
- * Server supplied
- */
- SERVER_SUPPLIED,
- /**
- * Not supplied by the server. The user is specifiying.
- */
- USER_SPECIFIED,
-
- /**
- * Not supplied by the server. The user is specifiying. Same as USER_SPECIFIED.
- * @deprecated use USER_SPECIFIED
- */
- CLIENT_SUPPLIED;
-
- /**
- * @param type
- * @return String value
- */
- public static String getStringValue(final IMPLEMENTATION_TYPE type){
- if (type == null)
- return "UNKNOWN"; //$NON-NLS-1$
- if (type == SERVER_SUPPLIED)
- return "SERVER_SUPPLIED";//$NON-NLS-1$
- if (type == USER_SPECIFIED || type ==CLIENT_SUPPLIED )
- return "USER_SPECIFIED";//$NON-NLS-1$
- return "UNKNOWN"; //$NON-NLS-1$
- }
-
- /**
- * @param type
- * @return IMPLEMENTATION_TYPE
- */
- public static IMPLEMENTATION_TYPE getValue(final String type){
- if (type == null)
- return UNKNOWN;
- if (type.equals("SERVER_SUPPLIED"))//$NON-NLS-1$
- return SERVER_SUPPLIED;
- if (type.equals("USER_SPECIFIED") || type.equals("CLIENT_SUPPLIED"))//$NON-NLS-1$// $NON-NLS-2$
- return USER_SPECIFIED;
- return UNKNOWN;
- }
-
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFConfigurationPresetFactory11.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFConfigurationPresetFactory11.java
deleted file mode 100644
index de9ae3e..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFConfigurationPresetFactory11.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2008 BEA Systems, Inc. and others
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Konstantin Komissarchik
- ******************************************************************************/
-
-package org.eclipse.jst.jsf.core.internal.project.facet;
-
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jst.common.project.facet.JavaFacetUtils;
-import org.eclipse.jst.j2ee.web.project.facet.WebFacetUtils;
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.core.internal.Messages;
-import org.eclipse.wst.common.project.facet.core.IDynamicPreset;
-import org.eclipse.wst.common.project.facet.core.IFacetedProjectBase;
-import org.eclipse.wst.common.project.facet.core.IPresetFactory;
-import org.eclipse.wst.common.project.facet.core.IProjectFacet;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.PresetDefinition;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-
-/**
- * @author <a href="mailto:kosta@bea.com">Konstantin Komissarchik</a>
- */
-
-public final class JSFConfigurationPresetFactory11
-
- implements IPresetFactory
-
-{
- public PresetDefinition createPreset( final String presetId,
- final Map<String,Object> context )
-
- throws CoreException
-
- {
- final IFacetedProjectBase fproj
- = (IFacetedProjectBase) context.get( IDynamicPreset.CONTEXT_KEY_FACETED_PROJECT );
-
- final IProjectFacetVersion webFacetVersion
- = fproj.getProjectFacetVersion( WebFacetUtils.WEB_FACET );
-
- if( webFacetVersion != null && webFacetVersion.compareTo( WebFacetUtils.WEB_23 ) >= 0 )
- {
- final Set<IProjectFacetVersion> facets = new HashSet<IProjectFacetVersion>();
-
- final IProjectFacet jsfFacet
- = ProjectFacetsManager.getProjectFacet( IJSFCoreConstants.JSF_CORE_FACET_ID );
-
- final IProjectFacetVersion jsfFacetVersion11
- = jsfFacet.getVersion( IJSFCoreConstants.JSF_VERSION_1_1 );
-
- facets.add( jsfFacetVersion11 );
- facets.add( webFacetVersion );
-
- if( webFacetVersion == WebFacetUtils.WEB_23 )
- {
- facets.add( JavaFacetUtils.JAVA_13 );
- }
- else if( webFacetVersion == WebFacetUtils.WEB_24 )
- {
- facets.add( JavaFacetUtils.JAVA_14 );
- }
- else
- {
- facets.add( JavaFacetUtils.JAVA_50 );
- }
-
- return new PresetDefinition( Messages.JSFFacet11_presetLabel, Messages.JSFFacet11_presetDescription, facets );
- }
-
- return null;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFFacetDefaultVersionProvider.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFFacetDefaultVersionProvider.java
deleted file mode 100644
index 549f050..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFFacetDefaultVersionProvider.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.project.facet;
-
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.wst.common.project.facet.core.IDefaultVersionProvider;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-
-/**
- * Provides the default JSF project facet version.
- * Currently always returns "1.1" facet version. Eventually should be computed from the project's facet context.
- */
-public final class JSFFacetDefaultVersionProvider implements IDefaultVersionProvider {
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.project.facet.core.IDefaultVersionProvider#getDefaultVersion()
- */
- public IProjectFacetVersion getDefaultVersion() {
- return ProjectFacetsManager.getProjectFacet(IJSFCoreConstants.JSF_CORE_FACET_ID).getVersion(IJSFCoreConstants.FACET_VERSION_1_1);
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFFacetException.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFFacetException.java
deleted file mode 100644
index d2878b3..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFFacetException.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.project.facet;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-
-/**
- * Exception for use during JSF Facet installation/un-installation
- *
- */
-public class JSFFacetException extends CoreException {
-
- private static final long serialVersionUID = 1L;
-
- /**
- * Constructor
- * @param msg
- */
- public JSFFacetException(String msg) {
- super(new Status(IStatus.ERROR, JSFCorePlugin.PLUGIN_ID, msg));
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFFacetInstallDataModelProvider.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFFacetInstallDataModelProvider.java
deleted file mode 100644
index 3227c38..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFFacetInstallDataModelProvider.java
+++ /dev/null
@@ -1,373 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.project.facet;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jst.j2ee.project.facet.IJ2EEModuleFacetInstallDataModelProperties;
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.core.internal.Messages;
-import org.eclipse.jst.jsf.core.internal.jsflibraryconfig.JSFLibraryInternalReference;
-import org.eclipse.jst.jsf.core.internal.jsflibraryconfig.JSFLibraryRegistryUtil;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.datamodel.FacetInstallDataModelProvider;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject.Action;
-
-/**
- * Provides a data model used by the JSF facet install.
- *
- * @author Gerry Kessler - Oracle
- */
-public class JSFFacetInstallDataModelProvider extends
- FacetInstallDataModelProvider implements
- IJSFFacetInstallDataModelProperties {
-
- private String errorMessage;
-
- public Set getPropertyNames() {
- Set names = super.getPropertyNames();
- names.add(IMPLEMENTATION_TYPE_PROPERTY_NAME);
- names.add(IMPLEMENTATION);
- names.add(DEPLOY_IMPLEMENTATION);
- names.add(CONFIG_PATH);
- names.add(SERVLET_NAME);
- names.add(SERVLET_CLASSNAME);
- names.add(SERVLET_URL_PATTERNS);
- names.add(WEBCONTENT_DIR);
-
- names.add(IMPLEMENTATION_LIBRARIES);
- names.add(COMPONENT_LIBRARIES);
- names.add(DEFAULT_IMPLEMENTATION_LIBRARY);
-
- return names;
- }
-
- public Object getDefaultProperty(String propertyName) {
- if (propertyName.equals(IMPLEMENTATION_TYPE_PROPERTY_NAME)){
- return IMPLEMENTATION_TYPE.UNKNOWN;
- }
- else if (propertyName.equals(IMPLEMENTATION)) {
- if (JSFLibraryRegistryUtil.getInstance().getJSFLibraryRegistry() == null)
- return null;
- return getDefaultImplementationLibrary();//JSFCorePlugin.getDefault().getJSFLibraryRegistry().getDefaultImplementation();
- } else if (propertyName.equals(DEPLOY_IMPLEMENTATION)) {
- return Boolean.TRUE;
- } else if (propertyName.equals(CONFIG_PATH)) {
- return JSFUtils.JSF_DEFAULT_CONFIG_PATH;
- } else if (propertyName.equals(SERVLET_NAME)) {
- return JSFUtils.JSF_DEFAULT_SERVLET_NAME;
- } else if (propertyName.equals(SERVLET_CLASSNAME)) {
- return JSFUtils.JSF_SERVLET_CLASS;
- } else if (propertyName.equals(SERVLET_URL_PATTERNS)) {
- return new String[] {JSFUtils.JSF_DEFAULT_URL_MAPPING };
- } else if (propertyName.equals(FACET_ID)) {
- return IJSFCoreConstants.JSF_CORE_FACET_ID;
- } else if (propertyName.equals(WEBCONTENT_DIR)){
- return "WebContent"; //not sure I need this //$NON-NLS-1$
- } else if (propertyName.equals(COMPONENT_LIBRARIES)) {
- return new JSFLibraryInternalReference[0];
- } else if (propertyName.equals(IMPLEMENTATION_LIBRARIES)) {
- return getDefaultJSFImplementationLibraries();
- } else if (propertyName.equals(DEFAULT_IMPLEMENTATION_LIBRARY)) {
- return getDefaultImplementationLibrary();
- }
- return super.getDefaultProperty(propertyName);
- }
-
- public IStatus validate(String name) {
- errorMessage = null;
- if (name.equals(IMPLEMENTATION_TYPE_PROPERTY_NAME)) {
- if (getProperty(IMPLEMENTATION_TYPE_PROPERTY_NAME) == IMPLEMENTATION_TYPE.UNKNOWN) {
- return createErrorStatus(Messages.JSFFacetInstallDataModelProvider_INITIAL_VALIDATION_IMPL_TYPE);
- }
- }
- else if (name.equals(IMPLEMENTATION)) {
- if (getProperty(IMPLEMENTATION_TYPE_PROPERTY_NAME) == IMPLEMENTATION_TYPE.USER_SPECIFIED) {
- JSFLibraryInternalReference lib = (JSFLibraryInternalReference)getProperty(IMPLEMENTATION);
- IStatus status = validateImpl(lib.getLibrary());
- if (!OK_STATUS.equals(status))
- return status;
-
- return validateClasspath();
- }
- } else if (name.equals(CONFIG_PATH)) {
- return validateConfigLocation(getStringProperty(CONFIG_PATH));
- } else if (name.equals(SERVLET_NAME)) {
- return validateServletName(getStringProperty(SERVLET_NAME));
- }
- else if (name.equals(COMPONENT_LIBRARIES)) {
- return validateClasspath();
- }
- return super.validate(name);
- }
-
- private IStatus createErrorStatus(String msg) {
- return new Status(IStatus.ERROR, JSFCorePlugin.PLUGIN_ID, msg);
- }
-
- private IStatus validateServletName(String servletName) {
- if (servletName == null || servletName.trim().length() == 0) {
- errorMessage = Messages.JSFFacetInstallDataModelProvider_ValidateServletName;
- return createErrorStatus(errorMessage);
- }
-
- return OK_STATUS;
- }
-
- private IStatus validateImpl(JSFLibrary impl) {
- if (impl == null) {
- errorMessage = Messages.JSFFacetInstallDataModelProvider_ValidateJSFImpl;
- }
- if (errorMessage != null) {
- return createErrorStatus(errorMessage);
- }
- return OK_STATUS;
- }
-
- private IStatus validateConfigLocation(String text) {
- if (text == null || text.trim().equals("")) { //$NON-NLS-1$
- errorMessage = Messages.JSFFacetInstallDataModelProvider_ValidateConfigFileEmpty;
- return createErrorStatus(errorMessage);
- }
- text = text.trim();
-
- if (getProjectPath() == null) //this circumstance occurs on page init
- return OK_STATUS;
-
- IPath fullPath = getProjectPath().append(text);
- IPath passedPath = new Path(text);
- if (!fullPath.isValidPath(text)){
- errorMessage = Messages.JSFFacetInstallDataModelProvider_ValidateConfigFilePath;
- return createErrorStatus(errorMessage);
- }
-
- //FIXME: check for valid file path also [passedPath.toFile().isFile()]
- if (text.toLowerCase().lastIndexOf(".xml") != text.length() - 4) { //$NON-NLS-1$
- errorMessage = Messages.JSFFacetInstallDataModelProvider_ValidateConfigFileXML;
- return createErrorStatus(errorMessage);
- }
-
- if (text.lastIndexOf("\\") >= 0){ //$NON-NLS-1$
- errorMessage = Messages.JSFFacetInstallDataModelProvider_ValidateConfigFileSlashes;
- return createErrorStatus(errorMessage);
- }
-
- if (passedPath.getDevice() != null) {
- errorMessage = NLS.bind(
- Messages.JSFFacetInstallDataModelProvider_ValidateConfigFileRelative1,
- getWebContentFolderName());
- return createErrorStatus(errorMessage);
- }
- IPath webContentFolder = getWebContentFolder();
- IPath setPath = webContentFolder.append(passedPath);
- if (!getWebContentFolder().isPrefixOf(setPath)) {
- errorMessage = NLS.bind(
- Messages.JSFFacetInstallDataModelProvider_ValidateConfigFileRelative2,
- getWebContentFolderName());
- return createErrorStatus(errorMessage);
- }
-
- return OK_STATUS;
- }
-
- private IStatus validateClasspath(){
- Set jars = new HashSet();
- if (doesProjectExist()){
- //validate actual classpath by loading jars from cp
- try {
- IClasspathEntry[] entries = getJavaProject().getResolvedClasspath(true);
- for (int i=0;i<entries.length;i++){
- IClasspathEntry entry = entries[i];
- if (entry.getEntryKind() == IClasspathEntry.CPE_LIBRARY){
- jars.add(entry.getPath().makeAbsolute().toString());
- }
- }
- } catch (JavaModelException e) {
- // FIXME: what should we do in this case?
- JSFCorePlugin.log(e, "Error searching class path"); //$NON-NLS-1$
- }
- }
- //else as we do not have a javaProject yet, all we can do is validate that there is no duplicate jars (absolute path)
-
- IStatus status = null;
-
- JSFLibraryInternalReference ref = null;
- if (getProperty(IMPLEMENTATION_TYPE_PROPERTY_NAME) == IMPLEMENTATION_TYPE.USER_SPECIFIED) {
- ref = ((JSFLibraryInternalReference)getProperty(IJSFFacetInstallDataModelProperties.IMPLEMENTATION));
- if (ref != null){
- status = checkForDupeArchiveFiles(jars, ((JSFLibraryInternalReference)getProperty(IJSFFacetInstallDataModelProperties.IMPLEMENTATION)).getLibrary());
- if (!OK_STATUS.equals(status)){
- return status;
- }
- } else {
- return createErrorStatus(Messages.JSFFacetInstallDataModelProvider_ClientImplValidationMsg);
- }
- }
-
- JSFLibraryInternalReference[] compLibs = (JSFLibraryInternalReference[]) getProperty(IJSFFacetInstallDataModelProperties.COMPONENT_LIBRARIES);
- if (compLibs != null){
- for (int i=0;i<compLibs.length;i++){
- JSFLibrary lib = compLibs[i].getLibrary();
- status = checkForDupeArchiveFiles(jars, lib);
- if (!OK_STATUS.equals(status)){
- return status;
- }
- }
- }
- return OK_STATUS;
- }
-
- private IJavaProject getJavaProject() {
- IProject proj = getProject();
- if (proj != null)
- return JavaCore.create(proj);
- return null;
- }
-
- private IProject getProject(){
- String projName = (String)getProperty(FACET_PROJECT_NAME);
- if (projName == null || "".equals(projName))
- return null;
-
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projName);
- return project;
- }
-
- private boolean doesProjectExist() {
- IProject project = getProject();
- return (project != null) && project.exists();
- }
-
- private IStatus checkForDupeArchiveFiles(Set jars,
- JSFLibrary aJSFLib) {
- if (aJSFLib == null)
- return OK_STATUS;
-
- for (Iterator it=aJSFLib.getArchiveFiles().iterator();it.hasNext();){
- ArchiveFile jar = (ArchiveFile)it.next();
- if (jars.contains(jar.getResolvedSourceLocation())){
- return createErrorStatus(NLS.bind(Messages.JSFFacetInstallDataModelProvider_DupeJarValidation,jar.getResolvedSourceLocation()));
- }
- jars.add(jar.getResolvedSourceLocation());
- }
- return OK_STATUS;
- }
-
- private IPath getProjectPath() {
- IProject project = getProject();
- if (project == null)
- return null;
- else if (project.exists())
- return project.getLocation();
-
- String projName = (String)getProperty(FACET_PROJECT_NAME);
- IFacetedProjectWorkingCopy projModel = (IFacetedProjectWorkingCopy)getProperty(FACETED_PROJECT_WORKING_COPY );
-
- if (projModel.getProjectLocation() != null)
- return projModel.getProjectLocation().append(projName);
-
- return ResourcesPlugin.getWorkspace().getRoot().getRawLocation().append(projName);
-
- }
-
- private IPath getWebContentFolder() {
- //One can get here 2 ways:
- //if web app exists and user is adding a facet, or
- // if creating a new web app.
-
- IPath webContentPath = null;
- String projName = model.getStringProperty(IFacetDataModelProperties.FACET_PROJECT_NAME);
- IProject proj = ResourcesPlugin.getWorkspace().getRoot()
- .getProject(projName);
-
- String webFolder = getWebContentFolderName();
- if (proj.exists()) {
-
- webContentPath = ComponentCore.createComponent(proj).getRootFolder()
- .getUnderlyingFolder().getRawLocation();
- }
- else {
-
- if (webFolder == null){
- //we got problems... should not happen
- return proj.getFullPath();
- }
- webContentPath = proj.getFullPath().append(webFolder);
-
- }
- return webContentPath;
- }
-
- private String getWebContentFolderName() {
- String projName = (String)getProperty(FACET_PROJECT_NAME);
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projName);
- if (project.exists()){
- IPath webContentPath = ComponentCore.createComponent(project).getRootFolder()
- .getUnderlyingFolder().getProjectRelativePath();
-
- return webContentPath.toString();
- }
-
- IFacetedProjectWorkingCopy projWC = (IFacetedProjectWorkingCopy)getProperty(FACETED_PROJECT_WORKING_COPY);
- Set<Action> pfas = projWC.getProjectFacetActions();
- for (Action action : pfas){
- if (action.getProjectFacetVersion().getProjectFacet().getId().equals("jst.web")){
- IDataModel webFacet = (IDataModel) action.getConfig();
- return webFacet.getStringProperty(IJ2EEModuleFacetInstallDataModelProperties.CONFIG_FOLDER );
- }
- }
-
- //should not get here.
- return null;
- }
-
- private List getDefaultJSFImplementationLibraries() {
- List list = new ArrayList();
- if (JSFLibraryRegistryUtil.getInstance().getJSFLibraryRegistry() != null) {
- JSFLibrary jsfLib = JSFLibraryRegistryUtil.getInstance().getJSFLibraryRegistry().getDefaultImplementation();
- if (jsfLib != null){
- JSFLibraryInternalReference prjJSFLib = new JSFLibraryInternalReference(jsfLib, true, true);
- list.add(prjJSFLib);
- }
- }
- return list;
- }
-
- private JSFLibraryInternalReference getDefaultImplementationLibrary() {
- if (JSFLibraryRegistryUtil.getInstance().getJSFLibraryRegistry() != null) {
- JSFLibrary jsfLib = JSFLibraryRegistryUtil.getInstance().getJSFLibraryRegistry().getDefaultImplementation();
- return new JSFLibraryInternalReference(jsfLib, true, true);
- }
- return null;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFFacetInstallDelegate.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFFacetInstallDelegate.java
deleted file mode 100644
index b96e96f..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFFacetInstallDelegate.java
+++ /dev/null
@@ -1,366 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.core.internal.project.facet;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathAttribute;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jst.common.project.facet.core.ClasspathHelper;
-import org.eclipse.jst.j2ee.classpathdep.ClasspathDependencyUtil;
-import org.eclipse.jst.j2ee.classpathdep.IClasspathDependencyConstants;
-import org.eclipse.jst.j2ee.internal.J2EEVersionConstants;
-import org.eclipse.jst.j2ee.model.IModelProvider;
-import org.eclipse.jst.j2ee.model.ModelProviderManager;
-import org.eclipse.jst.javaee.web.Servlet;
-import org.eclipse.jst.javaee.web.WebApp;
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.core.internal.Messages;
-import org.eclipse.jst.jsf.core.internal.jsflibraryconfig.JSFLibraryInternalReference;
-import org.eclipse.jst.jsf.core.internal.jsflibraryconfig.JSFLibraryRegistryUtil;
-import org.eclipse.jst.jsf.core.jsflibraryconfiguration.JSFLibraryConfigurationHelper;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.IDelegate;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-/**
- * JSF Facet Install Delegate for WTP faceted web projects. Deals with 2.3, 2.4 and 2.5 web app models.
- *
- * Uses <code>com.eclispe.jst.jsf.core.internal.project.facet.JSFFacetInstallDataModelProvider<code> for model
- * <li> creates JSF configuration file if not already present. It will not attempt to upgrade or downgrade the version if there is a mismatch.
- * <li> updates web.xml for: servlet, servlet-mapping and context-param
- * <li> adds implementation jars to WEB-INF/lib if user requests
- *
- * @see org.eclipse.jst.jsf.core.internal.project.facet.JSFFacetInstallDataModelProvider
- * @since 1.0
- */
-public final class JSFFacetInstallDelegate implements IDelegate {
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.project.facet.core.IDelegate#execute(org.eclipse.core.resources.IProject, org.eclipse.wst.common.project.facet.core.IProjectFacetVersion, java.lang.Object, org.eclipse.core.runtime.IProgressMonitor)
- */
- public void execute(final IProject project, final IProjectFacetVersion fv,
- final Object cfg, final IProgressMonitor monitor)
- throws CoreException
-
- {
-
- if (monitor != null) {
- monitor.beginTask("", 1); //$NON-NLS-1$
- }
-
- try {
- IDataModel config = null;
-
- if (cfg != null) {
- config = (IDataModel) cfg;
- } else {
- throw new JSFFacetException(
- Messages.JSFFacetInstallDelegate_InternalErr);
- }
-
- //Before we do any configuration, verify that web.xml is available for update
- IModelProvider provider = JSFUtils.getModelProvider(project);
- if (provider == null ) {
- throw new JSFFacetException( NLS.bind(Messages.JSFFacetInstallDelegate_ConfigErr, project.getName()));
- } else if (!(provider.validateEdit(null, null).isOK())){
- if (!(provider.validateEdit(null, null).isOK())) {//checks for web.xml file being read-only and allows user to set writeable
- throw new JSFFacetException(NLS.bind(Messages.JSFFacetInstallDelegate_NonUpdateableWebXML, project.getName())); //$NON-NLS-2$
- }
- }
-
- // Create JSF Libs as classpath containers and set WTP dependencies
- // as required
- createClasspathEntries(project, fv, config, monitor);
-
- // Create config file
- createConfigFile(project, fv, config, monitor);
-
- // Update web model
- createServletAndModifyWebXML(project, config, monitor);
-
- if (monitor != null) {
- monitor.worked(1);
- }
-
- } finally {
- if (monitor != null) {
- monitor.done();
- }
- }
- }
-
- /**
- * Adds the JSF Library references specified in the wizard to the project as
- * classpath containers. Marks the containers as J2EE module dependencies as
- * required
- *
- * @param project
- * @param config
- * @param monitor
- */
- private void createClasspathEntries(final IProject project, final IProjectFacetVersion fv, final IDataModel config, final IProgressMonitor monitor) {
- IJavaProject javaProject = JavaCore.create(project);
- List cpEntries = new ArrayList();
- try {
- for (int i=0;i<javaProject.getRawClasspath().length;i++){
- cpEntries.add(javaProject.getRawClasspath()[i]);
- }
- } catch (JavaModelException e) {
- JSFCorePlugin.log(e, "Unable to read classpath"); //$NON-NLS-1$
- }
-
- IPath path, cp = null;
- IClasspathEntry entry = null;
- JSFLibraryInternalReference libref = null;
-
- //Implementation
- if (config.getProperty(IJSFFacetInstallDataModelProperties.IMPLEMENTATION_TYPE_PROPERTY_NAME)
- == IJSFFacetInstallDataModelProperties.IMPLEMENTATION_TYPE.USER_SPECIFIED){
- cp = new Path(JSFLibraryConfigurationHelper.JSF_LIBRARY_CP_CONTAINER_ID);
- libref = (JSFLibraryInternalReference)config.getProperty(IJSFFacetInstallDataModelProperties.IMPLEMENTATION);
- path = cp.append(new Path(libref.getID()));
- entry = getNewCPEntry(path, libref);
- cpEntries.add(entry);
- }
-
- JSFLibraryInternalReference[] compLibs = (JSFLibraryInternalReference[])config.getProperty(IJSFFacetInstallDataModelProperties.COMPONENT_LIBRARIES);
- for (int i=0;i<compLibs.length;i++){
- libref = compLibs[i];
- cp = new Path(JSFLibraryConfigurationHelper.JSF_LIBRARY_CP_CONTAINER_ID);
- path = cp.append(new Path(libref.getID()));
- entry = getNewCPEntry(path, libref);
- if (entry != null)
- cpEntries.add(entry);
- }
-
- JSFLibraryRegistryUtil.setRawClasspath(javaProject, cpEntries, monitor);
-
- //allow for the raw classpath to be set from JSF Libs before setting the server supplied impl libs from the server, if available
- if (config.getProperty(IJSFFacetInstallDataModelProperties.IMPLEMENTATION_TYPE_PROPERTY_NAME)
- == IJSFFacetInstallDataModelProperties.IMPLEMENTATION_TYPE.SERVER_SUPPLIED) {
- try {
- ClasspathHelper.removeClasspathEntries(project, fv);
- ClasspathHelper.addClasspathEntries(project, fv);
- } catch (CoreException e) {
- JSFCorePlugin.log(IStatus.ERROR, "Unable to add server supplied implementation to the classpath.", e);//$NON-NLS-1$
- }
- }
-
- }
-
- /**
- * @param path
- * @param lib
- * @return creates new IClasspathEntry with WTP dependency attribute set, if required
- */
- private IClasspathEntry getNewCPEntry(final IPath path, final JSFLibraryInternalReference lib) {
-
- IClasspathEntry entry = null;
- if (lib.isCheckedToBeDeployed()){
- IClasspathAttribute depAttrib = JavaCore.newClasspathAttribute(IClasspathDependencyConstants.CLASSPATH_COMPONENT_DEPENDENCY,
- ClasspathDependencyUtil.getDefaultRuntimePath(true).toString());
- entry = JavaCore.newContainerEntry(path,null, new IClasspathAttribute[]{depAttrib}, true);
- }
- else {
- entry = JavaCore.newContainerEntry(path);
- }
-
- return entry;
- }
-
- /**
- * @param config
- * @return list of URL patterns from the datamodel
- */
- private List getServletMappings(final IDataModel config) {
- List mappings = new ArrayList();
- String[] patterns = (String[])config.getProperty(IJSFFacetInstallDataModelProperties.SERVLET_URL_PATTERNS);
- for (int i = 0; i < patterns.length; i++) {
- String pattern = patterns[i];
- mappings.add(pattern);
- }
-
- return mappings;
- }
-
- /**
- * @param project
- * @param jsfConfigPath
- * @return absolute IPath to jsfConfig
- */
- private IPath resolveConfigPath(final IProject project, final String jsfConfigPath) {
- return ComponentCore.createComponent(project).getRootFolder()
- .getUnderlyingFolder().getRawLocation().append(
- new Path(jsfConfigPath));
-
- }
-
- /**
- * Create the faces configuration file. If the file already exist, then the file is left alone.
- * @param project
- * @param fv
- * @param config
- * @param monitor
- */
- private void createConfigFile(final IProject project,
- final IProjectFacetVersion fv, final IDataModel config,
- final IProgressMonitor monitor) {
-
-
- final IPath configPath = resolveConfigPath(project, config.getStringProperty(IJSFFacetInstallDataModelProperties.CONFIG_PATH));
- try {
- // do not overwrite if the file exists
- if (!configPath.toFile().exists()) {
- final IWorkspaceRunnable op = new IWorkspaceRunnable(){
- public void run(IProgressMonitor monitor_inner) throws CoreException{
- if (shouldUseJ2EEConfig(fv)){
- JSFUtils11.createConfigFile(fv.getVersionString(),
- configPath);
- } else {
- JSFUtils12.createConfigFile(fv.getVersionString(),
- configPath);
- }
- project.refreshLocal(IResource.DEPTH_INFINITE, monitor_inner);
- }
-
- private boolean shouldUseJ2EEConfig(final IProjectFacetVersion facetVersion) {
- if (IJSFCoreConstants.FACET_VERSION_1_1.equals(facetVersion.getVersionString()))
- {
- return true;
- }
- return false;
- }
- };
- op.run(monitor);
- }
- } catch (CoreException e) {
- JSFCorePlugin.log(e, "Exception occured while creating faces-config.xml");//$NON-NLS-1$
- }
-
- }
-
- /**
- * Create servlet and URL mappings and update the webapp
- * @param project
- * @param config
- * @param monitor
- */
- private void createServletAndModifyWebXML(final IProject project,
- final IDataModel config, final IProgressMonitor monitor) {
-
- IModelProvider provider = JSFUtils.getModelProvider(project);
- IPath webXMLPath = new Path("WEB-INF").append("web.xml"); //$NON-NLS-1$ //$NON-NLS-2$
- if (JSFUtils12.isWebApp25(provider.getModelObject())) {
- provider.modify(new UpdateWebXMLForJavaEE(project, config), doesDDFileExist(project, webXMLPath) ? webXMLPath : IModelProvider.FORCESAVE);
- }
- else {//must be 2.3 or 2.4
- provider.modify(new UpdateWebXMLForJ2EE(project, config), webXMLPath);
- }
-
- }
-
- private boolean doesDDFileExist(IProject project, IPath webXMLPath) {
- return project.getProjectRelativePath().append(webXMLPath).toFile().exists();
- }
-
- private class UpdateWebXMLForJavaEE implements Runnable {
- private IProject project;
- private IDataModel config;
-
- UpdateWebXMLForJavaEE(final IProject project, final IDataModel config){
- this.project = project;
- this.config = config;
- }
-
- public void run() {
- WebApp webApp = (WebApp) ModelProviderManager.getModelProvider(project).getModelObject();
- // create or update servlet ref
- Servlet servlet = JSFUtils12.findJSFServlet(webApp);// check to see
- // if already
-// No longer removing any old mappings on install - see 194919 // present
-// if (servlet != null) {
-// // remove old mappings
-// JSFUtils12.removeURLMappings(webApp, servlet);
-// }
-
- servlet = JSFUtils12
- .createOrUpdateServletRef(webApp, config, servlet);
-
- // init mappings
- List listOfMappings = getServletMappings(config);
- JSFUtils12.setUpURLMappings(webApp, listOfMappings, servlet);
-
- // setup context params
- JSFUtils12.setupConfigFileContextParamForV2_5(webApp, config);
- }
- }
-
- private class UpdateWebXMLForJ2EE implements Runnable {
- private IProject project;
- private IDataModel config;
-
- UpdateWebXMLForJ2EE(IProject project, final IDataModel config){
- this.project = project ;
- this.config = config;
- }
-
- public void run() {
- org.eclipse.jst.j2ee.webapplication.WebApp webApp = (org.eclipse.jst.j2ee.webapplication.WebApp)ModelProviderManager.getModelProvider(project).getModelObject();
- // create or update servlet ref
- org.eclipse.jst.j2ee.webapplication.Servlet servlet = JSFUtils11.findJSFServlet(webApp);// check to see
- // if already
- // present
-
-// No longer removing any old mappings on install - see 194919
-// if (servlet != null) {
-// // remove old mappings
-// JSFUtils11.removeURLMappings(webApp, servlet);
-// }
-
- servlet = JSFUtils11
- .createOrUpdateServletRef(webApp, config, servlet);
-
- // init mappings
- List listOfMappings = getServletMappings(config);
- JSFUtils11.setUpURLMappings(webApp, listOfMappings, servlet);
-
- // setup context params
- setupContextParams(webApp, config);
- }
-
- private void setupContextParams(final org.eclipse.jst.j2ee.webapplication.WebApp webApp, final IDataModel config) {
- if (webApp.getVersionID() == J2EEVersionConstants.WEB_2_3_ID)//shouldn't have to do it this way, but that's the way it goes 119442
- JSFUtils11.setupConfigFileContextParamForV2_3(webApp, config);
- else
- JSFUtils11.setupConfigFileContextParamForV2_4(webApp, config);
- }
- }
-
-
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFFacetPrimaryRuntimeChangedListener.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFFacetPrimaryRuntimeChangedListener.java
deleted file mode 100644
index e855551..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFFacetPrimaryRuntimeChangedListener.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.project.facet;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jst.common.project.facet.core.ClasspathHelper;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigUtils;
-import org.eclipse.jst.jsf.core.jsflibraryconfiguration.JSFLibraryConfigurationHelper;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;
-import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
-import org.eclipse.wst.common.project.facet.core.events.IPrimaryRuntimeChangedEvent;
-
-/**
- * Handles primary runtime changed events when the JSF Facet is installed
- *
- * @since JSF 1.0.1
- */
-public class JSFFacetPrimaryRuntimeChangedListener implements IFacetedProjectListener {
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener#handleEvent(org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent)
- */
- public void handleEvent(IFacetedProjectEvent event) {
- if (event instanceof IPrimaryRuntimeChangedEvent &&
- getJSFFacetedVersion(event.getProject().getProject()) != null && //must be a JSF faceted project
- JSFLibraryConfigurationHelper.isConfiguredForSystemSuppliedImplementation(event.getProject().getProject())){
-
- try {
- IProject project = event.getProject().getProject();
- IProjectFacetVersion fv = getJSFFacetedVersion(project);
- ClasspathHelper.removeClasspathEntries(project, fv);
- ClasspathHelper.addClasspathEntries(project, fv);
- } catch (CoreException e) {
- JSFCorePlugin.log(IStatus.ERROR, "Unable to replace server supplied implementation when runtime changed.", e);//$NON-NLS-1$
- }
- }
-
- }
-
- /**
- * @param project
- * @return IProjectFacetVersion and null if not JSF faceted
- */
- private IProjectFacetVersion getJSFFacetedVersion(IProject project) {
- return JSFAppConfigUtils.getProjectFacet(project);
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFFacetUninstallDelegate.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFFacetUninstallDelegate.java
deleted file mode 100644
index 892f8f3..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFFacetUninstallDelegate.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.project.facet;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jst.common.project.facet.core.ClasspathHelper;
-import org.eclipse.jst.j2ee.model.IModelProvider;
-import org.eclipse.jst.j2ee.model.ModelProviderManager;
-import org.eclipse.jst.javaee.core.ParamValue;
-import org.eclipse.jst.javaee.web.Servlet;
-import org.eclipse.jst.javaee.web.WebApp;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.core.internal.Messages;
-import org.eclipse.jst.jsf.core.jsflibraryconfiguration.JSFLibraryConfigurationHelper;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.common.project.facet.core.IDelegate;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-/**
- * JSF Facet Un-install Delegate for WTP faceted projects.
- *
- * <li> removes JSF servlet, servlet-mappings and context-params
- * <li> leaves JSF configuration files on disk
- * <li> removes JSF classpath containers
- *
- */
-public final class JSFFacetUninstallDelegate implements IDelegate {
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.project.facet.core.IDelegate#execute(org.eclipse.core.resources.IProject, org.eclipse.wst.common.project.facet.core.IProjectFacetVersion, java.lang.Object, org.eclipse.core.runtime.IProgressMonitor)
- */
- public void execute(final IProject project, final IProjectFacetVersion fv,
- final Object config, final IProgressMonitor monitor) throws CoreException {
- {
-
- if (monitor != null) {
- monitor.beginTask("", 1); //$NON-NLS-1$
- }
-
- try {
- //Before we do any de-configuration, verify that web.xml is available for update
- IModelProvider provider = JSFUtils.getModelProvider(project);
- if (provider == null ) {
- throw new JSFFacetException(NLS.bind(Messages.JSFFacetUninstallDelegate_ConfigErr, project.getName()));
- } else if (!(provider.validateEdit(null, null).isOK())){
- throw new JSFFacetException(NLS.bind(Messages.JSFFacetUninstallDelegate_NonUpdateableWebXML, project.getName()));
- }
-
- // Remove JSF Libraries
- removeJSFLibraries(project, fv, monitor);
-
- //Remove Runtime contributed JSF classpath entries
- removeRuntimeContributedJSFClasspathEntries(project, fv, monitor);
-
- // remove servlet stuff from web.xml
- uninstallJSFReferencesFromWebApp(project, monitor);
-
- if (monitor != null) {
- monitor.worked(1);
- }
-
- } finally {
- if (monitor != null) {
- monitor.done();
- }
- }
- }
- }
-
- /**
- * Removes JSF Lib CP Containers from project
- * @param project
- * @param monitor
- */
- private void removeJSFLibraries(final IProject project, final IProjectFacetVersion fv, final IProgressMonitor monitor) {
- final IJavaProject jproj = JavaCore.create(project);
- List keptEntries = new ArrayList();
- try {
- IClasspathEntry[] entries = jproj.getRawClasspath();
- keptEntries = new ArrayList();
- for (int i=0;i<entries.length;i++){
- IClasspathEntry entry = entries[i];
- if ( !(JSFLibraryConfigurationHelper.isJSFLibraryContainer(entry)))
- keptEntries.add(entry);
- }
- } catch (JavaModelException e) {
- JSFCorePlugin.log(e, "Cannot get classpath entries to remove JSF Libraries for: "+project.getName()); //$NON-NLS-1$
- }
-
- if (keptEntries.size() > 0){
- try {
- jproj.setRawClasspath((IClasspathEntry[])keptEntries.toArray(new IClasspathEntry[0]), monitor);
- } catch (JavaModelException e) {
- JSFCorePlugin.log(e, "Exception occured while removing JSF Libraries during JSF Facet uninstall"); //$NON-NLS-1$
- }
- }
-
-
- }
-
- private void removeRuntimeContributedJSFClasspathEntries(final IProject project, final IProjectFacetVersion fv, final IProgressMonitor monitor) {
- try {
- ClasspathHelper.removeClasspathEntries(project, fv);
- } catch (CoreException e) {
- JSFCorePlugin.log(IStatus.ERROR, "Unable to remove server supplied implementation from the classpath.", e);//$NON-NLS-1$
- }
- }
-
- private void uninstallJSFReferencesFromWebApp(final IProject project,
- final IProgressMonitor monitor) {
-
- IModelProvider provider = JSFUtils.getModelProvider(project);
- Object webAppObj = provider.getModelObject();
- if (webAppObj != null) {
- IPath ddPath = new Path("WEB-INF").append("web.xml"); //$NON-NLS-1$ //$NON-NLS-2$
- if (isJavaEEWebApp(webAppObj)){
- WebApp webApp = (WebApp)webAppObj;
- Servlet servlet = JSFUtils12.findJSFServlet(webApp);
- if (servlet == null)
- return;
-
- provider.modify(new RemoveJSFFromJavaEEWebAppOperation(project), ddPath);
- } else {//2.3 or 2.4 web app
- org.eclipse.jst.j2ee.webapplication.WebApp webApp = (org.eclipse.jst.j2ee.webapplication.WebApp)webAppObj;
- org.eclipse.jst.j2ee.webapplication.Servlet servlet = JSFUtils11.findJSFServlet(webApp);
- if (servlet == null)
- return;
-
- provider.modify(new RemoveJSFFromJ2EEWebAppOperation(project), ddPath);
- }
- }
- }
-
- private boolean isJavaEEWebApp(final Object webAppObj) {
- if (webAppObj instanceof WebApp)
- return true;
-
- return false;
-
- }
-
- static class RemoveJSFFromJavaEEWebAppOperation implements Runnable {
- private IProject _project;
-
- RemoveJSFFromJavaEEWebAppOperation(final IProject project){
- this._project = project;
- }
-
- public void run() {
- WebApp webApp = (WebApp) ModelProviderManager.getModelProvider(_project).getModelObject();
- Servlet servlet = JSFUtils12.findJSFServlet(webApp);
-
- // remove faces url mappings
- JSFUtils12.removeURLMappings(webApp, servlet);
- // remove context params
- removeJSFContextParams(webApp, servlet);
- // remove servlet
- removeJSFServlet(webApp, servlet);
-
- }
- private void removeJSFContextParams(final WebApp webApp, final Servlet servlet) {
- Iterator it = webApp.getContextParams().iterator();
- while (it.hasNext()) {
- ParamValue cp = (ParamValue) it.next();
- if (cp.getParamName().equals(JSFUtils.JSF_CONFIG_CONTEXT_PARAM)) {
- webApp.getContextParams().remove(cp);
- break;
- }
- }
- }
-
- private void removeJSFServlet(final WebApp webApp, final Servlet servlet) {
- webApp.getServlets().remove(servlet);
- }
-
- }
-
- static class RemoveJSFFromJ2EEWebAppOperation implements Runnable {
- private IProject _project;
-
- RemoveJSFFromJ2EEWebAppOperation(final IProject project){
- this._project = project;
- }
-
- public void run() {
- org.eclipse.jst.j2ee.webapplication.WebApp webApp = (org.eclipse.jst.j2ee.webapplication.WebApp) ModelProviderManager.getModelProvider(_project).getModelObject();
- org.eclipse.jst.j2ee.webapplication.Servlet servlet = JSFUtils11.findJSFServlet(webApp);
-
- // remove faces url mappings
- JSFUtils11.removeURLMappings(webApp, servlet);
- // remove context params
- removeJSFContextParams(webApp, servlet);
- // remove servlet
- removeJSFServlet(webApp, servlet);
-
- }
- private void removeJSFContextParams(final org.eclipse.jst.j2ee.webapplication.WebApp webApp, final org.eclipse.jst.j2ee.webapplication.Servlet servlet) {
- Iterator it = webApp.getContextParams().iterator();
- while (it.hasNext()) {
- org.eclipse.jst.j2ee.common.ParamValue cp = (org.eclipse.jst.j2ee.common.ParamValue) it.next();
- if (cp.getName().equals(JSFUtils.JSF_CONFIG_CONTEXT_PARAM)) {
- webApp.getContextParams().remove(cp);
- break;
- }
- }
- }
-
- private void removeJSFServlet(final org.eclipse.jst.j2ee.webapplication.WebApp webApp, final org.eclipse.jst.j2ee.webapplication.Servlet servlet) {
- webApp.getServlets().remove(servlet);
- }
-
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFUtils.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFUtils.java
deleted file mode 100644
index 88e8d61..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFUtils.java
+++ /dev/null
@@ -1,327 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.core.internal.project.facet;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jst.j2ee.model.IModelProvider;
-import org.eclipse.jst.j2ee.model.ModelProviderManager;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.core.internal.Messages;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-
-/**
- *
- */
-public abstract class JSFUtils {
- /**
- * The default name for the Faces servlet
- */
- public static final String JSF_DEFAULT_SERVLET_NAME = "Faces Servlet"; //$NON-NLS-1$
- /**
- * The default name of the Faces servlet class
- */
- public static final String JSF_SERVLET_CLASS = "javax.faces.webapp.FacesServlet"; //$NON-NLS-1$
- /**
- * The name of the context parameter used for JSF configuration files
- */
- public static final String JSF_CONFIG_CONTEXT_PARAM = "javax.faces.CONFIG_FILES"; //$NON-NLS-1$
-
- /**
- * The name of the context parameter used for defining the default JSP file extension
- */
- public static final String JSF_DEFAULT_SUFFIX_CONTEXT_PARAM = "javax.faces.DEFAULT_SUFFIX"; //$NON-NLS-1$
-
- /**
- * The path to the default application configuration file
- */
- public static final String JSF_DEFAULT_CONFIG_PATH = "/WEB-INF/faces-config.xml"; //$NON-NLS-1$
-
- /**
- * Default URL mapping to faces servlet
- */
- public static final String JSF_DEFAULT_URL_MAPPING = "/faces/*"; //$NON-NLS-1$
-
- /**
- * the key for implementation libraries in persistent properties
- * TODO: should encapsulate the property somewhere and hide the constant
- */
- public static final String PP_JSF_IMPLEMENTATION_LIBRARIES = "jsf.implementation.libraries"; //$NON-NLS-1$
- /**
- * the key for component libraries in persistent properties
- * TODO: should encapsulate the property somewhere and hide the constant
- */
- public static final String PP_JSF_COMPONENT_LIBRARIES = "jsf.component.libraries"; //$NON-NLS-1$
- /**
- * the key for implementation type in persistent properties
- * TODO: should encapsulate the property somewhere and hide the constant
- */
- public static final String PP_JSF_IMPLEMENTATION_TYPE = "jsf.implementation.type"; //$NON-NLS-1$
- /**
- * Construct an array that hold paths for all JARs in a JSF library.
- * However, archive files that no longer exist are filtered out.
- *
- * @param jsfLib
- * @param logMissingJar true to log an error for each invalid JAR.
- * @return elements
- */
- public static IPath[] getJARPathforJSFLibwFilterMissingJars(JSFLibrary jsfLib, boolean logMissingJar) {
- EList archiveFiles = jsfLib.getArchiveFiles();
- int numJars = numberofValidJar(archiveFiles);
- IPath[] elements = new IPath[numJars];
- ArchiveFile ar = null;
- int idxValidJar = 0;
- for (int i= 0; i < archiveFiles.size(); i++) {
- ar = (ArchiveFile)archiveFiles.get(i);
- if ( !ar.exists() ) {
- if (logMissingJar) {
- logErroronMissingJAR(jsfLib, ar);
- }
- } else {
- elements[idxValidJar] = new Path(((ArchiveFile)archiveFiles.get(i)).getResolvedSourceLocation()).makeAbsolute();
- idxValidJar++;
- }
- }
- return elements;
- }
-
- /**
- * Construct an array that hold paths for all JARs in a JSF library.
- *
- * @param jsfLib
- * @param logMissingJar true to log an error for each invalid JAR.
- * @return elements
- */
- public static IPath[] getJARPathforJSFLib(JSFLibrary jsfLib, boolean logMissingJar) {
- EList archiveFiles = jsfLib.getArchiveFiles();
- int numJars = archiveFiles.size();
- IPath[] elements = new IPath[numJars];
- ArchiveFile ar = null;
- for (int i= 0; i < numJars; i++) {
- ar = (ArchiveFile)archiveFiles.get(i);
- if ( !ar.exists() && logMissingJar ) {
- logErroronMissingJAR(jsfLib, ar);
- }
- elements[i] = new Path(((ArchiveFile)archiveFiles.get(i)).getResolvedSourceLocation()).makeAbsolute();
- }
- return elements;
- }
-
- private static int numberofValidJar(EList archiveFiles) {
- int total = 0;
- final Iterator it = archiveFiles.iterator();
- ArchiveFile ar = null;
- while(it.hasNext()) {
- ar = (ArchiveFile) it.next();
- if (ar.exists()) {
- total++;
- }
- }
- return total;
- }
-
- private static void logErroronMissingJAR(JSFLibrary jsfLib, ArchiveFile ar) {
- String msg = NLS.bind(Messages.JSFUtils_MissingJAR,
- ar.getName(),
- jsfLib.getLabel());
- JSFCorePlugin.log(IStatus.ERROR, msg);
- }
-
-
- /**
- * @param config
- * @return servlet display name to use from wizard data model
- */
- protected static String getDisplayName(IDataModel config) {
- String displayName = config.getStringProperty(IJSFFacetInstallDataModelProperties.SERVLET_NAME);
- if (displayName == null || displayName.trim().equals("")) //$NON-NLS-1$
- displayName = JSF_DEFAULT_SERVLET_NAME;
- return displayName.trim();
- }
-
- /**
- * @param config
- * @return servlet display name to use from wizard data model
- */
- protected static String getServletClassname(IDataModel config) {
- String className = config.getStringProperty(IJSFFacetInstallDataModelProperties.SERVLET_CLASSNAME);
- if (className == null || className.trim().equals("")) //$NON-NLS-1$
- className = JSF_SERVLET_CLASS;
- return className.trim();
- }
-
- /**
- * Servlet 2.3_SRV.11.2: a string that begins with a "/" and ends
- * with "/*" is a prefix mapping
- *
- * @param mapping
- * @return true if the mapping string represents a prefix mapping
- */
- public static boolean isPrefixMapping(final String mapping)
- {
- if (mapping == null || mapping.length() < 4)
- {
- return false;
- }
-
- return mapping.charAt(0) == '/' && mapping.endsWith("/*");
- }
-
- /**
- * Servlet 2.3_SRV.11.2: a string that begins with "*."
- * is an extension mapping
- *
- * @param mapping
- * @return true if mapping is an extension mapping
- */
- public static boolean isExtensionMapping(final String mapping)
- {
- if (mapping == null)
- {
- return false;
- }
-
- return mapping.startsWith("*.");
- }
-
- /**
- * @param webProject
- * @return IModelProvider
- */
- public static IModelProvider getModelProvider(IProject webProject) {
- IModelProvider provider = ModelProviderManager.getModelProvider(webProject);
- Object webAppObj = provider.getModelObject();
- if (webAppObj == null){
- return null;
- }
- return provider;
- }
-
- /**
- * Search the list of servlet-mappings for the first extension and prefix mappings. The contents
- * of mappings is assumed to be all url-pattern's.
- *
- * If prefExtMapping is not null, it is an extension mapping and
- * it is in mappings, then it is returned. Otherwise, the first extension
- * mapping in mappings is returned. Returns null if mappings does not
- * contain an extension mapping. The same algorithm holds for prefPrefixMapping and
- * corresponding prefix mapping.
- *
- * See isExtensionMapping and isPrefixMapping for more information on url patterns.
- *
- * @param mappings
- * @param prefExtMapping
- * @param prefPrefixMapping
- * @return the result
- */
- public static MappingSearchResult searchServletMappings(
- final List<String> mappings, String prefExtMapping,
- String prefPrefixMapping) {
- String firstExtFound = null;
- String firstPrefixFound = null;
- boolean foundExtMapping = false;
- boolean foundPrefixMapping = false;
-
- // if the caller has no preferredMapping, then
- // set it to something guaranteed to be non-null
- // and which is guaranteed not to match anything
- // that pass isExtensionMapping
- if (prefExtMapping == null) {
- prefExtMapping = "NOTANEXTENSIONMAPPING";
- }
-
- // similarly, guarantee that if the caller has no
- // preferred prefix mapping, that we set a non-null
- // comp mapping
- if (prefPrefixMapping == null) {
- prefPrefixMapping = "NOTAPREFIXMAPPING";
- }
-
- SEARCH_LOOP: for (String mapping : mappings) {
- if (isExtensionMapping(mapping)) {
- // can assum that mapping is non-null since
- // it is an ext mapping
- if (prefExtMapping.equals(mapping.trim())) {
- firstExtFound = prefExtMapping;
- continue;
- }
-
- if (firstExtFound == null) {
- firstExtFound = mapping.trim();
- }
- } else if (isPrefixMapping(mapping)) {
- if (prefPrefixMapping.equals(mapping.trim())) {
- firstPrefixFound = prefPrefixMapping;
- continue;
- }
-
- if (firstPrefixFound == null) {
- firstPrefixFound = mapping.trim();
- }
- }
-
- if (foundExtMapping && foundPrefixMapping) {
- break SEARCH_LOOP;
- }
- }
-
- return new MappingSearchResult(firstExtFound, firstPrefixFound);
- }
-
- /**
- * The result of a servlet mapping search
- *
- */
- public static class MappingSearchResult {
- private final String _extensionMapping; // may be null;
- private final String _prefixMapping; // may be null
-
- MappingSearchResult(final String extensionMapping,
- final String prefixMapping) {
- _extensionMapping = extensionMapping;
- _prefixMapping = prefixMapping;
- }
-
- /**
- * @return true if the search yielded a valid result
- */
- public boolean isResult() {
- return _extensionMapping != null || _prefixMapping != null;
- }
-
- /**
- * @return the first extension mapping matching search criteria or null
- * if none
- */
- public final String getExtensionMapping() {
- return _extensionMapping;
- }
-
- /**
- * @return the first prefix mapping matching search criteria or null
- * if none
- */
- public final String getPrefixMapping() {
- return _prefixMapping;
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFUtils11.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFUtils11.java
deleted file mode 100644
index 8fa212f..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFUtils11.java
+++ /dev/null
@@ -1,464 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.core.internal.project.facet;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jst.j2ee.common.CommonFactory;
-import org.eclipse.jst.j2ee.common.ParamValue;
-import org.eclipse.jst.j2ee.web.componentcore.util.WebArtifactEdit;
-import org.eclipse.jst.j2ee.webapplication.ContextParam;
-import org.eclipse.jst.j2ee.webapplication.JSPType;
-import org.eclipse.jst.j2ee.webapplication.Servlet;
-import org.eclipse.jst.j2ee.webapplication.ServletMapping;
-import org.eclipse.jst.j2ee.webapplication.ServletType;
-import org.eclipse.jst.j2ee.webapplication.WebApp;
-import org.eclipse.jst.j2ee.webapplication.WebapplicationFactory;
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.core.internal.Messages;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-/**
- * Utility file for JSF model v1.1
- *
- * @author Gerry Kessler - Oracle
- */
-public class JSFUtils11 extends JSFUtils {
-
- /**
- * Convenience method for getting writeable WebApp model
- * @param project
- * @return WebArtifactEdit
- * @deprecated - must use IModelProviders
- */
- public static WebArtifactEdit getWebArtifactEditForWrite(final IProject project) {
- return WebArtifactEdit.getWebArtifactEditForWrite(project);
- }
-
- /**
- * Convenience method for getting read-only WebApp model
- * @param project
- * @return WebArtifactEdit
- * @deprecated - must use IModelProviders
- */
- public static WebArtifactEdit getWebArtifactEditForRead(final IProject project) {
- return WebArtifactEdit.getWebArtifactEditForRead(project);
- }
-
- /**
- * @param webApp as Object
- * @return Servlet - the JSF Servlet for the specified WebApp or null if not present
- */
- public static Servlet findJSFServlet(final Object webApp) {
- Iterator it = null;
- if (webApp == null)
- return null;
- else if (webApp instanceof WebApp)
- it = ((WebApp)webApp).getServlets().iterator();
- else if (webApp instanceof org.eclipse.jst.javaee.web.WebApp)
- it = ((org.eclipse.jst.javaee.web.WebApp)webApp).getServlets().iterator();
- else
- return null;
-
- while (it.hasNext()) {
- Servlet servlet = (Servlet) it.next();
- if (servlet != null && servlet.getWebType() != null) {
-
- if( servlet.getWebType().isServletType()) {
- if (((ServletType) servlet.getWebType()).getClassName() != null &&
- ((ServletType) servlet.getWebType()).getClassName().trim().equals(
- JSF_SERVLET_CLASS)) {
- return servlet;
- }
- } else if (servlet.getWebType().isJspType()) {
- if (((JSPType) servlet.getWebType()).getJspFile() != null &&
- ((JSPType) servlet.getWebType()).getJspFile().trim().equals(
- JSF_SERVLET_CLASS)) {
- return servlet;
- }
- }
- }
- }
-
- // if we get to here then we have finished the loop
- // without finding the servlet we're looking for
- return null;
- }
-
- /**
- * Creates a stubbed JSF configuration file for specified JSF version and path
- * @param jsfVersion
- * @param configPath
- */
- public static void createConfigFile(final String jsfVersion, final IPath configPath) {
- FileOutputStream os = null;
- PrintWriter pw = null;
- final String QUOTE = new String(new char[] { '"' });
- try {
- IPath dirPath = configPath.removeLastSegments(1);
- dirPath.toFile().mkdirs();
- File file = configPath.toFile();
- file.createNewFile();
- os = new FileOutputStream(file);
- pw = new PrintWriter(os);
- pw.write("<?xml version=" + QUOTE + "1.0" + QUOTE + " encoding=" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- + QUOTE + "UTF-8" + QUOTE + "?>\n\n"); //$NON-NLS-1$ //$NON-NLS-2$
-
- if (jsfVersion.equals(IJSFCoreConstants.FACET_VERSION_1_1))
- {
- pw.write("<!DOCTYPE faces-config PUBLIC\n"); //$NON-NLS-1$
- pw
- .write(" " //$NON-NLS-1$
- + QUOTE
- + "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN" //$NON-NLS-1$
- + QUOTE + "\n"); //$NON-NLS-1$
- pw.write(" " + QUOTE //$NON-NLS-1$
- + "http://java.sun.com/dtd/web-facesconfig_1_1.dtd" //$NON-NLS-1$
- + QUOTE + ">\n\n"); //$NON-NLS-1$
-
- pw.write("<faces-config>\n\n"); //$NON-NLS-1$
- pw.write("</faces-config>\n"); //$NON-NLS-1$
- }
-
- pw.close();
- pw = null;
- } catch (FileNotFoundException e) {
- JSFCorePlugin.log(IStatus.ERROR, Messages.JSFUtils_ErrorCreatingConfigFile, e);
- } catch (IOException e) {
- JSFCorePlugin.log(IStatus.ERROR, Messages.JSFUtils_ErrorCreatingConfigFile, e);
- } finally {
- if (pw != null)
- pw.close();
- if (os != null) {
- try {
- os.close();
- } catch (IOException e) {
- JSFCorePlugin.log(IStatus.ERROR, Messages.JSFUtils_ErrorClosingConfigFile, e);
- }
- }
- }
- }
-
- /**
- * Creates servlet reference in WebApp if not present or updates servlet name if found
- * using the passed configuration.
- *
- * @param webApp
- * @param config
- * @param servlet
- * @return Servlet servlet - if passed servlet was null, will return created servlet
- */
- public static Servlet createOrUpdateServletRef(final WebApp webApp,
- final IDataModel config, Servlet servlet) {
-
- String displayName = getDisplayName(config);
- String className = getServletClassname(config);
-
- if (servlet == null){
- // Create the servlet instance and set up the parameters from data
- // model
- servlet = WebapplicationFactory.eINSTANCE.createServlet();
- servlet.setServletName(displayName);
-
- ServletType servletType = WebapplicationFactory.eINSTANCE
- .createServletType();
- servletType.setClassName(className);
- servlet.setWebType(servletType);
- servlet.setLoadOnStartup(Integer.valueOf(1));
- // Add the servlet to the web application model
- webApp.getServlets().add(servlet);
- } else {
- // update
- updateServletMappings(webApp, servlet, servlet.getServletName().trim(), displayName);
- servlet.setServletName(displayName);
- servlet.setLoadOnStartup(Integer.valueOf(1));
- }
- return servlet;
- }
-
- private static void updateServletMappings(final WebApp webApp, final Servlet servlet,
- final String servletName, final String newServletName) {
- List<ServletMapping> mappings = findServletMappings(webApp, servlet, servletName);
- for (ServletMapping map : mappings){
- map.setName(newServletName);
- }
-
- }
-
-
- private static List<ServletMapping> findServletMappings(final WebApp webApp, final Servlet servlet, final String servletName) {
- List<ServletMapping> mappings = new ArrayList<ServletMapping>();
- List<ServletMapping> allMappings = webApp.getServletMappings();
- for (int i=allMappings.size()-1;i>=0;--i){
- ServletMapping mapping = allMappings.get(i);
- if (mapping != null &&
- mapping.getServlet() != null &&
- mapping.getServlet().getServletName() != null &&
- mapping.getServlet().getServletName().trim().equals(servletName))
- mappings.add(mapping);
- }
- return mappings;
- }
-
- /**
- * @param webApp as Object
- * @return true if webApp instanceof org.eclipse.jst.javaee.web.WebApp
- */
- public static boolean isWebApp25(final Object webApp) {
- if (webApp instanceof org.eclipse.jst.javaee.web.WebApp)
- return true;
- return false;
- }
-
- /**
- * Creates servlet-mappings for the servlet
- *
- * @param webApp
- * @param urlMappingList - list of string values to be used in url-pattern for servlet-mapping
- * @param servlet
- */
- public static void setUpURLMappings(final WebApp webApp, final List urlMappingList,
- final Servlet servlet) {
- // Add mappings
- Iterator it = urlMappingList.iterator();
- while (it.hasNext()) {
- String pattern = (String) it.next();
- if (!(doesServletMappingExist(webApp, servlet, pattern))){
- ServletMapping mapping = WebapplicationFactory.eINSTANCE
- .createServletMapping();
- mapping.setServlet(servlet);
- mapping.setName(servlet.getServletName());
- mapping.setUrlPattern(pattern);
- webApp.getServletMappings().add(mapping);
- }
- }
- }
-
-
- private static boolean doesServletMappingExist(final WebApp webApp, final Servlet servlet,
- final String pattern) {
-
- List mappings = webApp.getServletMappings();
- String servletName = servlet.getServletName();
- if (servletName != null) {
- for (int i=mappings.size()-1;i>=0;--i){
- ServletMapping mapping = (ServletMapping)mappings.get(i);
- if (mapping != null &&
- mapping.getServlet() != null &&
- mapping.getServlet().getServletName() != null &&
- mapping.getServlet().getServletName().trim().equals(servletName) &&
- mapping.getUrlPattern() != null &&
- mapping.getUrlPattern().trim().equals(pattern)) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Removes servlet-mappings for servlet using servlet-name.
- * @param webApp
- * @param servlet
- */
- public static void removeURLMappings(final WebApp webApp, final Servlet servlet) {
- List mappings = webApp.getServletMappings();
- String servletName = servlet.getServletName();
- if (servletName != null) {
- for (int i=mappings.size()-1;i>=0;--i){
- ServletMapping mapping = (ServletMapping)mappings.get(i);
- if (mapping != null &&
- mapping.getServlet() != null &&
- mapping.getServlet().getServletName() != null &&
- mapping.getServlet().getServletName().trim()
- .equals(servletName)) {
- mappings.remove(mapping);
- }
- }
- }
- }
-
- /**
- * Creates or updates config file context-param in v 2.3 WebApp if non default configuration file is specified.
- * @param webApp
- * @param config
- */
- public static void setupConfigFileContextParamForV2_3(final WebApp webApp,
- final IDataModel config) {
- // if not default name and location, then add context param
- ContextParam cp = null;
- ContextParam foundCP = null;
- boolean found = false;
- if (!config.getStringProperty(IJSFFacetInstallDataModelProperties.CONFIG_PATH).equals(JSF_DEFAULT_CONFIG_PATH)) {
- // check to see if present
- Iterator it = webApp.getContexts().iterator();
- while (it.hasNext()) {
- cp = (ContextParam) it.next();
- if (cp != null &&
- cp.getParamName() != null &&
- cp.getParamName().equals(JSF_CONFIG_CONTEXT_PARAM)) {
- foundCP = cp;
- found = true;
- }
- }
- if (!found) {
- cp = WebapplicationFactory.eINSTANCE.createContextParam();
- cp.setParamName(JSF_CONFIG_CONTEXT_PARAM);
- cp.setParamValue(config.getStringProperty(IJSFFacetInstallDataModelProperties.CONFIG_PATH));
- webApp.getContexts().add(cp);
- } else {
- cp = foundCP;
- if (cp.getParamValue().indexOf(config.getStringProperty(IJSFFacetInstallDataModelProperties.CONFIG_PATH)) < 0) {
- String curVal = cp.getParamValue();
- String val = config.getStringProperty(IJSFFacetInstallDataModelProperties.CONFIG_PATH);
- if (curVal != null && !"".equals(curVal.trim())) { //$NON-NLS-1$
- val = curVal + ",\n" + val; //$NON-NLS-1$
- }
- cp.setParamValue(val);
- }
- }
- }
- }
- /**
- * Creates or updates config file context-param in v2.4 WebApp if non default configuration file is specified.
- * @param webApp
- * @param config
- */
- public static void setupConfigFileContextParamForV2_4(final WebApp webApp,
- final IDataModel config) {
- // if not default name and location, then add context param
- ParamValue foundCP = null;
- ParamValue cp = null;
- boolean found = false;
- if (!config.getStringProperty(IJSFFacetInstallDataModelProperties.CONFIG_PATH).equals(JSF_DEFAULT_CONFIG_PATH)) {
- // check to see if present
- Iterator it = webApp.getContextParams().iterator();
- while (it.hasNext()) {
- cp = (ParamValue) it.next();
- if (cp != null &&
- cp.getName() != null &&
- cp.getName().trim().equals(JSF_CONFIG_CONTEXT_PARAM)) {
- foundCP = cp;
- found = true;
- }
- }
- if (!found) {
- ParamValue pv = CommonFactory.eINSTANCE.createParamValue();
- pv.setName(JSF_CONFIG_CONTEXT_PARAM);
- pv.setValue(config.getStringProperty(IJSFFacetInstallDataModelProperties.CONFIG_PATH));
- webApp.getContextParams().add(pv);
- } else {
- cp = foundCP;
- if (cp.getValue().indexOf(config.getStringProperty(IJSFFacetInstallDataModelProperties.CONFIG_PATH)) < 0) {
- String curVal = cp.getValue();
- String val = config.getStringProperty(IJSFFacetInstallDataModelProperties.CONFIG_PATH);
- if (curVal != null && !"".equals(curVal.trim())) { //$NON-NLS-1$
- val = curVal + ",\n" + val; //$NON-NLS-1$
- }
- cp.setValue(val);
- }
- }
- }
- }
-
- /**
- * @param webAppObj as Object
- * @return true if webApp instanceof org.eclipse.jst.j2ee.web.WebApp and versionID == 24
- */
- public static boolean isWebApp24(final Object webAppObj) {
- if (webAppObj instanceof WebApp &&
- ((WebApp)webAppObj).getVersionID() == 24)
- return true;
- return false;
- }
-
- /**
- * @param webAppObj as Object
- * @return true if webApp instanceof org.eclipse.jst.j2ee.web.WebApp and versionID == 23
- */
- public static boolean isWebApp23(final Object webAppObj) {
- if (webAppObj instanceof WebApp &&
- ((WebApp)webAppObj).getVersionID() == 23)
- return true;
- return false;
- }
-
- /**
- * @param webApp
- * @return the default file extension from the context param. Default is "jsp" if no context param.
- */
- public static String getDefaultSuffix(final WebApp webApp) {
- String defaultSuffix = "jsp"; //$NON-NLS-1$
- for (Iterator it = webApp.getContexts().iterator();it.hasNext();) {
- ContextParam cp = (ContextParam) it.next();
- if (cp != null &&
- cp.getParamName() != null &&
- cp.getParamName().trim().equals(JSF_DEFAULT_SUFFIX_CONTEXT_PARAM)){
- String defSuffix = cp.getParamValue();
- if (defSuffix.startsWith(".")) //$NON-NLS-1$
- defSuffix = defSuffix.substring(1);
-
- return defSuffix;
- }
- }
- return defaultSuffix;
- }
-
- /**
- * @param map
- * @return prefix mapping. may return null.
- */
- public static String getPrefixMapping(final ServletMapping map) {
- IPath extPath = new Path(map.getUrlPattern());
- if (extPath != null){
- String ext = extPath.getFileExtension();
- if (ext == null){
- String lastSeg = extPath.lastSegment();
- if (lastSeg != null &&
- lastSeg.equals("*")) //$NON-NLS-1$
- {
- return extPath.removeLastSegments(1).toString();
- }
-
- return extPath.toString();
- }
- }
- return null;
- }
-
- /**
- * @param map
- * @return extension from map. Will return null if file extension not found in url patterns.
- */
- public static String getFileExtensionFromMap(final ServletMapping map) {
- IPath extPath = new Path(map.getUrlPattern());
- if (extPath != null){
- String ext = extPath.getFileExtension();
- if (ext != null && !ext.equals("")) //$NON-NLS-1$
- return ext;
- }
- return null;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFUtils12.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFUtils12.java
deleted file mode 100644
index 71a2b2b..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFUtils12.java
+++ /dev/null
@@ -1,354 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.core.internal.project.facet;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jst.javaee.core.JavaeeFactory;
-import org.eclipse.jst.javaee.core.ParamValue;
-import org.eclipse.jst.javaee.core.UrlPatternType;
-import org.eclipse.jst.javaee.web.Servlet;
-import org.eclipse.jst.javaee.web.ServletMapping;
-import org.eclipse.jst.javaee.web.WebApp;
-import org.eclipse.jst.javaee.web.WebAppVersionType;
-import org.eclipse.jst.javaee.web.WebFactory;
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.core.internal.Messages;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-/**
- * Utility file for JSF v1.2 model
- *
- * @author Gerry Kessler - Oracle
- */
-public class JSFUtils12 extends JSFUtils {
-
- /**
- * @param webApp
- * @return Servlet - the JSF Servlet for the specified WebApp or null if not present
- */
- public static Servlet findJSFServlet(final WebApp webApp) {
-
- Iterator it = webApp.getServlets().iterator();
-
- while (it.hasNext()) {
- Servlet servlet = (Servlet) it.next();
- if (servlet.getServletClass() != null &&
- servlet.getServletClass().trim().equals (JSF_SERVLET_CLASS)) {
- return servlet;
- }
- }
-
- // if we get to here then we have finished the loop
- // without finding the servlet we're looking for
- return null;
- }
-
- /**
- * Creates a stubbed JSF v1.2 configuration file for specified JSF version and path
- * @param jsfVersion
- * @param configPath
- */
- public static void createConfigFile(final String jsfVersion, final IPath configPath) {
- FileOutputStream os = null;
- PrintWriter pw = null;
- final String QUOTE = new String(new char[] { '"' });
- try {
- IPath dirPath = configPath.removeLastSegments(1);
- dirPath.toFile().mkdirs();
- File file = configPath.toFile();
- file.createNewFile();
- os = new FileOutputStream(file);
- pw = new PrintWriter(os);
- pw.write("<?xml version=" + QUOTE + "1.0" + QUOTE + " encoding=" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- + QUOTE + "UTF-8" + QUOTE + "?>\n\n"); //$NON-NLS-1$ //$NON-NLS-2$
-
- if (jsfVersion.equals(IJSFCoreConstants.FACET_VERSION_1_2))
- {
- pw.write("<faces-config\n"); //$NON-NLS-1$
- pw.write(" " + "xmlns=" + QUOTE //$NON-NLS-1$ //$NON-NLS-2$
- + "http://java.sun.com/xml/ns/javaee" + QUOTE + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
- pw.write(" " + "xmlns:xsi=" + QUOTE //$NON-NLS-1$ //$NON-NLS-2$
- + "http://www.w3.org/2001/XMLSchema-instance" + QUOTE //$NON-NLS-1$
- + "\n"); //$NON-NLS-1$
- pw
- .write(" " //$NON-NLS-1$
- + "xsi:schemaLocation=" //$NON-NLS-1$
- + QUOTE
- + "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd" //$NON-NLS-1$
- + QUOTE + "\n"); //$NON-NLS-1$
- pw.write(" " + "version=" + QUOTE + "1.2" + QUOTE + ">\n\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- pw.write("</faces-config>\n"); //$NON-NLS-1$
- }
-
- pw.close();
- pw = null;
- } catch (FileNotFoundException e) {
- JSFCorePlugin.log(IStatus.ERROR, Messages.JSFUtils_ErrorCreatingConfigFile, e);
- } catch (IOException e) {
- JSFCorePlugin.log(IStatus.ERROR, Messages.JSFUtils_ErrorCreatingConfigFile, e);
- } finally {
- if (pw != null)
- pw.close();
- if (os != null) {
- try {
- os.close();
- } catch (IOException e) {
- JSFCorePlugin.log(IStatus.ERROR, Messages.JSFUtils_ErrorClosingConfigFile, e);
- }
- }
- }
- }
-
-
- /**
- * Creates servlet reference in WebApp if not present or updates servlet name if found
- * using the passed configuration.
- *
- * @param webApp
- * @param config
- * @param servlet
- * @return Servlet servlet - if passed servlet was null, will return created servlet
- */
- public static Servlet createOrUpdateServletRef(final WebApp webApp,
- final IDataModel config, org.eclipse.jst.javaee.web.Servlet servlet) {
-
- String displayName = getDisplayName(config);
- String className = getServletClassname(config);
-
- if (servlet == null){
- // Create the servlet instance and set up the parameters from data
- // model
- servlet = WebFactory.eINSTANCE.createServlet();
- servlet.setServletName(displayName);
- servlet.setServletClass(className);
- servlet.setLoadOnStartup(Integer.valueOf(1));
- // Add the servlet to the web application model
- webApp.getServlets().add(servlet);
-
- } else {
- updateServletMappings(webApp, servlet, displayName);
- servlet.setServletName(displayName);
- servlet.setLoadOnStartup(Integer.valueOf(1));
- }
- return servlet;
- }
-
- private static void updateServletMappings(final WebApp webApp, final Servlet servlet,
- final String displayName) {
- // update mappings for new name
- ServletMapping mapping = findServletMapping(webApp, servlet);
- if (mapping != null) {
- mapping.setServletName(displayName);
- }
-
- }
-
- /**
- * @param webAppObj as Object
- * @return true if webApp instanceof org.eclipse.jst.javaee.web.WebApp and WebAppVersionType._25
- */
- public static boolean isWebApp25(final Object webAppObj) {
- if (webAppObj instanceof WebApp &&
- ((WebApp)webAppObj).getVersion() == WebAppVersionType._25_LITERAL)
- return true;
- return false;
- }
-
- /**
- * Creates servlet-mappings for the servlet for 2.5 WebModules or greated
- *
- * @param webApp
- * @param urlMappingList - list of string values to be used in url-pattern for servlet-mapping
- * @param servlet
- */
- public static void setUpURLMappings(final WebApp webApp, final List urlMappingList,
- final Servlet servlet) {
-
- if (urlMappingList.size() > 0) {
- ServletMapping mapping = findServletMapping(webApp, servlet);
- if (mapping == null){
- mapping = WebFactory.eINSTANCE.createServletMapping();
- mapping.setServletName(servlet.getServletName());
- webApp.getServletMappings().add(mapping);
- }
- // Add patterns
- Iterator it = urlMappingList.iterator();
- while (it.hasNext()) {
- String pattern = (String) it.next();
- if (!(doesServletMappingPatternExist(webApp, mapping, pattern))){
- UrlPatternType urlPattern = JavaeeFactory.eINSTANCE.createUrlPatternType();
- urlPattern.setValue(pattern);
- mapping.getUrlPatterns().add(urlPattern);
- }
- }
- }
- }
-
- private static ServletMapping findServletMapping(final WebApp webApp, final Servlet servlet) {
- for (Iterator it=webApp.getServletMappings().iterator();it.hasNext();){
- ServletMapping mapping = (ServletMapping)it.next();
- if (mapping.getServletName() != null &&
- servlet.getServletName() != null &&
- mapping.getServletName().trim().equals(servlet.getServletName().trim()))
- return mapping;
- }
- return null;
- }
-
- private static boolean doesServletMappingPatternExist(final WebApp webApp, final ServletMapping mapping,
- final String pattern) {
- for (Iterator it=mapping.getUrlPatterns().iterator();it.hasNext();){
- String patternTypeValue = ((UrlPatternType)it.next()).getValue();
- if( patternTypeValue != null &&
- pattern.equals(patternTypeValue.trim()))
- return true;
- }
- return false;
- }
-
- /**
- * Removes servlet-mappings for servlet using servlet-name for >= 2.5 WebModules.
- * @param webApp
- * @param servlet
- */
- public static void removeURLMappings(final WebApp webApp, final Servlet servlet) {
- List mappings = webApp.getServletMappings();
- String servletName = servlet.getServletName();
- if (servletName != null) {
- servletName = servletName.trim();
- for (int i=mappings.size()-1;i>=0;--i){
- ServletMapping mapping = (ServletMapping)mappings.get(i);
- if (mapping != null &&
- mapping.getServletName() != null &&
- mapping.getServletName().trim()
- .equals(servletName)) {
- mappings.remove(mapping);
- }
- }
- }
- }
-
- /**
- * Creates or updates config file context-param in v2.5 WebApp if non default configuration file is specified.
- * @param webApp
- * @param config
- */
- public static void setupConfigFileContextParamForV2_5(final org.eclipse.jst.javaee.web.WebApp webApp,
- final IDataModel config) {
- // if not default name and location, then add context param
- ParamValue foundCP = null;
- ParamValue cp = null;
- boolean found = false;
- if (!config.getStringProperty(IJSFFacetInstallDataModelProperties.CONFIG_PATH).equals(JSF_DEFAULT_CONFIG_PATH)) {
- // check to see if present
- Iterator it = webApp.getContextParams().iterator();
- while (it.hasNext()) {
- cp = (org.eclipse.jst.javaee.core.ParamValue) it.next();
- if (cp != null &&
- cp.getParamName()!= null &&
- cp.getParamName().trim().equals(JSF_CONFIG_CONTEXT_PARAM)) {
- foundCP = cp;
- found = true;
- }
- }
- if (!found) {
- ParamValue pv = JavaeeFactory.eINSTANCE.createParamValue();
- pv.setParamName(JSF_CONFIG_CONTEXT_PARAM);
- pv.setParamValue(config.getStringProperty(IJSFFacetInstallDataModelProperties.CONFIG_PATH));
- webApp.getContextParams().add(pv);
- } else {
- cp = foundCP;
- if (cp.getParamValue().indexOf(config.getStringProperty(IJSFFacetInstallDataModelProperties.CONFIG_PATH)) < 0) {
- String curVal = cp.getParamValue();
- String val = config.getStringProperty(IJSFFacetInstallDataModelProperties.CONFIG_PATH);
- if (curVal != null && !"".equals(curVal.trim())) { //$NON-NLS-1$
- val = curVal + ",\n" + val; //$NON-NLS-1$
- }
- cp.setParamValue(val);
- }
- }
- }
- }
-
- /**
- * @param webApp
- * @return the default file extension from the context param. Default is "jsp" if no context param
- */
- public static String getDefaultSuffix(final WebApp webApp) {
- String defaultSuffix = "jsp"; //$NON-NLS-1$
- for (Iterator it = webApp.getContextParams().iterator();it.hasNext();) {
- ParamValue cp = (ParamValue) it.next();
- if (cp != null &&
- cp.getParamName() != null &&
- cp.getParamName().trim().equals(JSF_DEFAULT_SUFFIX_CONTEXT_PARAM)){
- String defSuffix = cp.getParamValue();
- if (defSuffix.startsWith(".")) //$NON-NLS-1$
- defSuffix = defSuffix.substring(1);
-
- return defSuffix;
- }
- }
- return defaultSuffix;
- }
-
- /**
- * @param map
- * @return prefix mapping
- */
- public static String getPrefixMapping(final ServletMapping map) {
- List urls = map.getUrlPatterns();
- for (Iterator it=urls.iterator();it.hasNext();){
- IPath extPath = new Path(((UrlPatternType)it.next()).getValue());
- if (extPath != null){
- String ext = extPath.getFileExtension();
- if (ext == null){
- String lastSeg = extPath.lastSegment();
- if (lastSeg.equals("*")) //$NON-NLS-1$
- {
- return extPath.removeLastSegments(1).toString();
- }
-
- return extPath.toString();
- }
- }
- }
- return null;
- }
-
- /**
- * @param map
- * @return extension from map. Will return null if file extension not found in url patterns.
- */
- public static String getFileExtensionFromMap(final ServletMapping map) {
- List urls = map.getUrlPatterns();
- for (Iterator it=urls.iterator();it.hasNext();){
- IPath extPath = new Path(((UrlPatternType)it.next()).getValue());
- if (extPath != null){
- String ext = extPath.getFileExtension();
- if (ext != null && !ext.equals("")) //$NON-NLS-1$
- return ext;
- }
- }
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/region/Region2AttrAdapter.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/region/Region2AttrAdapter.java
deleted file mode 100644
index cd29bb9..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/region/Region2AttrAdapter.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-/**
- *
- */
-package org.eclipse.jst.jsf.core.internal.region;
-
-import org.eclipse.jst.jsf.common.dom.AttrDOMAdapter;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContextFactory;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.w3c.dom.Node;
-
-/**
- * A AttrDOMAdapter that adapts from a ITextRegions. Instances of class can only
- * be obtained from and are always relative to, an owning Region2ElementAdapter
- *
- * @author cbateman
- *
- */
-public class Region2AttrAdapter extends AttrDOMAdapter
-{
- private final Node _attr;
-
- /**
- * @param owner
- * @param attr
- */
- Region2AttrAdapter(final Region2ElementAdapter owner, final Node attr)
- {
- super(owner);
- _attr = attr;
- }
-
- @Override
- public Region2ElementAdapter getOwningElement()
- {
- return (Region2ElementAdapter) super.getOwningElement();
- }
-
- @Override
- public String getLocalName()
- {
- return _attr.getLocalName();
- }
-
- @Override
- public String getNodeName()
- {
- return _attr.getNodeName();
- }
-
- @Override
- public String getPrefix()
- {
- return _attr.getPrefix();
- }
-
- @Override
- public String getValue()
- {
- return _attr.getNodeValue();
- }
-
- /**
- * @return the structured document context
- */
- public IStructuredDocumentContext getDocumentContext()
- {
- return IStructuredDocumentContextFactory.INSTANCE.getContext
- (getOwningElement().getDocumentContext().getStructuredDocument(),
- getStartOffset());
- }
-
- /**
- * @return the absolute document offset where the attribute starts.
- */
- public int getStartOffset()
- {
- return getOwningElement().getTextRegion().getStartOffset()+getAttributeNameRegion().getStart();
- }
-
- /**
- * Offsets in the region will be relative to the parent element, not the
- * document
- *
- * @return the ITextRegion for the attribute name of the attribute adapted
- * by attrAdapter
- * @throws IllegalArgumentException
- * if attrAdapter.getOwningElement != this
- */
- // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=217523 for deprecation
- @SuppressWarnings("deprecation")
- public ITextRegion getAttributeNameRegion()
- {
-
- return getDOMAttr(_attr).getNameRegion();
- }
-
- /**
- * Offsets in the region will be relative to the parent element, not the
- * document
- *
- * @return the ITextRegion for the attribute value of the attribute adapted
- * by attrAdapter
- * @throws IllegalArgumentException
- * if attrAdapter.getOwningElement != this
- */
- @SuppressWarnings("deprecation")
- // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=217523 for deprecation
- public ITextRegion getAttributeValueRegion()
- {
- return getDOMAttr(_attr).getValueRegion();
- }
-
- private IDOMAttr getDOMAttr(final Node attrAsNode)
- {
- assert attrAsNode instanceof IDOMAttr;
-
- return ((IDOMAttr) attrAsNode);
- }
-}
\ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/region/Region2ElementAdapter.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/region/Region2ElementAdapter.java
deleted file mode 100644
index 21b4487..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/region/Region2ElementAdapter.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.region;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import org.eclipse.jst.jsf.common.dom.ElementDOMAdapter;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IDOMContextResolver;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.ITaglibContextResolver;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.internal.IStructuredDocumentContextResolverFactory2;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContextFactory;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionCollection;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * Adapt a region object for DOM element information. Does not implement entire
- * DOM interface. Object is lazily initialized and not thread-safe.
- *
- * @author cbateman
- *
- */
-public class Region2ElementAdapter extends ElementDOMAdapter
-{
- private final RegionProcessorStrategy _regionParser;
-
- /**
- * Create a new adapter for this region. If the region does not contain
- * enough information to construct a meaningful adapter, it will throw
- * NoElementException. The adapter is lazily initialized and won't process
- * the region until the first call to a get method is made.
- *
- * @param region
- * @throws NoElementException
- */
- public Region2ElementAdapter(final ITextRegion region)
- throws NoElementException
- {
- _regionParser = new RegionProcessorStrategy(region);
- }
-
- @Override
- public Map<String, Region2AttrAdapter> getAttributes()
- {
- return _regionParser.getAttributes();
- }
-
- @Override
- public String getNamespace()
- {
- return _regionParser.getNamespace();
- }
-
- @Override
- public String getLocalName()
- {
- return _regionParser.getLocalName();
- }
-
- @Override
- public String getNodeName()
- {
- return _regionParser.getNodeName();
- }
-
- @Override
- public String getPrefix()
- {
- return _regionParser.getPrefix();
- }
-
- /**
- * @return the structured document context
- */
- public IStructuredDocumentContext getDocumentContext()
- {
- return _regionParser._context;
- }
-
- /**
- * @return an ITextRegion containing absolute offset information for this element
- */
- public ITextRegionCollection getTextRegion()
- {
- return _regionParser._region;
- }
-
- /**
- * @return the element
- */
- public Element getElement()
- {
- return (Element) _regionParser._node;
- }
-
- private class RegionProcessorStrategy
- {
- private final AtomicBoolean _isInitialized =
- new AtomicBoolean(false);
- private final ITextRegionCollection _region;
-
- private Map<String, Region2AttrAdapter> _attributes;
- private Node _node;
- private IStructuredDocumentContext _context;
-
- RegionProcessorStrategy(final ITextRegion region) throws NoElementException
- {
- if (!(region instanceof ITextRegionCollection)
- || ((ITextRegionCollection) region).getFirstRegion()
- .getType() != DOMRegionContext.XML_TAG_OPEN)
- {
- throw new NoElementException(
- "Region is not a collection with an open tag");
- }
-
- _region = (ITextRegionCollection) region;
-
- _context =
- IStructuredDocumentContextFactory.INSTANCE.getContext(
- ((IStructuredDocumentRegion) _region)
- .getParentDocument(), _region
- .getStartOffset());
-
- if (_context == null)
- {
- throw new NoElementException(
- "Couldn't acquire structured document context");
- }
-
- final IDOMContextResolver resolver =
- IStructuredDocumentContextResolverFactory.INSTANCE
- .getDOMContextResolver(_context);
-
- if (resolver == null)
- {
- throw new NoElementException("Couldn't acquire dom resolver");
- }
-
- _node = resolver.getNode();
-
- if (_node == null)
- {
- throw new NoElementException("Couldn't get Node from region");
- }
- }
-
- public String getLocalName()
- {
- return _node.getLocalName();
- }
-
- public String getNodeName()
- {
- return _node.getNodeName();
- }
-
- public String getPrefix()
- {
- return _node.getPrefix();
- }
-
- public String getNamespace()
- {
- final ITaglibContextResolver tagLibResolver =
- IStructuredDocumentContextResolverFactory2.INSTANCE
- .getTaglibContextResolverFromDelegates(_context);
-
- if (tagLibResolver != null)
- {
- return tagLibResolver.getTagURIForNodeName(_node);
- }
-
- return null;
- }
-
- public Map<String, Region2AttrAdapter> getAttributes()
- {
- mapAttributesOnlyOnce();
- return Collections.unmodifiableMap(_attributes);
- }
- public boolean isInitialized()
- {
- return _isInitialized.get();
- }
-
- private void mapAttributesOnlyOnce()
- {
- // only once
- if (_attributes != null)
- return;
-
- _attributes = Collections.EMPTY_MAP;
-
- final NamedNodeMap attributes = _node.getAttributes();
-
- if (attributes != null)
- {
- final int numAttrs = attributes.getLength();
- _attributes = new HashMap<String, Region2AttrAdapter>(
- (int) (numAttrs / 0.75f) + 1, 0.75f);
- for (int i = 0; i < numAttrs; i++)
- {
- final Node nodeAttr = attributes.item(i);
- Region2AttrAdapter attr = new Region2AttrAdapter(
- Region2ElementAdapter.this, nodeAttr);
- _attributes.put(attr.getLocalName(), attr);
- }
- }
- }
- }
-
- /**
- * Indicates that construction of this adapter failed because an IRegion
- * didn't have sufficient information (or didn't represent an element at
- * all)
- *
- * @author cbateman
- *
- */
- public static class NoElementException extends Exception
- {
- /**
- * serializable id
- */
- private static final long serialVersionUID = -4479154049727036580L;
-
- private NoElementException(final String reason)
- {
- super(reason);
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/tld/AttributeIdentifierFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/tld/AttributeIdentifierFactory.java
deleted file mode 100644
index 2d675ce..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/tld/AttributeIdentifierFactory.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.tld;
-
-import org.eclipse.jst.jsf.common.dom.AttributeIdentifier;
-import org.eclipse.jst.jsf.common.dom.TagIdentifier;
-
-/**
- * A factory for creating instances of AttributeIdentifier. Some results may be
- * cached or otherwise based on shared instances.
- *
- * @author cbateman
- *
- */
-public final class AttributeIdentifierFactory
-{
- /**
- * @param tagId
- * @param attributeName
- * @return an attribute id based on the tagid and attribute name provided.
- */
- public static AttributeIdentifier createAttributeIdentifier(
- final TagIdentifier tagId, final String attributeName)
- {
- return new SimpleAttributeIdentifier(tagId, attributeName);
- }
-
- private final static class SimpleAttributeIdentifier extends
- AttributeIdentifier
- {
- private final TagIdentifier _tagId;
- private final String _attributeName;
-
- public SimpleAttributeIdentifier(final TagIdentifier tagId,
- String attributeName)
- {
- _tagId = tagId;
- _attributeName = attributeName;
- }
-
- @Override
- public String getName()
- {
- return _attributeName;
- }
-
- @Override
- public TagIdentifier getTagIdentifier()
- {
- return _tagId;
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/tld/CMUtil.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/tld/CMUtil.java
deleted file mode 100644
index b31f609..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/tld/CMUtil.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.tld;
-
-import java.util.Iterator;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TaglibTracker;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDDocument;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDElementDeclaration;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMNodeWrapper;
-import org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapter;
-import org.w3c.dom.Element;
-
-/**
- * Utility class to content model related information.
- *
- * @author mengbo
- */
-public final class CMUtil {
- /**
- * If the element is a custom tag, get the URI of it. If the element is a
- * standard JSP tag, return null. If is not jsp tag, then return null
- * @param decl
- *
- * @return the tag uri as a string
- */
- public static String getTagURI(CMElementDeclaration decl) {
- if (decl instanceof CMNodeWrapper) {
- decl = (CMElementDeclaration) ((CMNodeWrapper) decl)
- .getOriginNode();
- }
- if (decl instanceof TLDElementDeclaration) {
- CMDocument doc = ((TLDElementDeclaration) decl).getOwnerDocument();
- if (doc instanceof TLDDocument) {
- return ((TLDDocument) doc).getUri();
- }
- }
- return null;
- }
-
- /**
- * Test whether this is the JSP core tag.
- *
- * @param decl
- * @return true if decl is a jsp element declaration
- */
- public static boolean isJSP(CMElementDeclaration decl) {
- if (!decl.supports(HTMLCMProperties.IS_JSP)) {
- return false;
- }
- Boolean b = (Boolean) decl.getProperty(HTMLCMProperties.IS_JSP);
- return b.booleanValue();
- }
-
- /**
- * @param decl
- * @return true if the element declartion is a non-JSP html element
- */
- public static boolean isHTML(CMElementDeclaration decl) {
- if (!isJSP(decl) && (decl instanceof HTMLElementDeclaration)) {
- return true;
- }
- return false;
- }
-
- /**
- * get element declaration of specified element
- *
- * @param element
- * @return null if can't get it.
- */
- public static CMElementDeclaration getElementDeclaration(Element element) {
- if (element == null) {
- return null;
- }
- INodeNotifier notifier = (INodeNotifier) element.getOwnerDocument();
- if (notifier == null) {
- return null;
- }
- ModelQueryAdapter mqa = (ModelQueryAdapter) notifier
- .getAdapterFor(ModelQueryAdapter.class);
- if (mqa == null) {
- return null;
- }
- return mqa.getModelQuery().getCMElementDeclaration(element);
- }
-
- /**
- * @param element
- * @return the TLDElementDeclaration for element or null if not found
- */
- public static TLDElementDeclaration getTLDElementDeclaration(Element element) {
- CMNode decl = getElementDeclaration(element);
- if (decl instanceof CMNodeWrapper) {
- decl = ((CMNodeWrapper) decl).getOriginNode();
- }
- if (decl instanceof TLDElementDeclaration) {
- return (TLDElementDeclaration) decl;
- }
- return null;
- }
-
- /**
- * !!! NOTE: this function is intended to work around the problem that if your element
- * has not yet been added to an IDOMModel, getElementDeclaration won't be able to find
- * it. This method does nothing (unlike the ModelQuery-based approach in getElementDeclaration)
- * to ensure that the namespace "uri" provided is valid in the structured document provided. It is
- * therefore only advisable to use this method in cases where your node is not already a member of a
- * IDOMModel.
- *
- * @param uri
- * @param elementName
- * @param document
- * @return the TLDElementDeclaration for this required tag or null if there is nothing appropriate
- */
- public static CMElementDeclaration getTLDElementDeclaration(final String uri, final String elementName, IDocument document)
- {
- TLDCMDocumentManager tldmgr = TaglibController.getTLDCMDocumentManager(document);
-
- if (tldmgr != null)
- {
- for (Iterator it = tldmgr.getTaglibTrackers().iterator();it.hasNext();)
- {
- TaglibTracker tracker = (TaglibTracker) it.next();
-
- if (tracker.getURI().equals(uri))
- {
- return (CMElementDeclaration) tracker.getElements().getNamedItem(tracker.getPrefix()+":"+elementName);
- }
- }
- }
- // fallthrough
- return null;
- }
-
- /**
- * give an element, get its namespace URI.
- *
- * @param element
- * @return the namespace URI
- */
- public static String getElementNamespaceURI(Element element) {
- //System.out.printf("uri for %s is %s\n", element.toString(), element.getNamespaceURI());
-
- CMElementDeclaration decl = getElementDeclaration(element);
- if (decl == null) {
-
- // if the content model has nothing, see if the element
- // itself has an xml namespace
- // TODO: should only apply this if the source document
- // is a valid XML doc?
- final String uri = element.getNamespaceURI();
-
- // may be null which the default state
- return uri;
- }
-
- if (isJSP(decl)) {
- return ITLDConstants.URI_JSP;
- } else if (isHTML(decl)) {
- return ITLDConstants.URI_HTML;
- }
-
- return getTagURI(decl);
- }
-
- /**
- * @param element
- * @return true if the element can have children
- */
- public static boolean canHaveDirectTextChild(Element element) {
- CMElementDeclaration decl = getElementDeclaration(element);
- if (decl == null) {
- return true;
- }
- int contentType = decl.getContentType();
- return contentType != CMElementDeclaration.ELEMENT
- && contentType != CMElementDeclaration.EMPTY;
-
- }
-
- private CMUtil()
- {
- // util class, no external instantiation
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/tld/DocumentTagIdentifier.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/tld/DocumentTagIdentifier.java
deleted file mode 100644
index 1af913f..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/tld/DocumentTagIdentifier.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.tld;
-
-import org.eclipse.jst.jsf.common.dom.TagIdentifier;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.w3c.dom.Element;
-
-/**
- * A tag wrapper for a DOM element. This element may or may not be a JSP tag,
- * but must be contained in a DOM tree.
- *
- * @author cbateman
- *
- */
-/*package*/ class DocumentTagIdentifier extends TagIdentifier
-{
- private final Element _element;
-
- /**
- * @param element
- */
- public DocumentTagIdentifier(Element element)
- {
- _element = element;
- }
-
- public String getTagName()
- {
- return _element.getLocalName();
- }
-
- public String getUri() {
- String uri = CMUtil.getElementNamespaceURI(_element);
-
- // give the content model priority
- if (uri == null)
- {
- uri = _element.getNamespaceURI();
- }
-
- return uri;
- }
-
- public boolean isJSPTag() {
- CMElementDeclaration elemDecl = getElementDeclaration();
-
- if (elemDecl != null)
- {
- return CMUtil.isJSP(elemDecl);
- }
-
- return false;
- }
-
- /**
- * @return the element declaration for this tag
- */
- protected final CMElementDeclaration getElementDeclaration()
- {
- return CMUtil.getElementDeclaration(_element);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/tld/IJSFConstants.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/tld/IJSFConstants.java
deleted file mode 100644
index 4f2ee35..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/tld/IJSFConstants.java
+++ /dev/null
@@ -1,979 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.tld;
-
-import org.eclipse.jst.jsf.common.dom.TagIdentifier;
-
-/**
- * Constants covering the JSF Core and JSF HTML tag and tag attribute names
- */
-public interface IJSFConstants
-{
-
- /**
- * actionListener tagname
- */
- final static public String TAG_ACTIONLISTENER = "actionListener";
-
- /**
- * attribute tagname
- */
- final static public String TAG_ATTRIBUTE = "attribute";
-
- /**
- * convertDateTime tagname
- */
- final static public String TAG_CONVERTDATETIME = "convertDateTime";
-
- /**
- * converter tagname
- */
- final static public String TAG_CONVERTER = "converter";
-
- /**
- * convertNumber tagname
- */
- final static public String TAG_CONVERTNUMBER = "convertNumber";
-
- /**
- * facet tagname
- */
- final static public String TAG_FACET = "facet";
-
- /**
- * loadBundle tagname
- */
- final static public String TAG_LOADBUNDLE = "loadBundle";
-
- /**
- * param tagname
- */
- final static public String TAG_PARAM = "param";
-
- /**
- * phaseListener tagname
- */
- final static public String TAG_PHASELISTENER = "phaseListener";
-
- /**
- * selectItem tagname
- */
- final static public String TAG_SELECTITEM = "selectItem";
-
- /**
- * selectItems tagname
- */
- final static public String TAG_SELECTITEMS = "selectItems";
-
- /**
- * setPropertyActionListener tagname
- */
- final static public String TAG_SETPROPERTYACTIONLISTENER = "setPropertyActionListener";
-
- /**
- * subview tagname
- */
- final static public String TAG_SUBVIEW = "subview";
-
- /**
- * validateDoubleRange tagname
- */
- final static public String TAG_VALIDATEDOUBLERANGE = "validateDoubleRange";
-
- /**
- * validateLength tagname
- */
- final static public String TAG_VALIDATELENGTH = "validateLength";
-
- /**
- * validateLongRange tagname
- */
- final static public String TAG_VALIDATELONGRANGE = "validateLongRange";
-
- /**
- * validator tagname
- */
- final static public String TAG_VALIDATOR = "validator";
-
- /**
- * valueChangeListener tagname
- */
- final static public String TAG_VALUECHANGELISTENER = "valueChangeListener";
-
- /**
- * verbatim tagname
- */
- final static public String TAG_VERBATIM = "verbatim";
-
- /**
- * view tagname
- */
- final static public String TAG_VIEW = "view";
-
- /**
- * column tagname
- */
- final static public String TAG_COLUMN = "column";
-
- /**
- * commandButton tagname
- */
- final static public String TAG_COMMANDBUTTON = "commandButton";
-
- /**
- * commandLink tagname
- */
- final static public String TAG_COMMANDLINK = "commandLink";
-
- /**
- * dataTable tagname
- */
- final static public String TAG_DATATABLE = "dataTable";
-
- /**
- * form tagname
- */
- final static public String TAG_FORM = "form";
-
- /**
- * graphicImage tagname
- */
- final static public String TAG_GRAPHICIMAGE = "graphicImage";
-
- /**
- * inputHidden tagname
- */
- final static public String TAG_INPUTHIDDEN = "inputHidden";
-
- /**
- * inputSecret tagname
- */
- final static public String TAG_INPUTSECRET = "inputSecret";
-
- /**
- * inputText tagname
- */
- final static public String TAG_INPUTTEXT = "inputText";
-
- /**
- * inputTextarea tagname
- */
- final static public String TAG_INPUTTEXTAREA = "inputTextarea";
-
- /**
- * message tagname
- */
- final static public String TAG_MESSAGE = "message";
-
- /**
- * messages tagname
- */
- final static public String TAG_MESSAGES = "messages";
-
- /**
- * outputFormat tagname
- */
- final static public String TAG_OUTPUTFORMAT = "outputFormat";
-
- /**
- * outputLabel tagname
- */
- final static public String TAG_OUTPUTLABEL = "outputLabel";
-
- /**
- * outputLink tagname
- */
- final static public String TAG_OUTPUTLINK = "outputLink";
-
- /**
- * outputText tagname
- */
- final static public String TAG_OUTPUTTEXT = "outputText";
-
- /**
- * panelGrid tagname
- */
- final static public String TAG_PANELGRID = "panelGrid";
-
- /**
- * panelGroup tagname
- */
- final static public String TAG_PANELGROUP = "panelGroup";
-
- /**
- * selectBooleanCheckbox tagname
- */
- final static public String TAG_SELECTBOOLEANCHECKBOX = "selectBooleanCheckbox";
-
- /**
- * selectManyCheckbox tagname
- */
- final static public String TAG_SELECTMANYCHECKBOX = "selectManyCheckbox";
-
- /**
- * selectManyListbox tagname
- */
- final static public String TAG_SELECTMANYLISTBOX = "selectManyListbox";
-
- /**
- * selectManyMenu tagname
- */
- final static public String TAG_SELECTMANYMENU = "selectManyMenu";
-
- /**
- * selectOneListbox tagname
- */
- final static public String TAG_SELECTONELISTBOX = "selectOneListbox";
-
- /**
- * selectOneMenu tagname
- */
- final static public String TAG_SELECTONEMENU = "selectOneMenu";
-
- /**
- * selectOneMenu tagname
- */
- final static public String TAG_SELECTONERADIO = "selectOneRadio";
-
- // tag identifiers
- /**
- * TagIdentifier for TAG_VIEW
- */
- final static TagIdentifier TAG_IDENTIFIER_VIEW =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_CORE, TAG_VIEW);
-
- /**
- * TagIdentifier for TAG_LOADBUNDLE
- */
- final static TagIdentifier TAG_IDENTIFIER_LOADBUNDLE =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_CORE, TAG_LOADBUNDLE);
-
- /**
- * TagIdentifier for TAG_FACET
- */
- final static TagIdentifier TAG_IDENTIFIER_FACET =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_CORE, TAG_FACET);
-
- /**
- * TagIdentifier for TAG_VERBATIM
- */
- final static TagIdentifier TAG_IDENTIFIER_VERBATIM =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_CORE, TAG_VERBATIM);
-
- /**
- * TagIdentifier for TAG_DATATABLE
- */
- final static TagIdentifier TAG_IDENTIFIER_DATA_TABLE =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_HTML, TAG_DATATABLE);
-
- /**
- * TagIdentifier for TAG_PANELGRID
- */
- final static TagIdentifier TAG_IDENTIFIER_PANEL_GRID =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_HTML, TAG_PANELGRID);
-
- /**
- * TagIdentifier for TAG_COLUMN
- */
- final static TagIdentifier TAG_IDENTIFIER_COLUMN =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_HTML, TAG_COLUMN);
-
- /**
- * TagIdentifier for TAG_FORM
- */
- final static TagIdentifier TAG_IDENTIFIER_FORM =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_HTML, TAG_FORM);
-
- /**
- * TagIdentifier for TAG_INPUTTEXT
- */
- final static TagIdentifier TAG_IDENTIFIER_INPUTTEXT =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_HTML, TAG_INPUTTEXT);
-
- /**
- * TagIdentifier for TAG_INPUTSECRET
- */
- final static TagIdentifier TAG_IDENTIFIER_INPUTSECRET =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_HTML, TAG_INPUTSECRET);
-
- /**
- * TagIdentifier for TAG_INPUTTEXTAREA
- */
- final static TagIdentifier TAG_IDENTIFIER_INPUTTEXTAREA =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_HTML, TAG_INPUTTEXTAREA);
-
- /**
- * TagIdentifier for TAG_OUTPUTTEXT
- */
- final static TagIdentifier TAG_IDENTIFIER_OUTPUTTEXT =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_HTML, TAG_OUTPUTTEXT);
-
- /**
- * TagIdentifier for TAG_OUTPUTLABEL
- */
- final static TagIdentifier TAG_IDENTIFIER_OUTPUTLABEL =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_HTML, TAG_OUTPUTLABEL);
-
- /**
- * TagIdentifier for TAG_GRAPHICIMAGE
- */
- final static TagIdentifier TAG_IDENTIFIER_GRAPHICIMAGE =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_HTML, TAG_GRAPHICIMAGE);
-
- /**
- * TagIdentifier for TAG_COMMANDBUTTON
- */
- final static TagIdentifier TAG_IDENTIFIER_COMMANDBUTTON =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_HTML, TAG_COMMANDBUTTON);
-
- /**
- * TagIdentifier for TAG_COMMANDLINK
- */
- final static TagIdentifier TAG_IDENTIFIER_COMMANDLINK =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_HTML, TAG_COMMANDLINK);
-
- /**
- * TagIdentifier for TAG_INPUTHIDDEN
- */
- final static TagIdentifier TAG_IDENTIFIER_INPUTHIDDEN =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_HTML, TAG_INPUTHIDDEN);
-
- /**
- * TagIdentifier for TAG_MESSAGE
- */
- final static TagIdentifier TAG_IDENTIFIER_MESSAGE =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_HTML, TAG_MESSAGE);
-
- /**
- * TagIdentifier for TAG_MESSAGES
- */
- final static TagIdentifier TAG_IDENTIFIER_MESSAGES =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_HTML, TAG_MESSAGES);
-
- /**
- * TagIdentifier for TAG_OUTPUTFORMAT
- */
- final static TagIdentifier TAG_IDENTIFIER_OUTPUTFORMAT =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_HTML, TAG_OUTPUTFORMAT);
-
- /**
- * TagIdentifier for TAG_OUTPUTLINK
- */
- final static TagIdentifier TAG_IDENTIFIER_OUTPUTLINK =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_HTML, TAG_OUTPUTLINK);
-
- /**
- * TagIdentifier for TAG_PANELGROUP
- */
- final static TagIdentifier TAG_IDENTIFIER_PANEL_GROUP =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_HTML, TAG_PANELGROUP);
-
- /**
- * TagIdentifier for TAG_SELECTBOOLEANCHECKBOX
- */
- final static TagIdentifier TAG_IDENTIFIER_SELECTBOOLEANCHECKBOX =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_HTML, TAG_SELECTBOOLEANCHECKBOX);
-
- /**
- * TagIdentifier for TAG_SELECTMANYCHECKBOX
- */
- final static TagIdentifier TAG_IDENTIFIER_SELECTMANYCHECKBOX =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_HTML, TAG_SELECTMANYCHECKBOX);
-
- /**
- * TagIdentifier for TAG_SELECTMANYLISTBOX
- */
- final static TagIdentifier TAG_IDENTIFIER_SELECTMANYLISTBOX =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_HTML, TAG_SELECTMANYLISTBOX);
-
- /**
- * TagIdentifier for TAG_SELECTMANYMENU
- */
- final static TagIdentifier TAG_IDENTIFIER_SELECTMANYMENU =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_HTML, TAG_SELECTMANYMENU);
-
- /**
- * TagIdentifier for TAG_SELECTONELISTBOX
- */
- final static TagIdentifier TAG_IDENTIFIER_SELECTONELISTBOX =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_HTML, TAG_SELECTONELISTBOX);
-
- /**
- * TagIdentifier for TAG_SELECTONEMENU
- */
- final static TagIdentifier TAG_IDENTIFIER_SELECTONEMENU =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_HTML, TAG_SELECTONEMENU);
-
- /**
- * TagIdentifier for TAG_SELECTONERADIO
- */
- final static TagIdentifier TAG_IDENTIFIER_SELECTONERADIO =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_HTML, TAG_SELECTONERADIO);
-
- /**
- * TagIdentifier for TAG_ACTIONLISTENER
- */
- final static TagIdentifier TAG_IDENTIFIER_ACTIONLISTENER =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_CORE, TAG_ACTIONLISTENER);
-
- /**
- * TagIdentifier for TAG_ATTRIBUTE
- */
- final static TagIdentifier TAG_IDENTIFIER_ATTRIBUTE =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_CORE, TAG_ATTRIBUTE);
-
- /**
- * TagIdentifier for TAG_CONVERTDATETIME
- */
- final static TagIdentifier TAG_IDENTIFIER_CONVERTDATETIME =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_CORE, TAG_CONVERTDATETIME);
-
- /**
- * TagIdentifier for TAG_CONVERTNUMBER
- */
- final static TagIdentifier TAG_IDENTIFIER_CONVERTNUMBER =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_CORE, TAG_CONVERTNUMBER);
-
- /**
- * TagIdentifier for TAG_CONVERTER
- */
- final static TagIdentifier TAG_IDENTIFIER_CONVERTER =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_CORE, TAG_CONVERTER);
-
- /**
- * TagIdentifier for TAG_PARAM
- */
- final static TagIdentifier TAG_IDENTIFIER_PARAM =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_CORE, TAG_PARAM);
-
- /**
- * TagIdentifier for TAG_PHASELISTENER
- */
- final static TagIdentifier TAG_IDENTIFIER_PHASELISTENER =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_CORE, TAG_PHASELISTENER);
-
- /**
- * TagIdentifier for TAG_SELECTITEM
- */
- final static TagIdentifier TAG_IDENTIFIER_SELECTITEM =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_CORE, TAG_SELECTITEM);
-
- /**
- * TagIdentifier for TAG_SELECTITEMS
- */
- final static TagIdentifier TAG_IDENTIFIER_SELECTITEMS =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_CORE, TAG_SELECTITEMS);
-
- /**
- * TagIdentifier for TAG_SETPROPERTYACTIONLISTENER
- */
- final static TagIdentifier TAG_IDENTIFIER_SETPROPERTYACTIONLISTENER =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_CORE, TAG_SETPROPERTYACTIONLISTENER);
-
- /**
- * TagIdentifier for TAG_SUBVIEW
- */
- final static TagIdentifier TAG_IDENTIFIER_SUBVIEW =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_CORE, TAG_SUBVIEW);
-
- /**
- * TagIdentifier for TAG_VALIDATEDOUBLERANGE
- */
- final static TagIdentifier TAG_IDENTIFIER_VALIDATEDOUBLERANGE =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_CORE, TAG_VALIDATEDOUBLERANGE);
-
- /**
- * TagIdentifier for TAG_VALIDATELENGTH
- */
- final static TagIdentifier TAG_IDENTIFIER_VALIDATELENGTH =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_CORE, TAG_VALIDATELENGTH);
-
- /**
- * TagIdentifier for TAG_VALIDATELONGRANGE
- */
- final static TagIdentifier TAG_IDENTIFIER_VALIDATELONGRANGE =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_CORE, TAG_VALIDATELONGRANGE);
-
- /**
- * TagIdentifier for TAG_VALIDATOR
- */
- final static TagIdentifier TAG_IDENTIFIER_VALIDATOR =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_CORE, TAG_VALIDATOR);
-
- /**
- * TagIdentifier for TAG_VALUECHANGELISTENER
- */
- final static TagIdentifier TAG_IDENTIFIER_VALUECHANGELISTENER =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_CORE, TAG_VALUECHANGELISTENER);
-
- // attribute names
- /**
- * accept tag attribute name
- */
- final static public String ATTR_ACCEPT = "accept";
-
- /**
- * acceptcharset tag attribute name
- */
- final static public String ATTR_ACCEPTCHARSET = "acceptcharset";
-
- /**
- * accesskey tag attribute name
- */
- final static public String ATTR_ACCESSKEY = "accesskey";
-
- /**
- * action tag attribute name
- */
- final static public String ATTR_ACTION = "action";
-
- /**
- * actionListener tag attribute name
- */
- final static public String ATTR_ACTIONLISTENER = "actionListener";
-
- /**
- * alt tag attribute name
- */
- final static public String ATTR_ALT = "alt";
-
- /**
- * basename tag attribute name
- */
- final static public String ATTR_BASENAME = "basename";
-
- /**
- * bgcolor tag attribute name
- */
- final static public String ATTR_BGCOLOR = "bgcolor";
-
- /**
- * binding tag attribute name
- */
- final static public String ATTR_BINDING = "binding";
-
- /**
- * border tag attribute name
- */
- final static public String ATTR_BORDER = "border";
-
- /**
- * cellpadding tag attribute name
- */
- final static public String ATTR_CELLPADDING = "cellpadding";
-
- /**
- * cellspacing tag attribute name
- */
- final static public String ATTR_CELLSPACING = "cellspacing";
-
- /**
- * charset tag attribute name
- */
- final static public String ATTR_CHARSET = "charset";
-
- /**
- * cols tag attribute name
- */
- final static public String ATTR_COLS = "cols";
-
- /**
- * columnClasses tag attribute name
- */
- final static public String ATTR_COLUMNCLASSES = "columnClasses";
-
- /**
- * columns tag attribute name
- */
- final static public String ATTR_COLUMNS = "columns";
-
- /**
- * converterId tag attribute name
- */
- final static public String ATTR_CONVERTERID = "converterId";
-
- /**
- * coords tag attribute name
- */
- final static public String ATTR_COORDS = "coords";
-
- /**
- * currencyCode tag attribute name
- */
- final static public String ATTR_CURRENCYCODE = "currencyCode";
-
- /**
- * currencySymbol tag attribute name
- */
- final static public String ATTR_CURRENCYSYMBOL = "currencySymbol";
-
- /**
- * dateStyle tag attribute name
- */
- final static public String ATTR_DATESTYLE = "dateStyle";
-
- /**
- * dir tag attribute name
- */
- final static public String ATTR_DIR = "dir";
-
- /**
- * disabled tag attribute name
- */
- final static public String ATTR_DISABLED = "disabled";
-
- /**
- * errorClass tag attribute name
- */
- final static public String ATTR_ERRORCLASS = "errorClass";
-
- /**
- * errorStyle tag attribute name
- */
- final static public String ATTR_ERRORSTYLE = "errorStyle";
-
- /**
- * escape tag attribute name
- */
- final static public String ATTR_ESCAPE = "escape";
-
- /**
- * fatalClass tag attribute name
- */
- final static public String ATTR_FATALCLASS = "fatalClass";
-
- /**
- * fatalStyle tag attribute name
- */
- final static public String ATTR_FATALSTYLE = "fatalStyle";
-
- /**
- * first tag attribute name
- */
- final static public String ATTR_FIRST = "first";
-
- /**
- * footerClass tag attribute name
- */
- final static public String ATTR_FOOTERCLASS = "footerClass";
-
- /**
- * for tag attribute name
- */
- final static public String ATTR_FOR = "for";
-
- /**
- * frame tag attribute name
- */
- final static public String ATTR_FRAME = "frame";
-
- /**
- * globalOnly tag attribute name
- */
- final static public String ATTR_GLOBEONLY = "globalOnly";
-
- /**
- * headerClass tag attribute name
- */
- final static public String ATTR_HEADERCLASS = "headerClass";
-
- /**
- * hreflang tag attribute name
- */
- final static public String ATTR_HREFLANG = "hreflang";
-
- /**
- * id tag attribute name
- */
- final static public String ATTR_ID = "id";
-
- /**
- * image tag attribute name
- */
- final static public String ATTR_IMAGE = "image";
-
- /**
- * immediate tag attribute name
- */
- final static public String ATTR_IMMEDIATE = "immediate";
-
- /**
- * infoClass tag attribute name
- */
- final static public String ATTR_INFOCLASS = "infoClass";
-
- /**
- * infoStyle tag attribute name
- */
- final static public String ATTR_INFOSTYLE = "infoStyle";
-
- /**
- * itemDescription tag attribute name
- */
- final static public String ATTR_ITEMDESCRIPTION = "itemDescription";
-
- /**
- * itemDisabled tag attribute name
- */
- final static public String ATTR_ITEMDISABLED = "itemDisabled";
-
- /**
- * itemLabel tag attribute name
- */
- final static public String ATTR_ITEMLABEL = "itemLabel";
-
- /**
- * itemValue tag attribute name
- */
- final static public String ATTR_ITEMVALUE = "itemValue";
-
- /**
- * lang tag attribute name
- */
- final static public String ATTR_LANG = "lang";
-
- /**
- * layout tag attribute name
- */
- final static public String ATTR_LAYOUT = "layout";
-
- /**
- * locale tag attribute name
- */
- final static public String ATTR_LOCALE = "locale";
-
- /**
- * maximum tag attribute name
- */
- final static public String ATTR_MAXIMUM = "maximum";
-
- /**
- * minimum tag attribute name
- */
- final static public String ATTR_MINIMUM = "minimum";
-
- /**
- * name tag attribute name
- */
- final static public String ATTR_NAME = "name";
-
- /**
- * onblur tag attribute name
- */
- final static public String ATTR_ONBLUR = "onblur";
-
- /**
- * onchange tag attribute name
- */
- final static public String ATTR_ONCHANGE = "onchange";
-
- /**
- * onclick tag attribute name
- */
- final static public String ATTR_ONCLICK = "onclick";
-
- /**
- * ondblclick tag attribute name
- */
- final static public String ATTR_ONDBLCLICK = "ondblclick";
-
- /**
- * onfocus tag attribute name
- */
- final static public String ATTR_ONFOCUS = "onfocus";
-
- /**
- * onkeydown tag attribute name
- */
- final static public String ATTR_ONKEYDOWN = "onkeydown";
-
- /**
- * onkeypress tag attribute name
- */
- final static public String ATTR_ONKEYPRESS = "onkeypress";
-
- /**
- * onkeyup tag attribute name
- */
- final static public String ATTR_ONKEYUP = "onkeyup";
-
- /**
- * onmousedown tag attribute name
- */
- final static public String ATTR_ONMOUSEDOWN = "onmousedown";
-
- /**
- * onmousemove tag attribute name
- */
- final static public String ATTR_ONMOUSEMOVE = "onmousemove";
-
- /**
- * onmouseout tag attribute name
- */
- final static public String ATTR_ONMOUSEOUT = "onmouseout";
-
- /**
- * onmouseover tag attribute name
- */
- final static public String ATTR_ONMOUSEOVER = "onmouseover";
-
- /**
- * onmouseup tag attribute name
- */
- final static public String ATTR_ONMOUSEUP = "onmouseup";
-
- /**
- * onselect tag attribute name
- */
- final static public String ATTR_ONSELECT = "onselect";
-
- /**
- * pattern tag attribute name
- */
- final static public String ATTR_PATTERN = "pattern";
-
- /**
- * readonly tag attribute name
- */
- final static public String ATTR_READONLY = "readonly";
-
- /**
- * rel tag attribute name
- */
- final static public String ATTR_REL = "rel";
-
- /**
- * rendered tag attribute name
- */
- final static public String ATTR_RENDERED = "rendered";
-
- /**
- * rev tag attribute name
- */
- final static public String ATTR_REV = "rev";
-
- /**
- * rowClasses tag attribute name
- */
- final static public String ATTR_ROWCLASSES = "rowClasses";
-
- /**
- * rows tag attribute name
- */
- final static public String ATTR_ROWS = "rows";
-
- /**
- * rules tag attribute name
- */
- final static public String ATTR_RULES = "rules";
-
- /**
- * shape tag attribute name
- */
- final static public String ATTR_SHAPE = "shape";
-
- /**
- * showDetail tag attribute name
- */
- final static public String ATTR_SHOWDETAIL = "showDetail";
-
- /**
- * showSummary tag attribute name
- */
- final static public String ATTR_SHOWSUMMARY = "showSummary";
-
- /**
- * size tag attribute name
- */
- final static public String ATTR_SIZE = "size";
-
- /**
- * style tag attribute name
- */
- final static public String ATTR_STYLE = "style";
-
- /**
- * styleClass tag attribute name
- */
- final static public String ATTR_STYLECLASS = "styleClass";
-
- /**
- * summary tag attribute name
- */
- final static public String ATTR_SUMMARY = "summary";
-
- /**
- * tabindex tag attribute name
- */
- final static public String ATTR_TABINDEX = "tabindex";
-
- /**
- * target tag attribute name
- */
- final static public String ATTR_TARGET = "target";
-
- /**
- * timeStyle tag attribute name
- */
- final static public String ATTR_TIMESTYLE = "timeStyle";
-
- /**
- * title tag attribute name
- */
- final static public String ATTR_TITLE = "title";
-
- /**
- * tooltip tag attribute name
- */
- final static public String ATTR_TOOLTIP = "tooltip";
-
- /**
- * type tag attribute name
- */
- final static public String ATTR_TYPE = "type";
-
- /**
- * url tag attribute name
- */
- final static public String ATTR_URL = "url";
-
- /**
- * validatorId tag attribute name
- */
- final static public String ATTR_VALIDATORID = "validatorId";
-
- /**
- * value tag attribute name
- */
- final static public String ATTR_VALUE = "value";
-
- /**
- * var tag attribute name
- */
- final static public String ATTR_VAR = "var";
-
- /**
- * warnClass tag attribute name
- */
- final static public String ATTR_WARNCLASS = "warnClass";
-
- /**
- * warnStyle tag attribute name
- */
- final static public String ATTR_WARNSTYLE = "warnStyle";
-
- /**
- * width tag attribute name
- */
- final static public String ATTR_WIDTH = "width";
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/tld/ITLDConstants.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/tld/ITLDConstants.java
deleted file mode 100644
index 3ec16f4..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/tld/ITLDConstants.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.tld;
-
-/**
- * Global tag library constants
- *
- * @author cbateman
- *
- */
-public interface ITLDConstants {
-
- /**
- * The JSF core (f) component URI
- */
- public static final String URI_JSF_CORE = "http://java.sun.com/jsf/core"; //$NON-NLS-1$
- /**
- * The JSF html (h) component URI
- */
- public static final String URI_JSF_HTML = "http://java.sun.com/jsf/html"; //$NON-NLS-1$
- /**
- * The last component of the html uri
- */
- public static final String URI_HTML = "html"; //$NON-NLS-1$
- /**
- * The last component of the core uri
- */
- public static final String URI_JSP = "jsp"; //$NON-NLS-1$
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/tld/JSPTagIdentifier.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/tld/JSPTagIdentifier.java
deleted file mode 100644
index 8546c38..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/tld/JSPTagIdentifier.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.tld;
-
-import org.eclipse.jst.jsf.common.dom.TagIdentifier;
-
-/**
- * A tag wrapper for a JSP tag.
- *
- * @author cbateman
- *
- */
-/*package*/ class JSPTagIdentifier extends TagIdentifier
-{
- private final String _uri;
- private final String _tagName;
-
- /**
- * @param uri
- * @param tagName
- */
- public JSPTagIdentifier(final String uri, final String tagName)
- {
- _uri = uri;
- _tagName = tagName;
- }
- public String getTagName() {
- return _tagName;
- }
-
- public String getUri() {
- return _uri;
- }
-
- public boolean isJSPTag() {
- return true;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/tld/LoadBundleUtil.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/tld/LoadBundleUtil.java
deleted file mode 100644
index daf4e7a..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/tld/LoadBundleUtil.java
+++ /dev/null
@@ -1,297 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.tld;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IStorage;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-
-/**
- * @author mengbo
- */
-public class LoadBundleUtil {
-
- private LoadBundleUtil() {
- // no external instantiation
- }
-
-
- /**
- * @param project
- * @param baseName
- * @return an IStorage pointing to the request bundle or null if not found
- * @throws CoreException if the search for the file encounters a problem
- */
- public static IStorage getLoadBundleResource(final IProject project,
- final String baseName) throws CoreException {
- if (project == null || baseName == null) {
- return null;
- }
- IStorage loadBundleResource = null;
- if (project.hasNature(JavaCore.NATURE_ID)) {
- IJavaProject javaProject = JavaCore.create(project);
- IFile sourceFile = getSourceFile(javaProject, baseName);
- if (sourceFile == null || !sourceFile.exists()) {
- loadBundleResource = getJarFile(javaProject, baseName);
- } else {
- loadBundleResource = sourceFile;
- }
- }
-
- return loadBundleResource;
- }
-
- private static IFile getSourceFile(IJavaProject javaProject, String baseName)
- throws JavaModelException {
- IClasspathEntry[] classpathEntries = javaProject.getRawClasspath();
- for (int i = 0; i < classpathEntries.length; i++) {
- if (classpathEntries[i].getEntryKind() == IClasspathEntry.CPE_SOURCE) {
- IPath path = classpathEntries[i].getPath().append(
- getFilePath(baseName)).removeFirstSegments(1);
- path = javaProject.getProject().getFullPath().append(path);
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(
- path);
- if (file.exists()) {
- return file;
- }
- }
- }
- return null;
- }
-
- private static IPath getFilePath(String baseName) {
- IPath path = new Path(baseName.replace('.', '/'));//$NON-NLS-1$
- path = path.addFileExtension("properties");//$NON-NLS-1$
- return path;
- }
-
- private static IStorage getJarFile(IJavaProject javaProject, String baseName)
- throws JavaModelException {
- IClasspathEntry[] roots = javaProject.getRawClasspath();
- for (int i = 0; i < roots.length; i++) {
- if (roots[i].getEntryKind() != IClasspathEntry.CPE_LIBRARY) {
- continue;
- }
-
- IPackageFragmentRoot[] packageFragmentRoots = javaProject
- .findPackageFragmentRoots(roots[i]);
- for (int j = 0; j < packageFragmentRoots.length; j++) {
- String packageName = getPackageName(baseName);
- Object[] resources = null;
- if (packageName.length() == 0) {
- resources = packageFragmentRoots[j].getNonJavaResources();
- } else {
- IPackageFragment fragment = packageFragmentRoots[j]
- .getPackageFragment(getPackageName(baseName));
- if (fragment != null && fragment.exists()) {
- resources = fragment.getNonJavaResources();
- }
- }
-
- if (resources != null && resources.length > 0) {
- for (int k = 0; k < resources.length; k++) {
- if (resources[k] instanceof IStorage) {
- IStorage storage = (IStorage) resources[k];
- if (getFileName(baseName).equalsIgnoreCase(
- storage.getName())) {
- return storage;
- }
- }
- }
- }
- }
- }
- return null;
- }
-
- private static String getPackageName(String baseName) {
- int index = baseName.lastIndexOf('.');//$NON-NLS-1$
- if (index == -1) {
- return "";//$NON-NLS-1$
- }
- return baseName.substring(0, index);
- }
-
- private static String getFileName(String baseName) {
- int index = baseName.lastIndexOf('.');//$NON-NLS-1$
- if (index == -1) {
- return baseName + ".properties";
- }
- return baseName.substring(index + 1).concat(".properties");//$NON-NLS-1$
- }
-
- /**
- * Encapsulates the hiearchy of bundle data sources in the hierarchy
- * for a ResourceBundle base name. In practice this is often simply
- * a single IFile for a
- * @author cbateman
- *
- */
-// public static class BundleHierarchy
-// {
-// // list in order from most specific (first queried) to least,
-// // front to back
-// //private final List _hierarchy;
-//
-// /**
-// * Takes the list *by reference*. Does not take a copy.
-// * @param hierarchy
-// */
-// public BundleHierarchy(List hierarchy)
-// {
-// _hierarchy = hierarchy;
-// }
-//
-// public BundleHierarchy()
-// {
-// _hierarchy = new ArrayList();
-// }
-// }
-
- /**
- * Used to describe the design time approximation of the locale lookup precendence
- * that will be used by ResourceBundle to find a localized resource bundle.
- *
- * See the official JavaDoc for java.util.ResourceBundle.getBundle for docs on search
- * order.
- *
- * @author cbateman
- *
- */
- public static class LocaleDescriptor
- {
- private Locale _locale;
- private List _possibleSuffices;
-
- /**
- * @param language -- must not be null
- */
- public LocaleDescriptor(String language)
- {
- _locale = new Locale(language);
- }
-
- /**
- * All arguments must be non-null. To set a language only descriptor,
- * see others.
- *
- * @param language -- must not be null
- * @param country -- must not be null
- */
- public LocaleDescriptor(String language,
- String country)
- {
- _locale = new Locale(language, country);
- }
-
- /**
- * All arguments must be non-null. Null arguments will cause an exception.
- * To create descriptor without variant and/or country set, see other constructors
- * @param language -- must not be null
- * @param country -- must not be null
- * @param variant -- must not be null
- */
- public LocaleDescriptor(String language,
- String country, String variant)
- {
- _locale = new Locale(language, country, variant);
- }
-
- /**
- * @param baseName
- * @return an iterator through all possible bundle names starting with the most
- * specific and becoming more general for base name based on this locale.
- *
- * i.e. if baseName is "bundle" and the local is en_US_1 then in order the
- * iterator will produce:
- *
- * bundle_en_US_1
- * bundle_en_US
- * bundle_en
- * bundle
- *
- * per the ResourceBundle API
- *
- */
- public Iterator getBundleNameIterator(final String baseName)
- {
-
- return new Iterator()
- {
- final Iterator it = getPossibleBaseNameSuffices().iterator();
-
- public boolean hasNext() {
- return it.hasNext();
- }
-
- public Object next() {
- return baseName+it.next();
- }
-
- public void remove() {
- // delegate; should throw exception
- it.remove();
- }
- };
- }
-
- private synchronized List getPossibleBaseNameSuffices()
- {
- if (_possibleSuffices == null)
- {
- List possibleSuffices = new ArrayList(3);
-
- final String language = _locale.getLanguage();
- final String country = _locale.getCountry();
- final String variant = _locale.getVariant();
-
- possibleSuffices.add("");
- possibleSuffices.add("_"+language);
- if (country != null)
- {
- possibleSuffices.add(0, "_"+language + "_" + country);
- if (variant != null)
- {
- possibleSuffices.add(0, "_"+language+"_"+country+"_"+variant);
- }
- }
- _possibleSuffices = Collections.unmodifiableList(possibleSuffices);
- }
-
- return _possibleSuffices;
- }
-
- /**
- * @return the local information as a standard locale object
- */
- public Locale getLocale()
- {
- return _locale;
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/tld/TLDTagIdentifier.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/tld/TLDTagIdentifier.java
deleted file mode 100644
index 97f946a..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/tld/TLDTagIdentifier.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.tld;
-
-import org.eclipse.jst.jsf.common.dom.TagIdentifier;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDDocument;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDElementDeclaration;
-
-final class TLDTagIdentifier extends TagIdentifier
-{
- private final TLDElementDeclaration _tldDecl;
-
- public TLDTagIdentifier(final TLDElementDeclaration tldDecl)
- {
- _tldDecl = tldDecl;
- }
-
- @Override
- public String getTagName()
- {
- return _tldDecl.getElementName();
- }
-
- @Override
- public String getUri()
- {
- return ((TLDDocument)_tldDecl.getOwnerDocument()).getUri();
- }
-
- @Override
- public boolean isJSPTag()
- {
- return true;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/tld/TagIdentifierFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/tld/TagIdentifierFactory.java
deleted file mode 100644
index 013a973..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/tld/TagIdentifierFactory.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.internal.tld;
-
-import org.eclipse.jst.jsf.common.dom.TagIdentifier;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDDocument;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDElementDeclaration;
-import org.w3c.dom.Element;
-
-/**
- * Factory creating tag identifiers
- *
- * @author cbateman
- *
- */
-public final class TagIdentifierFactory
-{
- /**
- * Create a tag identifier based on a uri and tagName
- *
- * @param uri
- * @param tagName
- * @return a new tag identifier for (uri, tagName)
- */
- public static TagIdentifier createJSPTagWrapper(final String uri, final String tagName)
- {
- return new JSPTagIdentifier(uri, tagName);
- }
-
- /**
- * @param element
- * @return a tag identifier based on a DOM element
- */
- public static TagIdentifier createDocumentTagWrapper(final Element element)
- {
- return new DocumentTagIdentifier(element);
- }
-
- /**
- * @param elementDecl
- * @return a tag identifier that bridges a TLDElementDeclaration
- */
- public static TagIdentifier createTLDTagWrapper(final TLDElementDeclaration elementDecl)
- {
- if (!(elementDecl.getOwnerDocument() instanceof TLDDocument))
- {
- throw new IllegalArgumentException("Element decl must have a tlddoc for a parent: "+elementDecl.toString());
- }
- return new TLDTagIdentifier(elementDecl);
- }
-
- private TagIdentifierFactory()
- {
- // static class, no external instantiation
- }
-}
-
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/AbstractJSFAppConfigLocater.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/AbstractJSFAppConfigLocater.java
deleted file mode 100644
index 943fecb..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/AbstractJSFAppConfigLocater.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.jsfappconfig;
-
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.Set;
-
-/**
- * Abstract implementation of {@link IJSFAppConfigLocater} that provides common
- * locater functionality. {@link IJSFAppConfigLocater} implementations should
- * extend this class or provide similar functionality.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author Ian Trimble - Oracle
- */
-public abstract class AbstractJSFAppConfigLocater implements IJSFAppConfigLocater {
-
- /**
- * {@link JSFAppConfigManager} instance to which this locater belongs.
- */
- protected JSFAppConfigManager manager = null;
-
- /**
- * Set of known {@link IJSFAppConfigProvider} instances.
- */
- protected Set configProviders = new LinkedHashSet();
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.core.jsfappconfig.IJSFAppConfigLocater#setJSFAppConfigManager(org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigManager)
- */
- public void setJSFAppConfigManager(JSFAppConfigManager manager) {
- this.manager = manager;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.jsf.core.jsfappconfig.IJSFAppConfigLocater#getJSFAppConfigManager()
- */
- public JSFAppConfigManager getJSFAppConfigManager() {
- return manager;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.core.jsfappconfig.IJSFAppConfigLocater#startLocating()
- */
- public abstract void startLocating();
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.core.jsfappconfig.IJSFAppConfigLocater#stopLocating()
- */
- public abstract void stopLocating();
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.core.jsfappconfig.IJSFAppConfigLocater#getJSFAppConfigProviders()
- */
- public Set getJSFAppConfigProviders() {
- return configProviders;
- }
-
- /**
- * Adds an {@link IJSFAppConfigProvider} instance to the set of known
- * instances and notifies {@link JSFAppConfigManager} instance of the
- * addition if successful.
- *
- * @param configProvider {@link IJSFAppConfigProvider} instance to be
- * added.
- * @return true if instance was added, else false.
- */
- protected boolean addConfigProvider(IJSFAppConfigProvider configProvider) {
- boolean added = configProviders.add(configProvider);
- if (added && manager != null) {
- configProvider.setJSFAppConfigLocater(this);
- manager.notifyJSFAppConfigProvidersChangeListeners(
- configProvider,
- JSFAppConfigProvidersChangeEvent.ADDED);
- }
- return added;
- }
-
- /**
- * Removes an {@link IJSFAppConfigProvider} instance from the set of known
- * instances and notifies {@link JSFAppConfigManager} instance of the
- * removal if successful.
- *
- * @param configProvider {@link IJSFAppConfigProvider} instance to be
- * removed.
- * @return true if instance was removed, else false.
- */
- protected boolean removeConfigProvider(IJSFAppConfigProvider configProvider) {
- if (configProvider != null) {
- configProvider.releaseFacesConfigModel();
- }
- boolean removed = configProviders.remove(configProvider);
- if (removed && manager != null) {
- manager.notifyJSFAppConfigProvidersChangeListeners(
- configProvider,
- JSFAppConfigProvidersChangeEvent.REMOVED);
- }
- return removed;
- }
-
- /**
- * Updates known set of {@link IJSFAppConfigProvider} instances by removing
- * instances that are in the existing set but not in the passed set and
- * adding instances that are in the passed set but not in the existing set.
- * Instances that are in both the existing set and the passed set are left
- * unchanged. The {@link JSFAppConfigManager} is notified of removals and
- * additions, and no notification is sent for instances that are left
- * unchanged.
- *
- * @param newConfigProviders New set of {@link IJSFAppConfigProvider}
- * instances.
- */
- protected void updateConfigProviders(Set newConfigProviders) {
- if (newConfigProviders != null) {
- LinkedHashSet oldConfigProviders = new LinkedHashSet();
- //iterate over existing set
- Iterator itConfigProviders = configProviders.iterator();
- while (itConfigProviders.hasNext()) {
- IJSFAppConfigProvider configProvider = (IJSFAppConfigProvider)itConfigProviders.next();
- //remove provider from new set if it is already in existing set
- if (!newConfigProviders.remove(configProvider)) {
- //stage removal of existing provider that is not in new set
- oldConfigProviders.add(configProvider);
- }
- }
- //remove providers that are not in new set from existing set
- Iterator itOldConfigProviders = oldConfigProviders.iterator();
- while (itOldConfigProviders.hasNext()) {
- IJSFAppConfigProvider configProvider = (IJSFAppConfigProvider)itOldConfigProviders.next();
- //call removeConfigProvider(...) method so manager's listeners are notified
- removeConfigProvider(configProvider);
- }
- //add providers that are still in new set to existing set
- Iterator itNewConfigProviders = newConfigProviders.iterator();
- while (itNewConfigProviders.hasNext()) {
- IJSFAppConfigProvider configProvider = (IJSFAppConfigProvider)itNewConfigProviders.next();
- //call addConfigProvider(...) method so manager's listeners are notified
- addConfigProvider(configProvider);
- }
- }
- }
-
- /**
- * Removes all {@link IJSFAppConfigProvider} instances from the known set,
- * sending notification of all removals to the {@link JSFAppConfigManager}
- * instance.
- */
- protected void removeAllConfigProviders() {
- updateConfigProviders(Collections.EMPTY_SET);
- }
-
- /*
- * (non-Javadoc)
- * @see java.lang.Object#finalize()
- */
- protected void finalize() {
- removeAllConfigProviders();
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/AbstractJSFAppConfigProvider.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/AbstractJSFAppConfigProvider.java
deleted file mode 100644
index baaf9e1..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/AbstractJSFAppConfigProvider.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.jsfappconfig;
-
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
-
-/**
- * Abstract implementation of {@link IJSFAppConfigProvider} that provides
- * common provider functionality. {@link IJSFAppConfigProvider} instances
- * should extend this class or provide similar functionality.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author Ian Trimble - Oracle
- */
-public abstract class AbstractJSFAppConfigProvider implements IJSFAppConfigProvider {
-
- /**
- * {@link IJSFAppConfigLocater} instance that located this instance.
- */
- protected IJSFAppConfigLocater jsfAppConfigLocater = null;
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.core.jsfappconfig.IJSFAppConfigProvider#setJSFAppConfigLocater(org.eclipse.jst.jsf.core.jsfappconfig.IJSFAppConfigLocater)
- */
- public void setJSFAppConfigLocater(IJSFAppConfigLocater locater) {
- this.jsfAppConfigLocater = locater;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.core.jsfappconfig.IJSFAppConfigProvider#getFacesConfigModel()
- */
- public abstract FacesConfigType getFacesConfigModel();
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.core.jsfappconfig.IJSFAppConfigProvider#releaseFacesConfigModel()
- */
- public abstract void releaseFacesConfigModel();
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/ArtifactEditJSFAppConfigProvider.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/ArtifactEditJSFAppConfigProvider.java
deleted file mode 100644
index 50ba81a..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/ArtifactEditJSFAppConfigProvider.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.jsfappconfig;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-/**
- * ArtifactEditJSFAppConfigProvider uses FacesConfigArtifactEdit to provide
- * the root element of an application configuration model.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author Ian Trimble - Oracle
- */
-public class ArtifactEditJSFAppConfigProvider extends AbstractJSFAppConfigProvider {
-
- /**
- * IFile instance that represents an application configuration resource
- * file.
- */
- protected IFile appConfigFile = null;
-
- /**
- * FacesConfigArtifactEdit instance used to get the application
- * configuration model.
- */
- protected FacesConfigArtifactEdit facesConfigArtifactEdit = null;
-
- /**
- * Cached {@link FacesConfigType} instance.
- */
- protected FacesConfigType facesConfig = null;
-
- /**
- * Creates an instance, storing the passed IFile instance for subsequent
- * processing.
- *
- * @param appConfigFile IFile instance that represents an application
- * configuration resource file
- */
- public ArtifactEditJSFAppConfigProvider(IFile appConfigFile) {
- this.appConfigFile = appConfigFile;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.core.jsfappconfig.IJSFAppConfigProvider#getFacesConfigModel()
- */
- public FacesConfigType getFacesConfigModel() {
- if (facesConfig == null) {
- if (appConfigFile != null) {
- IProject project = appConfigFile.getProject();
- IPath appConfigFilePath = JSFAppConfigUtils.getWebContentFolderRelativePath(appConfigFile);
- if (appConfigFilePath != null) {
- facesConfigArtifactEdit = FacesConfigArtifactEdit.getFacesConfigArtifactEditForRead(project, appConfigFilePath.toString());
- if (facesConfigArtifactEdit != null) {
- facesConfig = facesConfigArtifactEdit.getFacesConfig();
- if (facesConfig != null) {
- jsfAppConfigLocater.getJSFAppConfigManager().addFacesConfigChangeAdapter(facesConfig);
- }
- }
- }
- }
- }
- return facesConfig;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.core.jsfappconfig.IJSFAppConfigProvider#releaseFacesConfigModel()
- */
- public void releaseFacesConfigModel() {
- jsfAppConfigLocater.getJSFAppConfigManager().removeFacesConfigChangeAdapter(facesConfig);
- if (facesConfigArtifactEdit != null) {
- facesConfigArtifactEdit.dispose();
- }
- }
-
- /*
- * (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object otherObject) {
- boolean equals = false;
- if (otherObject instanceof ArtifactEditJSFAppConfigProvider) {
- IFile otherAppConfigFile = ((ArtifactEditJSFAppConfigProvider)otherObject).appConfigFile;
- if (appConfigFile != null) {
- equals = appConfigFile.equals(otherAppConfigFile);
- } else {
- equals = otherAppConfigFile == null;
- }
- }
- return equals;
- }
-
- /*
- * (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return appConfigFile != null ? appConfigFile.hashCode() : 0;
- }
-
- /*
- * (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer sb = new StringBuffer("ArtifactEditJSFAppConfigProvider["); //$NON-NLS-1$
- if (appConfigFile != null) {
- sb.append(appConfigFile.toString());
- } else {
- sb.append("null"); //$NON-NLS-1$
- }
- sb.append("]"); //$NON-NLS-1$
- return sb.toString();
- }
-
- /*
- * (non-Javadoc)
- * @see java.lang.Object#finalize()
- */
- protected void finalize() {
- releaseFacesConfigModel();
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/ContextParamSpecifiedJSFAppConfigLocater.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/ContextParamSpecifiedJSFAppConfigLocater.java
deleted file mode 100644
index 5df2941..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/ContextParamSpecifiedJSFAppConfigLocater.java
+++ /dev/null
@@ -1,305 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.jsfappconfig;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jst.j2ee.common.ParamValue;
-import org.eclipse.jst.j2ee.model.IModelProvider;
-import org.eclipse.jst.j2ee.model.ModelProviderManager;
-import org.eclipse.jst.j2ee.webapplication.ContextParam;
-import org.eclipse.jst.j2ee.webapplication.WebApp;
-
-/**
- * ContextParamSpecifiedJSFAppConfigLocater attempts to locate application
- * configuration files specified by the JSF CONFIG_FILES context parameter.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author Ian Trimble - Oracle
- * TODO:cleanup once JavaEE API's stabilize
- */
-public class ContextParamSpecifiedJSFAppConfigLocater extends WebContentRelativeJSFAppConfigLocater {
-
- /**
- * Cached instance of ContextParamAdapter.
- */
- protected ContextParamAdapter contextParamAdapter = null;
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.jsf.core.jsfappconfig.AbstractJSFAppConfigLocater#startLocating()
- */
- public void startLocating() {
- locateProviders();
- Object webAppObj = getModelObject();
- if (webAppObj != null){
- contextParamAdapter = new ContextParamAdapter();
- if (webAppObj instanceof WebApp)
- startLocatingJ2EEConfigs((WebApp)webAppObj);
- else if (webAppObj instanceof org.eclipse.jst.javaee.web.WebApp)
- startLocatingJEEConfigs((org.eclipse.jst.javaee.web.WebApp)webAppObj);
- } else {
- //TODO should never get here. Log err?
- }
- }
-
- private Object getModelObject() {
- IModelProvider provider = ModelProviderManager.getModelProvider(getJSFAppConfigManager().getProject());
- return provider.getModelObject();
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.jsf.core.jsfappconfig.AbstractJSFAppConfigLocater#stopLocating()
- */
- public void stopLocating() {
- if (contextParamAdapter != null) {
- Object webAppObj = getModelObject();
- if (webAppObj != null){
- if (webAppObj instanceof WebApp)
- stopLocatingJ2EEConfigs((WebApp)webAppObj);
- else if (webAppObj instanceof org.eclipse.jst.javaee.web.WebApp)
- stopLocatingJEEConfigs((org.eclipse.jst.javaee.web.WebApp)webAppObj);
- } else {
- //TODO should never get here. Log err?
- }
- contextParamAdapter = null;
- }
- }
-
- private void startLocatingJ2EEConfigs(WebApp webApp){
- webApp.eAdapters().add(contextParamAdapter);
- EList contexts = webApp.getContexts();
- if (contexts != null) {
- Iterator itContexts = contexts.iterator();
- while (itContexts.hasNext()) {
- ContextParam contextParam = (ContextParam)itContexts.next();
- contextParam.eAdapters().add(contextParamAdapter);
- }
- }
- EList contextParams = webApp.getContextParams();
- if (contextParams != null) {
- Iterator itContextParams = contextParams.iterator();
- while (itContextParams.hasNext()) {
- ParamValue paramValue = (ParamValue)itContextParams.next();
- paramValue.eAdapters().add(contextParamAdapter);
- }
- }
- }
-
- private void startLocatingJEEConfigs(org.eclipse.jst.javaee.web.WebApp webApp){
- ((EObject)webApp).eAdapters().add(contextParamAdapter);
-// System.out.println(((EObject)webApp).eDeliver());
- List params = webApp.getContextParams();
- if (params != null) {
- Iterator itContexts = params.iterator();
- while (itContexts.hasNext()) {
- EObject contextParam = (EObject)itContexts.next();
- contextParam.eAdapters().add(contextParamAdapter);
- }
- }
- }
-
-
- private void stopLocatingJ2EEConfigs(WebApp webApp) {
- webApp.eAdapters().remove(contextParamAdapter);
- EList contexts = webApp.getContexts();
- if (contexts != null) {
- Iterator itContexts = contexts.iterator();
- while (itContexts.hasNext()) {
- ContextParam contextParam = (ContextParam)itContexts.next();
- contextParam.eAdapters().remove(contextParamAdapter);
- }
- }
- EList contextParams = webApp.getContextParams();
- if (contextParams != null) {
- Iterator itContextParams = contextParams.iterator();
- while (itContextParams.hasNext()) {
- ParamValue paramValue = (ParamValue)itContextParams.next();
- paramValue.eAdapters().remove(contextParamAdapter);
- }
- }
- }
-
- private void stopLocatingJEEConfigs(org.eclipse.jst.javaee.web.WebApp webApp) {
- ((EObject)webApp).eAdapters().remove(contextParamAdapter);
- List contextParams = webApp.getContextParams();
- if (contextParams != null) {
- Iterator itContextParams = contextParams.iterator();
- while (itContextParams.hasNext()) {
- EObject paramValue = (EObject)itContextParams.next();
- paramValue.eAdapters().remove(contextParamAdapter);
- }
- }
- }
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.jsf.core.jsfappconfig.WebContentRelativeJSFAppConfigLocater#getFilenames()
- */
- protected List getFilenames() {
- return JSFAppConfigUtils.getConfigFilesFromContextParam(manager.getProject());
- }
-
- /**
- * Adapter implementation used to monitor addition/removal of context-param
- * nodes and change in name of existing nodes in order to respond to
- * changes to the JSF CONFIG_FILES context-param.
- *
- * @author Ian Trimble - Oracle
- */
- class ContextParamAdapter extends AdapterImpl {
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.emf.common.notify.impl.AdapterImpl#notifyChanged(org.eclipse.emf.common.notify.Notification)
- */
- public void notifyChanged(Notification notification) {
- Object objNotifier = notification.getNotifier();
-// System.out.println(objNotifier.toString());
- if (objNotifier instanceof WebApp ||
- objNotifier instanceof org.eclipse.jst.javaee.web.WebApp) {
- int eventType = notification.getEventType();
- switch (eventType) {
- case Notification.ADD:
- Object objNewValue = notification.getNewValue();
- if (objNewValue instanceof ContextParam ||
- objNewValue instanceof org.eclipse.jst.javaee.core.ParamValue) {
- contextParamAdded((EObject)objNewValue);
- } else if (objNewValue instanceof ParamValue ) {
- paramValueAdded((EObject)objNewValue);
- }
- break;
- case Notification.REMOVE:
- Object objOldValue = notification.getOldValue();
- if (objOldValue instanceof ContextParam ||
- objOldValue instanceof org.eclipse.jst.javaee.core.ParamValue) {
- contextParamRemoved((EObject)objOldValue);
- } else if (objOldValue instanceof ParamValue) {
- paramValueRemoved((EObject)objOldValue);
- }
- break;
- }
- } else if (objNotifier instanceof ContextParam ||
- objNotifier instanceof org.eclipse.jst.javaee.core.ParamValue) {
- if (notification.getEventType() != Notification.REMOVING_ADAPTER) {
- locateProviders();
- }
- } else if (objNotifier instanceof ParamValue) {
- if (notification.getEventType() != Notification.REMOVING_ADAPTER) {
- locateProviders();
- }
- }
- }
-
- /**
- * Called when a new ContextParam instance is added.
- *
- * @param contextParam ContextParam instance.
- */
- protected void contextParamAdded(EObject contextParam) {
- if (isConfigFilesContextParam(contextParam)) {
- locateProviders();
- }
- contextParam.eAdapters().add(this);
- }
-
- /**
- * Called when a new ParamValue instance is added.
- *
- * @param paramValue ParamValue instance.
- */
- protected void paramValueAdded(EObject paramValue) {
- if (isConfigFilesParamValue(paramValue)) {
- locateProviders();
- }
- paramValue.eAdapters().add(this);
- }
-
- /**
- * Called when a ContextParam instance is removed.
- *
- * @param contextParam ContextParam instance.
- */
- protected void contextParamRemoved(EObject contextParam) {
- if (isConfigFilesContextParam(contextParam)) {
- locateProviders();
- }
- contextParam.eAdapters().remove(this);
- }
-
- /**
- * Called when a ParamValue instance is removed.
- *
- * @param paramValue ParamValue instance.
- */
- protected void paramValueRemoved(EObject paramValue) {
- if (isConfigFilesParamValue(paramValue)) {
- locateProviders();
- }
- paramValue.eAdapters().remove(this);
- }
-
- /**
- * Tests if the passed ContextParam instance is the JSF CONFIG_FILES
- * context parameter.
- *
- * @param contextParam ContextParam instance.
- * @return true if the passed ContextParam instance is the JSF
- * CONFIG_FILES context parameter, else false
- */
- protected boolean isConfigFilesContextParam(EObject contextParam) {
- boolean isConfigFiles = false;
- if (contextParam != null) {
- String name = null;
- if (contextParam instanceof ContextParam)
- name = ((ContextParam)contextParam).getParamName();
- else if (contextParam instanceof org.eclipse.jst.javaee.core.ParamValue)
- name = ((org.eclipse.jst.javaee.core.ParamValue)contextParam).getParamName();
-
- if (name != null && name.equals(JSFAppConfigUtils.CONFIG_FILES_CONTEXT_PARAM_NAME)) {
- isConfigFiles = true;
- }
- }
- return isConfigFiles;
- }
-
- /**
- * Tests if the passed ParamValue instance is the JSF CONFIG_FILES
- * context parameter.
- *
- * @param paramVal as EObject ParamValue instance.
- * @return true if the passed ParamValue instance is the JSF
- * CONFIG_FILES context parameter, else false
- */
- protected boolean isConfigFilesParamValue(EObject paramVal) {
- boolean isConfigFiles = false;
- if (paramVal != null) {
- String name = null;
- if (paramVal instanceof ParamValue)
- name = ((ParamValue)paramVal).getName();
- else if (paramVal instanceof org.eclipse.jst.javaee.core.ParamValue)
- name = ((org.eclipse.jst.javaee.core.ParamValue)paramVal).getParamName();
-
- if (name != null && name.equals(JSFAppConfigUtils.CONFIG_FILES_CONTEXT_PARAM_NAME)) {
- isConfigFiles = true;
- }
- }
- return isConfigFiles;
- }
-
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/DefaultJSFAppConfigLocater.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/DefaultJSFAppConfigLocater.java
deleted file mode 100644
index 4cc953d..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/DefaultJSFAppConfigLocater.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.jsfappconfig;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceDeltaVisitor;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
-import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
-
-/**
- * DefaultJSFAppConfigLocater attempts to locate the default application
- * configuration file, located at "/WEB-INF/faces-config.xml".
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author Ian Trimble - Oracle
- */
-public class DefaultJSFAppConfigLocater extends WebContentRelativeJSFAppConfigLocater
- implements IResourceChangeListener {
-
- /**
- * Web content folder-relative name of the default application
- * configuration resource file.
- */
- public static final String DEF_APPCONFIGRESOURCE_FILENAME = "WEB-INF/faces-config.xml"; //$NON-NLS-1$
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.jsf.core.jsfappconfig.AbstractJSFAppConfigLocater#startLocating()
- */
- public void startLocating() {
- locateProviders();
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- workspace.addResourceChangeListener(this, IResourceChangeEvent.POST_BUILD);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.jsf.core.jsfappconfig.AbstractJSFAppConfigLocater#stopLocating()
- */
- public void stopLocating() {
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- workspace.removeResourceChangeListener(this);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.jsf.core.jsfappconfig.WebContentRelativeJSFAppConfigLocater#getFilenames()
- */
- protected List getFilenames() {
- List filenames = new ArrayList();
- filenames.add(DEF_APPCONFIGRESOURCE_FILENAME);
- return filenames;
- }
-
- /**
- * Responds to resource change events.
- *
- * @param event IResourceChangeEvent instance.
- */
- public void resourceChanged(IResourceChangeEvent event) {
- IResourceDelta delta = event.getDelta();
- try {
- delta.accept(new ResourceDeltaVisitor());
- } catch (CoreException cex) {
- JSFCorePlugin.log(
- IStatus.WARNING,
- cex.getLocalizedMessage(),
- cex);
- }
- }
-
- /**
- * ResourceDeltaVisitor is used to visit an IResourceDelta instance to
- * discover if the default application configuration resource file has
- * been added or removed.
- *
- * @author Ian Trimble - Oracle
- */
- class ResourceDeltaVisitor implements IResourceDeltaVisitor {
-
- /**
- * Cached IPath instance for default configuration resource file.
- */
- protected IPath defConfigPath = null;
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.resources.IResourceDeltaVisitor#visit(org.eclipse.core.resources.IResourceDelta)
- */
- public boolean visit(IResourceDelta delta) {
- boolean visitChildren = false;
- initDefConfigPath();
- if (defConfigPath != null) {
- IPath deltaPath = delta.getFullPath();
- if (deltaPath != null) {
- if (defConfigPath.equals(deltaPath)) {
- locateProviders();
- } else if (deltaPath.isPrefixOf(defConfigPath)) {
- visitChildren = true;
- }
- }
- } else {
- locateProviders();
- }
- return visitChildren;
- }
-
- /**
- * Determines IPath instance for default configuration resource file
- * and caches in class member.
- */
- protected void initDefConfigPath() {
- if (defConfigPath == null) {
- IProject project = manager.getProject();
- if (project != null) {
- IVirtualFolder webContentFolder = JSFAppConfigUtils.getWebContentFolder(project);
- if (webContentFolder != null) {
- IVirtualResource defConfigFile = webContentFolder.findMember(DEF_APPCONFIGRESOURCE_FILENAME);
- if (defConfigFile != null) {
- defConfigPath = defConfigFile.getWorkspaceRelativePath();
- }
- }
- }
- }
- }
-
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/IFacesConfigChangeListener.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/IFacesConfigChangeListener.java
deleted file mode 100644
index 7f40db6..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/IFacesConfigChangeListener.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.jsfappconfig;
-
-import org.eclipse.emf.common.notify.Notification;
-
-/**
- * IFacesConfigChangeListener is the interface that must be implemented by
- * objects interested in receiving notification of changes to application
- * configuration models.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author Ian Trimble - Oracle
- */
-public interface IFacesConfigChangeListener {
-
- /**
- * Called when a change in an application configuration model for which
- * this listener has been registered occurs.
- *
- * @param notification EMF {@link Notification} instance that describes the
- * model change.
- */
- public void notifyChanged(Notification notification);
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/IJSFAppConfigLocater.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/IJSFAppConfigLocater.java
deleted file mode 100644
index 6c0a6a2..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/IJSFAppConfigLocater.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.jsfappconfig;
-
-import java.util.Set;
-
-/**
- * IJSFAppConfigLocater is the interface that Objects capable of locating
- * and providing JSF application configuration resources must implement.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author Ian Trimble - Oracle
- */
-public interface IJSFAppConfigLocater {
-
- /**
- * Sets the {@link JSFAppConfigManager} instance to which this locater
- * belongs.
- *
- * @param manager {@link JSFAppConfigManager} instance to be set.
- */
- public void setJSFAppConfigManager(JSFAppConfigManager manager);
-
- /**
- * Gets the {@link JSFAppConfigManager} instance to which this locater
- * belongs.
- *
- * @return {@link JSFAppConfigManager} instance to which this locater
- * belongs.
- */
- public JSFAppConfigManager getJSFAppConfigManager();
-
- /**
- * Starts locating JSF application configuration resources.
- */
- public void startLocating();
-
- /**
- * Stops locating JSF application configuration resources.
- */
- public void stopLocating();
-
- /**
- * Gets the set of {@link IJSFAppConfigProvider} instances that this
- * locater has located.
- *
- * @return set of {@link IJSFAppConfigProvider} instances.
- */
- public Set getJSFAppConfigProviders();
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/IJSFAppConfigProvider.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/IJSFAppConfigProvider.java
deleted file mode 100644
index a351eaa..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/IJSFAppConfigProvider.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.jsfappconfig;
-
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
-
-/**
- * IJSFAppConfigProvider is the interface that Objects capable of providing
- * JSF application configuration models must implement.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author Ian Trimble - Oracle
- */
-public interface IJSFAppConfigProvider {
-
- /**
- * Sets the {@link IJSFAppConfigLocater} instance that located this
- * instance.
- *
- * @param locater {@link IJSFAppConfigLocater} instance that located this
- * instance.
- */
- public void setJSFAppConfigLocater(IJSFAppConfigLocater locater);
-
- /**
- * Gets the root element of the application configuration model for read
- * access.
- *
- * @return FacesConfigType instance, which is the root element of an
- * application configuration model.
- */
- public FacesConfigType getFacesConfigModel();
-
- /**
- * Releases resources associated with acquiring the application
- * configuration model (if any).
- */
- public void releaseFacesConfigModel();
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/IJSFAppConfigProvidersChangeListener.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/IJSFAppConfigProvidersChangeListener.java
deleted file mode 100644
index d8282c9..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/IJSFAppConfigProvidersChangeListener.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.jsfappconfig;
-
-/**
- * Interface that an Object wishing to be notified about changes to the Set of
- * IJSFAppConfigProvider instances implements.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author Ian Trimble - Oracle.
- */
-public interface IJSFAppConfigProvidersChangeListener {
-
- /**
- * Callback method indicating a change in the Set of JSFAppConfigProvider
- * instances.
- *
- * @param event JSFAppConfigProvidersChangeEvent instance.
- */
- public void changedJSFAppConfigProviders(JSFAppConfigProvidersChangeEvent event);
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/ImplicitRuntimeJSFAppConfigLocater.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/ImplicitRuntimeJSFAppConfigLocater.java
deleted file mode 100644
index eddcfeb..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/ImplicitRuntimeJSFAppConfigLocater.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.jsfappconfig;
-
-import java.util.LinkedHashSet;
-import java.util.Set;
-
-/**
- * ImplicitRuntimeJSFAppConfigLocater creates an {@link IJSFAppConfigProvider}
- * instance that provides an application configuration model that contains
- * implicit configuration elements that are specified as required to be
- * provided by a JSF implementation.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author Ian Trimble - Oracle
- */
-public class ImplicitRuntimeJSFAppConfigLocater extends AbstractJSFAppConfigLocater {
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.core.jsfappconfig.AbstractJSFAppConfigLocater#startLocating()
- */
- public void startLocating() {
- locateProviders();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.core.jsfappconfig.AbstractJSFAppConfigLocater#stopLocating()
- */
- public void stopLocating() {
- //nothing to do
- }
-
- /**
- * Adds an {@link IJSFAppConfigProvider} instance that provides an
- * application configuration model that contains implicit configuration
- * objects provided by a JSF implementation at runtime.
- */
- public void locateProviders() {
- Set newConfigProviders = new LinkedHashSet();
- newConfigProviders.add(new ImplicitRuntimeJSFAppConfigProvider());
- updateConfigProviders(newConfigProviders);
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/ImplicitRuntimeJSFAppConfigProvider.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/ImplicitRuntimeJSFAppConfigProvider.java
deleted file mode 100644
index 7a1e581..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/ImplicitRuntimeJSFAppConfigProvider.java
+++ /dev/null
@@ -1,295 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.jsfappconfig;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jst.jsf.facesconfig.emf.ComponentClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.ComponentType;
-import org.eclipse.jst.jsf.facesconfig.emf.ComponentTypeType;
-import org.eclipse.jst.jsf.facesconfig.emf.ConverterClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.ConverterForClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.ConverterIdType;
-import org.eclipse.jst.jsf.facesconfig.emf.ConverterType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigFactory;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
-import org.eclipse.jst.jsf.facesconfig.emf.ValidatorClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.ValidatorIdType;
-import org.eclipse.jst.jsf.facesconfig.emf.ValidatorType;
-
-/**
- * ImplicitRuntimeJSFAppConfigProvider provides an application configuration
- * model that contains implicit configuration objects provided by a JSF
- * implementation at runtime.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author Ian Trimble - Oracle
- */
-public class ImplicitRuntimeJSFAppConfigProvider extends AbstractJSFAppConfigProvider {
-
- /**
- * Cached {@link FacesConfigType} instance.
- */
- protected FacesConfigType facesConfig = null;
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.core.jsfappconfig.IJSFAppConfigProvider#getFacesConfigModel()
- */
- public FacesConfigType getFacesConfigModel() {
- if (facesConfig == null) {
- createModel();
- if (facesConfig != null) {
- jsfAppConfigLocater.getJSFAppConfigManager().addFacesConfigChangeAdapter(facesConfig);
- }
- }
- return facesConfig;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.core.jsfappconfig.IJSFAppConfigProvider#releaseFacesConfigModel()
- */
- public void releaseFacesConfigModel() {
- jsfAppConfigLocater.getJSFAppConfigManager().removeFacesConfigChangeAdapter(facesConfig);
- facesConfig = null;
- }
-
- /**
- * Creates the application configuration model and assigns it to the
- * facesConfig property.
- */
- protected void createModel() {
- facesConfig = FacesConfigFactory.eINSTANCE.createFacesConfigType();
- //create and add converters by id
- EList converters = facesConfig.getConverter();
- converters.add(createConverter("BigDecimal")); //$NON-NLS-1$
- converters.add(createConverter("BigInteger")); //$NON-NLS-1$
- converters.add(createConverter("Boolean")); //$NON-NLS-1$
- converters.add(createConverter("Byte")); //$NON-NLS-1$
- converters.add(createConverter("Character")); //$NON-NLS-1$
- converters.add(createConverter("DateTime")); //$NON-NLS-1$
- converters.add(createConverter("Double")); //$NON-NLS-1$
- converters.add(createConverter("Float")); //$NON-NLS-1$
- converters.add(createConverter("Integer")); //$NON-NLS-1$
- converters.add(createConverter("Long")); //$NON-NLS-1$
- converters.add(createConverter("Number")); //$NON-NLS-1$
- converters.add(createConverter("Short")); //$NON-NLS-1$
- // converters by for-class (see spec 3.3.3 -- Standard Converter Implementions
- converters.add(createForClassConverter("java.lang.Boolean", "javax.faces.convert.BooleanConverter"));
- converters.add(createForClassConverter("java.lang.Byte", "javax.faces.convert.ByteConverter"));
- converters.add(createForClassConverter("java.lang.Character", "javax.faces.convert.CharacterConverter"));
- converters.add(createForClassConverter("java.lang.Double", "javax.faces.convert.DoubleConverter"));
- converters.add(createForClassConverter("java.lang.Float", "javax.faces.convert.FloatConverter"));
- converters.add(createForClassConverter("java.lang.Integer", "javax.faces.convert.IntegerConverter"));
- converters.add(createForClassConverter("java.lang.Long", "javax.faces.convert.LongConverter"));
- converters.add(createForClassConverter("java.lang.Short", "javax.faces.converter.ShortConverter"));
- //create and add validators
- EList validators = facesConfig.getValidator();
- validators.add(createValidator("DoubleRange")); //$NON-NLS-1$
- validators.add(createValidator("Length")); //$NON-NLS-1$
- validators.add(createValidator("LongRange")); //$NON-NLS-1$
- //create and add UI components
- EList components = facesConfig.getComponent();
- components.add(createUIComponent("Column")); //$NON-NLS-1$
- components.add(createUIComponent("Command")); //$NON-NLS-1$
- components.add(createUIComponent("Data")); //$NON-NLS-1$
- components.add(createUIComponent("Form")); //$NON-NLS-1$
- components.add(createUIComponent("Graphic")); //$NON-NLS-1$
- components.add(createUIComponent("Input")); //$NON-NLS-1$
- components.add(createUIComponent("Message")); //$NON-NLS-1$
- components.add(createUIComponent("Messages")); //$NON-NLS-1$
- components.add(createUIComponent("NamingContainer")); //$NON-NLS-1$
- components.add(createUIComponent("Output")); //$NON-NLS-1$
- components.add(createUIComponent("Panel")); //$NON-NLS-1$
- components.add(createUIComponent("Parameter")); //$NON-NLS-1$
- components.add(createUIComponent("SelectBoolean")); //$NON-NLS-1$
- components.add(createUIComponent("SelectItem")); //$NON-NLS-1$
- components.add(createUIComponent("SelectItems")); //$NON-NLS-1$
- components.add(createUIComponent("SelectMany")); //$NON-NLS-1$
- components.add(createUIComponent("SelectOne")); //$NON-NLS-1$
- components.add(createUIComponent("ViewRoot")); //$NON-NLS-1$
- //create and add HTML components
- components.add(createHTMLComponent("HtmlCommandButton")); //$NON-NLS-1$
- components.add(createHTMLComponent("HtmlCommandLink")); //$NON-NLS-1$
- components.add(createHTMLComponent("HtmlDataTable")); //$NON-NLS-1$
- components.add(createHTMLComponent("HtmlForm")); //$NON-NLS-1$
- components.add(createHTMLComponent("HtmlGraphicImage")); //$NON-NLS-1$
- components.add(createHTMLComponent("HtmlInputHidden")); //$NON-NLS-1$
- components.add(createHTMLComponent("HtmlInputSecret")); //$NON-NLS-1$
- components.add(createHTMLComponent("HtmlInputText")); //$NON-NLS-1$
- components.add(createHTMLComponent("HtmlInputTextarea")); //$NON-NLS-1$
- components.add(createHTMLComponent("HtmlMessage")); //$NON-NLS-1$
- components.add(createHTMLComponent("HtmlMessages")); //$NON-NLS-1$
- components.add(createHTMLComponent("HtmlOutputFormat")); //$NON-NLS-1$
- components.add(createHTMLComponent("HtmlOutputLabel")); //$NON-NLS-1$
- components.add(createHTMLComponent("HtmlOutputLink")); //$NON-NLS-1$
- components.add(createHTMLComponent("HtmlOutputText")); //$NON-NLS-1$
- components.add(createHTMLComponent("HtmlPanelGrid")); //$NON-NLS-1$
- components.add(createHTMLComponent("HtmlPanelGroup")); //$NON-NLS-1$
- components.add(createHTMLComponent("HtmlSelectBooleanCheckbox")); //$NON-NLS-1$
- components.add(createHTMLComponent("HtmlSelectManyCheckbox")); //$NON-NLS-1$
- components.add(createHTMLComponent("HtmlSelectManyListbox")); //$NON-NLS-1$
- components.add(createHTMLComponent("HtmlSelectManyMenu")); //$NON-NLS-1$
- components.add(createHTMLComponent("HtmlSelectOneListbox")); //$NON-NLS-1$
- components.add(createHTMLComponent("HtmlSelectOneMenu")); //$NON-NLS-1$
- components.add(createHTMLComponent("HtmlSelectOneRadio")); //$NON-NLS-1$
- }
-
- /**
- * Creates a {@link ConverterType} instance.
- *
- * @param name Base name of converter from which converter-id and
- * converter-class are formed.
- * @return {@link ConverterType} instance.
- */
- protected ConverterType createConverter(String name) {
- ConverterType converterType = FacesConfigFactory.eINSTANCE.createConverterType();
- //set converter-id
- ConverterIdType converterIdType = FacesConfigFactory.eINSTANCE.createConverterIdType();
- StringBuffer sb = new StringBuffer();
- sb.append("javax.faces."); //$NON-NLS-1$
- sb.append(name);
- converterIdType.setTextContent(sb.toString());
- converterType.setConverterId(converterIdType);
- //set converter-class
- ConverterClassType converterClassType = FacesConfigFactory.eINSTANCE.createConverterClassType();
- sb = new StringBuffer();
- sb.append("javax.faces.convert."); //$NON-NLS-1$
- sb.append(name);
- sb.append("Converter"); //$NON-NLS-1$
- converterClassType.setTextContent(sb.toString());
- converterType.setConverterClass(converterClassType);
- return converterType;
- }
-
- private ConverterType createForClassConverter(String forClass, String converterClass)
- {
- ConverterType converterType = FacesConfigFactory.eINSTANCE.createConverterType();
- //set converter-id
- ConverterForClassType converterForClass = FacesConfigFactory.eINSTANCE.createConverterForClassType();
- converterForClass.setTextContent(forClass);
- converterType.setConverterForClass(converterForClass);
- //set converter-class
- ConverterClassType converterClassType = FacesConfigFactory.eINSTANCE.createConverterClassType();
- converterClassType.setTextContent(converterClass);
- converterType.setConverterClass(converterClassType);
- return converterType;
- }
-
- /**
- * Creates a {@link ValidatorType} instance.
- *
- * @param name Base name of validator from which validator-id and
- * validator-class are formed.
- * @return {@link ValidatorType} instance.
- */
- protected ValidatorType createValidator(String name) {
- ValidatorType validatorType = FacesConfigFactory.eINSTANCE.createValidatorType();
- //set validator-id
- ValidatorIdType validatorIdType = FacesConfigFactory.eINSTANCE.createValidatorIdType();
- StringBuffer sb = new StringBuffer();
- sb.append("javax.faces."); //$NON-NLS-1$
- sb.append(name);
- validatorIdType.setTextContent(sb.toString());
- validatorType.setValidatorId(validatorIdType);
- //set validator-class
- ValidatorClassType validatorClassType = FacesConfigFactory.eINSTANCE.createValidatorClassType();
- sb = new StringBuffer();
- sb.append("javax.faces.validator."); //$NON-NLS-1$
- sb.append(name);
- sb.append("Validator"); //$NON-NLS-1$
- validatorClassType.setTextContent(sb.toString());
- validatorType.setValidatorClass(validatorClassType);
- return validatorType;
- }
-
- /**
- * Creates a {@link ComponentType} instance to represent a standard UI
- * component.
- *
- * @param name Base name of component from which component-type and
- * component-class are formed.
- * @return {@link ComponentType} instance.
- */
- protected ComponentType createUIComponent(String name) {
- ComponentType componentType = FacesConfigFactory.eINSTANCE.createComponentType();
- //set component-type
- ComponentTypeType componentTypeType = FacesConfigFactory.eINSTANCE.createComponentTypeType();
- StringBuffer sb = new StringBuffer();
- sb.append("javax.faces."); //$NON-NLS-1$
- sb.append(name);
- componentTypeType.setTextContent(sb.toString());
- componentType.setComponentType(componentTypeType);
- //set component-class
- ComponentClassType componentClassType = FacesConfigFactory.eINSTANCE.createComponentClassType();
- sb = new StringBuffer();
- sb.append("javax.faces.component.UI"); //$NON-NLS-1$
- sb.append(name);
- componentClassType.setTextContent(sb.toString());
- componentType.setComponentClass(componentClassType);
- return componentType;
- }
-
- /**
- * Creates a {@link ComponentType} instance to represent a concrete HTML
- * component.
- *
- * @param name Base name of component from which component-type and
- * component-class are formed.
- * @return {@link ComponentType} instance.
- */
- protected ComponentType createHTMLComponent(String name) {
- ComponentType componentType = FacesConfigFactory.eINSTANCE.createComponentType();
- //set component-type
- ComponentTypeType componentTypeType = FacesConfigFactory.eINSTANCE.createComponentTypeType();
- StringBuffer sb = new StringBuffer();
- sb.append("javax.faces."); //$NON-NLS-1$
- sb.append(name);
- componentTypeType.setTextContent(sb.toString());
- componentType.setComponentType(componentTypeType);
- //set component-class
- ComponentClassType componentClassType = FacesConfigFactory.eINSTANCE.createComponentClassType();
- sb = new StringBuffer();
- sb.append("javax.faces.component.html."); //$NON-NLS-1$
- sb.append(name);
- componentClassType.setTextContent(sb.toString());
- componentType.setComponentClass(componentClassType);
- return componentType;
- }
-
- /*
- * (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object otherObject) {
- boolean equals = false;
- if (otherObject instanceof ImplicitRuntimeJSFAppConfigProvider) {
- equals = true;
- }
- return equals;
- }
-
- /*
- * (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return ImplicitRuntimeJSFAppConfigProvider.class.getName().hashCode();
- }
-
- /*
- * (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return "ImplicitRuntimeJSFAppConfigProvider[]"; //$NON-NLS-1$
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/JARFileJSFAppConfigProvider.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/JARFileJSFAppConfigProvider.java
deleted file mode 100644
index 3d967f9..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/JARFileJSFAppConfigProvider.java
+++ /dev/null
@@ -1,254 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.jsfappconfig;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.Collections;
-import java.util.jar.JarFile;
-import java.util.zip.ZipEntry;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.core.internal.Messages;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigResourceFactory;
-import org.eclipse.osgi.util.NLS;
-
-/**
- * JARFileJSFAppConfigProvider provides the root element of an application
- * configuration model by loading the model from a /META-INF/faces-config.xml
- * entry in a JAR file.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author Ian Trimble - Oracle
- */
-public class JARFileJSFAppConfigProvider extends AbstractJSFAppConfigProvider {
-
- /**
- * Prefix required to turn filename into a JAR URI.
- */
- public static final String JARFILE_URI_PREFIX = "jar:file:///";
-
- /**
- * Suffix required to turn filename into a JAR URI.
- */
- public static final String FACES_CONFIG_IN_JAR_SUFFIX = "!/META-INF/faces-config.xml";
-
- /**
- * Name of a JAR file that contains a /META-INF/faces-config.xml entry.
- */
- protected String filename = null;
-
- /**
- * Cached {@link FacesConfigType} instance.
- */
- protected FacesConfigType facesConfig = null;
-
- /**
- * Flag to track if load error has been logged at least once.
- */
- protected boolean loadErrorLogged = false;
-
- /**
- * Creates an instance, storing the passed IProject instance and file name
- * String to be used for subsequent processing.
- *
- * @param filename Name of a JAR file that contains a
- * /META-INF/faces-config.xml entry.
- */
- public JARFileJSFAppConfigProvider(String filename) {
- this.filename = filename;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.core.jsfappconfig.IJSFAppConfigProvider#getFacesConfigModel()
- */
- public FacesConfigType getFacesConfigModel() {
- // TODO: should this job be pushed into the model?
- if (facesConfig == null && filename != null)
- {
- facesConfig = getFacesConfig();
-
- if (facesConfig != null)
- {
- jsfAppConfigLocater.getJSFAppConfigManager().addFacesConfigChangeAdapter(facesConfig);
- }
- }
- return facesConfig;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.core.jsfappconfig.IJSFAppConfigProvider#releaseFacesConfigModel()
- */
- public void releaseFacesConfigModel() {
- jsfAppConfigLocater.getJSFAppConfigManager().removeFacesConfigChangeAdapter(facesConfig);
- }
-
- /**
- * Called to log a load error; load error will be logged once only per
- * instance, per VM session.
- *
- * @param ex Throwable instance to be logged.
- */
- protected void logLoadError(Throwable ex) {
- if (!loadErrorLogged) {
- JSFCorePlugin.log(
- IStatus.ERROR,
- NLS.bind(Messages.JARFileJSFAppConfigProvider_ErrorLoadingModel, JARFILE_URI_PREFIX + filename + FACES_CONFIG_IN_JAR_SUFFIX),
- ex);
- loadErrorLogged = true;
- }
- }
-
- /*
- * (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object otherObject) {
- boolean equals = false;
- if (otherObject instanceof JARFileJSFAppConfigProvider) {
- String otherFilename = ((JARFileJSFAppConfigProvider)otherObject).filename;
- if (filename != null) {
- equals = filename.equals(otherFilename);
- } else {
- equals = otherFilename == null;
- }
- }
- return equals;
- }
-
- /*
- * (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return filename != null ? filename.hashCode() : 0;
- }
-
- /*
- * (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer sb = new StringBuffer("JARFileJSFAppConfigProvider["); //$NON-NLS-1$
- if (filename != null) {
- sb.append(filename);
- } else {
- sb.append("null"); //$NON-NLS-1$
- }
- sb.append("]"); //$NON-NLS-1$
- return sb.toString();
- }
-
- private FacesConfigType getFacesConfig()
- {
- JarFile jarFile = null;
- File tempFile = null;
- OutputStream tempFileStream = null;
-
- try
- {
- jarFile = new JarFile(filename, false);
- ZipEntry entry = jarFile.getEntry("META-INF/faces-config.xml");
-
- if (entry != null)
- {
- InputStream stream = jarFile.getInputStream(entry);
-
- tempFile = File.createTempFile("tempfile", ".xml");
- tempFileStream = new FileOutputStream(tempFile);
-
- int read = 0;
- byte[] buffer = new byte[4096];
-
- while ((read = stream.read(buffer)) != -1)
- {
- tempFileStream.write(buffer, 0, read);
- }
-
- tempFileStream.close();
- tempFileStream = null;
-
- FacesConfigResourceFactory factory = FacesConfigResourceFactory.createResourceFactoryForJar();
- //FacesConfigResourceFactory.register(tempFile.toURI().toString());
- Resource resource = factory.createResource(URI.createFileURI(tempFile.getAbsolutePath()));
-
- try {
- if (resource != null) {
- resource.load(Collections.EMPTY_MAP);
- EList resourceContents = resource.getContents();
- if (resourceContents != null && resourceContents.size() > 0) {
- facesConfig = (FacesConfigType)resourceContents.get(0);
- if (facesConfig != null) {
- jsfAppConfigLocater.getJSFAppConfigManager().addFacesConfigChangeAdapter(facesConfig);
- }
- }
- }
- } catch(IllegalStateException ise) {
- //log error
- logLoadError(ise);
- } catch(IOException ioe) {
- //log error
- logLoadError(ioe);
- }
- }
-
- return facesConfig;
- }
- catch (IOException ioe)
- {
- logLoadError(ioe);
- return null;
- }
- finally
- {
- if (jarFile != null)
- {
- try
- {
- jarFile.close();
- }
- catch (IOException ioe)
- {
- logLoadError(ioe);
- }
- }
-
- if (tempFileStream != null)
- {
- try
- {
- tempFileStream.close();
- }
- catch(IOException ioe)
- {
- logLoadError(ioe);
- }
- }
-
- if (tempFile != null && tempFile.exists())
- {
- if (!tempFile.delete())
- {
- tempFile.deleteOnExit();
- }
- }
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/JSFAppConfigManager.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/JSFAppConfigManager.java
deleted file mode 100644
index 04d2ce4..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/JSFAppConfigManager.java
+++ /dev/null
@@ -1,804 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.jsfappconfig;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.util.EContentAdapter;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.facesconfig.emf.ApplicationType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
-import org.eclipse.jst.jsf.facesconfig.emf.FromViewIdType;
-import org.eclipse.jst.jsf.facesconfig.emf.NavigationRuleType;
-import org.eclipse.jst.jsf.facesconfig.emf.PropertyResolverType;
-import org.eclipse.jst.jsf.facesconfig.emf.VariableResolverType;
-
-/**
- * JSFAppConfigManager provides an entry point to an entire JSF application
- * configuration, which is defined in one or more application configuration
- * resource files.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author Ian Trimble - Oracle
- */
-public class JSFAppConfigManager implements IResourceChangeListener {
-
- /**
- * Key that is used for the IProject instance's session property that
- * holds a JSFAppConfigManager instance.
- */
- public static final QualifiedName KEY_SESSIONPROPERTY =
- new QualifiedName(JSFCorePlugin.PLUGIN_ID, "JSFAppConfigManager"); //$NON-NLS-1$
-
- /**
- * IProject instance to which this JSFAppConfigManager instance is keyed.
- */
- protected IProject project = null;
-
- /**
- * Collection of {@link IJSFAppConfigLocater} instances.
- */
- protected List configLocaters = null;
-
- /**
- * Collection of {@link IJSFAppConfigProvidersChangeListener} instances.
- */
- protected List configProvidersChangeListeners = null;
-
- /**
- * Map of application configuration model EMF classes to
- * {@link IFacesConfigChangeListener} instances.
- */
- protected Map facesConfigChangeListeners = null;
-
- /**
- * Single {@link FacesConfigChangeAdapter} instance.
- */
- protected FacesConfigChangeAdapter facesConfigChangeAdapter = null;
-
- /**
- * Gets a JSFAppConfigManager instance that is keyed to the passed IProject
- * parameter. May return null if the project is not valid or if a
- * CoreException is thrown while attempting to get or set the instance as
- * a session property.
- *
- * @param project IProject instance to which the returned
- * JSFAppConfigManager instance is keyed.
- * @return JSFAppConfigManager instance, or null.
- */
- public static synchronized JSFAppConfigManager getInstance(IProject project) {
- JSFAppConfigManager manager = null;
- if (JSFAppConfigUtils.isValidJSFProject(project)) {
- manager = getFromSessionProperty(project);
- if (manager == null) {
- manager = new JSFAppConfigManager(project);
- }
- }
- return manager;
- }
-
- /**
- * Attempts to get a JSFAppConfigManager instance from a session property
- * of the passed IProject instance. Will return null if the session
- * property has not yet been set.
- *
- * @param project IProject instance from which to retrieve the
- * JSFAppConfigManager instance.
- * @return JSFAppConfigManager instance, or null.
- */
- protected static JSFAppConfigManager getFromSessionProperty(IProject project) {
- JSFAppConfigManager manager = null;
- try {
- Object obj = project.getSessionProperty(KEY_SESSIONPROPERTY);
- if (obj instanceof JSFAppConfigManager) {
- manager = (JSFAppConfigManager)obj;
- }
- } catch(CoreException ce) {
- //log error
- JSFCorePlugin.log(IStatus.ERROR, ce.getLocalizedMessage(), ce);
- }
- return manager;
- }
-
- /**
- * Sets this JSFAppConfigManager instance as a session property of its
- * IProject instance.
- */
- protected void setAsSessionProperty() {
- if (project != null && project.isAccessible()) {
- try {
- project.setSessionProperty(KEY_SESSIONPROPERTY, this);
- } catch(CoreException ce) {
- //log error
- JSFCorePlugin.log(IStatus.ERROR, ce.getLocalizedMessage(), ce);
- }
- }
- }
-
- /**
- * Unsets this JSFAppConfigManager instance as a session property of its
- * IProject instance.
- */
- protected void unsetAsSessionProperty() {
- if (project != null && project.isAccessible()) {
- try {
- project.setSessionProperty(KEY_SESSIONPROPERTY, null);
- } catch(CoreException ce) {
- //log error
- JSFCorePlugin.log(IStatus.ERROR, ce.getLocalizedMessage(), ce);
- }
- }
- }
-
- /**
- * Constructor is private to prevent direct instantiation; call
- * getInstance(IProject).
- *
- * @param project IProject instance to which the new JSFAppConfigManager
- * instance is keyed.
- */
- private JSFAppConfigManager(IProject project) {
- this.project = project;
- initialize();
- }
-
- /**
- * Gets this instance's IProject instance.
- *
- * @return This instance's IProject instance.
- */
- public IProject getProject() {
- return project;
- }
-
- /**
- * Initializes instance by:
- * <ul>
- * <li>creating facesConfigChangeListeners collection, </li>
- * <li>creating configProvidersChangeListeners collection, </li>
- * <li>creating and populating configLocaters collection, </li>
- * <li>invoking the startLocating() method on all configLocaters, </li>
- * <li>setting instance as a session property of the IProject instance, </li>
- * <li>adding a resource change listener to the workspace.</li>
- * </ul>
- */
- protected void initialize() {
- //create collections
- facesConfigChangeListeners = new HashMap();
- configProvidersChangeListeners = new ArrayList();
- configLocaters = new ArrayList();
- //populate initial set of locaters
- populateConfigLocaters();
- //instruct locaters to start locating
- startConfigLocaters();
- //set as session property of project
- setAsSessionProperty();
- //add resource change listener
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- workspace.addResourceChangeListener(this, IResourceChangeEvent.POST_CHANGE);
- }
-
- /**
- * Populates configLocaters Set with "built-in" set of
- * {@link IJSFAppConfigLocater} implementations.
- */
- protected void populateConfigLocaters() {
- //implicit runtime-provided configuration
- IJSFAppConfigLocater implicitRuntimeConfigLocater = new ImplicitRuntimeJSFAppConfigLocater();
- implicitRuntimeConfigLocater.setJSFAppConfigManager(this);
- configLocaters.add(implicitRuntimeConfigLocater);
- //default ("/WEB-INF/faces-config.xml") locater
- IJSFAppConfigLocater defaultConfigLocater = new DefaultJSFAppConfigLocater();
- defaultConfigLocater.setJSFAppConfigManager(this);
- configLocaters.add(defaultConfigLocater);
- //web.xml context-parameter specified locater
- IJSFAppConfigLocater contextParamConfigLocater = new ContextParamSpecifiedJSFAppConfigLocater();
- contextParamConfigLocater.setJSFAppConfigManager(this);
- configLocaters.add(contextParamConfigLocater);
- //runtime classpath locater
- IJSFAppConfigLocater classpathConfigLocater = new RuntimeClasspathJSFAppConfigLocater();
- classpathConfigLocater.setJSFAppConfigManager(this);
- configLocaters.add(classpathConfigLocater);
- }
-
- /**
- * Instructs set of {@link IJSFAppConfigLocater} instances to start
- * locating JSF application configuration resources.
- */
- protected void startConfigLocaters() {
- Iterator itConfigLocaters = configLocaters.iterator();
- while (itConfigLocaters.hasNext()) {
- IJSFAppConfigLocater configLocater = (IJSFAppConfigLocater)itConfigLocaters.next();
- configLocater.startLocating();
- }
- }
-
- /**
- * Instructs set of {@link IJSFAppConfigLocater} instances to stop
- * locating JSF application configuration resources.
- */
- protected void stopConfigLocaters() {
- Iterator itConfigLocaters = configLocaters.iterator();
- while (itConfigLocaters.hasNext()) {
- IJSFAppConfigLocater configLocater = (IJSFAppConfigLocater)itConfigLocaters.next();
- configLocater.stopLocating();
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent)
- */
- public void resourceChanged(IResourceChangeEvent event) {
- IResourceDelta delta = event.getDelta();
- if (delta.getKind() == IResourceDelta.CHANGED) {
- IResourceDelta[] removedDeltas = delta.getAffectedChildren(IResourceDelta.REMOVED);
- if (removedDeltas.length == 1) {
- IResourceDelta removedDelta = removedDeltas[0];
- IResource removedResource = removedDelta.getResource();
- if (removedResource != null && removedResource == project) {
- IResourceDelta[] addedDeltas = delta.getAffectedChildren(IResourceDelta.ADDED);
- if (addedDeltas.length == 1) {
- IResourceDelta addedDelta = addedDeltas[0];
- IResource addedResource = addedDelta.getResource();
- if (addedResource instanceof IProject) {
- changeProject((IProject)addedResource);
- }
- }
- }
- }
- }
- }
-
- /**
- * Called to respond to a change in the IProject instance to which this
- * instance belongs. Changes the cached IProject instance, stops all config
- * locaters, starts all config locaters.
- *
- * @param newProject New IProject instance to which this manager belongs.
- */
- protected void changeProject(IProject newProject) {
- this.project = newProject;
- stopConfigLocaters();
- startConfigLocaters();
- }
-
- /**
- * Adds an instance of {@link IJSFAppConfigProvidersChangeListener}.
- *
- * @param listener An instance of {@link IJSFAppConfigProvidersChangeListener}.
- * @return true if added, else false.
- */
- public boolean addJSFAppConfigProvidersChangeListener(IJSFAppConfigProvidersChangeListener listener) {
- return configProvidersChangeListeners.add(listener);
- }
-
- /**
- * Removes an instance of {@link IJSFAppConfigProvidersChangeListener}.
- *
- * @param listener an instance of {@link IJSFAppConfigProvidersChangeListener}.
- * @return true if removed, else false.
- */
- public boolean removeJSFAppConfigProvidersChangeListener(IJSFAppConfigProvidersChangeListener listener) {
- return configProvidersChangeListeners.remove(listener);
- }
-
- /**
- * Notifies all {@link IJSFAppConfigProvidersChangeListener} instances of
- * a change in the Set of {@link IJSFAppConfigProvider} instances.
- *
- * @param configProvider {@link IJSFAppConfigProvider} instance that has
- * changed.
- * @param eventType Event type.
- */
- public void notifyJSFAppConfigProvidersChangeListeners(IJSFAppConfigProvider configProvider, int eventType) {
- JSFAppConfigProvidersChangeEvent event = new JSFAppConfigProvidersChangeEvent(configProvider, eventType);
- Iterator itListeners = configProvidersChangeListeners.iterator();
- while (itListeners.hasNext()) {
- IJSFAppConfigProvidersChangeListener listener =
- (IJSFAppConfigProvidersChangeListener)itListeners.next();
- listener.changedJSFAppConfigProviders(event);
- }
- }
-
- /**
- * Adds an instance of {@link IFacesConfigChangeListener}. <br>
- * <br>
- * <b>NOTE:</b> Calling this method will cause all application
- * configuration models to be loaded, to ensure that a
- * {@link FacesConfigChangeAdapter} has been added to each model.
- *
- * @param emfClass EMF class in which the listener is interested.
- * @param listener {@link IFacesConfigChangeListener} instance.
- * @return Previous {@link IFacesConfigChangeListener}, or null.
- */
- public Object addFacesConfigChangeListener(Class emfClass, IFacesConfigChangeListener listener) {
- /*
- * Get all models, which will ensure that each one has had a
- * FacesConfigChangeAdapter added to it.
- */
- getFacesConfigModels();
- return facesConfigChangeListeners.put(emfClass, listener);
- }
-
- /**
- * Removes an instance of {@link IFacesConfigChangeListener}.
- *
- * @param emfClass EMF class in which the listener was interested.
- * @return Removed {@link IFacesConfigChangeListener}, or null.
- */
- public Object removeFacesConfigChangeListener(Class emfClass) {
- return facesConfigChangeListeners.remove(emfClass);
- }
-
- /**
- * Notifies {@link IFacesConfigChangeListener} instances of model changes
- * in which they registered interest.
- *
- * @param notification EMF {@link Notification} instance that describes the
- * model change.
- */
- public void notifyFacesConfigChangeListeners(Notification notification) {
- Object emfFeature = notification.getFeature();
- if (emfFeature instanceof EStructuralFeature) {
- Class emfClass = ((EStructuralFeature)emfFeature).getEType().getInstanceClass();
- IFacesConfigChangeListener listener = (IFacesConfigChangeListener)facesConfigChangeListeners.get(emfClass);
- if (listener != null) {
- listener.notifyChanged(notification);
- }
- }
- }
-
- /**
- * Gets all {@link IJSFAppConfigProvider} instances from all
- * {@link IJSFAppConfigLocater} instances.
- *
- * @return Set of all {@link IJSFAppConfigProvider} instances.
- */
- public Set getJSFAppConfigProviders() {
- Set allConfigProviders = new LinkedHashSet();
- Iterator itConfigLocaters = configLocaters.iterator();
- while (itConfigLocaters.hasNext()) {
- IJSFAppConfigLocater configLocater = (IJSFAppConfigLocater)itConfigLocaters.next();
- allConfigProviders.addAll(configLocater.getJSFAppConfigProviders());
- }
- return allConfigProviders;
- }
-
- /**
- * Gets all {@link FacesConfigType} instances from all
- * {@link IJSFAppConfigProvider} instances.
- *
- * @return List of all {@link FacesConfigType} instances.
- */
- public List getFacesConfigModels() {
- List facesConfigModels = new ArrayList();
- Iterator itConfigProviders = getJSFAppConfigProviders().iterator();
- while (itConfigProviders.hasNext()) {
- IJSFAppConfigProvider configProvider = (IJSFAppConfigProvider)itConfigProviders.next();
- FacesConfigType facesConfig = configProvider.getFacesConfigModel();
- if (facesConfig != null) {
- facesConfigModels.add(facesConfig);
- }
- }
- return facesConfigModels;
- }
-
- /*
- * (non-Javadoc)
- * @see java.lang.Object#finalize()
- */
- protected void finalize() {
- //remove resource change listener
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- workspace.removeResourceChangeListener(this);
- //remove session property from project
- unsetAsSessionProperty();
- //instruct locaters to stop locating
- stopConfigLocaters();
- //clear collections
- configLocaters.clear();
- configProvidersChangeListeners.clear();
- facesConfigChangeListeners.clear();
- }
-
- /**
- * Gets list of all ManagedBeanType instances from all known faces-config
- * models; list may be empty.
- *
- * @return List of all ManagedBeanType instances from all known
- * faces-config models (list may be empty).
- */
- public List getManagedBeans() {
- List allManagedBeans = new ArrayList();
- List facesConfigs = getFacesConfigModels();
- Iterator itFacesConfigs = facesConfigs.iterator();
- while (itFacesConfigs.hasNext()) {
- FacesConfigType facesConfig = (FacesConfigType)itFacesConfigs.next();
- EList managedBeans = facesConfig.getManagedBean();
- allManagedBeans.addAll(managedBeans);
- }
- return allManagedBeans;
- }
-
- /**
- * @return List of all variable resolver class names registered.
- */
- public final List<String> getPropertyResolvers()
- {
- final List<String> allPropertyResolvers = new ArrayList<String>();
- final List applications = getApplications();
- final Iterator appIterator = applications.iterator();
- while (appIterator.hasNext())
- {
- final ApplicationType application = (ApplicationType) appIterator.next();
- for (final Iterator it = application.getPropertyResolver().iterator(); it.hasNext();)
- {
- final PropertyResolverType propRes = (PropertyResolverType) it.next();
- String propClass = propRes.getTextContent();
- if (propClass != null)
- {
- propClass = propClass.trim();
- if (!"".equals(propClass))
- {
- allPropertyResolvers.add(propClass);
- }
- }
- }
- }
- return allPropertyResolvers;
- }
-
- /**
- * Gets list of all ValidatorType instances from all known faces-config
- * models; list may be empty.
- *
- * @return List of all ValidatorType instances from all known faces-config
- * models (list may be empty).
- */
- public List getValidators() {
- List allValidators = new ArrayList();
- List facesConfigs = getFacesConfigModels();
- Iterator itFacesConfigs = facesConfigs.iterator();
- while (itFacesConfigs.hasNext()) {
- FacesConfigType facesConfig = (FacesConfigType)itFacesConfigs.next();
- EList validators = facesConfig.getValidator();
- allValidators.addAll(validators);
- }
- return allValidators;
- }
-
- /**
- * @return List of all variable resolver class names registered.
- */
- public final List<String> getVariableResolvers()
- {
- final List<String> allVariableResolvers = new ArrayList<String>();
- final List applications = getApplications();
- final Iterator appIterator = applications.iterator();
- while (appIterator.hasNext())
- {
- final ApplicationType application = (ApplicationType) appIterator.next();
- for (final Iterator it = application.getVariableResolver().iterator(); it.hasNext();)
- {
- final VariableResolverType varRes = (VariableResolverType) it.next();
- String varClass = varRes.getTextContent();
- if (varClass != null)
- {
- varClass = varClass.trim();
- if (!"".equals(varClass))
- {
- allVariableResolvers.add(varClass);
- }
- }
- }
- }
- return allVariableResolvers;
- }
-
- /**
- * Gets list of all ConverterType instances from all known faces-config
- * models; list may be empty.
- *
- * @return List of all ConverterType instances from all known faces-config
- * models (list may be empty).
- */
- public List getConverters() {
- List allConverters = new ArrayList();
- List facesConfigs = getFacesConfigModels();
- Iterator itFacesConfigs = facesConfigs.iterator();
- while (itFacesConfigs.hasNext()) {
- FacesConfigType facesConfig = (FacesConfigType)itFacesConfigs.next();
- EList converters = facesConfig.getConverter();
- allConverters.addAll(converters);
- }
- return allConverters;
- }
-
- /**
- * Gets list of all NavigationRuleType instances from all known
- * faces-config models; list may be empty.
- *
- * @return List of all NavigationRuleType instances from all known
- * faces-config models (list may be empty).
- */
- public List getNavigationRules() {
- List allNavigationRules = new ArrayList();
- List facesConfigs = getFacesConfigModels();
- Iterator itFacesConfigs = facesConfigs.iterator();
- while (itFacesConfigs.hasNext()) {
- FacesConfigType facesConfig = (FacesConfigType)itFacesConfigs.next();
- EList navigationRules = facesConfig.getNavigationRule();
- allNavigationRules.addAll(navigationRules);
- }
- return allNavigationRules;
- }
-
- /**
- * Gets list of all NavigationRuleType instances from all known
- * faces-config models where the navigation-rule's from-view-id value
- * matches the web content folder-relative value of the passed IFile
- * instance; list may be empty. Matching is performed in the same manner
- * as for a JSF implementation's default NavigationHandler.
- *
- * @param pageFile IFile instance to match against the from-view-id value
- * of all NavigationRuleType instances. File is assumed to be relative to
- * the web content folder, but may be expressed in a more complete form;
- * its path will be calculated relative to the web content folder.
- * @return List of all NavigationRuleType instances from all known
- * faces-config models where the navigation-rule's from-view-id value
- * matches the web content folder-relative value of the passed IFile
- * instance (list may be empty).
- */
- public List getNavigationRulesForPage(IFile pageFile) {
- List navigationRulesForPage = new ArrayList();
- IPath pageFilePath = JSFAppConfigUtils.getWebContentFolderRelativePath(pageFile);
- if (pageFilePath != null) {
- String pageFileString = pageFilePath.toString();
- if (!pageFileString.startsWith("/")) {
- pageFileString = "/" + pageFileString;
- }
- List navigationRules = getNavigationRules();
- Iterator itNavigationRules = navigationRules.iterator();
- while (itNavigationRules.hasNext()) {
- NavigationRuleType navigationRule = (NavigationRuleType)itNavigationRules.next();
- FromViewIdType fromViewIdType = navigationRule.getFromViewId();
- if (fromViewIdType != null) {
- String fromViewId = fromViewIdType.getTextContent();
- if (fromViewId != null && fromViewId.length() > 0) {
- if (!fromViewId.equals("*")) { //$NON-NLS-1$
- if (fromViewId.equals(pageFileString)) {
- //exact match
- navigationRulesForPage.add(navigationRule);
- } else if (fromViewId.endsWith("*")) { //$NON-NLS-1$
- String prefixFromViewId = fromViewId.substring(0, fromViewId.length() - 1);
- if (pageFileString.startsWith(prefixFromViewId)) {
- //prefix match
- navigationRulesForPage.add(navigationRule);
- }
- }
- } else {
- //from-view-id == "*" - matches all pages
- navigationRulesForPage.add(navigationRule);
- }
- }
- } else {
- //no from-view-id element - matches all pages
- navigationRulesForPage.add(navigationRule);
- }
- }
- }
- return navigationRulesForPage;
- }
-
- /**
- * Gets list of all ApplicationType instances from all known
- * faces-config models; list may be empty.
- *
- * @return List of all ApplicationType instances from all known
- * faces-config models (list may be empty).
- */
- public List getApplications() {
- List allApplications = new ArrayList();
- List facesConfigs = getFacesConfigModels();
- Iterator itFacesConfigs = facesConfigs.iterator();
- while (itFacesConfigs.hasNext()) {
- FacesConfigType facesConfig = (FacesConfigType)itFacesConfigs.next();
- EList applications = facesConfig.getApplication();
- allApplications.addAll(applications);
- }
- return allApplications;
- }
-
- /**
- * Gets list of all FactoryType instances from all known faces-config
- * models; list may be empty.
- *
- * @return List of all FactoryType instances from all known faces-config
- * models (list may be empty).
- */
- public List getFactories() {
- List allFactories = new ArrayList();
- List facesConfigs = getFacesConfigModels();
- Iterator itFacesConfigs = facesConfigs.iterator();
- while (itFacesConfigs.hasNext()) {
- FacesConfigType facesConfig = (FacesConfigType)itFacesConfigs.next();
- EList factories = facesConfig.getFactory();
- allFactories.addAll(factories);
- }
- return allFactories;
- }
-
- /**
- * Gets list of all ComponentType instances from all known faces-config
- * models; list may be empty.
- *
- * @return List of all ComponentType instances from all known faces-config
- * models (list may be empty).
- */
- public List getComponents() {
- List allComponents = new ArrayList();
- List facesConfigs = getFacesConfigModels();
- Iterator itFacesConfigs = facesConfigs.iterator();
- while (itFacesConfigs.hasNext()) {
- FacesConfigType facesConfig = (FacesConfigType)itFacesConfigs.next();
- EList components = facesConfig.getComponent();
- allComponents.addAll(components);
- }
- return allComponents;
- }
-
- /**
- * Gets list of all ReferencedBeanType instances from all known
- * faces-config models; list may be empty.
- *
- * @return List of all ReferencedBeanType instances from all known
- * faces-config models (list may be empty).
- */
- public List getReferencedBeans() {
- List allReferencedBeans = new ArrayList();
- List facesConfigs = getFacesConfigModels();
- Iterator itFacesConfigs = facesConfigs.iterator();
- while (itFacesConfigs.hasNext()) {
- FacesConfigType facesConfig = (FacesConfigType)itFacesConfigs.next();
- EList referencedBeans = facesConfig.getReferencedBean();
- allReferencedBeans.addAll(referencedBeans);
- }
- return allReferencedBeans;
- }
-
- /**
- * Gets list of all RenderKitType instances from all known faces-config
- * models; list may be empty.
- *
- * @return List of all RenderKitType instances from all known faces-config
- * models (list may be empty).
- */
- public List getRenderKits() {
- List allRenderKits = new ArrayList();
- List facesConfigs = getFacesConfigModels();
- Iterator itFacesConfigs = facesConfigs.iterator();
- while (itFacesConfigs.hasNext()) {
- FacesConfigType facesConfig = (FacesConfigType)itFacesConfigs.next();
- EList renderKits = facesConfig.getRenderKit();
- allRenderKits.addAll(renderKits);
- }
- return allRenderKits;
- }
-
- /**
- * Gets list of all LifecycleType instances from all known faces-config
- * models; list may be empty.
- *
- * @return List of all LifecycleType instances from all known faces-config
- * models (list may be empty).
- */
- public List getLifecycles() {
- List allLifecycles = new ArrayList();
- List facesConfigs = getFacesConfigModels();
- Iterator itFacesConfigs = facesConfigs.iterator();
- while (itFacesConfigs.hasNext()) {
- FacesConfigType facesConfig = (FacesConfigType)itFacesConfigs.next();
- EList lifecycles = facesConfig.getLifecycle();
- allLifecycles.addAll(lifecycles);
- }
- return allLifecycles;
- }
-
- /**
- * @return the list of all resource bundles declared in all the FacesConfig
- * configurations found.
- */
- public List getResourceBundles()
- {
- List allResourceBundles = new ArrayList();
- List facesConfigs = getFacesConfigModels();
- Iterator itFacesConfigs = facesConfigs.iterator();
- while (itFacesConfigs.hasNext()) {
- FacesConfigType facesConfig = (FacesConfigType)itFacesConfigs.next();
- for (final Iterator applicationIt = facesConfig.getApplication().iterator(); applicationIt.hasNext();)
- {
- ApplicationType appType = (ApplicationType) applicationIt.next();
- allResourceBundles.addAll(appType.getResourceBundle());
- }
- }
- return allResourceBundles;
- }
-
- /**
- * Adds this instance's {@link FacesConfigChangeAdapter} instance to the
- * passed application configuration model's adapters collection.
- *
- * @param facesConfig Application configuration model's root object.
- */
- public void addFacesConfigChangeAdapter(FacesConfigType facesConfig) {
- if (facesConfig != null) {
- if (facesConfigChangeAdapter == null) {
- facesConfigChangeAdapter = new FacesConfigChangeAdapter();
- }
- facesConfig.eAdapters().add(facesConfigChangeAdapter);
- }
- }
-
- /**
- * Removes this instance's {@link FacesConfigChangeAdapter} instance from
- * the passed application configuration model's adapters collection.
- *
- * @param facesConfig Application configuration model's root object.
- */
- public void removeFacesConfigChangeAdapter(FacesConfigType facesConfig) {
- if (facesConfig != null && facesConfigChangeAdapter != null) {
- facesConfig.eAdapters().remove(facesConfigChangeAdapter);
- }
- }
-
- /**
- * FacesConfigChangeAdapter is an EMF adapter which provides a mechanism
- * for notification of changes to features in any application configuration
- * model for which {@link IFacesConfigChangeListener} instances have
- * registered an interest.
- *
- * @author Ian Trimble - Oracle
- */
- class FacesConfigChangeAdapter extends EContentAdapter {
- /*
- * (non-Javadoc)
- * @see org.eclipse.emf.ecore.util.EContentAdapter#notifyChanged(org.eclipse.emf.common.notify.Notification)
- */
- public void notifyChanged(Notification notification) {
- super.notifyChanged(notification);
- notifyFacesConfigChangeListeners(notification);
- }
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/JSFAppConfigProvidersChangeEvent.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/JSFAppConfigProvidersChangeEvent.java
deleted file mode 100644
index a946e4c..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/JSFAppConfigProvidersChangeEvent.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.jsfappconfig;
-
-/**
- * JSFAppConfigProvidersChangeEvent provides change information to instances of
- * IJSFAppConfigProvidersChangeListener.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author Ian Trimble - Oracle
- */
-public class JSFAppConfigProvidersChangeEvent {
-
- /**
- * Event type; instance of IJSFAppConfigProvider was added (value == 1).
- */
- public static final int ADDED = 1;
-
- /**
- * Event type; instance of IJSFAppConfigProvider was removed (value == 2).
- */
- public static final int REMOVED = 2;
-
- /**
- * Instance of IJSFAppConfigProvider that was added or removed.
- */
- protected IJSFAppConfigProvider configProvider = null;
-
- /**
- * Event type.
- */
- protected int eventType;
-
- /**
- * Constructs an instance.
- *
- * @param configProvider Instance of IJSFAppConfigProvider that was added
- * or removed
- * @param eventType Event type
- */
- public JSFAppConfigProvidersChangeEvent(IJSFAppConfigProvider configProvider, int eventType) {
- this.configProvider = configProvider;
- this.eventType = eventType;
- }
-
- /**
- * Gets the instance of IJSFAppConfigProvider that was added or removed.
- *
- * @return Instance of IJSFAppConfigProvider that was added or removed
- */
- public IJSFAppConfigProvider getJSFAppConfigProvider() {
- return configProvider;
- }
-
- /**
- * Gets the event type.
- *
- * @return Event type
- */
- public int getEventType() {
- return eventType;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/JSFAppConfigUtils.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/JSFAppConfigUtils.java
deleted file mode 100644
index c74b44e..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/JSFAppConfigUtils.java
+++ /dev/null
@@ -1,372 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.jsfappconfig;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-import java.util.StringTokenizer;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jst.j2ee.common.ParamValue;
-import org.eclipse.jst.j2ee.internal.J2EEVersionConstants;
-import org.eclipse.jst.j2ee.model.IModelProvider;
-import org.eclipse.jst.j2ee.model.ModelProviderManager;
-import org.eclipse.jst.j2ee.web.componentcore.util.WebArtifactEdit;
-import org.eclipse.jst.j2ee.webapplication.ContextParam;
-import org.eclipse.jst.j2ee.webapplication.WebApp;
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.core.internal.Messages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-
-/**
- * JSFAppConfigUtils provides utility methods useful in processing of a JSF
- * application configuration.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author Ian Trimble - Oracle
- */
-public class JSFAppConfigUtils {
-
- /**
- * Name of JSF CONFIG_FILES context parameter ("javax.faces.CONFIG_FILES").
- */
- public static final String CONFIG_FILES_CONTEXT_PARAM_NAME = "javax.faces.CONFIG_FILES"; //$NON-NLS-1$
-
- /**
- * Location in JAR file of application configuration resource file
- * ("META-INF/faces-config.xml").
- */
- public static final String FACES_CONFIG_IN_JAR_PATH = "META-INF/faces-config.xml"; //$NON-NLS-1$
-
-
- /**
- * @param project
- * @param minVersion
- * @return true if project is a JSF facet project and the version of the project
- * is at least minVersion.
- */
- public static boolean isValidJSFProject(IProject project, String minVersion)
- {
- boolean isValid = false;
-
- final IProjectFacetVersion projectFacetVersion = getProjectFacet(project);
-
- if (projectFacetVersion != null)
- {
- try
- {
- final String versionString =
- projectFacetVersion.getVersionString();
- final Comparator comparator =
- projectFacetVersion.getProjectFacet().getVersionComparator();
- final int compareToMin =
- comparator.compare(versionString, minVersion);
-
- if (compareToMin >=0)
- {
- return true;
- }
- }
- catch (CoreException ce)
- {
- JSFCorePlugin.log(ce, "Error checking facet version"); //$NON-NLS-1$
- }
- }
- return isValid;
- }
-
- /**
- * Tests if the passed IProject instance is a valid JSF project in the
- * following ways:
- * <ul>
- * <li>project is not null and is accessible, </li>
- * <li>project has the JSF facet set on it.</li>
- * </ul>
- *
- * @param project IProject instance to be tested.
- * @return true if the IProject instance is a valid JSF project, else
- * false.
- */
- public static boolean isValidJSFProject(IProject project) {
- boolean isValid = false;
- IProjectFacetVersion projectFacet = getProjectFacet(project);
- if (projectFacet != null)
- {
- isValid = true;
- }
- return isValid;
- }
- /**
- * Get the facet version for the project
- * @param project
- * @return the project facet version or null if could not be found or if
- * project is not accessible
- */
- public static IProjectFacetVersion getProjectFacet(IProject project)
- {
- //check for null or inaccessible project
- if (project != null && project.isAccessible()) {
- //check for JSF facet on project
- try {
- IFacetedProject facetedProject = ProjectFacetsManager.create(project);
- if (facetedProject != null) {
- Set projectFacets = facetedProject.getProjectFacets();
- Iterator itProjectFacets = projectFacets.iterator();
- while (itProjectFacets.hasNext()) {
- IProjectFacetVersion projectFacetVersion = (IProjectFacetVersion)itProjectFacets.next();
- if (IJSFCoreConstants.JSF_CORE_FACET_ID.equals(projectFacetVersion.getProjectFacet().getId()))
- {
- return projectFacetVersion;
- }
- }
- }
- } catch(CoreException ce) {
- //log error
- JSFCorePlugin.log(IStatus.ERROR, ce.getLocalizedMessage(), ce);
- }
- }
- return null;
- }
-
- /**
- * Gets an IVirtualFolder instance which represents the root context's
- * web content folder.
- *
- * @param project IProject instance for which to get the folder.
- * @return IVirtualFolder instance which represents the root context's
- * web content folder.
- */
- public static IVirtualFolder getWebContentFolder(IProject project) {
- IVirtualFolder folder = null;
- IVirtualComponent component = ComponentCore.createComponent(project);
- if (component != null) {
- folder = component.getRootFolder();
- }
- return folder;
- }
-
- /**
- * Gets an IPath instance representing the path of the passed IFile
- * instance relative to the web content folder.
- *
- * @param file IFile instance for which a path is required.
- * @return IPath instance representing the path relative to the web content
- * folder.
- */
- public static IPath getWebContentFolderRelativePath(IFile file) {
- IPath path = null;
- if (file != null) {
- IVirtualFolder webContentFolder = getWebContentFolder(file.getProject());
- if (webContentFolder != null) {
- IPath webContentPath = webContentFolder.getProjectRelativePath();
- IPath filePath = file.getProjectRelativePath();
- int matchingFirstSegments = webContentPath.matchingFirstSegments(filePath);
- path = filePath.removeFirstSegments(matchingFirstSegments);
- }
- }
- return path;
- }
-
- /**
- * Gets list of application configuration file names as listed in the JSF
- * CONFIG_FILES context parameter ("javax.faces.CONFIG_FILES"). Will return
- * an empty list if WebArtifactEdit is null, if WebApp is null, if context
- * parameter does not exist, or if trimmed context parameter's value is
- * an empty String.
- *
- * @param project IProject instance for which to get the context
- * parameter's value.
- * @return List of application configuration file names as listed in the
- * JSF CONFIG_FILES context parameter ("javax.faces.CONFIG_FILES"); list
- * may be empty.
- */
- public static List getConfigFilesFromContextParam(IProject project) {
- List filesList = Collections.EMPTY_LIST;
- if (isValidJSFProject(project)) {
- IModelProvider provider = ModelProviderManager.getModelProvider(project);
- Object webAppObj = provider.getModelObject();
- if (webAppObj != null){
- if (webAppObj instanceof WebApp)
- filesList = getConfigFilesForJ2EEApp(project);
- else if (webAppObj instanceof org.eclipse.jst.javaee.web.WebApp)
- filesList = getConfigFilesForJEEApp((org.eclipse.jst.javaee.web.WebApp)webAppObj);
- }
-
- }
- return filesList;
- }
-
- private static List getConfigFilesForJEEApp(org.eclipse.jst.javaee.web.WebApp webApp) {
- String filesString = null;
- List contextParams = webApp.getContextParams();
- Iterator itContextParams = contextParams.iterator();
- while (itContextParams.hasNext()) {
- org.eclipse.jst.javaee.core.ParamValue paramValue = (org.eclipse.jst.javaee.core.ParamValue)itContextParams.next();
- if (paramValue.getParamName().equals(CONFIG_FILES_CONTEXT_PARAM_NAME)) {
- filesString = paramValue.getParamValue();
- break;
- }
- }
- return parseFilesString(filesString);
- }
-
- private static List getConfigFilesForJ2EEApp(IProject project){
- List filesList = new ArrayList();
- WebArtifactEdit webArtifactEdit = WebArtifactEdit.getWebArtifactEditForRead(project);
- if (webArtifactEdit != null) {
- try {
- WebApp webApp = null;
- try {
- webApp = webArtifactEdit.getWebApp();
- } catch(ClassCastException cce) {
- //occasionally thrown from WTP code in RC3 and possibly later
- JSFCorePlugin.log(IStatus.ERROR, cce.getLocalizedMessage(), cce);
- return filesList;
- }
- if (webApp != null) {
- String filesString = null;
- //need to branch here due to model version differences (BugZilla #119442)
- if (webApp.getVersionID() == J2EEVersionConstants.WEB_2_3_ID) {
- EList contexts = webApp.getContexts();
- Iterator itContexts = contexts.iterator();
- while (itContexts.hasNext()) {
- ContextParam contextParam = (ContextParam)itContexts.next();
- if (contextParam.getParamName().equals(CONFIG_FILES_CONTEXT_PARAM_NAME)) {
- filesString = contextParam.getParamValue();
- break;
- }
- }
- } else {
- EList contextParams = webApp.getContextParams();
- Iterator itContextParams = contextParams.iterator();
- while (itContextParams.hasNext()) {
- ParamValue paramValue = (ParamValue)itContextParams.next();
- if (paramValue.getName().equals(CONFIG_FILES_CONTEXT_PARAM_NAME)) {
- filesString = paramValue.getValue();
- break;
- }
- }
- }
- filesList = parseFilesString(filesString);
- }
- } finally {
- webArtifactEdit.dispose();
- }
- }
-
- return filesList;
- }
-
- private static List parseFilesString(String filesString) {
- List filesList = new ArrayList();
- if (filesString != null && filesString.trim().length() > 0) {
- StringTokenizer stFilesString = new StringTokenizer(filesString, ","); //$NON-NLS-1$
- while (stFilesString.hasMoreTokens()) {
- String configFile = stFilesString.nextToken().trim();
- filesList.add(configFile);
- }
- }
- return filesList;
- }
-
- /**
- * Gets list of JAR file names, where each file name represents a JAR on
- * the classpath that contains a /META-INF/faces-config.xml entry. Will
- * return an empty list if no such JAR files are located.
- *
- * @param project IProject instance for which to scan the classpath.
- * @return List of JAR file names, where each file name represents a JAR
- * on the classpath that contains a ...META-INF/faces-config.xml entry;
- * list may be empty.
- * @throws CoreException Thrown when underlying calls into JavaCore fail.
- * @throws IOException Thrown when attempt to open JAR to determine if it
- * contains a /META-INF/faces-config.xml entry fails.
- */
- public static List getConfigFileJARsFromClasspath(IProject project) throws CoreException, IOException {
- ArrayList JARsList = new ArrayList();
- if (project.isAccessible()
- && project.hasNature(JavaCore.NATURE_ID)) {
- IJavaProject javaProject = JavaCore.create(project);
- if (javaProject != null) {
- IClasspathEntry[] classpathEntries = javaProject.getResolvedClasspath(true);
- if (classpathEntries != null && classpathEntries.length > 0) {
- IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
- for (int i = 0; i < classpathEntries.length; i++) {
- IClasspathEntry classpathEntry = classpathEntries[i];
- if (classpathEntry.getEntryKind() == IClasspathEntry.CPE_LIBRARY) {
- IPath libraryPath = classpathEntry.getPath();
- if (libraryPath.getFileExtension() != null && libraryPath.getFileExtension().length() > 0) {
- if (libraryPath.getDevice() == null && workspaceRoot.getProject(libraryPath.segment(0)).exists()) {
- libraryPath = workspaceRoot.getFile(libraryPath).getLocation();
- }
- String libraryPathString = libraryPath.toString();
- JarFile jarFile = null;
- try {
- //check existence first [222249]
- File file = new File(libraryPathString);
- if (file.exists()) {
- jarFile = new JarFile(file, false);
- if (jarFile != null) {
- JarEntry jarEntry = jarFile.getJarEntry(FACES_CONFIG_IN_JAR_PATH);
- if (jarEntry != null) {
- JARsList.add(libraryPathString);
- }
- }
- }
- } catch (FileNotFoundException fnfex) {
- //should not get here, but eat error since this could only occur in under strange circumstances [222249]
- } catch(IOException ioe) {
- JSFCorePlugin.log(
- IStatus.ERROR,
- NLS.bind(Messages.JSFAppConfigUtils_ErrorOpeningJarFile, libraryPathString),
- ioe);
- } finally {
- if (jarFile != null) {
- jarFile.close();
- }
- }
- }
- }
- }
- }
- }
- }
- return JARsList;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/RuntimeClasspathJSFAppConfigLocater.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/RuntimeClasspathJSFAppConfigLocater.java
deleted file mode 100644
index 7cb04b0..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/RuntimeClasspathJSFAppConfigLocater.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.jsfappconfig;
-
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jdt.core.IElementChangedListener;
-import org.eclipse.jdt.core.IJavaElementDelta;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-
-/**
- * RuntimeClasspathJSFAppConfigLocater attempts to locate application
- * configuration files in JAR files on the runtime classpath. The runtime
- * classpath includes the server runtime classpath and the JAR files that will
- * be deployed to the web application's /WEB-INF/lib folder.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author Ian Trimble - Oracle
- */
-public class RuntimeClasspathJSFAppConfigLocater extends AbstractJSFAppConfigLocater
- implements IElementChangedListener {
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.jsf.core.jsfappconfig.AbstractJSFAppConfigLocater#startLocating()
- */
- public void startLocating() {
- locateProviders();
- JavaCore.addElementChangedListener(this);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.jsf.core.jsfappconfig.AbstractJSFAppConfigLocater#stopLocating()
- */
- public void stopLocating() {
- JavaCore.removeElementChangedListener(this);
- }
-
- /**
- * Locates application configuration resources specified in JAR files on
- * the runtime classpath, and updates the set of
- * {@link IJSFAppConfigProvider} instances accordingly.
- */
- public void locateProviders() {
- try {
- List JARs = JSFAppConfigUtils.getConfigFileJARsFromClasspath(manager.getProject());
- Iterator itJARs = JARs.iterator();
- Set newConfigProviders = new LinkedHashSet();
- while (itJARs.hasNext()) {
- String JARFilename = (String)itJARs.next();
- JARFileJSFAppConfigProvider configProvider = new JARFileJSFAppConfigProvider(JARFilename);
- newConfigProviders.add(configProvider);
- }
- updateConfigProviders(newConfigProviders);
- } catch(CoreException ce) {
- //log error
- JSFCorePlugin.log(IStatus.ERROR, ce.getLocalizedMessage(), ce);
- } catch(IOException ioe) {
- //log error
- JSFCorePlugin.log(IStatus.ERROR, ioe.getLocalizedMessage(), ioe);
- }
- }
-
- /**
- * Called when a Java element has changed.
- *
- * @param event ElementChangedEvent instance describing the change.
- */
- public void elementChanged(ElementChangedEvent event) {
- if (classpathChanged(event.getDelta())) {
- locateProviders();
- }
- }
-
- /**
- * Recursively tests if the passed IJavaElementDelta instance or any of its
- * descendents indicate a classpath change has occurred.
- *
- * @param delta IJavaElement instance to be tested.
- * @return true if a claspath change has occurred, else false.
- */
- protected boolean classpathChanged(IJavaElementDelta delta) {
- int deltaFlags = delta.getFlags();
- if (((deltaFlags & IJavaElementDelta.F_ADDED_TO_CLASSPATH) == IJavaElementDelta.F_ADDED_TO_CLASSPATH) ||
- ((deltaFlags & IJavaElementDelta.F_ARCHIVE_CONTENT_CHANGED) == IJavaElementDelta.F_ARCHIVE_CONTENT_CHANGED) ||
- ((deltaFlags & IJavaElementDelta.F_REMOVED_FROM_CLASSPATH) == IJavaElementDelta.F_REMOVED_FROM_CLASSPATH)) {
- return true;
- }
- boolean changed = false;
- IJavaElementDelta[] childDeltas = delta.getAffectedChildren();
- if (childDeltas != null) {
- for (int i = 0; i < childDeltas.length; i++) {
- if (classpathChanged(childDeltas[i])) {
- changed = true;
- break;
- }
- }
- }
- return changed;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/WebContentRelativeJSFAppConfigLocater.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/WebContentRelativeJSFAppConfigLocater.java
deleted file mode 100644
index 4359d21..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/WebContentRelativeJSFAppConfigLocater.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.jsfappconfig;
-
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
-import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
-
-/**
- * WebContentRelativeJSFAppConfigLocater is an abstract base class that
- * attempts to locate specified application configuration files relative to a
- * web content folder. Subclasses must override the getFilenames() method to
- * return a list of filenames that the locateProviders() method will attempt to
- * locate, and call locateProviders().
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author Ian Trimble - Oracle
- */
-public abstract class WebContentRelativeJSFAppConfigLocater extends AbstractJSFAppConfigLocater {
-
- /**
- * Locates application configuration resources specified by the filenames
- * (relative to the web content folder) returned by getFilenames(), and
- * updates the set of {@link IJSFAppConfigProvider} instances accordingly.
- */
- public void locateProviders() {
- IProject project = manager.getProject();
- IVirtualFolder webContentFolder = JSFAppConfigUtils.getWebContentFolder(project);
- if (webContentFolder != null) {
- List filenames = getFilenames();
- Iterator itFilenames = filenames.iterator();
- Set newConfigProviders = new LinkedHashSet();
- while (itFilenames.hasNext()) {
- String filename = (String)itFilenames.next();
- IVirtualResource appConfigResource = webContentFolder.findMember(filename);
- if (appConfigResource != null && appConfigResource.getType() == IVirtualResource.FILE) {
- IFile file = (IFile)appConfigResource.getUnderlyingResource();
- if (file != null && file.exists()) {
- ArtifactEditJSFAppConfigProvider configProvider = new ArtifactEditJSFAppConfigProvider(file);
- newConfigProviders.add(configProvider);
- }
- }
- }
- updateConfigProviders(newConfigProviders);
- }
- }
-
- /**
- * Gets a list of Strings representing the filenames (relative to the web
- * content folder) that locateProviders() will attempt to locate.
- *
- * @return A list of Strings representing the filenames (relative to the
- * web content folder) that locateProviders() will attempt to locate.
- */
- protected abstract List getFilenames();
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/package-info.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/package-info.java
deleted file mode 100644
index f1a3d13..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsfappconfig/package-info.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-/**
- * Project-level support for JSF application configuration files.
- *
- * <p><b>Provisional API - subject to change</b></p>
- */
-package org.eclipse.jst.jsf.core.jsfappconfig;
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryconfiguration/JSFLibraryConfigurationHelper.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryconfiguration/JSFLibraryConfigurationHelper.java
deleted file mode 100644
index dc851a9..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryconfiguration/JSFLibraryConfigurationHelper.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.jsflibraryconfiguration;
-
-import java.util.Collection;
-import java.util.HashSet;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.core.jsflibraryconfiguration.internal.JSFLibraryReferenceFacadeFactory;
-
-/**
- * Helper class for adopters needing to deal with JSF Library References
- *
- * <p><b>Provisional API - subject to change</b></p>
- * @since WTP JSF 1.0
- */
-public final class JSFLibraryConfigurationHelper {
- /**
- * container id for JSF Library Classpath Containers
- */
- public static final String JSF_LIBRARY_CP_CONTAINER_ID="org.eclipse.jst.jsf.core.internal.jsflibrarycontainer";
-
- /**
- * @param project
- * @return collection of references
- */
- public static Collection<JSFLibraryReference> getJSFLibraryReferences(IProject project) {
- Collection<JSFLibraryReference> results = new HashSet<JSFLibraryReference>();
- IJavaProject jproj = JavaCore.create(project);
- try {
- IClasspathEntry[] entries = jproj.getRawClasspath();
- boolean foundImpl = false;
- for (int i=0;i<entries.length;i++){
- JSFLibraryReference ref = JSFLibraryReferenceFacadeFactory.create(entries[i]);
- if (ref != null){
- results.add(ref);
- if (ref.isJSFImplementation())
- foundImpl = true;
- }
- }
- if (! foundImpl){
- results.add(JSFLibraryReferenceFacadeFactory.createServerSuppliedJSFLibRef());
- }
- } catch (JavaModelException e) {
- JSFCorePlugin.log(e, "Exception occurred calling getJSFLibraryReferences for "+project.getName());
- }
- return results;
- }
-
- /**
- * @param cpEntry
- * @return boolean indicating that the classpath entry is a JSF Libary Classpath Container
- */
- public static boolean isJSFLibraryContainer(IClasspathEntry cpEntry) {
- if (cpEntry.getEntryKind() != IClasspathEntry.CPE_CONTAINER)
- return false;
-
- IPath path = cpEntry.getPath();
- return path != null && path.segmentCount() == 2 && JSF_LIBRARY_CP_CONTAINER_ID.equals(path.segment(0));
- }
-
- /**
- * @param project
- * @return true if the JSF Faceted project is configured to use system supplied implementation
- */
- public static boolean isConfiguredForSystemSuppliedImplementation(IProject project) {
- Collection<JSFLibraryReference> refs = getJSFLibraryReferences(project);
- for(JSFLibraryReference ref : refs){
- if (ref instanceof JSFLibraryReferenceServerSupplied)
- return true;
- }
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryconfiguration/JSFLibraryReference.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryconfiguration/JSFLibraryReference.java
deleted file mode 100644
index 9c77f03..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryconfiguration/JSFLibraryReference.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.jsflibraryconfiguration;
-
-import java.util.Collection;
-
-import org.eclipse.jdt.core.IClasspathEntry;
-
-/**
- * Represents a reference to a JSF Library on a project
- *
- * <p><b>Provisional API - subject to change</b></p>
- */
-public abstract interface JSFLibraryReference {
- /**
- * @return id for the library
- */
- public String getId();
- /**
- * @return name
- */
- public String getName();
- /**
- * @return collection of jars as {@link IClasspathEntry}s
- */
- public Collection<IClasspathEntry> getJars();
- /**
- * @return {@link JSFVersion} value
- */
- public JSFVersion getMaxSupportedVersion();
- /**
- * @return label user sees for this library
- */
- public String getLabel();
- /**
- * @return flag
- */
- public boolean isJSFImplementation();
- /**
- * @return is deployed (marked as J2EE Module Dependency)
- */
- public boolean isDeployed();
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryconfiguration/JSFLibraryReferencePluginProvided.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryconfiguration/JSFLibraryReferencePluginProvided.java
deleted file mode 100644
index c12f3c2..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryconfiguration/JSFLibraryReferencePluginProvided.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.jsflibraryconfiguration;
-
-/**
- * A reference to a plugin-defined JSF Library
- *
- * <p><b>Provisional API - subject to change</b></p>
- */
-@SuppressWarnings("deprecation")
-public interface JSFLibraryReferencePluginProvided extends JSFLibraryReferenceUserSpecified, JSFLibraryReferenceUserDefined {
- /**
- * @return plugin id. May return null if plugin id cannot be determined.
- */
- public String getPluginId();
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryconfiguration/JSFLibraryReferenceServerSupplied.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryconfiguration/JSFLibraryReferenceServerSupplied.java
deleted file mode 100644
index b03ece3..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryconfiguration/JSFLibraryReferenceServerSupplied.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.jsflibraryconfiguration;
-
-/**
- * A reference to a JSF Library where the implementation library is presumed to be coming from the
- * server
- *
- * <p><b>Provisional API - subject to change</b></p>
- */
-public interface JSFLibraryReferenceServerSupplied extends
- JSFLibraryReference {
-
- /**
- * Constant used for server supplied virtual JSF Library referencew
- */
- public static final String ID = "_ServerSupplied_";
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryconfiguration/JSFLibraryReferenceUserDefined.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryconfiguration/JSFLibraryReferenceUserDefined.java
deleted file mode 100644
index f5e69d3..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryconfiguration/JSFLibraryReferenceUserDefined.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.jsflibraryconfiguration;
-
-
-/**
- * Represents an reference to a user specified JSF Library
- * @deprecated use JSFLibraryReferenceUserSpecified
- */
-public interface JSFLibraryReferenceUserDefined extends JSFLibraryReference {
- //
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryconfiguration/JSFLibraryReferenceUserSpecified.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryconfiguration/JSFLibraryReferenceUserSpecified.java
deleted file mode 100644
index c0ba3a8..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryconfiguration/JSFLibraryReferenceUserSpecified.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.jsflibraryconfiguration;
-
-
-/**
- * Represents an reference to a user specified JSF Library
- *
- * <p><b>Provisional API - subject to change</b></p>
- */
-public interface JSFLibraryReferenceUserSpecified extends JSFLibraryReference {
- //
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryconfiguration/JSFVersion.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryconfiguration/JSFVersion.java
deleted file mode 100644
index b4e14d4..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryconfiguration/JSFVersion.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.jsflibraryconfiguration;
-
-/**
- * Enumeration of JavaServer Faces Versions
- *
- * <p><b>Provisional API - subject to change</b></p>
- */
-public enum JSFVersion {
-
- /**
- * Unknown version support
- */
- UNKNOWN,
- /**
- * Supports JSF Version 1.0
- */
- V1_0,
- /**
- * Supports JSF Version 1.1
- */
- V1_1,
- /**
- * Supports JSF Version 1.1
- */
- V1_2;
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryconfiguration/internal/AbstractJSFLibraryReferenceImpl.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryconfiguration/internal/AbstractJSFLibraryReferenceImpl.java
deleted file mode 100644
index ad6d8fe..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryconfiguration/internal/AbstractJSFLibraryReferenceImpl.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.jsflibraryconfiguration.internal;
-
-
-
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jst.jsf.core.internal.jsflibraryconfig.JSFLibraryInternalReference;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary;
-import org.eclipse.jst.jsf.core.jsflibraryconfiguration.JSFLibraryReference;
-import org.eclipse.jst.jsf.core.jsflibraryconfiguration.JSFVersion;
-/**
- * @author gekessle
- *
- */
-public abstract class AbstractJSFLibraryReferenceImpl implements JSFLibraryReference {
-
- /**
- * The {@link org.eclipse.jst.jsf.core.internal.jsflibraryconfig.JSFLibraryInternalReference} being wrapped
- */
- protected JSFLibraryInternalReference libRef;
- private String _id;
- private String _label;
- private boolean _isImplementation;
- private boolean _isDeloyed;
-
- /**
- * Constructor for "virtual" JSF Library References like "ServerSupplied"
- * @param id
- * @param label
- * @param isImplementation
- */
- public AbstractJSFLibraryReferenceImpl(String id, String label, boolean isImplementation){
- _id = id;
- _label = label;
- _isImplementation = isImplementation;
- }
-
- /**
- * Constructor non-virtual library references
- * @param libRef
- * @param isDeployed
- */
- public AbstractJSFLibraryReferenceImpl(JSFLibraryInternalReference libRef, boolean isDeployed){
- this.libRef = libRef;
- _isDeloyed = isDeployed;
- }
-
- public String getId() {
- if (libRef != null)
- return libRef.getID();
-
- return _id;
- }
-
- public String getLabel() {
- if (libRef != null)
- return libRef.getLabel();
-
- return _label;
- }
-
- public boolean isDeployed() {
- return _isDeloyed;
- }
-
- public boolean isJSFImplementation() {
- if (libRef != null)
- return libRef.isImplementation();
-
- return _isImplementation;
- }
-
- /**
- * @return the JSFLibrary underpinning the reference.
- * May be null if the library is missing or cannot be resolved from the registry.
- */
- protected JSFLibrary getLibrary(){
- return libRef.getLibrary();
- }
-
- public Collection<IClasspathEntry> getJars() {
- Set<IClasspathEntry> results = new HashSet<IClasspathEntry>();
- if (getLibrary() != null){
- List jars = getLibrary().getArchiveFiles();
- for (Iterator it= jars.iterator();it.hasNext();){
- ArchiveFile jar = (ArchiveFile)it.next();
- String path = jar.getResolvedSourceLocation();
- results.add(JavaCore.newLibraryEntry(new Path(path), null, null));
- }
- }
- return results;
- }
-
- public JSFVersion getMaxSupportedVersion() {
- if (getLibrary() != null)
- return adaptVersion(getLibrary().getJSFVersion());
- return null;
- }
-
- private JSFVersion adaptVersion(
- org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFVersion version) {
-
- switch (version.getValue()){
- case org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFVersion.V1_1:
- return JSFVersion.V1_1;
- case org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFVersion.V1_2:
- return JSFVersion.V1_2;
- default:
- return JSFVersion.UNKNOWN;
-
- }
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.core.jsflibraryconfiguration.JSFLibraryReference#getName()
- */
- public String getName() {
- if (getLibrary()!= null) {
- return getLibrary().getName();
- }
- return getId();
- }
-
- public String toString(){
- StringBuffer buf = new StringBuffer("id: ");
- buf.append(getId());
- buf.append(", label: ");
- buf.append(getLabel());
- buf.append(", isDeployed: ");
- buf.append(isDeployed());
- buf.append(", isImpl: ");
- buf.append(isJSFImplementation());
- buf.append(", version: ");
- buf.append(getMaxSupportedVersion().name());
-
- return buf.toString();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryconfiguration/internal/JSFLibraryReferenceFacadeFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryconfiguration/internal/JSFLibraryReferenceFacadeFactory.java
deleted file mode 100644
index cb15c67..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryconfiguration/internal/JSFLibraryReferenceFacadeFactory.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.jsflibraryconfiguration.internal;
-
-import org.eclipse.jdt.core.IClasspathAttribute;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jst.j2ee.classpathdep.IClasspathDependencyConstants;
-import org.eclipse.jst.jsf.core.internal.jsflibraryconfig.JSFLibraryRegistryUtil;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.PluginProvidedJSFLibrary;
-import org.eclipse.jst.jsf.core.jsflibraryconfiguration.JSFLibraryConfigurationHelper;
-import org.eclipse.jst.jsf.core.jsflibraryconfiguration.JSFLibraryReference;
-import org.eclipse.jst.jsf.core.jsflibraryconfiguration.JSFLibraryReferenceServerSupplied;
-
-/**
- * Factory for producing facade objects for references to the internal EMF JSF Library classes
- */
-public class JSFLibraryReferenceFacadeFactory {
- /**
- * Returns a JSFLibraryReferenceUserSpecified (or JSFLibraryReferenceUserDefined}) or JSFLibraryReferencePluginProvided instance.
- * Will not create a JSFLibraryReferenceServerSupplied as there is no cp entry. Use createServerSuppliedJSFLibRef instead.
- * @param classpathEntry
- * @return an instance of JSFLibraryInternalReference. Null will be returned if the cpEntry is not a JSF Library reference.
- */
- public static JSFLibraryReference create(final IClasspathEntry classpathEntry) {
- if (JSFLibraryConfigurationHelper.isJSFLibraryContainer(classpathEntry)){
- return createReference(classpathEntry);
- }
- return null;
- }
-
- /**
- * @return instance of {@link JSFLibraryReferenceServerSupplied}
- */
- public static JSFLibraryReferenceServerSupplied createServerSuppliedJSFLibRef(){
- return new JSFLibraryReferenceServerSuppliedImpl();
- }
-
-
- /**
- * @param classpathEntry
- * @return {@link JSFLibraryReference}
- */
- private static JSFLibraryReference createReference(
- final IClasspathEntry classpathEntry) {
-
- String libID = classpathEntry.getPath().segment(1);
- org.eclipse.jst.jsf.core.internal.jsflibraryconfig.JSFLibraryInternalReference libRef = JSFLibraryRegistryUtil.getInstance().getJSFLibraryReferencebyID(libID);
- if (libRef!= null){
- boolean isDeployed = getJ2EEModuleDependency(classpathEntry);
- if (libRef.getLibrary() instanceof PluginProvidedJSFLibrary)
- return new JSFLibraryReferencePluginProvidedImpl(libRef, isDeployed);
-
- return new JSFLibraryReferenceUserSpecifiedImpl(libRef, isDeployed);
- }
- return null;
- }
-
- private static boolean getJ2EEModuleDependency(IClasspathEntry classpathEntry) {
- IClasspathAttribute[] attrs = classpathEntry.getExtraAttributes();
- for (int i=0;i<attrs.length;i++){
- IClasspathAttribute attr = attrs[i];
- if (attr.getName().equals(IClasspathDependencyConstants.CLASSPATH_COMPONENT_DEPENDENCY)){
- return true;
- }
- }
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryconfiguration/internal/JSFLibraryReferencePluginProvidedImpl.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryconfiguration/internal/JSFLibraryReferencePluginProvidedImpl.java
deleted file mode 100644
index bb847ae..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryconfiguration/internal/JSFLibraryReferencePluginProvidedImpl.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.jsflibraryconfiguration.internal;
-
-import org.eclipse.jst.jsf.core.internal.jsflibraryconfig.JSFLibraryInternalReference;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.PluginProvidedJSFLibrary;
-import org.eclipse.jst.jsf.core.jsflibraryconfiguration.JSFLibraryReferencePluginProvided;
-
-/**
- *
- */
-public class JSFLibraryReferencePluginProvidedImpl extends AbstractJSFLibraryReferenceImpl implements JSFLibraryReferencePluginProvided {
-
- /**
- * Constructor
- * @param libRef
- * @param isDeployed
- */
- public JSFLibraryReferencePluginProvidedImpl(JSFLibraryInternalReference libRef, boolean isDeployed) {
- super(libRef, isDeployed);
- }
-
- public String getPluginId() {
- if (getLibrary() != null)
- return ((PluginProvidedJSFLibrary) getLibrary()).getPluginID();
-
- return null;
- }
-
- public String toString() {
- StringBuffer buf = new StringBuffer("PluginProvided: (");
- buf.append(super.toString());
-
- return buf.toString();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryconfiguration/internal/JSFLibraryReferenceServerSuppliedImpl.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryconfiguration/internal/JSFLibraryReferenceServerSuppliedImpl.java
deleted file mode 100644
index 6ab76ef..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryconfiguration/internal/JSFLibraryReferenceServerSuppliedImpl.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.jsflibraryconfiguration.internal;
-
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary;
-import org.eclipse.jst.jsf.core.jsflibraryconfiguration.JSFLibraryReferenceServerSupplied;
-import org.eclipse.jst.jsf.core.jsflibraryconfiguration.JSFVersion;
-
-/**
- * @author gekessle
- *
- */
-public class JSFLibraryReferenceServerSuppliedImpl
- extends AbstractJSFLibraryReferenceImpl
- implements JSFLibraryReferenceServerSupplied {
-
- /**
- * Constructor
- */
- public JSFLibraryReferenceServerSuppliedImpl(){
- //TODO: replace label with constant
- super(JSFLibraryReferenceServerSupplied.ID, "Server Supplied", true);
- }
-
- public String toString() {
- StringBuffer buf = new StringBuffer("ServerSupplied: (");
- buf.append(super.toString());
- buf.append(")");
-
- return buf.toString();
- }
-
- protected JSFLibrary getLibrary(){
- return null;
- }
-
- public JSFVersion getMaxSupportedVersion() {
- return JSFVersion.UNKNOWN;
- }
-//
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryconfiguration/internal/JSFLibraryReferenceUserSpecifiedImpl.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryconfiguration/internal/JSFLibraryReferenceUserSpecifiedImpl.java
deleted file mode 100644
index 833ed20..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryconfiguration/internal/JSFLibraryReferenceUserSpecifiedImpl.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.jsflibraryconfiguration.internal;
-
-import org.eclipse.jst.jsf.core.internal.jsflibraryconfig.JSFLibraryInternalReference;
-import org.eclipse.jst.jsf.core.jsflibraryconfiguration.JSFLibraryReferenceUserDefined;
-import org.eclipse.jst.jsf.core.jsflibraryconfiguration.JSFLibraryReferenceUserSpecified;
-
-/**
- * Implementation of a reference to a user specified JSF Library
- *
- */
-@SuppressWarnings("deprecation")
-public class JSFLibraryReferenceUserSpecifiedImpl extends AbstractJSFLibraryReferenceImpl implements JSFLibraryReferenceUserSpecified, JSFLibraryReferenceUserDefined{
- /**
- * @param libRef of type {@link JSFLibraryInternalReference}
- * @param isDeployed
- */
- public JSFLibraryReferenceUserSpecifiedImpl(
- JSFLibraryInternalReference libRef, boolean isDeployed) {
-
- super(libRef, isDeployed);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.core.jsflibraryconfiguration.internal.AbstractJSFLibraryReferenceImpl#toString()
- */
- public String toString() {
- StringBuffer buf = new StringBuffer("UserSpecified: (");
- buf.append(super.toString());
- buf.append(")");
-
- return buf.toString();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryconfiguration/package-info.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryconfiguration/package-info.java
deleted file mode 100644
index d17bacc..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryconfiguration/package-info.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-/**
- * API for configuring JSF Library References.
- *
- * <p><b>Provisional API - subject to change</b></p>
- */
-package org.eclipse.jst.jsf.core.jsflibraryconfiguration;
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryregistry/InvalidArchiveFilesCreationException.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryregistry/InvalidArchiveFilesCreationException.java
deleted file mode 100644
index d76849c..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryregistry/InvalidArchiveFilesCreationException.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.jsflibraryregistry;
-
-/**
- * Exception class thrown by PluginProvidedJSFLibraryCreationHelper.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @deprecated
- */
-public class InvalidArchiveFilesCreationException extends Exception {
- private static final long serialVersionUID = 1L;
-
- /**
- * Creates an instance with the specified message.
- * @param msg This instance's message
- */
- public InvalidArchiveFilesCreationException(String msg) {
- super(msg);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryregistry/JSFLibraryArchiveFilesDelegate.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryregistry/JSFLibraryArchiveFilesDelegate.java
deleted file mode 100644
index e4422b2..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryregistry/JSFLibraryArchiveFilesDelegate.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.jsflibraryregistry;
-
-import java.util.Collection;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryFactory;
-import org.osgi.framework.Bundle;
-
-/**
- * Abstract delegate class used by jsfLibraries ext-pt to return collection of
- * ArchiveFiles to PluginProvidedJSFLibraryCreationHelper.
- *
- * Caller must first setConfigurationElement(IConfigurationElement element)
- * before a call to getArchiveFiles().
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @deprecated along with the jsflibraries extension-point
- */
-public abstract class JSFLibraryArchiveFilesDelegate {
- private IConfigurationElement extPtElement;
- private String libID = null;
- private IPath pluginPath = null;
- private String pluginID;
- private String relativeDestLocation = "WEB-INF/lib"; //$NON-NLS-1$
-
- /**
- * Returns a Collection of <code>org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile</code>
- * instances.
- *
- * @return A Collection of <code>org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile</code>
- * instances
- */
- public abstract Collection getArchiveFiles();
-
- /**
- * Sets the IConfigurationElement instance to be subsequently used to get
- * the plugin ID and the name defined for the JSF Library.
- *
- * @param extPtElement IConfigurationElement instance
- */
- public final void setConfigurationElement(IConfigurationElement extPtElement){
- this.extPtElement = extPtElement;
- }
-
- /**
- * Constructs an instance.
- */
- public JSFLibraryArchiveFilesDelegate() {
- super();
- }
-
- /**
- * Sets the relative destination location subsequently used to set the
- * corresponding property on each created ArchiveFile.
- *
- * @param relPath Relative destination location for ArchiveFile instances
- */
- protected void setRelativeDestinationLocation(String relPath){
- relativeDestLocation = relPath;
- }
-
- /**
- * Returns ArchiveFile where the location is set relative to the plugin.
- * As long as the ArchiveFile is on the local machine somewhere, it should
- * be locatable.
- *
- * @param relativePathFileName Relative location of the ArchiveFile
- * @return ArchiveFile instance.
- */
- protected ArchiveFile createArchiveFile(String relativePathFileName){
- ArchiveFile file = JSFLibraryRegistryFactory.eINSTANCE.createArchiveFile();
- file.setRelativeToWorkspace(false);
- file.setSourceLocation(relativePathFileName);
- file.setRelativeDestLocation(relativeDestLocation);
- return file;
- }
-
-// protected ArchiveFile createArchiveFileWithAbsolutePath(String fullPath){
-// ArchiveFile file = JSFLibraryRegistryFactory.eINSTANCE.createArchiveFile();
-// file.setRelativeToWorkspace(false);
-// file.setSourceLocation(fullPath);
-// file.setRelativeDestLocation(relativeDestLocation);
-// return file;
-// }
-
- /**
- * Returns the JSFLibrary ID as set on the extension point.
- *
- * @return JSFLibrary ID
- */
- protected String getLibID(){
- if (libID == null){
- StringBuffer buf = new StringBuffer(getPluginID());
- buf.append("/").append(extPtElement.getAttribute(PluginProvidedJSFLibraryCreationHelper.NAME)); //$NON-NLS-1$
- libID = buf.toString();
- }
- return libID;
- }
-
- /**
- * Returns the plugin's path.
- *
- * @return The plugin's path.
- */
- protected IPath getPluginPath(){
- if (pluginPath == null){
- Bundle bundle = Platform.getBundle(getPluginID());
- pluginPath = new Path(bundle.getLocation());
- }
- return pluginPath;
- }
-
- /**
- * Returns the plugin's ID.
- *
- * @return The plugin's ID.
- */
- private String getPluginID() {
- if (pluginID == null){
- pluginID = extPtElement.getDeclaringExtension().getContributor().getName();
- }
- return pluginID;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryregistry/PluginProvidedJSFLibraryArchiveFilesDelegate.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryregistry/PluginProvidedJSFLibraryArchiveFilesDelegate.java
deleted file mode 100644
index e260f69..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryregistry/PluginProvidedJSFLibraryArchiveFilesDelegate.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.jsflibraryregistry;
-
-import org.eclipse.jst.jsf.core.jsflibraryregistry.internal.PluginProvidedJSFLibraryCreationHelper2;
-
-/**
- * Abstract class to be used for supplying the jar file names for a plugin provided jsf library.
- * <br>Adopters must implement getArchiveFiles() making use of the addArchiveFile(String pluginRootRelativePath) method.
- * <br><em>Note: A plugin providing jsf libraries cannot be jarred at this time. </em>
- * <br><br>ex.
- * <br> <pre><code>public void getArchiveFiles() {
- addArchiveFile("/lib/JAR1.jar");
- addArchiveFile("/lib/JAR2.jar");
- }
- </code>
- </pre>
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- */
-public abstract class PluginProvidedJSFLibraryArchiveFilesDelegate {
- private PluginProvidedJSFLibraryCreationHelper2 helper;
-
- /**
- * Constructs an instance.
- */
- public PluginProvidedJSFLibraryArchiveFilesDelegate() {
- super();
- }
-
- /**
- * Concrete delegate must implement this method to define jars in the library.
- * Use addJarFile(String pluginRootRelativePath) within this method to add jars to the library.
- */
- public abstract void getArchiveFiles();
-
- /**
- * Adds jar file to the library. Verification of file existence does not occur at this point.
- *
- * Jar must be specified as being relative to the plugin.
- * ex. "/lib/MyJar.jar" where the lib directory is a child of the root.
- *
- * @param pluginRootRelativePath
- */
- protected void addArchiveFile(String pluginRootRelativePath) {
- helper.addArchiveFile(pluginRootRelativePath);//getArchiveFiles().add(helper.createArchiveFile(pluginRootRelativePath));
- }
-
- /**
- * Not to be implemented by subclasses
- * @param helper
- */
- public void setCreationHelper(
- PluginProvidedJSFLibraryCreationHelper2 helper) {
- this.helper = helper;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryregistry/PluginProvidedJSFLibraryCreationHelper.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryregistry/PluginProvidedJSFLibraryCreationHelper.java
deleted file mode 100644
index cda0083..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryregistry/PluginProvidedJSFLibraryCreationHelper.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.jsflibraryregistry;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.core.internal.Messages;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryFactory;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFVersion;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.PluginProvidedJSFLibrary;
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Helper class used to create JSF Libraries from the
- * <code>org.eclipse.jst.jsf.core.jsflibraries</code> extension-point.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @deprecated - clients should not use
- */
-public final class PluginProvidedJSFLibraryCreationHelper {
- private IConfigurationElement config_element;
-
- /**
- * Key of the 'name' attribute of the extension point.
- */
- public final static String NAME = "name"; //$NON-NLS-1$
- /**
- * Key of the 'isImplementation' attribute of the extension point.
- */
- public final static String IS_IMPL = "isImplementation"; //$NON-NLS-1$
- /**
- * Key of the 'maxVersionSupported' attribute of the extension point.
- */
- public final static String VERSION = "maxVersionSupported"; //$NON-NLS-1$
- /**
- * Key of the 'archiveFilesDelegate' attribute of the extension point.
- */
- public final static String DELEGATE = "archiveFilesDelegate"; //$NON-NLS-1$
-
- /**
- * Creates an instance with the specified IConfigurationElement instance.
- *
- * @param jsfLibrary IConfigurationElement instance
- */
- public PluginProvidedJSFLibraryCreationHelper (IConfigurationElement jsfLibrary){
- this.config_element = jsfLibrary;
- }
-
- /**
- * Creates a new PluginProvidedJSFLibrary from the JSFLibrary extension point.
- *
- * @return PluginProvidedJSFLibrary instance.
- */
- public JSFLibrary create(){
- PluginProvidedJSFLibrary newLib = JSFLibraryRegistryFactory.eINSTANCE.createPluginProvidedJSFLibrary();
-// newLib.setID(getLibID());
- newLib.setPluginID(getPluginID());
- newLib.setName(config_element.getAttribute(NAME));
- newLib.setImplementation(config_element.getAttribute(IS_IMPL).equals("true") ? true : false); //$NON-NLS-1$
- newLib.setJSFVersion(JSFVersion.getJSFVersion(config_element.getAttribute(VERSION)));
-
- try {
- addArchives(newLib);
- return newLib;
- } catch (Exception e) {
- JSFCorePlugin.log(
- e,
- NLS.bind(
- Messages.PluginProvidedJSFLibraryCreationHelper_ErrorCreating,
- newLib.getName()));
- }
- return null;
- }
-
- /**
- * Adds ArchiveFile instances to the specified JSFLibrary instance.
- *
- * @param newLib JSFLibrary instance
- * @throws InvalidArchiveFilesCreationException on attempt to create
- * multiple instances at same location.
- * @throws CoreException on core failure.
- */
- private void addArchives(JSFLibrary newLib) throws InvalidArchiveFilesCreationException, CoreException {
- JSFLibraryArchiveFilesDelegate jarCol = null;
- ArchiveFile jar = null;
-
- jarCol = (JSFLibraryArchiveFilesDelegate)config_element.createExecutableExtension(DELEGATE);
- if (jarCol != null){
- jarCol.setConfigurationElement(config_element);
- Collection jars = jarCol.getArchiveFiles();
- if (jars == null)//TODO: better validation and error handling
- return;
- Iterator it = jars.iterator();
- while (it.hasNext()){
- Object aJar = it.next();
- if (aJar instanceof ArchiveFile){//for now check to see ArchiveFiles were being returned
- jar = (ArchiveFile)aJar;
- if (!newLib.containsArchiveFile(jar.getSourceLocation()))
- newLib.getArchiveFiles().add(jar);
- }
- else {
- throw new InvalidArchiveFilesCreationException(
- NLS.bind(
- Messages.PluginProvidedJSFLibraryCreationHelper_ErrorMultipleDefinition,
- jar.getSourceLocation(),
- config_element.getName()));
- }
-
- }
- }
- }
-
- /**
- * Returns the plugin's ID.
- *
- * @return The plugin's ID
- */
- private String getPluginID() {
- return config_element.getDeclaringExtension().getContributor().getName();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryregistry/internal/PluginProvidedJSFLibraryCreationHelper2.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryregistry/internal/PluginProvidedJSFLibraryCreationHelper2.java
deleted file mode 100644
index 7c280ea..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryregistry/internal/PluginProvidedJSFLibraryCreationHelper2.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.jsflibraryregistry.internal;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.core.internal.Messages;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryFactory;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFVersion;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.PluginProvidedJSFLibrary;
-import org.eclipse.jst.jsf.core.jsflibraryregistry.PluginProvidedJSFLibraryArchiveFilesDelegate;
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Helper class used to create plugin-rovided JSF Libraries from the
- * <code>org.eclipse.jst.jsf.core.pluginProvidedJsfLibraries</code> extension-point.
- * <br>
- *
- * @author Gerry Kessler - Oracle
- */
-public final class PluginProvidedJSFLibraryCreationHelper2 {
- private PluginProvidedJSFLibrary newLib;
- private IConfigurationElement config_element;
- private String relativeDestLocation = "WEB-INF/lib"; //$NON-NLS-1$
-
- /**
- * Key of the 'name' attribute of the extension point.
- */
- public final static String NAME = "name"; //$NON-NLS-1$
- /**
- * Key of the 'isImplementation' attribute of the extension point.
- */
- public final static String IS_IMPL = "isImplementation"; //$NON-NLS-1$
- /**
- * Key of the 'maxVersionSupported' attribute of the extension point.
- */
- public final static String VERSION = "maxVersionSupported"; //$NON-NLS-1$
- /**
- * Key of the 'archiveFilesDelegate' attribute of the extension point.
- */
- public final static String DELEGATE = "archiveFilesDelegate"; //$NON-NLS-1$
- /**
- * Key of the 'label' attribute of the extension point.
- */
- public final static String LABEL = "label"; //$NON-NLS-1$
-
- /**
- * Creates an instance with the specified IConfigurationElement instance.
- *
- * @param jsfLibrary IConfigurationElement instance
- */
- public PluginProvidedJSFLibraryCreationHelper2 (IConfigurationElement jsfLibrary){
- this.config_element = jsfLibrary;
- }
-
- /**
- * Add a jar file to the library
- * @param pluginRootRelativePath
- */
- public void addArchiveFile(String pluginRootRelativePath) {
- ArchiveFile jar = createArchiveFile(pluginRootRelativePath);
- if (!newLib.containsArchiveFile(jar.getSourceLocation()))
- newLib.getArchiveFiles().add(jar);
- }
-
- /**
- * Creates a new PluginProvidedJSFLibrary from the JSFLibrary extension point.
- *
- * @return PluginProvidedJSFLibrary instance.
- */
- public JSFLibrary create(){
- newLib = JSFLibraryRegistryFactory.eINSTANCE.createPluginProvidedJSFLibrary();
- newLib.setPluginID(getPluginID());
- newLib.setName(config_element.getAttribute(NAME));
- String label = config_element.getAttribute(LABEL);
- if (label != null && label.length() > 0){
- newLib.setLabel(label);
- }
- newLib.setImplementation(config_element.getAttribute(IS_IMPL).equals("true") ? true : false); //$NON-NLS-1$
- newLib.setJSFVersion(JSFVersion.getJSFVersion(config_element.getAttribute(VERSION)));
-
- try {
- addArchives();
- return newLib;
- } catch (Exception e) {
- JSFCorePlugin.log(
- e,
- NLS.bind(
- Messages.PluginProvidedJSFLibraryCreationHelper_ErrorCreating,
- newLib.getName()));
- }
- return null;
- }
-
- /**
- * Adds ArchiveFile instances to the specified JSFLibrary instance.
- *
- * @param newLib JSFLibrary instance
- * @throws CoreException on core failure.
- */
- private void addArchives() throws CoreException {
- PluginProvidedJSFLibraryArchiveFilesDelegate jarCol = null;
-
- jarCol = (PluginProvidedJSFLibraryArchiveFilesDelegate)config_element.createExecutableExtension(DELEGATE);
- if (jarCol != null){
- jarCol.setCreationHelper(this);
- jarCol.getArchiveFiles();
- }
- }
- /**
- * Returns ArchiveFile where the location is set relative to the plugin.
- * As long as the ArchiveFile is on the local machine somewhere, it should
- * be locatable.
- *
- * @param relativePathFileName Relative location of the ArchiveFile
- * @return ArchiveFile instance.
- */
- private ArchiveFile createArchiveFile(String pluginRootRelativePath){
- ArchiveFile file = JSFLibraryRegistryFactory.eINSTANCE.createArchiveFile();
- file.setRelativeToWorkspace(false);
- file.setSourceLocation(pluginRootRelativePath);
- file.setRelativeDestLocation(relativeDestLocation);
- return file;
- }
-
- /**
- * Returns the plugin's ID.
- *
- * @return The plugin's ID
- */
- private String getPluginID() {
- return config_element.getDeclaringExtension().getContributor().getName();
- }
-
-}
\ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryregistry/package-info.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryregistry/package-info.java
deleted file mode 100644
index 3eb240d..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/jsflibraryregistry/package-info.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-/**
- * API for configuring JSF Library References.
- *
- * <p><b>Provisional API - subject to change</b></p>
- */
-package org.eclipse.jst.jsf.core.jsflibraryregistry;
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/metadata/internal/HTMLContentModelMetaDataTranslator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/metadata/internal/HTMLContentModelMetaDataTranslator.java
deleted file mode 100644
index 64e707e..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/metadata/internal/HTMLContentModelMetaDataTranslator.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.core.metadata.internal;
-
-import org.eclipse.jst.jsf.common.metadata.internal.AbstractTagLibDomainContentModelMetaDataTranslator;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataModelMergeAssistant;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataSourceModelProvider;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataTranslator;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-
-/**
- * Translates the HTML CMDocument to standard metadata model entities and traits
- */
-public class HTMLContentModelMetaDataTranslator extends AbstractTagLibDomainContentModelMetaDataTranslator implements IMetaDataTranslator {
-
- public boolean canTranslate(IMetaDataSourceModelProvider modelProvider) {
- if (modelProvider != null &&
- modelProvider.getSourceModel() instanceof HTMLCMDocument)
- return true;
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.internal.IMetaDataTranslator#translate(org.eclipse.jst.jsf.common.metadata.internal.IMetaDataModelMergeAssistant)
- */
- public void translate(final IMetaDataModelMergeAssistant assistant) {
- _assistant = assistant;
- CMDocument doc = getSourceModel();
- if (doc instanceof HTMLCMDocument){
- doTranslate(doc);
- }
- }
-
- /**
- * @return getURIDisplayLabel()
- */
- protected String getURIDescription() {
- return getURIDisplayLabel();
- }
-
- /**
- * return "HTML 4.0"
- */
- protected String getURIDisplayLabel() {
- return "HTML 4.0";
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/metadata/internal/JSPContentModelMetaDataTranslator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/metadata/internal/JSPContentModelMetaDataTranslator.java
deleted file mode 100644
index 95ed2a0..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/metadata/internal/JSPContentModelMetaDataTranslator.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.core.metadata.internal;
-
-import org.eclipse.jst.jsf.common.metadata.internal.AbstractTagLibDomainContentModelMetaDataTranslator;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataModelMergeAssistant;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataSourceModelProvider;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataTranslator;
-import org.eclipse.wst.html.core.internal.contentmodel.JSPCMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-
-/**
- * Translates the JSP CMDocument to standard metadata model entities and traits
- */
-public class JSPContentModelMetaDataTranslator extends AbstractTagLibDomainContentModelMetaDataTranslator implements IMetaDataTranslator {
-
- public boolean canTranslate(IMetaDataSourceModelProvider modelProvider) {
- if (modelProvider != null &&
- modelProvider.getSourceModel() instanceof JSPCMDocument)
- return true;
- return false;
- }
-
- public void translate(final IMetaDataModelMergeAssistant assistant) {
- setAssistant(assistant);
- CMDocument doc = getSourceModel();
- if (doc instanceof JSPCMDocument){
- doTranslate(doc);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.internal.AbstractTagLibDomainContentModelMetaDataTranslator#getURIDescription()
- */
- protected String getURIDescription() {
- return "JSP Tags";
- }
-
- @Override
- protected String getURIDisplayLabel() {
- return "JSP";
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/metadata/internal/TaglibMetaDataLocator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/metadata/internal/TaglibMetaDataLocator.java
deleted file mode 100644
index 0275afc..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/metadata/internal/TaglibMetaDataLocator.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.core.metadata.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.jsf.common.metadata.internal.AbstractMetaDataLocator;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataLocator;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataSourceModelProvider;
-import org.eclipse.jst.jsf.common.metadata.internal.IPathSensitiveMetaDataLocator;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.CMDocumentFactoryTLD;
-import org.eclipse.jst.jsp.core.taglib.ITaglibRecord;
-import org.eclipse.jst.jsp.core.taglib.TaglibIndex;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDocumentFactory;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMDocType;
-
-/**
- * Locator of tag library meta data
- *
- */
-public class TaglibMetaDataLocator extends AbstractMetaDataLocator implements IPathSensitiveMetaDataLocator{
- //project must be set to the current project context during locate only... should not be used when noifying observers
- private IProject project;
- private TaglibMetaDataSource source;
-
- /**
- * Constructor
- */
- public TaglibMetaDataLocator(){
- super();
- }
-
- public List/*<IMetaDataModelProvider>*/ locateMetaDataModelProviders(String uri) {
- List ret = new ArrayList();
- CMDocument doc = null;
-
- if (uri == null){
- return ret;
- }
- else if (uri.equalsIgnoreCase(CMDocType.HTML_DOC_TYPE)){
- doc = HTMLCMDocumentFactory.getCMDocument(CMDocType.HTML_DOC_TYPE);
- }
- else if (uri.equalsIgnoreCase(CMDocType.JSP11_DOC_TYPE)){
- doc = HTMLCMDocumentFactory.getCMDocument(CMDocType.JSP11_DOC_TYPE);
- }
- else if (uri.equalsIgnoreCase(CMDocType.JSP12_DOC_TYPE)){
- doc = HTMLCMDocumentFactory.getCMDocument(CMDocType.JSP12_DOC_TYPE);
- }
- else if (uri.equalsIgnoreCase(CMDocType.JSP20_DOC_TYPE)){
- doc = HTMLCMDocumentFactory.getCMDocument(CMDocType.JSP20_DOC_TYPE);
- }
- else if (project != null ){//TLD
- CMDocumentFactoryTLD factory = new CMDocumentFactoryTLD();
- ITaglibRecord[] tldRecs = TaglibIndex.getAvailableTaglibRecords(project.getFullPath());
- ITaglibRecord tldRec = findTLD(tldRecs, uri);
- if (tldRec != null)
- doc = factory.createCMDocument(tldRec);
- }
-
- if (doc != null){
- source = new TaglibMetaDataSource(doc);
- ret.add(source);
- }
-
- return ret;
- }
-
- private ITaglibRecord findTLD(ITaglibRecord[] tldRecs, String uri) {
- for (int i=0;i<tldRecs.length;i++){
- ITaglibRecord tld = tldRecs[i];
- if (uri.equals(tld.getDescriptor().getURI()))
- return tld;
- }
- return null;
- }
-
- public void startLocating() {
-// TaglibIndex.addTaglibIndexListener(this);
- }
- public void stopLocating() {
-// TaglibIndex.removeTaglibIndexListener(this);//non-api call.... danger
- }
-
- //not currently listening, so will not be called
-// public void indexChanged(ITaglibDescriptor event) {
-// if (event.getURI() != null && event.getURI().equals(uri)){
-// if (!_notificationEventOccuring){
-// _notificationEventOccuring = true;
-// int type = adaptTagLibEvent(event);
-// IMetaDataChangeNotificationEvent mdEvent = new MetaDataChangeNotificationEvent(this, uri, type);
-// fireEvent(mdEvent);
-// _notificationEventOccuring = false;
-// }
-// }
-// }
-
-// private int adaptTagLibEvent(ITaglibRecordEvent event) {
-// switch (event.getType()){
-// case ITaglibRecordEvent.ADDED:
-// return IMetaDataChangeNotificationEvent.ADDED;
-// case ITaglibRecordEvent.REMOVED:
-// return IMetaDataChangeNotificationEvent.REMOVED;
-// default:
-// return IMetaDataChangeNotificationEvent.CHANGED;
-// }
-// }
-
-// private void fireEvent(final IMetaDataChangeNotificationEvent event) {
-// SafeRunnable.run(new ISafeRunnable(){
-//
-// public void handleException(Throwable exception) {
-// // TODO Auto-generated method stub
-// }
-//
-// public void run() throws Exception {
-// Iterator it = getObservers().iterator();
-// while (it.hasNext()){
-// IMetaDataObserver observer = (IMetaDataObserver)it.next();
-// observer.notifyMetadataChanged(event);
-// }
-// }
-//
-// });
-//
-// }
-
- public void setProjectContext(IProject project) {
- this.project = project;
- }
-
- private class TaglibMetaDataSource implements IMetaDataSourceModelProvider{
-
- private CMDocument doc;
- private IMetaDataLocator locator;
-
- TaglibMetaDataSource(CMDocument doc){
- super();
- this.doc = doc;
- }
-
- public Object getSourceModel() {
- return doc;
- }
-
- public IMetaDataLocator getLocator() {
- return locator;
- }
-
- public void setLocator(IMetaDataLocator locator) {
- this.locator = locator;
- }
-
- public Object getAdapter(Class klass) {
- return null;
- }
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/metadata/internal/TaglibMetaDataTLDTranslator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/metadata/internal/TaglibMetaDataTLDTranslator.java
deleted file mode 100644
index 73696da..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/metadata/internal/TaglibMetaDataTLDTranslator.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.core.metadata.internal;
-
-import org.eclipse.jst.jsf.common.metadata.internal.AbstractTagLibDomainContentModelMetaDataTranslator;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataModelMergeAssistant;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataSourceModelProvider;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataTranslator;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDAttributeDeclaration;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDDocument;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-
-/**
- * Translates a TLD CMDocument to standard metadata model entities and traits
- *
- */
-public class TaglibMetaDataTLDTranslator extends AbstractTagLibDomainContentModelMetaDataTranslator implements IMetaDataTranslator {
-
- public boolean canTranslate(IMetaDataSourceModelProvider modelProvider) {
- if (modelProvider != null &&
- modelProvider.getSourceModel() instanceof TLDDocument)
- return true;
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.internal.IMetaDataTranslator#translate(org.eclipse.jst.jsf.common.metadata.internal.IMetaDataModelMergeAssistant)
- */
- public void translate(final IMetaDataModelMergeAssistant assistant) {
- setAssistant(assistant);
- CMDocument doc = getSourceModel();
- if (doc instanceof TLDDocument){
- doTranslate(doc);
-
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.internal.AbstractTagLibDomainContentModelMetaDataTranslator#getURIDefaultPrefix()
- */
- protected String getURIDefaultPrefix(){
- return getTLDDocument().getShortname();
- }
-
- /**
- * @param tag
- * @return the tag.getDisplayName() if available
- */
- protected String getTagDisplayLabel(CMElementDeclaration tag){
- String label = ((TLDElementDeclaration)tag).getDisplayName();
- if (label == null)
- label = super.getTagDisplayName(tag);
- return label;
- }
-
- /**
- * @param tag
- * @return the tag.getDescription() if available
- */
- protected String getTagDescription(CMElementDeclaration tag){
- String desc = ((TLDElementDeclaration)tag).getDescription();
- if (desc == null)
- desc = super.getTagDescription(tag);
- return desc;
- }
-
- /**
- * @param tag
- * @return the tag.getSmallIcon() if available
- */
- protected String getTagSmallIcon(CMElementDeclaration tag){
- String smallIcon = ((TLDElementDeclaration)tag).getSmallIcon();
- if (smallIcon == null)
- smallIcon = super.getTagSmallIcon(tag);
- return smallIcon;
- }
-
- /**
- * @param tag
- * @return the tag.getLargeIcon() if available
- */
- protected String getTagLargeIcon(CMElementDeclaration tag){
- String largeIcon = ((TLDElementDeclaration)tag).getLargeIcon();
- if (largeIcon == null)
- largeIcon = super.getTagLargeIcon(tag);
- return largeIcon;
- }
-
- /**
- * @return the tag.getDescription() if available
- */
- protected String getURIDescription() {
- return getTLDDocument().getDescription();
- }
-
- /**
- * @return the tag.getDisplayName()
- */
- protected String getURIDisplayLabel() {
- return getTLDDocument().getDisplayName();
- }
-
- /**
- * @return the tld document for the source model
- */
- protected TLDDocument getTLDDocument(){
- return (TLDDocument)getSourceModel();
- }
-
- @Override
- protected String getTagAttributeDescription(CMAttributeDeclaration cmAttr) {
- String desc = ((TLDAttributeDeclaration)cmAttr).getDescription();
- if (desc == null)
- desc = super.getTagAttributeDescription(cmAttr);
- return desc;
- }
-
- @Override
- protected boolean getTagAttributeIsRequired(CMAttributeDeclaration cmAttr) {
- // TODO Auto-generated method stub
- return super.getTagAttributeIsRequired(cmAttr);
- }
-
- @Override
- protected String getTagAttributeDefaultValue(CMAttributeDeclaration cmAttr) {
- String val = ((TLDAttributeDeclaration)cmAttr).getAttrType().generateInstanceValue();
- if (val == null)
- val = super.getTagAttributeDefaultValue(cmAttr);
- return val;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/package-info.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/package-info.java
deleted file mode 100644
index d12392b..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/package-info.java
+++ /dev/null
@@ -1,16 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-/**
- * JSF Core Framework API.
- */
-package org.eclipse.jst.jsf.core;
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/set/constraint/MemberConstraint.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/set/constraint/MemberConstraint.java
deleted file mode 100644
index e6e69ca..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/set/constraint/MemberConstraint.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.set.constraint;
-
-import org.eclipse.emf.common.util.BasicDiagnostic;
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.jst.jsf.common.sets.AxiomaticSet;
-import org.eclipse.jst.jsf.common.sets.constraint.AbstractSetConstraint;
-
-/**
- * A set constraint that is satisfied if a test set contains all of the specified
- * mustBeMembers.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author cbateman
- *
- */
-public class MemberConstraint extends AbstractSetConstraint
-{
- private final AxiomaticSet _mustBeMembers;
-
- /**
- * @param mustBeMembers -- the set of objects that must occur in the
- * input set for the constraint to satisfy.
- */
- public MemberConstraint(AxiomaticSet mustBeMembers)
- {
- _mustBeMembers = mustBeMembers;
- }
-
- /**
- * Members of set must be comparable with thos in mustBeMembers using equals()
- * @param set
- * @return whether or not the constraint is satisfied. If not satisfied, the
- * diagnostic's data array will contain the objects that are missing.
- */
- public Diagnostic isSatisfied(AxiomaticSet set)
- {
- // the constraint is satisfied iff _mustBeMembers is a subset
- // of set. In other words, if every member of _mustBeMembers
- // is also in set.
-
- // we want to take _mustBeMembers - set. If the result is empty, then
- // all of the required elements are members of set. If the set is non-empty,
- // this tells us what is missing
- final AxiomaticSet complement = _mustBeMembers.subtract(set);
-
- if (complement.isEmpty())
- {
- return Diagnostic.OK_INSTANCE;
- }
-
- return new BasicDiagnostic(Diagnostic.ERROR, this.getClass().getName(),
- 0, "Failed membership constraint", complement.toArray());
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/set/constraint/package-info.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/set/constraint/package-info.java
deleted file mode 100644
index 27a3692..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/set/constraint/package-info.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-/**
- * JSF Core Set Constraints.
- *
- * <p><b>Provisional API - subject to change</b></p>
- */
-package org.eclipse.jst.jsf.core.set.constraint;
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/set/mapping/ElementToTagIdentifierMapping.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/set/mapping/ElementToTagIdentifierMapping.java
deleted file mode 100644
index 5af60bf..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/set/mapping/ElementToTagIdentifierMapping.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.set.mapping;
-
-import org.eclipse.jst.jsf.common.sets.mapping.AbstractObjectInjectiveSetMapping;
-import org.eclipse.jst.jsf.core.internal.tld.TagIdentifierFactory;
-import org.w3c.dom.Element;
-
-/**
- * Converts a set of DOM element's to a set of (object) injective set
- * of TagIdentifiers. If the element is a JSP tag, the tag uri will
- * be looked up.
- *
- * IMPORTANT: the returned TagIdentifiers are wrapper objects, so they only
- * maintain immutability and idempotency as long as the input dom elements
- * do not change.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author cbateman
- *
- */
-public class ElementToTagIdentifierMapping extends
- AbstractObjectInjectiveSetMapping
-{
- public Object map(Object element) {
- Element domElement = (Element) element;
- return TagIdentifierFactory.createDocumentTagWrapper(domElement);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/set/mapping/package-info.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/set/mapping/package-info.java
deleted file mode 100644
index 52c667a..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/set/mapping/package-info.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-/**
- * JSF Core Set Mapping.
- *
- * <p><b>Provisional API - subject to change</b></p>
- */
-package org.eclipse.jst.jsf.core.set.mapping;
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/tagmatcher/EvaluationException.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/tagmatcher/EvaluationException.java
deleted file mode 100644
index 0774212..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/tagmatcher/EvaluationException.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tagmatcher;
-
-/**
- * Wraps an exception thrown during algorithm evaluation
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author cbateman
- *
- */
-public class EvaluationException extends RuntimeException {
-
- /**
- *
- */
- private static final long serialVersionUID = -3250608181004283586L;
-
- /**
- *
- */
- public EvaluationException() {
- super();
- }
-
- /**
- * @param message
- */
- public EvaluationException(String message) {
- super(message);
- }
-
- /**
- * @param cause
- */
- public EvaluationException(Throwable cause) {
- super(cause);
- }
-
- /**
- * @param message
- * @param cause
- */
- public EvaluationException(String message, Throwable cause) {
- super(message, cause);
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/tagmatcher/InvalidExpressionException.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/tagmatcher/InvalidExpressionException.java
deleted file mode 100644
index 2651db8..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/tagmatcher/InvalidExpressionException.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tagmatcher;
-
-/**
- * Indicates an exception trapped while compiling or evaluating an
- * expression.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author cbateman
- *
- */
-public class InvalidExpressionException extends RuntimeException {
- /**
- *
- */
- private static final long serialVersionUID = 1445871263234840885L;
-
- /**
- * @see RuntimeException
- */
- public InvalidExpressionException() {
- super();
- }
-
- /**
- * @param message
- * @param cause
- */
- public InvalidExpressionException(String message, Throwable cause) {
- super(message, cause);
- }
-
- /**
- * @param message
- */
- public InvalidExpressionException(String message) {
- super(message);
- }
-
- /**
- * @param cause
- */
- public InvalidExpressionException(Throwable cause) {
- super(cause);
- }
-
-
-
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/tagmatcher/TagMatchingAlgorithm.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/tagmatcher/TagMatchingAlgorithm.java
deleted file mode 100644
index 11bce86..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/tagmatcher/TagMatchingAlgorithm.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tagmatcher;
-
-import org.eclipse.jst.jsf.common.sets.AxiomaticSet;
-import org.w3c.dom.Node;
-
-/**
- * An algorithm that can be applied at a particular DOM node. The result
- * may be expressed as a boolean or a set of matching nodes. The following
- * are equivalent:
- *
- * false and empty set
- * true and non-empty set
- *
- * Concrete implementations must be idempotent on evaluate():
- *
- * 1) evaluate(node) must always return the same set if called repeatedly on
- * the same node in the same DOM tree.
- * 2) evaluate must be able to be called on any number of nodes in order and always
- * produce the same result independent of what was called before and in what order.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author cbateman
- *
- */
-public abstract class TagMatchingAlgorithm
-{
- private boolean _isInvalid; // = false;
-
- private boolean _isInitialized;
- /**
- * The expression being passed to the algorithm
- */
- protected final String _expression;
-
- /**
- * Constructor.
- *
- * @param expression
- */
- protected TagMatchingAlgorithm(String expression)
- {
- _expression = expression;
- }
-
- /**
- * Called exactly once to initialize any pre-evaluation setup for
- * the expression set for the algorithm. This is public to allow
- * the client control when this initialization occurs in case it is expensive.
- * evaluate() will call this method automatically if it has never been called
- * @throws InvalidExpressionException if the underlying algorithm throws an
- * exception during init
- * @throws IllegalStateException if it has already been determined that the
- * expression is invalid.
- */
- public final void initialize()
- {
- if (_isInvalid)
- {
- throw new IllegalStateException("Expression: "+_expression+" has already been determined to be invalid");
- }
-
- if (!_isInitialized)
- {
- try
- {
- doInitialize();
- }
- catch (Exception e)
- {
- _isInvalid = true;
- throw new InvalidExpressionException(e);
- }
- _isInitialized = true;
- }
- }
-
- /**
- * @param applyTo
- * @return the set matching the configured expression applied to applyTo
- * using the algorithm represented by this instance.
- * @throws InvalidExpressionException of a problem occurs initializing the expression
- * @throws EvaluationException if the internal algorithm throws an exception while
- * evaluating.
- * @throws IllegalStateException if evaluate is called again once InvalidExpressionException
- * has already been thrown.
- */
- public final AxiomaticSet evaluate(Node applyTo)
- {
- initialize();
- return doEvaluate(applyTo);
- }
-
- /**
- * Implementers must override to the evaluation of the target,expression pair
- * @param target
- * @return the algorithm evaluated with
- */
- protected abstract AxiomaticSet doEvaluate(Node target);
-
- /**
- * Do any initialization that is required before the algorithm is used
- * to evaluate an expression on any node. This will get called exactly once and
- * is guaranteed to be called, at latest, immediately before doEvaluate
- *
- * Method may throw runtime exceptions. These will be repropagated as
- * InvalidExpressionException's with the original exception wrapped.
- * @throws Exception
- */
- protected abstract void doInitialize() throws Exception;
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/tagmatcher/XPathMatchingAlgorithm.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/tagmatcher/XPathMatchingAlgorithm.java
deleted file mode 100644
index 9ce74dd..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/tagmatcher/XPathMatchingAlgorithm.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tagmatcher;
-
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathExpression;
-import javax.xml.xpath.XPathExpressionException;
-import javax.xml.xpath.XPathFactory;
-
-import org.eclipse.jst.jsf.common.sets.AxiomaticSet;
-import org.eclipse.jst.jsf.common.sets.ConcreteAxiomaticSet;
-import org.eclipse.jst.jsf.common.sets.NodeSet;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * A algorithm that uses an XPath expression to evaluate a result. The
- * algorithm assumes (although cannot verify beforehand) that the expression
- * provided can be evaluated with a node set return type (see JAXP). If the
- * algorithm's underlying XPath evaluator throws an exception indicating that
- * the return type cannot be coerced to a node set, the algorithm will return
- * an empty set (no match) unless the strictMatching flag is set to true, in which
- * case it will re-throw the exception wrapped as an unchecked EvaluationException.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author cbateman
- *
- */
-public class XPathMatchingAlgorithm extends TagMatchingAlgorithm
-{
- private final boolean _isStrictMatching;
- private final XPath _xpath;
- private XPathExpression _compiledExpr;
-
- /**
- * @param expression
- */
- public XPathMatchingAlgorithm(String expression)
- {
- this(expression, false);
- }
-
- /**
- * @param expression
- * @param isStrictMatching
- */
- public XPathMatchingAlgorithm(String expression, boolean isStrictMatching)
- {
- super(expression);
- _isStrictMatching = isStrictMatching;
- _xpath = XPathFactory.newInstance().newXPath();
- }
-
- protected AxiomaticSet doEvaluate(Node target)
- {
- try
- {
- NodeList nodeList =
- (NodeList) _compiledExpr.evaluate(target, XPathConstants.NODESET);
- return new NodeSet(nodeList);
- }
- catch (XPathExpressionException xpam)
- {
- if (_isStrictMatching)
- {
- throw new EvaluationException(xpam);
- }
- // if not strict checking, return empty set
- return new ConcreteAxiomaticSet();
- }
- }
-
- protected void doInitialize() throws XPathExpressionException {
- // compile the xpath expr
- _compiledExpr = _xpath.compile(_expression);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/tagmatcher/package-info.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/tagmatcher/package-info.java
deleted file mode 100644
index 6f1afd5..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/tagmatcher/package-info.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-/**
- * JSF Core Tag Matching Support.
- *
- * <p><b>Provisional API - subject to change</b></p>
- */
-package org.eclipse.jst.jsf.core.tagmatcher;
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/DTAppManagerUtil.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/DTAppManagerUtil.java
deleted file mode 100644
index 8d97815..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/DTAppManagerUtil.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IWorkspaceContextResolver;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.internal.IStructuredDocumentContextResolverFactory2;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.designtime.context.DTFacesContext;
-import org.eclipse.jst.jsf.designtime.internal.view.IDTViewHandler;
-import org.eclipse.jst.jsf.designtime.internal.view.IViewDefnAdapter;
-import org.eclipse.jst.jsf.designtime.internal.view.IViewDefnAdapterFactory;
-import org.eclipse.jst.jsf.designtime.internal.view.IViewRootHandle;
-import org.eclipse.jst.jsf.designtime.internal.view.XMLViewDefnAdapter;
-import org.eclipse.jst.jsf.designtime.internal.view.IDTViewHandler.ViewHandlerException;
-
-/**
- * Utility methods for dealing with {@link DesignTimeApplicationManager}
- *
- * @author cbateman
- *
- */
-public class DTAppManagerUtil
-{
- /**
- * @param context
- * @return the view adapter for context or null if none.
- */
- public static XMLViewDefnAdapter getXMLViewDefnAdapter(
- final IStructuredDocumentContext context)
- {
- final IWorkspaceContextResolver wkResolver =
- IStructuredDocumentContextResolverFactory.INSTANCE
- .getWorkspaceContextResolver(context);
-
- final IProject project = wkResolver.getProject();
- final IResource res = wkResolver.getResource();
-
- if (project != null && res instanceof IFile)
- {
- return getXMLViewDefnAdapter(project, (IFile) res);
- }
- // not found
- return null;
- }
-
- /**
- * Equivalent to getXMLViewDefnAdapter(file.getProject(), file)
- *
- * @param file
- * @return the XMLViewDefnAdapter or null
- */
- public static XMLViewDefnAdapter getXMLViewDefnAdapter(final IFile file)
- {
- return getXMLViewDefnAdapter(file.getProject(), file);
- }
-
- /**
- * @param project
- * @param file
- * @return an XMLViewDefnAdapter for file in project or null if not
- * applicable
- */
- public static XMLViewDefnAdapter getXMLViewDefnAdapter(
- final IProject project, final IFile file)
- {
- final DesignTimeApplicationManager manager =
- DesignTimeApplicationManager.getInstance(project);
-
- if (manager == null)
- {
- return null;
- }
- final IDTViewHandler viewHandler =
- DesignTimeApplicationManager.getInstance(project)
- .getViewHandler();
- try
- {
- final DTFacesContext facesContext = manager.getFacesContext(file);
-
- if (facesContext != null)
- {
- final IViewDefnAdapterFactory factory =
- viewHandler.getViewMetadataAdapterFactory(facesContext);
- final IViewDefnAdapter adapter =
- factory.createAdapter(facesContext, viewHandler.getViewId(
- facesContext, file));
-
- if (adapter instanceof XMLViewDefnAdapter)
- {
- return (XMLViewDefnAdapter) adapter;
- }
- }
- }
- catch (final ViewHandlerException e)
- {
- JSFCorePlugin.log(e, "");
- }
- return null;
- }
-
- /**
- * @param project
- * @return the view handler for project or null if none.
- */
- public static IDTViewHandler getViewHandler(final IProject project)
- {
- final DesignTimeApplicationManager manager =
- DesignTimeApplicationManager.getInstance(project);
-
- if (manager == null)
- {
- return null;
- }
- return DesignTimeApplicationManager.getInstance(project)
- .getViewHandler();
- }
-
- /**
- * @param context
- * @return the view root handle from this context or null if can't get one.
- *
- */
- public static IViewRootHandle getViewRootHandle(final IStructuredDocumentContext context)
- {
- final IWorkspaceContextResolver resolver = IStructuredDocumentContextResolverFactory2.INSTANCE
- .getWorkspaceContextResolver(context);
-
- if (resolver == null)
- {
- return null;
- }
- IProject project = null;
- project = resolver.getProject();
-
- if (project == null)
- {
- return null;
- }
-
- final DesignTimeApplicationManager manager = DesignTimeApplicationManager
- .getInstance(project);
-
- if (manager != null)
- {
- final IResource res = resolver.getResource();
- if (res instanceof IFile)
- {
- final DTFacesContext facesContext = manager
- .getFacesContext((IFile) res);
- if (facesContext != null)
- {
- return facesContext.getViewRootHandle();
- }
- }
- }
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/DesignTimeApplicationManager.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/DesignTimeApplicationManager.java
deleted file mode 100644
index 288eb27..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/DesignTimeApplicationManager.java
+++ /dev/null
@@ -1,664 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.designtime;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.util.Properties;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jst.jsf.common.internal.resource.IResourceLifecycleListener;
-import org.eclipse.jst.jsf.common.internal.resource.LifecycleListener;
-import org.eclipse.jst.jsf.common.internal.resource.ResourceLifecycleEvent;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigUtils;
-import org.eclipse.jst.jsf.designtime.context.AbstractDTExternalContextFactory;
-import org.eclipse.jst.jsf.designtime.context.DTFacesContext;
-import org.eclipse.jst.jsf.designtime.context.IExternalContextFactoryLocator;
-import org.eclipse.jst.jsf.designtime.el.AbstractDTMethodResolver;
-import org.eclipse.jst.jsf.designtime.el.AbstractDTPropertyResolver;
-import org.eclipse.jst.jsf.designtime.el.AbstractDTVariableResolver;
-import org.eclipse.jst.jsf.designtime.internal.BasicExtensionFactory.ExtensionData;
-import org.eclipse.jst.jsf.designtime.internal.view.AbstractDTViewHandler;
-import org.eclipse.jst.jsf.designtime.internal.view.IDTViewHandler;
-
-/**
- * Per-web-application manager that manages design time information for a
- * corresponding project.
- *
- * TODO: migrate to managed singleton
- *
- * @author cbateman
- *
- */
-public final class DesignTimeApplicationManager
-{
- // TODO: load from property file?
- private static final String PROPERTY_QUALIFIER = "org.eclipse.jst.jsf.designtime.internal"; //$NON-NLS-1$
- private static final String SESSION_PROPERTY_NAME_PROJECT = "DesignTimeApplicationManager"; //$NON-NLS-1$
- private static final QualifiedName SESSION_PROPERTY_KEY_PROJECT = new QualifiedName(
- PROPERTY_QUALIFIER,
- SESSION_PROPERTY_NAME_PROJECT);
-
- private static final String SESSION_PROPERTY_NAME_FACES_CONTEXT = "DTFacesContext"; //$NON-NLS-1$
- private static final QualifiedName SESSION_PROPERTY_KEY_FACES_CONTEXT = new QualifiedName(
- PROPERTY_QUALIFIER,
- SESSION_PROPERTY_NAME_FACES_CONTEXT);
-
- private static final String PERSIST_PROPERTY_NAME_EXTERNAL_CONTEXT_PROVIDER = "ExternalContextProvider"; //$NON-NLS-1$
- private static final QualifiedName PERSIST_PROPERTY_KEY_EXTERNAL_CONTEXT_PROVIDER = new QualifiedName(
- PROPERTY_QUALIFIER,
- PERSIST_PROPERTY_NAME_EXTERNAL_CONTEXT_PROVIDER);
-
- private static final String PERSIST_PROPERTY_NAME_VARIABLE_RESOLVER_PROVIDER = "VariableResolverProvider"; //$NON-NLS-1$
- private static final QualifiedName PERSIST_PROPERTY_KEY_VARIABLE_RESOLVER_PROVIDER = new QualifiedName(
- PROPERTY_QUALIFIER,
- PERSIST_PROPERTY_NAME_VARIABLE_RESOLVER_PROVIDER);
-
- private static final String PERSIST_PROPERTY_NAME_PROPERTY_RESOLVER_PROVIDER = "PropertyResolverProvider"; //$NON-NLS-1$
- private static final QualifiedName PERSIST_PROPERTY_KEY_PROPERTY_RESOLVER_PROVIDER = new QualifiedName(
- PROPERTY_QUALIFIER,
- PERSIST_PROPERTY_NAME_PROPERTY_RESOLVER_PROVIDER);
-
- private static final String PERSIST_PROPERTY_NAME_METHOD_RESOLVER_PROVIDER = "MethodResolverProvider"; //$NON-NLS-1$
- private static final QualifiedName PERSIST_PROPERTY_KEY_METHOD_RESOLVER_PROVIDER = new QualifiedName(
- PROPERTY_QUALIFIER,
- PERSIST_PROPERTY_NAME_METHOD_RESOLVER_PROVIDER);
-
- private static final String PERSIST_PROPERTY_NAME_VIEW_HANDLER = "ViewHandler"; //$NON-NLS-1$
-
- private static final String DEFAULT_EXTERNAL_CONTEXT_ID = "org.eclipse.jst.jsf.core.externalcontext.default"; //$NON-NLS-1$
-
- private static final String DEFAULT_VARIABLE_RESOLVER_ID = "org.eclipse.jst.jsf.core.variableresolver.default.decorative"; //$NON-NLS-1$
-
- private static final String DEFAULT_PROPERTY_RESOLVER_ID = "org.eclipse.jst.jsf.core.propertyresolver.default.decorative"; //$NON-NLS-1$
-
- private static final String DEFAULT_METHOD_RESOLVER_ID = "org.eclipse.jst.jsf.core.methodresolver.default"; //$NON-NLS-1$
-
- private static final String DEFAULT_VIEW_HANDLER_ID = "org.eclipse.jst.jsf.designtime.view.jspviewhandler"; //$NON-NLS-1$
-
- /**
- * @param project
- * @return the app manager associated with project
- */
- public final static DesignTimeApplicationManager getInstance(
- final IProject project)
- {
- if (!hasJSFDesignTime(project))
- {
- return null;
- }
-
- try
- {
- synchronized (project)
- {
- DesignTimeApplicationManager manager = (DesignTimeApplicationManager) project
- .getSessionProperty(SESSION_PROPERTY_KEY_PROJECT);
-
- if (manager == null)
- {
- manager = new DesignTimeApplicationManager(project);
- project.setSessionProperty(SESSION_PROPERTY_KEY_PROJECT,
- manager);
-
- final DesignTimeApplicationManager localManager = manager;
- localManager._lifecycleListener
- .addListener(new IResourceLifecycleListener()
- {
- public EventResult acceptEvent(
- ResourceLifecycleEvent event)
- {
- if (event.getAffectedResource() == project)
- {
- if (event.getEventType() == ResourceLifecycleEvent.EventType.RESOURCE_INACCESSIBLE
- && event.getReasonType() == ResourceLifecycleEvent.ReasonType.RESOURCE_PROJECT_CLOSED)
- {
- synchronized (project)
- {
- localManager.dispose();
- }
- return EventResult.getDisposeAfterEventResult();
- }
- }
- return EventResult.getDefaultEventResult();
- }
- });
- }
-
- // bug 147729: if project was renamed, the project param will be
- // valid, but it will not be in sync with the one for _project
- // unfortunately, since we are using session propertie
- else
- {
- synchronized (manager)
- {
- if (!project.equals(manager._project))
- {
- manager._project = project;
- }
- }
- }
-
- return manager;
- }
- }
- catch (final CoreException ce)
- {
- Platform
- .getLog(JSFCorePlugin.getDefault().getBundle())
- .log(
- new Status(
- IStatus.ERROR,
- JSFCorePlugin.getDefault().getBundle()
- .getSymbolicName(),
- 0,
- "Problem loading design time appmanager", new Throwable(ce))); //$NON-NLS-1$
- }
-
- return null;
- }
-
- private void dispose()
- {
- if (_isDisposed.compareAndSet(false, true))
- {
- // dispose viewhandler
- IDTViewHandler handler = removeViewHandler();
-
- if (handler != null)
- {
- handler.dispose();
- }
- }
- }
-
- /**
- * <p>
- * The criteria for a project having a JSF design time are:
- * </p>
- *
- * <ul>
- * <li>project is non-null.</li>
- * <li>project is accessible (project.isAccessible() == true)</li>
- * <li>project has a JSF facet (this implies that it's dependent facets are
- * also present).</li>
- * </ul>
- *
- * @param project
- * @return true if project can have a JSF DesignTimeApplicationManager
- * associated with it. getInstance(project) uses this determine if
- * should construct an instance for a project.
- */
- public static boolean hasJSFDesignTime(final IProject project)
- {
- return project != null && project.isAccessible()
- && JSFAppConfigUtils.isValidJSFProject(project);
- }
-
- // instance definition
- // _project must be writable in case the manager needs to be retargetted
- // after a rename/move etc.
- private IProject _project;
- private final IExternalContextFactoryLocator _locator;
- // private IDTViewHandler _viewHandler;
- private final Properties _properties;
- private final LifecycleListener _lifecycleListener;
- private final AtomicBoolean _isDisposed;
-
- private DesignTimeApplicationManager(final IProject project)
- {
- _project = project;
- _locator = new MyExternalContextFactoryLocator();
- _properties = loadProperties(_project);
- _isDisposed = new AtomicBoolean();
- _lifecycleListener = new LifecycleListener(_project);
- }
-
- /**
- * @param file
- * must not be null
- * @return the faces context for the file or null if not found
- */
- public DTFacesContext getFacesContext(final IFile file)
- {
- if (!hasDTFacesContext(file))
- {
- return null;
- }
-
- try
- {
- synchronized (file)
- {
- Object context = file
- .getSessionProperty(SESSION_PROPERTY_KEY_FACES_CONTEXT);
- if (context == null)
- {
- context = new DTFacesContext(file, _locator);
- ((DTFacesContext) context).initialize(_lifecycleListener);
- file.setSessionProperty(SESSION_PROPERTY_KEY_FACES_CONTEXT,
- context);
- }
- return (DTFacesContext) context;
- }
- }
- catch (final CoreException ce)
- {
- Platform.getLog(JSFCorePlugin.getDefault().getBundle()).log(
- new Status(IStatus.ERROR, JSFCorePlugin.getDefault()
- .getBundle().getSymbolicName(), 0,
- "Problem loading design time facescontext", //$NON-NLS-1$
- new Throwable(ce)));
- }
-
- return null;
- }
-
- /**
- * Only files for which a runtime request context will be generated have a
- * corresponding design time context. This is generally confined to view
- * definition files such as JSP's.
- *
- * General criteria for a file to have a design time faces context are: -
- * the file is non-null and isAccessible() - the file has designtime view
- * handler (getViewHandler(file) != null) and it supports the content type
- * of file.
- *
- * getFacesContext uses this to decide whether to generate a context for an
- * IFile.
- *
- * @param file
- * @return true if file has a design time faces context
- */
- public boolean hasDTFacesContext(final IFile file)
- {
- final IDTViewHandler viewHandler = getViewHandler();
-
- if (file != null && file.isAccessible() && viewHandler != null
- && viewHandler.supportsViewDefinition(file))
- {
- return true;
- }
- return false;
- }
-
- /**
- * @return the design time view handler for this webap (project).
- */
- public synchronized IDTViewHandler getViewHandler()
- {
- final String viewHandlerId = getFromProjectSettings(
- PERSIST_PROPERTY_NAME_VIEW_HANDLER, DEFAULT_VIEW_HANDLER_ID);
-
- if (viewHandlerId != null)
- {
- final AbstractDTViewHandler viewHandler = JSFCorePlugin.getViewHandlers(viewHandlerId).getInstance(
- _project);
- viewHandler.setLifecycleListener(_lifecycleListener);
- return viewHandler;
- }
-
- return null;
- }
-
- /**
- * @return the view handler, removing the instance from any caching
- */
- private synchronized IDTViewHandler removeViewHandler()
- {
- final String viewHandlerId = getFromProjectSettings(
- PERSIST_PROPERTY_NAME_VIEW_HANDLER, DEFAULT_VIEW_HANDLER_ID);
-
- if (viewHandlerId != null)
- {
- return JSFCorePlugin.getViewHandlers(viewHandlerId).removeInstance(_project);
- }
- return null;
- }
-
- /**
- * Sets the persistent id on this project that will be used to load the view
- * handler.
- *
- * @param viewHandlerId
- */
- public synchronized void setViewHandlerId(final String viewHandlerId)
- {
- setProjectSetting(PERSIST_PROPERTY_NAME_VIEW_HANDLER, viewHandlerId);
- }
-
- /**
- * @param resolverPluginId
- * @throws CoreException
- */
- public synchronized void setExternalContextProvider(
- final String resolverPluginId) throws CoreException
- {
- _project.setPersistentProperty(
- PERSIST_PROPERTY_KEY_EXTERNAL_CONTEXT_PROVIDER,
- resolverPluginId);
- }
-
- /**
- * @return the id of the active design time external context provider
- */
- public synchronized String getExternalContextProvider()
- {
- return getResolverId(PERSIST_PROPERTY_KEY_EXTERNAL_CONTEXT_PROVIDER,
- DEFAULT_EXTERNAL_CONTEXT_ID);
- }
-
- /**
- * @return the designtime variable resolver for this application
- */
- public synchronized AbstractDTVariableResolver getVariableResolver()
- {
- ExtensionData<AbstractDTVariableResolver> extData = null;
-
- final String id = getResolverId_OLD(PERSIST_PROPERTY_KEY_VARIABLE_RESOLVER_PROVIDER);
- if (id != null)
- {
- extData = JSFCorePlugin.getVariableResolvers(id);
- }
-
- if (extData == null)
- {
- extData = JSFCorePlugin
- .getVariableResolvers(DEFAULT_VARIABLE_RESOLVER_ID);
- }
-
- return extData.getInstance(_project);
- }
-
- /**
- * Sets the plugin used to determine the designtime variable resolver. To
- * reset to the default, pass null.
- *
- * @param resolverPluginId
- * @throws CoreException --
- * if the setting the new value fails
- */
- public synchronized void setVariableResolverProvider(
- final String resolverPluginId) throws CoreException
- {
- _project.setPersistentProperty(
- PERSIST_PROPERTY_KEY_VARIABLE_RESOLVER_PROVIDER,
- resolverPluginId);
- }
-
- /**
- * @return the id of the active design time variable resolver
- */
- public synchronized String getVariableResolverProvider()
- {
- return getResolverId(PERSIST_PROPERTY_KEY_VARIABLE_RESOLVER_PROVIDER,
- DEFAULT_VARIABLE_RESOLVER_ID);
- }
-
- /**
- * @return the default property resolver that will be used if no other is
- * provided. The default property resolver is intended to match the
- * similar resolver used by the runtime.
- */
- public synchronized AbstractDTPropertyResolver getDefaultPropertyResolver()
- {
- return JSFCorePlugin.getPropertyResolver(DEFAULT_PROPERTY_RESOLVER_ID)
- .getInstance(_project);
- }
-
- /**
- * @return the designtime property resolver for this application
- */
- public synchronized AbstractDTPropertyResolver getPropertyResolver()
- {
- ExtensionData<AbstractDTPropertyResolver> extData = null;
-
- final String id = getResolverId_OLD(PERSIST_PROPERTY_KEY_PROPERTY_RESOLVER_PROVIDER);
- if (id != null)
- {
- extData = JSFCorePlugin.getPropertyResolver(id);
- }
-
- if (extData == null)
- {
- extData = JSFCorePlugin
- .getPropertyResolver(DEFAULT_PROPERTY_RESOLVER_ID);
- }
-
- return extData.getInstance(_project);
- }
-
- /**
- * @param resolverPluginId
- * @throws CoreException --
- * if setting the provider fails
- */
- public synchronized void setPropertyResolverProvider(
- final String resolverPluginId) throws CoreException
- {
- _project.setPersistentProperty(
- PERSIST_PROPERTY_KEY_PROPERTY_RESOLVER_PROVIDER,
- resolverPluginId);
- }
-
- /**
- * @return the id of the active design time variable resolver
- */
- public synchronized String getPropertyResolverProvider()
- {
- return getResolverId(PERSIST_PROPERTY_KEY_PROPERTY_RESOLVER_PROVIDER,
- DEFAULT_PROPERTY_RESOLVER_ID);
- }
-
- /**
- * @return the designtime method resolver for this application
- */
- public synchronized AbstractDTMethodResolver getMethodResolver()
- {
- ExtensionData<AbstractDTMethodResolver> extData = null;
-
- final String id = getResolverId_OLD(PERSIST_PROPERTY_KEY_METHOD_RESOLVER_PROVIDER);
- if (id != null)
- {
- extData = JSFCorePlugin.getMethodResolvers(id);
- }
-
- if (extData == null)
- {
- extData = JSFCorePlugin
- .getMethodResolvers(DEFAULT_METHOD_RESOLVER_ID);
- }
-
- return extData.getInstance(_project);
- }
-
- /**
- * @param resolverPluginId
- * @throws CoreException --
- * if setting the plugin fails
- */
- public synchronized void setMethodResolverProvider(
- final String resolverPluginId) throws CoreException
- {
- _project
- .setPersistentProperty(
- PERSIST_PROPERTY_KEY_METHOD_RESOLVER_PROVIDER,
- resolverPluginId);
-
- }
-
- /**
- * @return the id of the active design time variable resolver
- */
- public synchronized String getMethodResolverProvider()
- {
- return getResolverId(PERSIST_PROPERTY_KEY_METHOD_RESOLVER_PROVIDER,
- DEFAULT_METHOD_RESOLVER_ID);
- }
-
- private String getResolverId_OLD(final QualifiedName pluginKey)
- {
- String pluginId = null;
-
- try
- {
- pluginId = _project.getPersistentProperty(pluginKey);
- }
- catch (final CoreException ce)
- {
- JSFCorePlugin.getDefault().getLog().log(
- new Status(IStatus.ERROR, JSFCorePlugin.PLUGIN_ID, 0,
- "Error getting plugin property", //$NON-NLS-1$
- ce));
- pluginId = null;
- // fall-through and use the default
- }
-
- return pluginId;
- }
-
- private String getResolverId(final QualifiedName key,
- final String defaultValue)
- {
- String id = defaultValue;
-
- try
- {
- final String userId = _project.getPersistentProperty(key);
-
- if (userId != null)
- {
- id = userId;
- }
- }
- catch (final CoreException ce)
- {
- // do nothing; fall through and return default
- }
-
- return id;
- }
-
- private class MyExternalContextFactoryLocator implements
- IExternalContextFactoryLocator
- {
- public AbstractDTExternalContextFactory getFactory()
- {
- ExtensionData<AbstractDTExternalContextFactory> extData = null;
-
- final String id = getResolverId_OLD(PERSIST_PROPERTY_KEY_EXTERNAL_CONTEXT_PROVIDER);
- if (id != null)
- {
- extData = JSFCorePlugin.getExternalContextProviders(id);
- }
-
- if (extData == null)
- {
- extData = JSFCorePlugin
- .getExternalContextProviders(DEFAULT_EXTERNAL_CONTEXT_ID);
- }
-
- return extData.getInstance(_project);
- }
- }
-
- private String getFromProjectSettings(final String key,
- final String defaultValue)
- {
- return _properties.getProperty(key, defaultValue);
- }
-
- private void setProjectSetting(final String key, final String value)
- {
- _properties.setProperty(key, value);
- storeProperties(_properties);
- }
-
- private void storeProperties(final Properties properties)
- {
- IFile propFile;
- try
- {
- propFile = getPropsFile(_project);
- if (propFile != null)
- {
- final ByteArrayOutputStream outstream = new ByteArrayOutputStream();
- properties.store(outstream, null);
- propFile.setContents(new ByteArrayInputStream(outstream
- .toByteArray()), true, true, null);
- }
- }
- catch (final CoreException e)
- {
- JSFCorePlugin.log(e, "Problem storing properties");
- }
- catch (final IOException e)
- {
- JSFCorePlugin.log(e, "Problem storing properties");
- }
- }
-
- private Properties loadProperties(final IProject project)
- {
- final Properties props = new Properties();
- try
- {
- final IFile propFile = getPropsFile(project);
-
- if (propFile != null)
- {
- props.load(propFile.getContents());
- }
- }
- catch (final CoreException ce)
- {
- JSFCorePlugin.log(ce, "Problem loading properties");
- }
- catch (final IOException ce)
- {
- JSFCorePlugin.log(ce, "Problem loading properties");
- }
-
- return props;
- }
-
- private IFile getPropsFile(final IProject project) throws CoreException
- {
- final IFolder folder = project.getFolder(new Path(".settings"));
- if (!folder.exists())
- {
- folder.create(false, true, null);
- }
-
- final IFile file = folder.getFile(new Path(
- "org.eclipse.jst.jsf.designtime.appmgr.prefs"));
-
- if (!file.exists())
- {
- file.create(new ByteArrayInputStream(new byte[0]), false, null);
- }
-
- return file;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/context/AbstractDTExternalContext.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/context/AbstractDTExternalContext.java
deleted file mode 100644
index b0bac6a..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/context/AbstractDTExternalContext.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.context;
-
-import java.util.Collections;
-import java.util.Map;
-
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.context.symbol.source.ISymbolConstants;
-
-/**
- * The parent of all IDTExternalContext implementations
- *
- * Clients must sub-class to create IDTExternalContext implementations
- *
- * @author cbateman
- *
- */
-public abstract class AbstractDTExternalContext implements IDTExternalContext
-{
-
- /**
- * Return a map of available symbols in each of the masked scopes
- * indexed by symbol name
- *
- * Called by {@link #getMapForScope(int)} to satify the interface.
- * If null is returned {@link #getMapForScope(int)} will automatically
- * return an EMPTY_MAP.
- *
- * @param scopeMask
- * @return the map of symbols
- */
- protected abstract Map<String, ISymbol> doGetMapForScope(int scopeMask);
-
-
- public final Map<String, ISymbol> getMapForScope(final int scopeMask)
- {
- Map<String, ISymbol> mapForScope = doGetMapForScope(scopeMask);
-
- if (mapForScope == null)
- {
- mapForScope = Collections.EMPTY_MAP;
- }
- else
- {
- mapForScope = Collections.unmodifiableMap(mapForScope);
- }
- return mapForScope;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.designtime.context.IDTExternalContext#getRequestMap()
- */
- public final Map<String, ISymbol> getRequestMap()
- {
- return getMapForScope(ISymbolConstants.SYMBOL_SCOPE_REQUEST);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.designtime.context.IDTExternalContext#getSessionMap()
- */
- public final Map<String, ISymbol> getSessionMap()
- {
- return getMapForScope(ISymbolConstants.SYMBOL_SCOPE_SESSION);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.designtime.context.IDTExternalContext#getApplicationMap()
- */
- public final Map<String, ISymbol> getApplicationMap()
- {
- return getMapForScope(ISymbolConstants.SYMBOL_SCOPE_APPLICATION);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.designtime.context.IDTExternalContext#getNoneMap()
- */
- public final Map<String, ISymbol> getNoneMap()
- {
- return getMapForScope(ISymbolConstants.SYMBOL_SCOPE_NONE);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.designtime.context.IDTExternalContext#getRequestContextPath()
- */
- public String getRequestContextPath()
- {
- // API: do we need to support default behaviour here?
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/context/AbstractDTExternalContextFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/context/AbstractDTExternalContextFactory.java
deleted file mode 100644
index b2fbbbf..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/context/AbstractDTExternalContextFactory.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.designtime.context;
-
-import org.eclipse.core.runtime.IAdaptable;
-
-/**
- * Super-class of all external context factories
- *
- * @author cbateman
- *
- */
-public abstract class AbstractDTExternalContextFactory
-{
- /**
- * @param containerContext
- * @return a new IDTExternalContext for the containerContext refered
- * to by containerContext.
- */
- public abstract IDTExternalContext create(IAdaptable containerContext);
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/context/AbstractExternalContextFactoryLocator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/context/AbstractExternalContextFactoryLocator.java
deleted file mode 100644
index 77ae086..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/context/AbstractExternalContextFactoryLocator.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.context;
-
-/**
- * Parent of all implementers of IExternalContextFactoryLocator
- * @author cbateman
- *
- */
-public abstract class AbstractExternalContextFactoryLocator implements
- IExternalContextFactoryLocator
-{
- /**
- * @return the current external context factory
- */
- public abstract AbstractDTExternalContextFactory getFactory();
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/context/DTFacesContext.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/context/DTFacesContext.java
deleted file mode 100644
index ccecca5..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/context/DTFacesContext.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.designtime.context;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jst.jsf.common.internal.resource.IResourceLifecycleListener;
-import org.eclipse.jst.jsf.common.internal.resource.LifecycleListener;
-import org.eclipse.jst.jsf.common.internal.resource.ResourceLifecycleEvent;
-import org.eclipse.jst.jsf.common.internal.resource.ResourceLifecycleEvent.EventType;
-import org.eclipse.jst.jsf.designtime.DesignTimeApplicationManager;
-import org.eclipse.jst.jsf.designtime.internal.view.IDTViewHandler;
-import org.eclipse.jst.jsf.designtime.internal.view.IViewRootHandle;
-
-/**
- * Represents a design-time version of the JSF FacesContext for a particular web
- * application.
- *
- * Client may not sub-class.
- *
- * @author cbateman
- *
- */
-public final class DTFacesContext
-{
- private final IExternalContextFactoryLocator _locator;
- private final IAdaptable _contextObject;
- private final ViewRootHolder _viewRootHolder;
- private LifecycleListener _lifecycleListener;
- private IResourceLifecycleListener _listener;
-
- /**
- * @param contextObject
- * @param locator
- */
- public DTFacesContext(final IAdaptable contextObject,
- final IExternalContextFactoryLocator locator)
- {
- _contextObject = contextObject;
- _locator = locator;
-
- // init last -- NOTE: it is essential that the new Object be unique
- _viewRootHolder = new ViewRootHolder(this, new Object());
- }
-
- /**
- * @param locator
- * @deprecated Use DTFacesContext(IAdaptable,
- * IExternalContextFactoryLocator)
- */
- @Deprecated
- public DTFacesContext(final IExternalContextFactoryLocator locator)
- {
- _locator = locator;
- _contextObject = null;
-
- // init last -- NOTE: it is essential that the new Object be unique
- _viewRootHolder = new ViewRootHolder(this, new Object());
- }
-
- /**
- * THIS IS NOT AN API METHOD. External clients must not call.
- *
- * initilaize the faces context.
- * @param lifecycleListener
- */
- public void initialize(final LifecycleListener lifecycleListener)
- {
- final IResource res = adaptContextObject();
- _lifecycleListener = lifecycleListener;
-
- if (res != null && _lifecycleListener != null)
- {
- _listener = new IResourceLifecycleListener()
- {
- public EventResult acceptEvent(ResourceLifecycleEvent event)
- {
- if (res.equals(event.getAffectedResource()))
- {
- if (event.getEventType() == EventType.RESOURCE_INACCESSIBLE)
- {
- _lifecycleListener.removeResource(res);
- }
- }
- return EventResult.getDefaultEventResult();
- }
- };
-
- _lifecycleListener.addResource(res);
- _lifecycleListener.addListener(_listener);
- }
- }
-
- /**
- * @param contextObject --
- * the object corresponding to the external context. Usually an
- * IFile point to a file containing the external context. It must
- * be adaptable to an IFile.
- *
- * @return the designtime external context or null if one is not defined for
- * this contextObject
- */
- public IDTExternalContext getDTExternalContext(
- final IAdaptable contextObject)
- {
- IDTExternalContext externalContext = null;
-
- // if the context object is an IFile or can be adapted to one, create a
- // new externalContext for it
- if (contextObject instanceof IFile
- || (contextObject != null && contextObject
- .getAdapter(IFile.class) != null))
- {
-
- final AbstractDTExternalContextFactory factory = _locator
- .getFactory();
- externalContext = factory.create(contextObject);
- }
- return externalContext;
- }
-
- /**
- * <p>
- * Returns a new copy of the view root handle.
- * </p>
- *
- * return null if the value of the view root
- *
- * @return the cached view root. May be null.
- */
- public IViewRootHandle getViewRootHandle()
- {
- return _viewRootHolder.clone();
- }
-
- /**
- * @deprecated
- */
- @Deprecated
- private String _localeString = ""; //$NON-NLS-1$
-
- /**
- * @return the current locale string
- * @deprecated Use IDTViewHandler.calculateLocale instead
- */
- @Deprecated
- public String getLocaleString()
- {
- return _localeString;
- }
-
- /**
- * @param newLocaleString
- * @deprecated Use IDTViewHandler.calculateLocale instead
- */
- @Deprecated
- public void setLocaleString(final String newLocaleString)
- {
- _localeString = newLocaleString;
- }
-
- /**
- * @return the resource correspondinng to context object or null if it
- * cannot be adapted to an IResource
- */
- public IResource adaptContextObject()
- {
- if (_contextObject instanceof IResource)
- {
- return (IResource) _contextObject;
- }
- else if (_contextObject != null
- && _contextObject.getAdapter(IResource.class) != null)
- {
- return (IResource) _contextObject.getAdapter(IResource.class);
- }
- return null;
- }
-
- IDTViewHandler getViewHandler(final IResource res)
- {
- IDTViewHandler viewHandler = null;
-
- if (res != null)
- {
- final DesignTimeApplicationManager manager = DesignTimeApplicationManager
- .getInstance(res.getProject());
- if (manager != null)
- {
- viewHandler = manager.getViewHandler();
- }
- }
- return viewHandler;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/context/DTJSPExternalContext.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/context/DTJSPExternalContext.java
deleted file mode 100644
index 8c870d1..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/context/DTJSPExternalContext.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.designtime.context;
-
-import java.io.PrintStream;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jst.j2ee.web.componentcore.util.WebArtifactEdit;
-import org.eclipse.jst.jsf.common.JSFCommonPlugin;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.context.symbol.source.ISymbolConstants;
-import org.eclipse.jst.jsf.context.symbol.source.ISymbolSourceProvider;
-import org.eclipse.jst.jsf.context.symbol.source.ISymbolSourceProviderFactory;
-
-
-/**
- * A designtime proxy for the Faces ExternalContext
- *
- * Clients may sub-class.
- *
- * @author cbateman
- *
- */
-public class DTJSPExternalContext extends AbstractDTExternalContext
-{
- /**
- *
- */
- private final IFile _jspFile;
-
- /**
- * Construct a default external context
- *
- * @param jspFile
- */
- protected DTJSPExternalContext(final IAdaptable jspFile)
- {
- if (jspFile instanceof IFile)
- {
- _jspFile = (IFile) jspFile;
- }
- else if (jspFile != null)
- {
- IFile file = (IFile) jspFile.getAdapter(IFile.class);
-
- if (file != null)
- {
- _jspFile = file;
- }
- else
- {
- _jspFile = null;
- throw new AssertionError("jspFile must be adapable to an IFile"); //$NON-NLS-1$
- }
- }
- else
- {
- _jspFile = null;
- throw new AssertionError("jspFile must be adapable to an IFile"); //$NON-NLS-1$
- }
- }
-
- @Override
- protected Map doGetMapForScope(final int scopeMask)
- {
- final Map map = new HashMap();
-
- for (final Iterator it = JSFCommonPlugin.getSymbolSourceProviders().iterator(); it.hasNext();)
- {
- final ISymbolSourceProviderFactory factory = (ISymbolSourceProviderFactory) it.next();
- final ISymbolSourceProvider provider = factory.createInstance(_jspFile.getProject());
-
- final ISymbol[] symbols = provider.getSymbols(_jspFile, scopeMask);
-
- for (int i = 0; i < symbols.length; i++)
- {
- map.put(symbols[i].getName(), symbols[i]);
- }
- }
-
- return map;
- }
-
- /**
- * @param stream
- */
- public final void trace(PrintStream stream)
- {
- String[] scopeNames = {ISymbolConstants.SYMBOL_SCOPE_REQUEST_STRING,
- ISymbolConstants.SYMBOL_SCOPE_SESSION_STRING,
- ISymbolConstants.SYMBOL_SCOPE_APPLICATION_STRING,
- ISymbolConstants.SYMBOL_SCOPE_NONE_STRING
- };
- Map[] symbolMaps = {getRequestMap(), getSessionMap(), getApplicationMap(), getNoneMap()};
-
- for (int i = 0; i < scopeNames.length; i++)
- {
- stream.println("--------------"); //$NON-NLS-1$
- stream.println(scopeNames[i]+" Scope:"); //$NON-NLS-1$
- stream.println("--------------"); //$NON-NLS-1$
-
- for (final Iterator it = symbolMaps[i].values().iterator(); it.hasNext();)
- {
- ISymbol symbol = (ISymbol) it.next();
- System.out.println(symbol.getName());
- }
- }
- }
-
- @Override
- public String getRequestContextPath()
- {
- WebArtifactEdit artifactEdit = null;
- String path = null;
-
- try
- {
- // TODO: EARs?
- artifactEdit =
- WebArtifactEdit.getWebArtifactEditForRead(_jspFile.getProject());
- path = artifactEdit.getServerContextRoot();
- }
- finally
- {
- if (artifactEdit != null)
- {
- artifactEdit.dispose();
- }
- }
- return path;
- }
-
-// @Override
-// public String getRequestPathInfo() {
-// // TODO Auto-generated method stub
-// return super.getRequestPathInfo();
-// }
-//
-// @Override
-// public String getRequestServletPath() {
-// // TODO Auto-generated method stub
-// return super.getRequestServletPath();
-// }
-
-// private void getWebApp()
-// {
-// final IProject project = _jspFile.getProject();
-//
-// final IModelProvider provider =
-// ModelProviderManager.getModelProvider(project);
-// Object webAppObj = provider.getModelObject();
-//
-// if (webAppObj != null)
-// {
-// //
-// }
-//
-// }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/context/DefaultDTExternalContextFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/context/DefaultDTExternalContextFactory.java
deleted file mode 100644
index 1d2af78..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/context/DefaultDTExternalContextFactory.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.designtime.context;
-
-import org.eclipse.core.runtime.IAdaptable;
-
-/**
- * Creates external contexts for JSPs
- *
- * Clients may sub-class
- *
- * @author cbateman
- *
- */
-public class DefaultDTExternalContextFactory extends
- AbstractDTExternalContextFactory
-{
-
- /**
- * @param containerContext -- must be adaptable to an IFile of content type
- * JSP
- *
- * @return a new DT external context
- */
- public IDTExternalContext create(final IAdaptable containerContext)
- {
- return new DTJSPExternalContext(containerContext);
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/context/IDTExternalContext.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/context/IDTExternalContext.java
deleted file mode 100644
index 2b76cb8..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/context/IDTExternalContext.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.designtime.context;
-
-import java.util.Map;
-
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-
-/**
- * Interface that must be implemented by all design time external contexts
- *
- * Clients must not implement or sub-class. Sub-class AbstractDTExternalContext instead.
- *
- * @author cbateman
- *
- */
-public interface IDTExternalContext
-{
- /**
- * @param scopeMask -- the scope for which to return the symbol map
- * @return a map of ISymbols representing the currently available
- * scope variables. Never null, empty if no symbols
- *
- * Map is unmodifiable (throws exception on mutation operations)
- */
- Map<String, ISymbol> getMapForScope(int scopeMask);
-
- /**
- * @return a map of ISymbols representing the currently available
- * request scope variables. Never null, empty if no symbols
- *
- * Map is unmodifiable (throws exception on mutation operations)
- */
- Map<String, ISymbol> getRequestMap();
-
- /**
- * @return a map of ISymbols representing the currently available
- * session scope variables. Never null, empty if no symbols
- * Map is unmodifiable (throws exception on mutation operations)
- */
- Map<String, ISymbol> getSessionMap();
-
- /**
- * @return a map of ISymbols representing the currently available
- * application scope variables. Never null, empty if no symbols
- * Map is unmodifiable (throws exception on mutation operations)
- */
- Map<String, ISymbol> getApplicationMap();
-
- /**
- * @return a map of ISymbols representing the currently available
- * none scope variables. Never null, empty if no symbols
- * Map is unmodifiable (throws exception on mutation operations)
- */
- Map<String, ISymbol> getNoneMap();
-
- /**
- * Servlet 2.3_SRV.4.4: The context path of the application.
- *
- * @return the request context path
- */
- String getRequestContextPath();
-
- /**
- * Find all of the possible url-pattern's in the container that
- * could match the underlying resource. Normally this will be single
- * element list. It will only
- *
- * @return
- */
-// List<String> getAllContainerMappings();
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/context/IExternalContextFactoryLocator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/context/IExternalContextFactoryLocator.java
deleted file mode 100644
index 0842ed8..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/context/IExternalContextFactoryLocator.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.designtime.context;
-
-/**
- * This interface is used to decouple the faces context from the
- * DesignTimeApplicationManager
- *
- * Client must NOT implement or subclass.
- * Extend AbstractExternalContextFactoryLocator instead
- *
- * @author cbateman
- *
- */
-public interface IExternalContextFactoryLocator
-{
- /**
- * @return the current external context factory
- */
- AbstractDTExternalContextFactory getFactory();
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/context/ViewRootHolder.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/context/ViewRootHolder.java
deleted file mode 100644
index 93821e5..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/context/ViewRootHolder.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-/**
- *
- */
-package org.eclipse.jst.jsf.designtime.context;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.designtime.internal.view.DTUIViewRoot;
-import org.eclipse.jst.jsf.designtime.internal.view.IDTViewHandler;
-import org.eclipse.jst.jsf.designtime.internal.view.IViewRootHandle;
-import org.eclipse.jst.jsf.designtime.internal.view.DTUIViewRoot.StalenessListener;
-import org.eclipse.jst.jsf.designtime.internal.view.IDTViewHandler.ViewHandlerException;
-
-/* package */ final class ViewRootHolder implements IViewRootHandle, Cloneable
-{
- private final Object _recalcViewRootExclusion;
- private final DTFacesContext _facesContext;
- private DTUIViewRoot _viewRoot;
- private final List<StalenessListener> _waitingToAdd;
- private final List<StalenessListener> _waitingToRemove;
-
- public ViewRootHolder(final DTFacesContext facesContext, final Object recalcViewRootExclusion)
- {
- _facesContext = facesContext;
- _recalcViewRootExclusion = recalcViewRootExclusion;
- _waitingToAdd = new ArrayList<StalenessListener>();
- _waitingToRemove = new ArrayList<StalenessListener>();
- }
-
- private ViewRootHolder(ViewRootHolder cloneFrom)
- {
- _recalcViewRootExclusion = cloneFrom._recalcViewRootExclusion;
- _facesContext = cloneFrom._facesContext;
- _viewRoot = cloneFrom.getCachedViewRoot();
-
- // create brand new copies
- _waitingToAdd = new ArrayList<StalenessListener>();
- _waitingToRemove = new ArrayList<StalenessListener>();
- }
-
- public synchronized DTUIViewRoot getCachedViewRoot()
- {
- return _viewRoot;
- }
-
- public DTUIViewRoot updateViewRoot()
- {
- DTUIViewRoot viewRoot = null;
- final IResource contextResource = _facesContext.adaptContextObject();
-
- // we create this additional exclusion so that we avoid a
- // situation
- // where two threads enter and start recalculating the same view
- // root in parallel. Only one thread may be working on creating
- // a new view root for a particular view at any given time. Note
- // that due to read/write lock on the value, there is nothing
- // to stop readers from simultaneous getting the old value until
- // the new value is ready and has been set.
- synchronized (_recalcViewRootExclusion)
- {
- viewRoot = getCachedViewRoot();
-
- if (viewRoot == null || viewRoot.isStale())
- {
- // if the view root hasn't been created, then do so
- // and populate it
- final IDTViewHandler viewHandler = _facesContext
- .getViewHandler(contextResource);
-
- if (viewHandler != null)
- {
- final String viewId = viewHandler.getViewId(
- _facesContext, contextResource);
-
- try
- {
- viewRoot = viewHandler.createView(_facesContext,
- viewId);
- if (viewRoot != null)
- {
- setCachedViewRoot(viewRoot);
- }
-
- // do adds first, let remove trump all
- for (final StalenessListener addListener : _waitingToAdd)
- {
- viewRoot.addListener(addListener);
- }
-
- for (final StalenessListener removeListener : _waitingToRemove)
- {
- viewRoot.removeListener(removeListener);
- }
- }
- catch (final ViewHandlerException e)
- {
- JSFCorePlugin.log(e,
- "While creating dt viewroot for viewId: "
- + viewId);
- }
- }
- }
- }
- // return the copy. NEVER return _viewRoot directly since we are not
- // synchronized here.
- return viewRoot;
- }
-
- private synchronized void setCachedViewRoot(
- final DTUIViewRoot newViewRoot)
- {
- if (!Thread.holdsLock(_recalcViewRootExclusion))
- {
- throw new IllegalStateException(
- "Must hold _recalcViewRootExclusion to modify view root");
- }
- _viewRoot = newViewRoot;
- }
-
- @Override
- protected synchronized IViewRootHandle clone()
- {
- return new ViewRootHolder(this);
- }
-
- public void addListener(StalenessListener listener)
- {
- if (_viewRoot != null)
- {
- synchronized(this)
- {
- _viewRoot.addListener(listener);
- }
- }
- else
- {
- // ensure that if we calculating a new view root, then there isn't
- // an issue.
- synchronized(_recalcViewRootExclusion)
- {
- synchronized(this)
- {
- _waitingToAdd.add(listener);
- }
- }
- }
- }
-
- public void removeListener(StalenessListener listener)
- {
- DTUIViewRoot viewRoot = null;
-
- synchronized(this)
- {
- viewRoot = _viewRoot;
- }
-
- if (viewRoot != null)
- {
- synchronized(this)
- {
- viewRoot.removeListener(listener);
- }
- }
- else
- {
- // ensure that if we calculating a new view root, then there isn't
- // an issue.
- // always acquire the recalcViewRootExclusion first
- synchronized(_recalcViewRootExclusion)
- {
- synchronized(this)
- {
- _waitingToAdd.add(listener);
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/context/package-info.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/context/package-info.java
deleted file mode 100644
index 82480ed..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/context/package-info.java
+++ /dev/null
@@ -1,16 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-/**
- * JSF Design Time Context Simulation Classes.
- */
-package org.eclipse.jst.jsf.designtime.context;
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/el/AbstractDTMethodResolver.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/el/AbstractDTMethodResolver.java
deleted file mode 100644
index da11512..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/el/AbstractDTMethodResolver.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.designtime.el;
-
-import org.eclipse.jst.jsf.context.symbol.IMethodSymbol;
-import org.eclipse.jst.jsf.context.symbol.IObjectSymbol;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-
-/**
- * Sub-class of all design time method resolvers
- *
- * @author cbateman
- *
- */
-public abstract class AbstractDTMethodResolver
-{
- /**
- * Returns a symbol encapsulating the method on base with the name
- * methodId
- *
- * @param base
- * @param methodId
- * @return the symbol for the named methodId or null if not found
- */
- public abstract IMethodSymbol getMethod(IObjectSymbol base, Object methodId);
-
-
- /**
- * @param base
- * @return all method binding symbols for base
- */
- public abstract ISymbol[] getMethods(IObjectSymbol base);
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/el/AbstractDTPropertyResolver.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/el/AbstractDTPropertyResolver.java
deleted file mode 100644
index 33ab9bb..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/el/AbstractDTPropertyResolver.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.designtime.el;
-
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-
-/**
- * Super-class of all design time property resolvers
- *
- * @author cbateman
- *
- */
-public abstract class AbstractDTPropertyResolver
-{
- /**
- * Returns a symbol encapsulating the property on base with the name
- * properyId. Note that getProperty may return *more* property symbols
- * for the same 'base' because some ISymbol's have unconstrained type
- * descriptors. For example, a bean that implements java.util.Map,
- * may have any number of possible properties added at runtime that cannot
- * be determined at design time. It is up to implementers of this interface
- * to decide how (whether) to return these objects at design time
- *
- * @param base
- * @param propertyId
- * @return the symbol for the named propertyId or null if not found
- */
- public abstract ISymbol getProperty(ISymbol base, Object propertyId);
-
- /**
- * @param base
- * @param offset
- * @return the symbol for the property referred to by the offset
- * into base when it is treated as either an array or a list.
- * The symbol returned is *not* found in the getAllProperties list.
- */
- public abstract ISymbol getProperty(ISymbol base, int offset);
-
- /**
- * @param base
- * @return all properties of base that can be determined concretely
- * at designtime. Note that getProperty(base, x) may return non-null
- * for objects not found in the return from this method. @see getProperty
- */
- public abstract ISymbol[] getAllProperties(ISymbol base);
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/el/AbstractDTVariableResolver.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/el/AbstractDTVariableResolver.java
deleted file mode 100644
index 532fc5d..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/el/AbstractDTVariableResolver.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.designtime.el;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.designtime.context.DTFacesContext;
-
-/**
- * Super-class of all design-time variable resolver. A design time variable
- * resolver
- *
- * Clients may sub-class.
- *
- * @author cbateman
- *
- */
-public abstract class AbstractDTVariableResolver
-{
- /**
- * @param context
- * @param name
- * @param externalContextKey -- an adapter that identifies the external application
- * context within which to resolve name. For example, this could be an IFile
- * representing a JavaServer Page in which we want to resolve the symbol name
- * @return the symbol corresponding to name in the faces context or null
- * if not found
- */
- public abstract ISymbol resolveVariable(DTFacesContext context, String name, IAdaptable externalContextKey);
-
- /**
- * @param facesContext
- * @param externalContextKey
- * @return all variables
- */
- public abstract ISymbol[] getAllVariables(DTFacesContext facesContext,
- IAdaptable externalContextKey);
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/el/DefaultDTMethodResolver.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/el/DefaultDTMethodResolver.java
deleted file mode 100644
index bc6814b..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/el/DefaultDTMethodResolver.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.designtime.el;
-
-import java.util.Iterator;
-
-import org.eclipse.jst.jsf.context.symbol.IMethodSymbol;
-import org.eclipse.jst.jsf.context.symbol.IObjectSymbol;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-
-/**
- * This resolver has no direct analogue at runtime. JSF Components implement
- * method bindings at runtime in a runtime specific way. But at design time
- * we have no direct DTComponent so instead we use this resolver to resolve
- * an IInstanceSymbol and method name to an IMethodSymbol (if one exists).
- *
- * Clients may sub-class
- *
- * @author cbateman
- *
- */
-public class DefaultDTMethodResolver extends AbstractDTMethodResolver
-{
- /**
- * Returns a symbol encapsulating the method on base with the name
- * methodId
- *
- * @param base
- * @param methodId
- * @return the symbol for the named methodId or null if not found
- */
- public IMethodSymbol getMethod(IObjectSymbol base, Object methodId)
- {
- for (final Iterator it = base.getTypeDescriptor().getMethods().iterator(); it.hasNext();)
- {
- IMethodSymbol element = (IMethodSymbol) it.next();
- if (element.getName().equals(methodId))
- {
- return element;
- }
- }
-
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.designtime.el.AbstractDTMethodResolver#getMethods(org.eclipse.jst.jsf.context.symbol.IInstanceSymbol)
- */
- public ISymbol[] getMethods(IObjectSymbol base)
- {
- return (ISymbol[])
- base.getTypeDescriptor().getMethods().
- toArray(new ISymbol[0]);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/el/DefaultDTPropertyResolver.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/el/DefaultDTPropertyResolver.java
deleted file mode 100644
index d4a5eee..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/el/DefaultDTPropertyResolver.java
+++ /dev/null
@@ -1,280 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.designtime.el;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.util.BasicEList;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jst.jsf.common.internal.types.StringLiteralType;
-import org.eclipse.jst.jsf.common.internal.types.TypeConstants;
-import org.eclipse.jst.jsf.common.internal.types.ValueType;
-import org.eclipse.jst.jsf.context.symbol.IBoundedTypeDescriptor;
-import org.eclipse.jst.jsf.context.symbol.IObjectSymbol;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.context.symbol.ITypeDescriptor;
-
-/**
- * A design time proxy for the runtime PropertyResolver. This is used to
- * resolve all but the first element of a var.prop.prop2 type of sub-expression in
- * a JSF EL expression. @see DefaultDTVariableResolver for how to resolve 'var' at
- * designtime
- *
- * Clients may implement
- *
- * @author cbateman
- */
-public class DefaultDTPropertyResolver extends AbstractDTPropertyResolver
-{
- /**
- * Returns a symbol encapsulating the property on base with the name
- * properyId
- *
- * @param base
- * @param propertyId
- * @return the symbol for the named propertyId or null if not found
- */
- public ISymbol getProperty(ISymbol base, Object propertyId)
- {
- ITypeDescriptor typeDesc = null;
-
- Object[] factoredProperties = new Object[] {propertyId};
-
- // check for expected interface types per JSP.2.3.4
- if (base instanceof IObjectSymbol)
- {
- final IObjectSymbol objSymbol = (IObjectSymbol) base;
- typeDesc = objSymbol.getTypeDescriptor();
-
- // although not stated explicitly stated by the spec, in practice (based on Sun RI),
- // a list cannot have non-numeric indexed properties
- // note: due to remove(Object) having different return types
- // an object can't be both a List and a Map! So we can consider
- // a List instanceof out of order
- if (objSymbol.supportsCoercion(TypeConstants.TYPE_LIST))
- {
- typeDesc = null;
- }
- // per JSP.2.3.4, if instance of map (unconstrained in our terminology)
- else if (objSymbol.supportsCoercion(TypeConstants.TYPE_MAP))
- {
- EList<ValueType> args = new BasicEList<ValueType>();
- args.add(new StringLiteralType(propertyId.toString()));
-
- ISymbol prop = objSymbol.call("get", args, propertyId.toString()); //$NON-NLS-1$
-
- if (prop != null)
- {
- return prop;
- }
-
- typeDesc = objSymbol.coerce(TypeConstants.TYPE_MAP);
-
- // handle string keys into maps that contain dots. Because type descriptor
- // handle dotted property ids (i.e. 'x.y.z') as separate properties with
- // intermediate parts, we need to handle this specially.
- if (propertyId instanceof String && ((String)propertyId).indexOf('.')>-1)
- {
- factoredProperties = factorKey(propertyId);
- }
- }
-
- // check unconstrained type
- if (typeDesc instanceof IBoundedTypeDescriptor)
- {
- // TODO: propertyId may need to change when supporting
- // template types
- if (((IBoundedTypeDescriptor)typeDesc).isUnboundedForType(TypeConstants.TYPE_JAVAOBJECT))
- {
- // the most we know is that it could be an Object
- return ((IBoundedTypeDescriptor)typeDesc).getUnboundedProperty(propertyId, TypeConstants.TYPE_JAVAOBJECT);
- }
- }
- }
-
- int i = 0;
- ISymbol matchedSymbol;
-
- do
- {
- matchedSymbol = null; // always reset so if the for completes without setting, the
- // while ends
- SEARCH_SEGMENT: for (final Iterator it = getIterator(typeDesc); it.hasNext();)
- {
- final ISymbol element = (ISymbol) it.next();
-
- if (element.getName().equals(factoredProperties[i])
- && element instanceof IObjectSymbol)
- {
- matchedSymbol = element;
- typeDesc = ((IObjectSymbol)matchedSymbol).getTypeDescriptor();
- break SEARCH_SEGMENT;
- }
- }
- } while(++i < factoredProperties.length && matchedSymbol != null);
-
- // may be null if none matched
- return matchedSymbol;
- }
-
- /**
- * @param base
- * @return all properties of base
- */
- public ISymbol[] getAllProperties(ISymbol base)
- {
- // if nothing found, return an empty array
- List symbolsList = Collections.EMPTY_LIST;
-
- if (base instanceof IObjectSymbol)
- {
- ITypeDescriptor typeDesc = null;
-
- // per JSP.2.3.4, if instance of map (unconstrained in our terminology)
- if (((IObjectSymbol)base).supportsCoercion(TypeConstants.TYPE_MAP))
- {
- typeDesc =
- ((IObjectSymbol)base).coerce(TypeConstants.TYPE_MAP);
- }
- // Lists have no properties, even if they are also beans
- else if (((IObjectSymbol)base).supportsCoercion(TypeConstants.TYPE_LIST))
- {
- typeDesc = null;
- }
- else
- {
- typeDesc = ((IObjectSymbol)base).getTypeDescriptor();
-
- }
-
- if (typeDesc != null)
- {
- symbolsList = typeDesc.getProperties();
- }
- }
-
- return (ISymbol[]) symbolsList.toArray(ISymbol.EMPTY_SYMBOL_ARRAY);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.designtime.el.AbstractDTPropertyResolver#getProperty(org.eclipse.jst.jsf.context.symbol.ISymbol, int)
- */
- public ISymbol getProperty(ISymbol base, int offset)
- {
- ITypeDescriptor typeDesc = null;
-
- if (offset < 0)
- {
- // should never be called with offset < 0
- throw new AssertionError("offsets must be >=0 to be valid"); //$NON-NLS-1$
- }
-
- // check for expected interface types per JSP.2.3.4
- if (base instanceof IObjectSymbol)
- {
-
- final IObjectSymbol objSymbol = (IObjectSymbol) base;
- typeDesc = objSymbol.getTypeDescriptor();
-
- // per JSP.2.3.4, if instance of array (unconstrained in our terminology)
- if (typeDesc.isArray())
- {
- ISymbol arrayElement = typeDesc.getArrayElement();
- // reset the name
- arrayElement.setName(base.getName()+"["+offset+"]"); //$NON-NLS-1$ //$NON-NLS-2$
- return arrayElement;
- }
-
- // per JSP.2.3.4, if instance of list (unbounded in our terminology)
- if (objSymbol.supportsCoercion(TypeConstants.TYPE_LIST))
- {
- //typeDesc = objSymbol.coerce(TypeConstants.TYPE_LIST);
- final EList<ValueType> args = new BasicEList<ValueType>();
- args.add(new ValueType(Signature.SIG_INT, ValueType.ASSIGNMENT_TYPE_RHS));
- return objSymbol.call("get", args, base.getName()+"["+offset+"]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-
- // check unconstrained type
-// if (typeDesc instanceof IBoundedTypeDescriptor)
-// {
-// // TODO: propertyId may need to change when supporting
-// // template types
-// if (((IBoundedTypeDescriptor)typeDesc).isUnboundedForType(TypeConstants.TYPE_BOXED_INTEGER))
-// {
- // the most we know is that it could be an Object
-// return ((IBoundedTypeDescriptor)typeDesc)
-// .getUnboundedProperty
-// (new Integer(offset), TypeConstants.TYPE_BOXED_INTEGER);
-// final EList<Object> args = new BasicEList<Object>();
-// args.add(offset);
-// return ((IBoundedTypeDescriptor)typeDesc)
-// .call("get", args, base.getName()+"["+offset+"]");
-// }
-// }
- }
-
- return null;
- }
-
- /**
- * @param typeDesc
- * @return the type descriptor's property iterator or empty list
- * if null
- */
- protected final Iterator getIterator(ITypeDescriptor typeDesc)
- {
- if (typeDesc != null)
- {
- return typeDesc.getProperties().iterator();
- }
- return Collections.EMPTY_LIST.iterator();
- }
-
- /**
- * Takes a key expression and factors it down to into all property segments it contains.
- * Property segments occur mainly when String keys contain '.' characters, indicating that
- * more one than property actually must be traversed to evaluate the whole expr.
- * @param key
- * @return an array containing all property segments of the key. If the key contains only
- * one property, then this is returned a single element in the array
- */
- protected final Object[] factorKey(Object key)
- {
- if (key instanceof String)
- {
- List segments = new ArrayList();
-
- String stringKey = (String) key;
- int nextPos = -1;
-
- while ((nextPos = stringKey.indexOf('.')) > -1)
- {
- segments.add(stringKey.substring(0, nextPos));
- stringKey = stringKey.substring(nextPos+1);
- }
-
- if (stringKey != null && stringKey.length() > 0)
- {
- segments.add(stringKey);
- }
-
- return segments.toArray();
- }
-
- return new Object[] {key};
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/el/DefaultDTVariableResolver.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/el/DefaultDTVariableResolver.java
deleted file mode 100644
index 44d53a2..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/el/DefaultDTVariableResolver.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.designtime.el;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.context.symbol.source.ISymbolConstants;
-import org.eclipse.jst.jsf.designtime.context.DTFacesContext;
-import org.eclipse.jst.jsf.designtime.context.IDTExternalContext;
-import org.eclipse.jst.jsf.designtime.symbols.DefaultBeanSymbolSourceProvider;
-import org.eclipse.jst.jsf.designtime.symbols.DefaultBuiltInSymbolProvider;
-
-/**
- * A design time proxy for the runtime VariableResolver. This is used to
- * resolve the first element of a var.prop.prop2 type of sub-expression in
- * a JSF EL expression
- *
- * Clients may sub-class
- *
- * @author cbateman
- *
- */
-public class DefaultDTVariableResolver extends AbstractDTVariableResolver
-{
- /**
- * Tries to mirror the JSF 1.1 runtime VariableResolver
- *
- * @see org.eclipse.jst.jsf.designtime.el.AbstractDTVariableResolver#resolveVariable(org.eclipse.jst.jsf.designtime.context.DTFacesContext, java.lang.String, org.eclipse.core.runtime.IAdaptable)
- */
- public ISymbol resolveVariable(DTFacesContext context, String name, IAdaptable externalContextKey)
- {
- // check implicits first
- final DefaultBuiltInSymbolProvider builtins =
- DefaultBuiltInSymbolProvider.getInstance();
-
- ISymbol symbol = builtins.getSymbol(name, externalContextKey, ISymbolConstants.SYMBOL_SCOPE_ALL);
-
- if (symbol != null)
- {
- return symbol;
- }
-
- // next check the scope maps from request up to application
- final IDTExternalContext externalContext =
- context.getDTExternalContext(externalContextKey);
-
- if (externalContext == null)
- {
- // TODO: try to find bean here?
- return null;
- }
-
- symbol = externalContext.getRequestMap().get(name);
-
- // check request scope
- if (symbol == null)
- {
- symbol = externalContext.getSessionMap().get(name);
-
- // then check session scope
- if (symbol == null)
- {
- symbol = externalContext.getApplicationMap().get(name);
-
- // if the symbol is not found at any scope, then look for a
- // a bean.
- if (symbol == null)
- {
- final DefaultBeanSymbolSourceProvider beanProvider =
- DefaultBeanSymbolSourceProvider.getInstance();
-
- symbol = beanProvider.getSymbol(name, externalContextKey,
- ISymbolConstants.SYMBOL_SCOPE_ALL);
- }
- }
- }
-
- return symbol;
- }
-
- /**
- * @param facesContext
- * @param externalContextKey
- * @return all variables
- */
- public ISymbol[] getAllVariables(DTFacesContext facesContext,
- IAdaptable externalContextKey)
- {
- final List allSymbols = new ArrayList();
-
- addBuiltins(allSymbols, externalContextKey);
-
- final IDTExternalContext externalContext =
- facesContext.getDTExternalContext(externalContextKey);
-
- if (externalContext != null)
- {
- addExternalContextSymbols(allSymbols, externalContext);
- }
-
- addBeanSymbols(allSymbols, externalContextKey);
-
- return (ISymbol[]) allSymbols.toArray(ISymbol.EMPTY_SYMBOL_ARRAY);
- }
-
- /**
- * Adds the built-in symbols to the list. This behaviour is standarized and should
- * not be overriden in general. However, you may wish to change the default
- * built-in symbol provider with your own.
- *
- * @param list
- * @param externalContextKey
- */
- protected void addBuiltins(final List list, final IAdaptable externalContextKey)
- {
- // check implicits first
- final DefaultBuiltInSymbolProvider builtins =
- DefaultBuiltInSymbolProvider.getInstance();
-
- list.addAll(Arrays.asList(builtins.getSymbols(externalContextKey,
- ISymbolConstants.SYMBOL_SCOPE_ALL)));
- }
-
- /**
- * Simulate resolution of symbols from the request, session, application and none
- * scope maps. Use a symbol provider instead if you simply want to add
- * new symbols for a tag variable or other symbol source.
- *
- * @param list
- * @param externalContext
- */
- protected void addExternalContextSymbols(final List list,
- final IDTExternalContext externalContext)
- {
- if (externalContext != null)
- {
- final ISymbol[] externalContextSymbols =
- externalContext.getMapForScope
- (ISymbolConstants.SYMBOL_SCOPE_ALL).values().
- toArray(ISymbol.EMPTY_SYMBOL_ARRAY);
- list.addAll(Arrays.asList(externalContextSymbols));
- }
- }
-
- /**
- * Gets all the bean symbols. If you wish to override it would be advisable
- * to look at and/or sub-class the default bean symbol source provider
- *
- * @param list
- * @param externalContextKey
- */
- protected void addBeanSymbols(final List list, final IAdaptable externalContextKey)
- {
- final DefaultBeanSymbolSourceProvider beanProvider =
- DefaultBeanSymbolSourceProvider.getInstance();
-
- final ISymbol[] beanSymbols =
- beanProvider.getSymbols(externalContextKey,
- ISymbolConstants.SYMBOL_SCOPE_ALL);
-
- list.addAll(Arrays.asList(beanSymbols));
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/el/IDecorativeResolver.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/el/IDecorativeResolver.java
deleted file mode 100644
index 2c50134..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/el/IDecorativeResolver.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.designtime.el;
-
-/**
- * Tagging interface that must be implemented by all resolvers that want to participate
- * in result decoration (i.e. variable and property resolvers) via the
- * forRuntimeClass extension.
- *
- * Clients may implement.
- *
- * @author cbateman
- *
- */
-public interface IDecorativeResolver
-{
- // purposefully empty
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/el/IInstancePerProjectResolver.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/el/IInstancePerProjectResolver.java
deleted file mode 100644
index 41bcff8..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/el/IInstancePerProjectResolver.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.designtime.el;
-
-import org.eclipse.core.resources.IProject;
-
-/**
- * See the variable and properyresolver extension points attribute instancePerProject.
- *
- * Clients may implement.
- *
- * @author cbateman
- *
- */
-public interface IInstancePerProjectResolver
-{
- /**
- * Called by the design time application manager before using the
- * resolver with the project it associated with. Resolvers need not
- * implement unless they wish to be instancePerProject resolvers.
- *
- * @param project
- */
- void setProject(final IProject project);
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/el/package-info.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/el/package-info.java
deleted file mode 100644
index f714337..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/el/package-info.java
+++ /dev/null
@@ -1,16 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-/**
- * JSF Design Time EL Resolvers.
- */
-package org.eclipse.jst.jsf.designtime.el;
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/BasicExtensionFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/BasicExtensionFactory.java
deleted file mode 100644
index a4cc8c8..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/BasicExtensionFactory.java
+++ /dev/null
@@ -1,305 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.designtime.internal;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.designtime.el.IInstancePerProjectResolver;
-import org.osgi.framework.Bundle;
-
-/**
- * @author cbateman
- * @param <EXTENSIONTYPE>
- *
- */
-public class BasicExtensionFactory<EXTENSIONTYPE>
-{
- private final Bundle _bundle;
- private final String _extName;
- private Map<String, ExtensionData<EXTENSIONTYPE>> _registeredResolvers;
- private final String _elementName;
- private final ExtensionDataFactory _extensionDataFactory;
- private final boolean _alwaysPerProject;
-
- /**
- * @param bundle
- * @param extName
- * @param elementName
- * @param alwaysPerProject
- */
- public BasicExtensionFactory(final Bundle bundle, final String extName,
- final String elementName, final boolean alwaysPerProject)
- {
- _bundle = bundle;
- _extName = extName;
- _elementName = elementName;
- _extensionDataFactory = new ExtensionDataFactory<EXTENSIONTYPE>();
- _alwaysPerProject = alwaysPerProject;
- }
-
- /**
- * @return the resolvers. Lazily initialized.
- */
- public final Map<String, ExtensionData<EXTENSIONTYPE>> getExtensions()
- {
- if (_registeredResolvers == null)
- {
- _registeredResolvers = loadRegisteredExtensions();
- }
-
- return _registeredResolvers;
- }
-
- /**
- * @return the map of extensions by id.
- */
- protected Map<String, ExtensionData<EXTENSIONTYPE>> loadRegisteredExtensions()
- {
- final Map<String, ExtensionData<EXTENSIONTYPE>> resolvers = new HashMap<String, ExtensionData<EXTENSIONTYPE>>();
-
- final IExtensionPoint point = Platform.getExtensionRegistry()
- .getExtensionPoint(_bundle.getSymbolicName(), _extName);
-
- final IExtension[] extensions = point.getExtensions();
-
- for (final IExtension extension : extensions)
- {
- final IConfigurationElement[] elements = extension
- .getConfigurationElements();
-
- for (final IConfigurationElement element : elements)
- {
- if (_elementName.equals(element.getName())
- && element.getAttribute("class") != null //$NON-NLS-1$
- && element.getAttribute("id") != null) //$NON-NLS-1$
- {
- final ExtensionData extData = processExtension(element, _alwaysPerProject);
-
- if (extData != null)
- {
- resolvers.put(extData.getId(), extData);
- }
- }
- }
- }
- return resolvers;
- }
-
- /**
- * @param element
- * @param alwaysPerProject
- * @return the extension data for the extension or null if can't be created
- */
- protected ExtensionData processExtension(final IConfigurationElement element, final boolean alwaysPerProject)
- {
- return _extensionDataFactory.createExtensionData(element, alwaysPerProject);
- }
-
- /**
- * @author cbateman
- *
- * @param <EXTENSIONTYPE>
- */
- protected static class ExtensionDataFactory<EXTENSIONTYPE>
- {
- ExtensionData createExtensionData(final IConfigurationElement element,
- final boolean alwaysPerProject)
- {
- if (isPerProjectExtension(element, alwaysPerProject))
- {
- return new PerProjectExtensionData<EXTENSIONTYPE>(element);
- }
- return new SingleInstanceExtensionData<EXTENSIONTYPE>(element);
- }
-
- static boolean isPerProjectExtension(final IConfigurationElement element, final boolean alwaysPerProject)
- {
- if (alwaysPerProject)
- {
- return true;
- }
- final String flag = element.getAttribute("instancePerProject");
- // must check for null for backward compatibility, since
- // this attribute wasn't part of the original.
- if (flag != null)
- {
- return Boolean.valueOf(flag).booleanValue();
- }
- return false;
- }
- }
-
- /**
- * @param <EXTENSIONTYPE>
- */
- protected static class PerProjectExtensionData<EXTENSIONTYPE> extends
- ExtensionData<EXTENSIONTYPE>
- {
- private Map<IProject, EXTENSIONTYPE> _extensions;
-
- /**
- * @param element
- */
- protected PerProjectExtensionData(IConfigurationElement element)
- {
- super(element);
- }
-
- @Override
- public EXTENSIONTYPE getInstance(final IProject project)
- {
- if (!project.isAccessible())
- {
- _extensions.remove(project);
- return null;
- }
-
- if (_extensions == null)
- {
- _extensions = new HashMap<IProject, EXTENSIONTYPE>();
- }
-
- EXTENSIONTYPE instance = _extensions.get(project);
-
- if (instance == null)
- {
- try
- {
- instance = createInstance();
- if (instance instanceof IInstancePerProjectResolver)
- {
- ((IInstancePerProjectResolver) instance)
- .setProject(project);
- }
- _extensions.put(project, instance);
- }
- catch (Exception e)
- {
- JSFCorePlugin.log(e,
- "Instantiating extension class for id: " + getId());
- }
- }
- return instance;
- }
-
- @Override
- public EXTENSIONTYPE removeInstance(IProject project)
- {
- return _extensions.remove(project);
- }
- }
-
- /**
- * @param <EXTENSIONTYPE>
- *
- */
- protected static class SingleInstanceExtensionData<EXTENSIONTYPE> extends
- ExtensionData<EXTENSIONTYPE>
- {
- private EXTENSIONTYPE _instance;
-
- /**
- * @param element
- */
- protected SingleInstanceExtensionData(IConfigurationElement element)
- {
- super(element);
- }
-
- @Override
- public EXTENSIONTYPE getInstance(final IProject project)
- {
- if (_instance == null)
- {
- try
- {
- _instance = createInstance();
- }
- catch (CoreException e)
- {
- JSFCorePlugin.log(e,
- "Instantiating extension class for id: " + getId());
- }
- }
- return _instance;
- }
-
- @Override
- public EXTENSIONTYPE removeInstance(IProject project)
- {
- final EXTENSIONTYPE removedItem = _instance;
- _instance = null;
- return removedItem;
- }
- }
-
- /**
- * Extension data
- *
- * @param <EXTENSIONTYPE>
- *
- */
- public abstract static class ExtensionData<EXTENSIONTYPE>
- {
- private final IConfigurationElement _element;
-
- /**
- * @param element
- */
- protected ExtensionData(final IConfigurationElement element)
- {
- super();
- _element = element;
- }
-
- /**
- * @return the unique id of the variable resolver extension
- */
- public String getId()
- {
- return _element.getAttribute("id"); //$NON-NLS-1$
- }
-
- /**
- * @param project
- * @return the instance. project may be ignored if there is only one
- * global instance for this factory.
- */
- public abstract EXTENSIONTYPE getInstance(final IProject project);
-
- /**
- * @param project
- * @return the extension for the project, removing from any internal
- * caching. May return null if getInstance was never called for
- * project.
- */
- public abstract EXTENSIONTYPE removeInstance(final IProject project);
-
- /**
- * @return the resolver
- * @throws CoreException
- */
- protected EXTENSIONTYPE createInstance() throws CoreException
- {
- return (EXTENSIONTYPE) _element.createExecutableExtension("class");
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/DecoratableExtensionFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/DecoratableExtensionFactory.java
deleted file mode 100644
index 15d5308..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/DecoratableExtensionFactory.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.designtime.internal;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.osgi.framework.Bundle;
-
-/**
- * Factory for extensions that include a runtime class for which they decorate.
- *
- * @author cbateman
- *
- * @param <EXTENSIONTYPE>
- */
-public class DecoratableExtensionFactory<EXTENSIONTYPE> extends
- BasicExtensionFactory<EXTENSIONTYPE>
-{
- private static final String DECORATOR_ATTRIBUTE_NAME = "forRuntimeClass";
- private final Map<String, List<String>> _forNameToId;
-
- /**
- * @param bundle
- * @param extName
- * @param elementName
- * @param alwaysPerProject
- */
- public DecoratableExtensionFactory(final Bundle bundle,
- final String extName, final String elementName, final boolean alwaysPerProject)
- {
- super(bundle, extName, elementName, alwaysPerProject);
- _forNameToId = new HashMap<String, List<String>>();
- }
-
- /**
- * @param name
- * @return a canonically sorted list of ids of extensions registered by the
- * name.
- */
- public List<String> getIdsForName(final String name)
- {
- List<String> ids = _forNameToId.get(name);
- if (ids == null)
- {
- ids = Collections.EMPTY_LIST;
- }
- return ids;
- }
-
- /**
- * @return the number of runtime resolvers for which there is at least one
- * declarative variable resolver registered.
- */
- public int getNumDecorativeResolvers()
- {
- return _forNameToId.size();
- }
-
- @Override
- protected Map<String, ExtensionData<EXTENSIONTYPE>> loadRegisteredExtensions()
- {
- Map<String, ExtensionData<EXTENSIONTYPE>> extensions = super
- .loadRegisteredExtensions();
-
- // canonically sort forName's
- for (final Map.Entry<String, List<String>> entry : _forNameToId
- .entrySet())
- {
- Collections.sort(entry.getValue());
- }
-
- return extensions;
- }
-
-
- @Override
- protected ExtensionData processExtension(IConfigurationElement element, boolean alwaysPerProject)
- {
- final ExtensionData data = super.processExtension(element, alwaysPerProject);
- final String forRuntimeClass = element
- .getAttribute(DECORATOR_ATTRIBUTE_NAME);
- if (forRuntimeClass != null && !"".equals(forRuntimeClass.trim())){
- addRuntimeClassMapping(data.getId(), forRuntimeClass);
- }
- return data;
- }
-
- private void addRuntimeClassMapping(final String id,
- final String forRuntimeClass)
- {
- List mappings = _forNameToId.get(forRuntimeClass);
-
- if (mappings == null)
- {
- mappings = new ArrayList<String>(2);
- _forNameToId.put(forRuntimeClass, mappings);
- }
- mappings.add(id);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/Messages.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/Messages.java
deleted file mode 100644
index 9569c99..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/Messages.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package org.eclipse.jst.jsf.designtime.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.jst.jsf.designtime.internal.messages"; //$NON-NLS-1$
- public static String DefaultJSPTagResolver_DisplayName;
- public static String PersistedDataTagStrategy_DisplayName;
- public static String TagIntrospectingStrategy_DisplayName;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/jsp/AdditionalContextSymbolInfo.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/jsp/AdditionalContextSymbolInfo.java
deleted file mode 100644
index 4755fa8..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/jsp/AdditionalContextSymbolInfo.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.designtime.internal.jsp;
-
-import org.eclipse.jst.jsf.context.symbol.source.IAdditionalContextSymbolInfo;
-
-/**
- *
- * NOT API. Use IAdditionalContextSymbolInfo.
- *
- * @author cbateman
- *
- */
-/*package*/ final class AdditionalContextSymbolInfo implements IAdditionalContextSymbolInfo
-{
- private final String _symbolTypeSignature;
- private final String _valueExpressionAttributeName;
-
- /**
- * @param symbolTypeSignature
- */
- /*package*/ AdditionalContextSymbolInfo(final String symbolTypeSignature,
- String valueExpressionAttributeName)
- {
- super();
- this._symbolTypeSignature = symbolTypeSignature;
- this._valueExpressionAttributeName = valueExpressionAttributeName;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.context.symbol.source.IAdditionalContextSymbolInfo#getSymbolTypeSignature()
- */
- public String getSymbolTypeSignature()
- {
- return _symbolTypeSignature;
- }
-
- public String getValueExpressionAttributeName()
- {
- return _valueExpressionAttributeName;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/jsp/DataModelVariableFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/jsp/DataModelVariableFactory.java
deleted file mode 100644
index 95cde30..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/jsp/DataModelVariableFactory.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.jsp;
-
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.core.internal.tld.IJSFConstants;
-import org.eclipse.jst.jsf.designtime.symbols.AbstractDataModelVariableFactory;
-import org.eclipse.jst.jsf.designtime.symbols.DefaultDataTableSymbolFactory;
-import org.w3c.dom.Element;
-
-/**
- * Constructs an EL IObjectSymbol for a particular data table row access variable
- * based on the type of the bound data (the value attribute)
- *
- *
- * @author cbateman
- *
- */
-class DataModelVariableFactory extends DefaultDataTableSymbolFactory
-{
- private static DataModelVariableFactory INSTANCE;
-
- /**
- * @return an instance of the factory
- */
- public synchronized static DataModelVariableFactory getInstance()
- {
- if (INSTANCE == null)
- {
- INSTANCE = new DataModelVariableFactory();
- }
-
- return INSTANCE;
- }
-
- @Override
- public ISymbol createSymbolForDataTableValue(String symbolName,
- Element dataTableElement, IStructuredDocumentContext context)
- {
- if (!IJSFConstants.TAG_DATATABLE.equals(dataTableElement.getLocalName()))
- {
- throw new AssertionError("dataTableElement must be a dataTable"); //$NON-NLS-1$
- }
-
- return super.createSymbolForDataTableValue(symbolName, dataTableElement, context);
- }
-
- //private String getELText(IStructuredDocumentConte)
- private DataModelVariableFactory()
- {
- // no external instantiation
- super(new MyDataModelVariableFactory());
- }
-
- private static class MyDataModelVariableFactory extends AbstractDataModelVariableFactory
- {
- @Override
- protected String getVariableSourceName() {
- return "dataTable"; //$NON-NLS-1$
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/jsp/JSPDefaultSymbolFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/jsp/JSPDefaultSymbolFactory.java
deleted file mode 100644
index 4e70942..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/jsp/JSPDefaultSymbolFactory.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.designtime.internal.jsp;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jst.jsf.common.internal.types.TypeConstants;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IDOMContextResolver;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.ITaglibContextResolver;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IWorkspaceContextResolver;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.symbol.IBoundedJavaTypeDescriptor;
-import org.eclipse.jst.jsf.context.symbol.IComponentSymbol;
-import org.eclipse.jst.jsf.context.symbol.IMapTypeDescriptor;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.context.symbol.SymbolFactory;
-import org.eclipse.jst.jsf.context.symbol.source.AbstractContextSymbolFactory;
-import org.eclipse.jst.jsf.context.symbol.source.IAdditionalContextSymbolInfo;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.core.internal.tld.IJSFConstants;
-import org.eclipse.jst.jsf.core.internal.tld.ITLDConstants;
-import org.eclipse.jst.jsf.designtime.internal.symbols.ResourceBundleMapSourceFactory;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * @author cbateman
- *
- */
-public class JSPDefaultSymbolFactory extends AbstractContextSymbolFactory
-{
- protected ISymbol internalCreate(String symbolName,int scope,IAdaptable context,List problems, IAdditionalContextSymbolInfo additionInfo)
- {
- final IStructuredDocumentContext sContext =
- (IStructuredDocumentContext)
- context.getAdapter(IStructuredDocumentContext.class);
-
- final IDOMContextResolver domResolver =
- IStructuredDocumentContextResolverFactory.INSTANCE.getDOMContextResolver(sContext);
-
- if (domResolver != null)
- {
- final Node curNode = domResolver.getNode();
-
- if (curNode instanceof Attr)
- {
- final Attr attr = (Attr) curNode;
- final Node owningElement = attr.getOwnerElement();
-
- if (owningElement != null)
- {
- return handleSymbolCreation(symbolName, sContext, attr, owningElement, problems);
- }
- }
- }
-
- return null;
- }
-
-
- private ISymbol handleSymbolCreation(final String symbolName,
- final IStructuredDocumentContext context,
- final Attr attr,
- final Node owningElement,
- final List problems)
- {
- final ITaglibContextResolver resolver =
- IStructuredDocumentContextResolverFactory.INSTANCE.getTaglibContextResolver(context);
-
-
- if (resolver == null
- || !resolver.canResolveContext(context))
- {
- return null;
- }
-
- final String uri = resolver.getTagURIForNodeName(owningElement);
-
- // process core taglib
- if (ITLDConstants.URI_JSF_CORE.equals(uri))
- {
- return handleCoreTags(symbolName, owningElement, attr, context, problems);
- }
- else if (ITLDConstants.URI_JSF_HTML.equals(uri))
- {
- return handleHtmlTags(symbolName, owningElement, attr, context, problems);
- }
-
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.context.symbol.source.AbstractContextSymbolFactory#supports(org.eclipse.core.runtime.IAdaptable)
- */
- public boolean supports(IAdaptable context)
- {
- return context != null &&
- context.getAdapter(IStructuredDocumentContext.class) != null;
- }
-
- private ISymbol handleHtmlTags(String symbolName, Node owningElement, Attr attr, IStructuredDocumentContext context, List problems)
- {
- final String elementName = owningElement.getLocalName();
- final String attrName = attr.getName();
-
- if (IJSFConstants.TAG_DATATABLE.equals(elementName))
- {
- if (IJSFConstants.ATTR_VAR.equals(attrName))
- {
- return DataModelVariableFactory.getInstance()
- .createSymbolForDataTableValue(symbolName, (Element) owningElement, context);
- }
- }
-
- return null;
- }
-
- private ISymbol handleCoreTags(String symbolName, Node owningElement, Attr attr, IStructuredDocumentContext context, List problems)
- {
- final String elementName = owningElement.getLocalName();
-
- if (IJSFConstants.TAG_LOADBUNDLE.equals(elementName))
- {
-// long startTime = System.currentTimeMillis();
- ISymbol symbol = handleLoadBundleTag(symbolName, owningElement, attr, context, problems);
-
-// long endTime = System.currentTimeMillis();
-// long totalTime = endTime-startTime;
- //System.out.println("Loadbundle resolution for symbol "+symbolName+" took: "+totalTime+"ms");
- return symbol;
- }
- return null;
- }
-
- private ISymbol handleLoadBundleTag(String symbolName, Node owningElement, Attr attr, IStructuredDocumentContext context, List problems)
- {
- final String attrName = attr.getName();
- if (IJSFConstants.ATTR_VAR.equals(attrName))
- {
- final NamedNodeMap attrMap = owningElement.getAttributes();
- final Node baseNameNode = attrMap.getNamedItem(IJSFConstants.ATTR_BASENAME);
-
-
- if (baseNameNode != null)
- {
- try
- {
- final IWorkspaceContextResolver wkspaceResolver =
- IStructuredDocumentContextResolverFactory.INSTANCE.getWorkspaceContextResolver(context);
- IProject project = wkspaceResolver.getProject();
-
- if (project == null)
- {
- throw new RuntimeException("Error acquiring project"); //$NON-NLS-1$
- }
-
- final Map source =
- ResourceBundleMapSourceFactory
- .getResourceBundleMapSource(project, baseNameNode.getNodeValue());
- final IMapTypeDescriptor typeDesc =
- SymbolFactory.eINSTANCE.createIMapTypeDescriptor();
- typeDesc.setMapSource(source);
- final IComponentSymbol symbol =
- SymbolFactory.eINSTANCE.createIComponentSymbol();
- symbol.setName(symbolName);
- symbol.setTypeDescriptor(typeDesc);
- symbol.setDetailedDescription(Messages.getString("JSPDefaultSymbolFactory.Resource.bundle.map.detailedDescription")+baseNameNode.getNodeValue()+"</i>"); //$NON-NLS-1$ //$NON-NLS-2$
-
- return symbol;
- }
- catch (IOException ioe)
- {
- problems.add(new Status(IStatus.ERROR, JSFCorePlugin.PLUGIN_ID, 0,Messages.getString("JSPDefaultSymbolFactory.Problem.ErrorCreatingVariable"), ioe)); //$NON-NLS-1$
- }
- catch (JavaModelException jme)
- {
- problems.add(new Status(IStatus.ERROR, JSFCorePlugin.PLUGIN_ID, 0,Messages.getString("JSPDefaultSymbolFactory.Problem.ErrorCreatingVariable"), jme)); //$NON-NLS-1$
- }
- catch (CoreException ce)
- {
- problems.add(new Status(IStatus.ERROR, JSFCorePlugin.PLUGIN_ID, 0,Messages.getString("JSPDefaultSymbolFactory.Problem.ErrorCreatingVariable"), ce)); //$NON-NLS-1$
- }
-
- final IBoundedJavaTypeDescriptor typeDesc = SymbolFactory.eINSTANCE.createIBoundedJavaTypeDescriptor();
- typeDesc.setTypeSignatureDelegate( TypeConstants.TYPE_JAVAOBJECT );
- final IComponentSymbol symbol = SymbolFactory.eINSTANCE.createIComponentSymbol();
- symbol.setName(symbolName);
- symbol.setTypeDescriptor(typeDesc);
- symbol.setDetailedDescription(Messages.getString("JSPDefaultSymbolFactory.Resource.bundle.map.detailedDescription")+baseNameNode.getNodeValue()+"</i>"); //$NON-NLS-1$ //$NON-NLS-2$
-
- return symbol;
- }
- }
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/jsp/JSPModelProcessor.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/jsp/JSPModelProcessor.java
deleted file mode 100644
index d64a6ec..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/jsp/JSPModelProcessor.java
+++ /dev/null
@@ -1,726 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.designtime.internal.jsp;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.locks.ReentrantLock;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jst.jsf.common.JSFCommonPlugin;
-import org.eclipse.jst.jsf.common.internal.resource.IResourceLifecycleListener;
-import org.eclipse.jst.jsf.common.internal.resource.LifecycleListener;
-import org.eclipse.jst.jsf.common.internal.resource.ResourceLifecycleEvent;
-import org.eclipse.jst.jsf.common.internal.resource.ResourceLifecycleEvent.EventType;
-import org.eclipse.jst.jsf.common.internal.resource.ResourceLifecycleEvent.ReasonType;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.internal.TraitValueHelper;
-import org.eclipse.jst.jsf.common.metadata.query.ITaglibDomainMetaDataModelContext;
-import org.eclipse.jst.jsf.common.metadata.query.TaglibDomainMetaDataQueryHelper;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.ITaglibContextResolver;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContextFactory;
-import org.eclipse.jst.jsf.context.symbol.IComponentSymbol;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.context.symbol.SymbolFactory;
-import org.eclipse.jst.jsf.context.symbol.source.AbstractContextSymbolFactory;
-import org.eclipse.jst.jsf.context.symbol.source.ISymbolConstants;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.designtime.DesignTimeApplicationManager;
-import org.eclipse.jst.jsf.designtime.context.DTFacesContext;
-import org.eclipse.wst.html.core.internal.document.DOMStyleModelImpl;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-
-/**
- * Processes a JSP model to determine information of interest about it such
- * as what tags are currently in use. Listens to the model and updates it's
- * information when the model changes.
- *
- * @author cbateman
- *
- */
-public class JSPModelProcessor
-{
- private final static Map<IFile, JSPModelProcessor> RESOURCE_MAP =
- new HashMap<IFile, JSPModelProcessor>();
- private final static java.util.concurrent.locks.Lock CRITICAL_SECTION =
- new ReentrantLock();
- private static LifecycleListener LIFECYCLE_LISTENER;
-
- /**
- * @param file The file to get the model processor for
- * @return the processor for a particular model, creating it if it does not
- * already exist
- * @throws CoreException if an attempt to get the model associated with file
- * fails due to reasons other than I/O problems
- */
- public static JSPModelProcessor get(IFile file) throws CoreException
- {
- CRITICAL_SECTION.lock();
- try
- {
- if (!file.isAccessible())
- {
- throw new CoreException(new Status(IStatus.ERROR, JSFCorePlugin.PLUGIN_ID, "File must be accessible")); //$NON-NLS-1$
- }
-
- JSPModelProcessor processor = RESOURCE_MAP.get(file);
-
- if (processor == null)
- {
- if (LIFECYCLE_LISTENER == null)
- {
- LIFECYCLE_LISTENER = new LifecycleListener(file);
- }
- else
- {
- LIFECYCLE_LISTENER.addResource(file);
- }
-
- processor = new JSPModelProcessor(file,LIFECYCLE_LISTENER);
- RESOURCE_MAP.put(file, processor);
- }
-
- return processor;
- }
- finally
- {
- CRITICAL_SECTION.unlock();
- }
- }
-
- /**
- * Disposes of the JSPModelProcessor associated with model
- * @param file the model processor to be disposed
- */
- private static void dispose(IFile file)
- {
- CRITICAL_SECTION.lock();
- try
- {
- JSPModelProcessor processor = RESOURCE_MAP.get(file);
-
- if (processor != null)
- {
- RESOURCE_MAP.remove(file);
-
- if (!processor.isDisposed())
- {
- processor.dispose();
- LIFECYCLE_LISTENER.removeResource(file);
- }
-
- }
-
- if (RESOURCE_MAP.size() == 0)
- {
- // if we no longer have any resources being tracked,
- // then dispose the lifecycle listener
- LIFECYCLE_LISTENER.dispose();
- LIFECYCLE_LISTENER = null;
- }
- }
- finally
- {
- CRITICAL_SECTION.unlock();
- }
- }
-
- private final IFile _file;
- private LifecycleListener _lifecycleListener;
- private IResourceLifecycleListener _resListener;
- private boolean _isDisposed;
- private Map<Object, ISymbol> _requestMap;
- private Map<Object, ISymbol> _sessionMap;
- private Map<Object, ISymbol> _applicationMap;
- private Map<Object, ISymbol> _noneMap;
- private long _lastModificationStamp;
-
- // used to avoid infinite recursion in refresh. Must never be null
- private final CountingMutex _lastModificationStampMonitor = new CountingMutex();
-
- /**
- * Construct a new JSPModelProcessor for model
- *
- * @param model
- */
- private JSPModelProcessor(final IFile file, final LifecycleListener lifecycleListener)
- {
- //_model = getModelForFile(file);
- //_modelListener = new ModelListener();
- //_model.addModelLifecycleListener(_modelListener);
- _file = file;
- _lifecycleListener = lifecycleListener;
- _resListener = new IResourceLifecycleListener()
- {
- public EventResult acceptEvent(ResourceLifecycleEvent event)
- {
- final EventResult result = EventResult.getDefaultEventResult();
-
- // not interested
- if (!_file.equals(event.getAffectedResource()))
- {
- return result;
- }
-
- if (event.getEventType() == EventType.RESOURCE_INACCESSIBLE)
- {
- dispose(_file);
- }
- else if (event.getEventType() == EventType.RESOURCE_CHANGED)
- {
- // if the file has changed contents on disk, then
- // invoke an unforced refresh of the JSP file
- if (event.getReasonType() == ReasonType.RESOURCE_CHANGED_CONTENTS)
- {
- refresh(false);
- }
- }
-
- return result;
- }
- };
-
- lifecycleListener.addListener(_resListener);
-
- // a negative value guarantees that refresh(false) will
- // force a refresh on the first run
- _lastModificationStamp = -1;
- }
-
- private DOMStyleModelImpl getModelForFile(final IFile file)
- throws CoreException, IOException
- {
- final IModelManager modelManager =
- StructuredModelManager.getModelManager();
-
- IStructuredModel model = modelManager.getModelForRead(file);
-
- if (model instanceof DOMStyleModelImpl)
- {
- return (DOMStyleModelImpl) model;
- }
- else if (model != null)
- {
- // only release from read if we don't find a DOMModelForJSP
- // if the model is correct, it will be released in dispose
- model.releaseFromRead();
- }
-
- throw new CoreException
- (new Status(IStatus.ERROR
- , "org.eclipse.blah" //$NON-NLS-1$
- , 0 //$NON-NLS-1$
- ,"model not of expected type" //$NON-NLS-1$
- , new Throwable())); //$NON-NLS-1$
- }
-
- private void dispose()
- {
- if (!_isDisposed)
- {
- // ensure the resource listener is disposed
- _lifecycleListener.removeListener(_resListener);
- _resListener = null;
- _lifecycleListener = null;
-
- if (_requestMap != null)
- {
- _requestMap.clear();
- _requestMap = null;
- }
-
- if (_sessionMap != null)
- {
- _sessionMap.clear();
- _sessionMap = null;
- }
-
- if (_applicationMap != null)
- {
- _applicationMap.clear();
- _applicationMap = null;
- }
-
- if (_noneMap != null)
- {
- _noneMap.clear();
- _noneMap = null;
- }
-
- // mark as disposed
- _isDisposed = true;
- }
- }
-
- /**
- * @return true if this model processor has been disposed. Disposed
- * processors should not be used.
- */
- public boolean isDisposed()
- {
- return _isDisposed;
- }
-
- /**
- * If isModelDirty() returns true, then it means that a call
- * to refresh(false) will trigger a reprocess of the underlying document.
- *
- * @return true if the underlying JSP model is considered to be dirty
- */
- public boolean isModelDirty()
- {
- final long currentModificationStamp = _file.getModificationStamp();
- return _lastModificationStamp != currentModificationStamp;
- }
-
- /**
- * Updates the internal model
- * @param forceRefresh -- if true, always refreshes, if false,
- * then it only refreshes if the file's modification has changed
- * since the last refresh
- * @throws IllegalStateException if isDisposed() == true
- */
- public void refresh(final boolean forceRefresh)
- {
- if (isDisposed())
- {
- throw new IllegalStateException("Processor is disposed for file: "+_file.toString()); //$NON-NLS-1$
- }
-
- synchronized(_lastModificationStampMonitor)
- {
- if (_lastModificationStampMonitor.isSignalled())
- {
- // if this calls succeeds, then this thread has obtained the
- // lock already and has called through here before.
- // return immediately to ensure that we don't recurse infinitely
- return;
- }
-
- DOMStyleModelImpl model = null;
- try
- {
- _lastModificationStampMonitor.setSignalled(true);
-
-
- // only refresh if forced or if the underlying file has changed
- // since the last run
- if (forceRefresh
- || isModelDirty())
- {
- model = getModelForFile(_file);
- refreshInternal(model);
- _lastModificationStamp = _file.getModificationStamp();
- }
- }
- catch (CoreException e) {
- JSFCorePlugin.log(new RuntimeException(e), "Error refreshing internal model"); //$NON-NLS-1$
- } catch (IOException e) {
- JSFCorePlugin.log(new RuntimeException(e), "Error refreshing internal model"); //$NON-NLS-1$
- }
- // make sure that we unsignal the monitor before releasing the
- // mutex
- finally
- {
- if (model != null)
- {
- model.releaseFromRead();
- }
- _lastModificationStampMonitor.setSignalled(false);
- }
- }
- }
-
- private void refreshInternal(DOMStyleModelImpl model)
- {
- final IStructuredDocumentContext context =
- IStructuredDocumentContextFactory.INSTANCE.getContext(model.getStructuredDocument(), -1);
- final ITaglibContextResolver taglibResolver =
- IStructuredDocumentContextResolverFactory.INSTANCE.getTaglibContextResolver(context);
- IDOMDocument document = model.getDocument();
- getApplicationMap().clear();
- getRequestMap().clear();
- getSessionMap().clear();
- //long curTime = System.currentTimeMillis();
- recurseChildNodes(model, document.getChildNodes(), taglibResolver);
- //long netTime = System.currentTimeMillis() - curTime;
- //System.out.println("Net time to recurse document: "+netTime);
- }
-
- private void recurseChildNodes(final IDOMModel model,
- final NodeList nodes,
- final ITaglibContextResolver taglibResolver)
- {
- for (int i = 0; i < nodes.getLength(); i++)
- {
- final Node child = nodes.item(i);
-
- // process attributes at this node before recursing
- processAttributes(model, child, taglibResolver);
- recurseChildNodes(model, child.getChildNodes(), taglibResolver);
- }
- }
-
- private void processAttributes(final IDOMModel model, final Node node,
- final ITaglibContextResolver taglibResolver)
- {
- if (taglibResolver.hasTag(node))
- {
- final String uri =
- taglibResolver.getTagURIForNodeName(node);
- final String elementName = node.getLocalName();
-
- for (int i = 0; i < node.getAttributes().getLength(); i++)
- {
- final Node attribute = node.getAttributes().item(i);
-
- processSymbolContrib(model, uri, elementName, attribute);
- processSetsLocale(uri, elementName, attribute);
- }
- }
- }
-
- private void processSymbolContrib(final IDOMModel model, final String uri, final String elementName, Node attribute)
- {
- final SymbolContribAggregator aggregator =
- SymbolContribAggregator.
- create(_file.getProject(), uri, elementName, attribute.getLocalName());
-
- if (aggregator != null)
- {
- final AbstractContextSymbolFactory factory = aggregator.getFactory();
- final String symbolName = attribute.getNodeValue();
-
- if (factory != null)
- {
-// long curTime = System.currentTimeMillis();
- final IStructuredDocumentContext context =
- IStructuredDocumentContextFactory.INSTANCE.
- getContext(model.getStructuredDocument(),
- attribute);
-
- if (factory.supports(context))
- {
- final List problems = new ArrayList();
- ISymbol symbol =
- factory.create(symbolName,
- ISymbolConstants.SYMBOL_SCOPE_REQUEST, //TODO:
- context,
- problems,
- // TODO: add meta-data for signature
- new AdditionalContextSymbolInfo(aggregator.getStaticType(), aggregator.getValueExpressionAttr()));
-
- // long netTime = System.currentTimeMillis() - curTime;
- // System.out.println("Time to process loadBundle: "+netTime);
-
- if (symbol != null)
- {
- updateMap(symbol, aggregator.getScope());
- }
- }
- }
- else
- {
- IComponentSymbol componentSymbol =
- SymbolFactory.eINSTANCE.createIComponentSymbol();
- componentSymbol.setName(symbolName);
-
- updateMap(componentSymbol, aggregator.getScope());
- }
- }
- }
-
- @SuppressWarnings("deprecation") //$NON-NLS-1$
- private void processSetsLocale(final String uri, final String elementName, Node attribute)
- {
- LocaleSetAggregator aggregator = LocaleSetAggregator.create(_file.getProject(), uri, elementName, attribute.getLocalName());
-
- if (aggregator != null)
- {
- DesignTimeApplicationManager dtAppMgr =
- DesignTimeApplicationManager.getInstance(_file.getProject());
-
- if (dtAppMgr != null)
- {
- DTFacesContext facesContext = dtAppMgr.getFacesContext(_file);
-
- if (facesContext != null)
- {
- facesContext.setLocaleString(attribute.getNodeValue());
- }
- }
- }
- }
-
- /**
- * @param scopeName - one of "request", "session" or "application"
- * @return an unmodifable map containing all known symbols for
- * that scope. If scopeName is not found, returns the empty map.
- */
- public Map<Object, ISymbol> getMapForScope(String scopeName)
- {
- final Map<Object, ISymbol> map = getMapForScopeInternal(scopeName);
-
- if (map != null)
- {
- return Collections.unmodifiableMap(map);
- }
-
- return Collections.EMPTY_MAP;
- }
-
- private void updateMap(ISymbol symbol, String scopeName)
- {
- final Map<Object, ISymbol> map = getMapForScopeInternal(scopeName);
-
- if (map != null)
- {
- map.put(symbol.getName(), symbol);
- }
- else
- {
- Platform.getLog(JSFCorePlugin.getDefault().getBundle()).log(new Status(IStatus.ERROR, JSFCorePlugin.PLUGIN_ID, 0, "Scope not found: "+scopeName, new Throwable())); //$NON-NLS-1$
- }
- }
-
- private Map<Object, ISymbol> getMapForScopeInternal(String scopeName)
- {
- if (ISymbolConstants.SYMBOL_SCOPE_REQUEST_STRING.equals(scopeName))
- {
- return getRequestMap();
- }
- else if (ISymbolConstants.SYMBOL_SCOPE_SESSION_STRING.equals(scopeName))
- {
- return getSessionMap();
- }
- else if (ISymbolConstants.SYMBOL_SCOPE_APPLICATION_STRING.equals(scopeName))
- {
- return getApplicationMap();
- }
- else if (ISymbolConstants.SYMBOL_SCOPE_NONE_STRING.equals(scopeName))
- {
- return getNoneMap();
- }
-
- Platform.getLog(JSFCorePlugin.getDefault().getBundle()).log(new Status(IStatus.ERROR, JSFCorePlugin.PLUGIN_ID, 0, "Scope not found: "+scopeName, new Throwable())); //$NON-NLS-1$
- return null;
-
- }
-
- private Map getRequestMap()
- {
- if (_requestMap == null)
- {
- _requestMap = new HashMap<Object, ISymbol>();
- }
-
- return _requestMap;
- }
-
- private Map<Object, ISymbol> getSessionMap()
- {
- if (_sessionMap == null)
- {
- _sessionMap = new HashMap<Object, ISymbol>();
- }
-
- return _sessionMap;
- }
-
- private Map<Object, ISymbol> getApplicationMap()
- {
- if (_applicationMap == null)
- {
- _applicationMap = new HashMap<Object, ISymbol>();
- }
-
- return _applicationMap;
- }
-
- private Map<Object, ISymbol> getNoneMap()
- {
- if (_noneMap == null)
- {
- _noneMap = new HashMap<Object, ISymbol>();
- }
-
- return _noneMap;
- }
-
- /**
- * Aggregates the sets-locale meta-data
- *
- * @author cbateman
- */
- private static class LocaleSetAggregator
- {
- private final static String SETS_LOCALE = "sets-locale"; //$NON-NLS-1$
-
- static LocaleSetAggregator create(IProject project,
- final String uri,
- final String elementName, final String attributeName)
- {
- final ITaglibDomainMetaDataModelContext mdContext = TaglibDomainMetaDataQueryHelper.createMetaDataModelContext(project, uri);
- Trait trait = TaglibDomainMetaDataQueryHelper.getTrait(mdContext, elementName+"/"+attributeName, SETS_LOCALE); //$NON-NLS-1$
-
- if (TraitValueHelper.getValueAsBoolean(trait))
- {
- return new LocaleSetAggregator();
- }
-
- return null;
- }
- }
-
- /**
- * Aggregates all the symbol contributor meta-data into a single object
- *
- * @author cbateman
- *
- */
- private static class SymbolContribAggregator
- {
- private final static String CONTRIBUTES_VALUE_BINDING =
- "contributes-value-binding"; //$NON-NLS-1$
- private final static String VALUE_BINDING_SCOPE = "value-binding-scope"; //$NON-NLS-1$
- private final static String VALUE_BINDING_SYMBOL_FACTORY =
- "value-binding-symbol-factory"; //$NON-NLS-1$
- private final static String STATIC_TYPE_KEY = "optional-value-binding-static-type"; //$NON-NLS-1$
- private final static String VALUEEXPRESSION_ATTR_NAME_KEY = "optional-value-binding-valueexpr-attr"; //$NON-NLS-1$
-
- /**
- * @param attributeName
- * @return a new instance only if attributeName is a symbol contributor
- */
- static SymbolContribAggregator create(final IProject project,
- final String uri,
- final String elementName,
- final String attributeName)
- {
- final String entityKey = elementName+"/"+attributeName; //$NON-NLS-1$
- final ITaglibDomainMetaDataModelContext mdContext = TaglibDomainMetaDataQueryHelper.createMetaDataModelContext(project, uri);
- Trait trait = TaglibDomainMetaDataQueryHelper.getTrait(mdContext, entityKey, CONTRIBUTES_VALUE_BINDING);
-
- boolean contribsValueBindings = TraitValueHelper.getValueAsBoolean(trait);
-
- if (contribsValueBindings)
- {
- String scope = null;
- String symbolFactory = null;
-
- trait = TaglibDomainMetaDataQueryHelper.getTrait(mdContext, entityKey, VALUE_BINDING_SCOPE);
- scope = TraitValueHelper.getValueAsString(trait);
-
- if (scope != null && !scope.equals("")) //$NON-NLS-1$
- {
- trait = TaglibDomainMetaDataQueryHelper.getTrait(mdContext, entityKey, VALUE_BINDING_SYMBOL_FACTORY);
- symbolFactory = TraitValueHelper.getValueAsString(trait);
- }
-
- trait = TaglibDomainMetaDataQueryHelper.getTrait(mdContext, entityKey, STATIC_TYPE_KEY);
-
- String staticType = null;
-
- if (trait != null)
- {
- staticType = TraitValueHelper.getValueAsString(trait);
- }
-
- trait = TaglibDomainMetaDataQueryHelper.getTrait(mdContext, entityKey, VALUEEXPRESSION_ATTR_NAME_KEY);
-
- String valueExprAttr = null;
- if (trait != null)
- {
- valueExprAttr = TraitValueHelper.getValueAsString(trait);
- }
-
- return new SymbolContribAggregator(scope, symbolFactory, staticType, valueExprAttr);
- }
-
- return null;
- }
-
- private final Map<String, String> _metadata = new HashMap<String, String>(4);
-
- SymbolContribAggregator(final String scope, final String factory, final String staticType, final String valueExprAttr)
- {
- _metadata.put("scope", scope); //$NON-NLS-1$
- _metadata.put("factory", factory); //$NON-NLS-1$
- _metadata.put("staticType", staticType); //$NON-NLS-1$
- _metadata.put("valueExprAttr", valueExprAttr); //$NON-NLS-1$
- }
-
- /**
- * @return the scope
- */
- public String getScope()
- {
- return _metadata.get("scope"); //$NON-NLS-1$
- }
-
- /**
- * @return the factory
- */
- public AbstractContextSymbolFactory getFactory()
- {
- return JSFCommonPlugin.getSymbolFactories().get(_metadata.get("factory")); //$NON-NLS-1$
- }
-
- public String getStaticType()
- {
- return _metadata.get("staticType"); //$NON-NLS-1$
- }
-
- public String getValueExpressionAttr()
- {
- return _metadata.get("valueExprAttr"); //$NON-NLS-1$
- }
- }
-
- private static class CountingMutex extends Object
- {
- private boolean _signalled = false;
-
- /**
- * @return true if the state of mutex is signalled
- */
- public synchronized boolean isSignalled() {
- return _signalled;
- }
-
- /**
- * @param signalled
- */
- public synchronized void setSignalled(boolean signalled) {
- this._signalled = signalled;
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/jsp/Messages.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/jsp/Messages.java
deleted file mode 100644
index de41104..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/jsp/Messages.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.designtime.internal.jsp;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Message resource class
- *
- * @author cbateman
- *
- */
-/*package*/ final class Messages {
- private static final String BUNDLE_NAME = "org.eclipse.jst.jsf.designtime.messages"; //$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
- .getBundle(BUNDLE_NAME);
-
- private Messages() {
- // no external instatiation
- }
-
- /**
- * @param key
- * @return the message string for key or !key! if not found
- */
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/jsp/StartupHandler.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/jsp/StartupHandler.java
deleted file mode 100644
index b3b4377..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/jsp/StartupHandler.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.designtime.internal.jsp;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jst.jsf.common.internal.JSPUtil;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigUtils;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorReference;
-import org.eclipse.ui.IPartListener2;
-import org.eclipse.ui.IStartup;
-import org.eclipse.ui.IWindowListener;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPartReference;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * On workbench startup, registers a part listener that triggers when
- * a JSP editor opens.
- *
- * @author cbateman
- *
- */
-public class StartupHandler implements IStartup
-{
- private final JSPEditorListener _partListener = new JSPEditorListener();
-
- public void earlyStartup()
- {
- PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable()
- {
- public void run()
- {
- IWorkbenchWindow windows[] =
- PlatformUI.getWorkbench().getWorkbenchWindows();
-
- for (int i = 0; i < windows.length; i++)
- {
- IWorkbenchPage pages[] = windows[i].getPages();
- for (int j = 0; j < pages.length; j++)
- {
- IEditorReference[] editorReferences =
- pages[j].getEditorReferences();
-
- for (int k = 0; k < editorReferences.length; k++)
- {
- if (_partListener.isValidJSPEditor(editorReferences[k]))
- {
- _partListener.setJSPModelListener(editorReferences[k]);
- }
- }
- }
- windows[i].getPartService().addPartListener(_partListener);
- }
-
- // TODO: register with all windows?
- PlatformUI.getWorkbench().addWindowListener(new IWindowListener()
- {
- public void windowActivated(IWorkbenchWindow window) {
- // do nothing
- }
-
- public void windowDeactivated(IWorkbenchWindow window) {
- // do nothing
- }
-
- public void windowClosed(IWorkbenchWindow window) {
- window.getPartService().removePartListener(_partListener);
- }
-
- public void windowOpened(IWorkbenchWindow window) {
- window.getPartService().addPartListener(_partListener);
- }
- });
- }
- });
- }
-
- private static class JSPEditorListener implements IPartListener2
- {
- private JSPModelProcessor _processor;
-
- public void partActivated(IWorkbenchPartReference partRef) {
- // do nothing
- }
-
- public void partBroughtToTop(IWorkbenchPartReference partRef) {
- // do nothing
- }
-
- public void partClosed(IWorkbenchPartReference partRef) {
- // do nothing
- }
-
- public void partDeactivated(IWorkbenchPartReference partRef) {
- // do nothing
- }
-
- public void partOpened(IWorkbenchPartReference partRef) {
- if (isValidJSPEditor(partRef))
- {
- setJSPModelListener((IEditorReference)partRef);
- }
- }
-
- public void partHidden(IWorkbenchPartReference partRef) {
- // do nothing
- }
-
- public void partVisible(IWorkbenchPartReference partRef) {
- // do nothing
- }
-
- public void partInputChanged(IWorkbenchPartReference partRef) {
- // do nothing
- }
-
- private boolean isJSPEditor(IEditorReference editorRef)
- {
- IFile file = getIFile(editorRef);
-
- if (file != null)
- {
- return JSPUtil.isJSPContentType(file);
- }
-
- return false;
- }
-
- /**
- * @param editorRef
- * @return true if the editor is editing the JSP content type and
- * the owning project is a JSF project
- */
- boolean isValidJSPEditor(IEditorReference editorRef)
- {
- final IFile file = getIFile(editorRef);
-
- return file != null &&
- JSFAppConfigUtils.isValidJSFProject(file.getProject()) &&
- isJSPEditor(editorRef);
- }
-
- boolean isValidJSPEditor(IWorkbenchPartReference partRef)
- {
- if (partRef instanceof IEditorReference)
- {
- return isValidJSPEditor((IEditorReference)partRef);
- }
-
- return false;
- }
-
- void setJSPModelListener(IEditorReference editorRef)
- {
- IFile file = getIFile(editorRef);
-
- if (file != null)
- {
- try
- {
- // implicitly creates if not present
- _processor = JSPModelProcessor.get(file);
- _processor.refresh(false);
- }
- catch (Exception e)
- {
- JSFCorePlugin.getDefault().getLog().log(new Status(IStatus.ERROR, JSFCorePlugin.PLUGIN_ID, 0, "Error acquiring model processor",e)); //$NON-NLS-1$
- }
- }
- }
-
- IFile getIFile(IEditorReference editorRef)
- {
- try
- {
- IEditorInput editorInput = editorRef.getEditorInput();
- Object adapt = editorInput.getAdapter(IFile.class);
-
- if (adapt instanceof IFile)
- {
- return (IFile) adapt;
- }
- }
- catch (PartInitException excp)
- {
- JSFCorePlugin.getDefault().getLog().log(new Status(IStatus.ERROR, JSFCorePlugin.PLUGIN_ID, 0, "Error acquiring editor input",excp)); //$NON-NLS-1$
- }
-
- return null;
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/messages.properties b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/messages.properties
deleted file mode 100644
index f4a8f98..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/messages.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-DefaultJSPTagResolver_DisplayName=Meta-data Driven Resolver
-PersistedDataTagStrategy_DisplayName=Cached Data Tag Resolver
-TagIntrospectingStrategy_DisplayName=Introspecting Tag Resolver
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/resolver/ViewBasedTaglibResolverFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/resolver/ViewBasedTaglibResolverFactory.java
deleted file mode 100644
index 3ed3716..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/resolver/ViewBasedTaglibResolverFactory.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.resolver;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ITagElement;
-import org.eclipse.jst.jsf.context.IModelContext;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IDOMContextResolver;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IMetadataContextResolver;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.ITaglibContextResolver;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IWorkspaceContextResolver;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.internal.ITextRegionContextResolver;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.designtime.DTAppManagerUtil;
-import org.eclipse.jst.jsf.designtime.internal.view.XMLViewDefnAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * A Taglib resolver that delegates to the design tieme view handler so that it
- * is independent of the tag definition type in use. Document must still be an
- * IStructuredDocument.
- *
- */
-public class ViewBasedTaglibResolverFactory implements
-IStructuredDocumentContextResolverFactory, IAdaptable
-{
- public IDOMContextResolver getDOMContextResolver(
- final IStructuredDocumentContext context)
- {
- // no dom resolver
- return null;
- }
-
- public IMetadataContextResolver getMetadataContextResolver(
- final IStructuredDocumentContext context)
- {
- // no metadata resolver
- return null;
- }
-
- public ITaglibContextResolver getTaglibContextResolver(
- final IStructuredDocumentContext context)
- {
- if (context.getStructuredDocument() instanceof IStructuredDocument)
- {
- final IWorkspaceContextResolver resolver = INSTANCE
- .getWorkspaceContextResolver(context);
- if (resolver != null)
- {
- final IProject project = resolver.getProject();
- final IResource res = resolver.getResource();
-
- if (project != null && res instanceof IFile)
- {
- final IFile file = (IFile) res;
-
- try
- {
- return new ViewBasedTaglibResolver(context, file,
- project);
- }
- catch (final IllegalArgumentException e)
- {
- // the constructor will throw this if the view
- // definition
- // adapter for file is not of the base type it needs
- // just fall through, no need to log
- }
- }
- }
- }
-
- return null;
- }
-
- /**
- * A taglib resolver that goes through the design time view handler to
- * resolve tags. This allows us to abstract the definition format (XML) from
- * the kind of tag handlers that process it (JSP vs. Facelets vs. others).
- *
- */
- private static class ViewBasedTaglibResolver implements
- ITaglibContextResolver
- {
- private final IProject _project;
- private final IFile _file;
- private final IStructuredDocumentContext _context;
-
- /**
- * @param context
- * @param file
- * @param project
- */
- private ViewBasedTaglibResolver(
- final IStructuredDocumentContext context, final IFile file,
- final IProject project)
- {
- super();
- _context = context;
- _file = file;
- _project = project;
-
- if (DTAppManagerUtil.getXMLViewDefnAdapter(project, file) == null)
- {
- throw new IllegalArgumentException(
- "View definition adapter not found");
- }
- }
-
- public String getTagPrefixForURI(final String uri)
- {
- final XMLViewDefnAdapter adapter = DTAppManagerUtil
- .getXMLViewDefnAdapter(_file);
-
- if (adapter != null)
- {
- return adapter.getPrefix(uri, _context.getStructuredDocument());
- }
- return null;
- }
-
- public String getTagURIForNodeName(final Node node)
- {
- final XMLViewDefnAdapter adapter = DTAppManagerUtil
- .getXMLViewDefnAdapter(_file);
- final Element element = getElement(node);
- if (element != null && adapter != null)
- {
- return adapter.getNamespace(element, _context.getStructuredDocument());
- }
- return null;
- }
-
- public NodeList getTagsByNamespaceURI(final String uri,
- final String tagName)
- {
- // TODO: what is the purpose of this API? deprecate?
- return null;
- }
-
- public boolean hasTag(final Node node)
- {
- // it is sufficient to check that the view adapter will give us
- // a non-null tag element
- return getTagElement(node) != null;
- }
-
- public boolean canResolveContext(final IModelContext modelContext)
- {
- // must be a JSP page
- final Object adapter = modelContext.getAdapter(IStructuredDocumentContext.class);
-
- if (adapter instanceof IStructuredDocumentContext)
- {
- return ((IStructuredDocumentContext)adapter).getStructuredDocument() instanceof IStructuredDocument;
- }
- return false;
- }
-
- private Element getElement(final Node node)
- {
- Element checkNode = null;
-
- if (node instanceof Element)
- {
- checkNode = (Element) node;
- }
- else if (node instanceof Attr)
- {
- checkNode = ((Attr) node).getOwnerElement();
- }
- return checkNode;
- }
-
- private ITagElement getTagElement(final Node node)
- {
- final Element element = getElement(node);
-
- final XMLViewDefnAdapter adapter =
- DTAppManagerUtil.getXMLViewDefnAdapter(_project, _file);
-
- if (element != null && adapter != null)
- {
- return adapter.mapToTagElement(element, _context
- .getStructuredDocument());
- }
- // shouldn't happen since the constuctor throws an exceptino
- // if can't get the adapter
- JSFCorePlugin.log("Unexpected case",
- new Throwable(_file.toString()));
- return null;
- }
- }
-
-
- public ITextRegionContextResolver getTextRegionResolver(
- final IStructuredDocumentContext context)
- {
- // no text region resolver
- return null;
- }
-
- public IWorkspaceContextResolver getWorkspaceContextResolver(
- final IStructuredDocumentContext context)
- {
- // no workspace resolver
- return null;
- }
-
- public Object getAdapter(final Class adapter)
- {
- if (adapter.isInstance(this))
- {
- return this;
- }
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/symbols/ConfigBasedDTPropertyResolver.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/symbols/ConfigBasedDTPropertyResolver.java
deleted file mode 100644
index 2564e31..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/symbols/ConfigBasedDTPropertyResolver.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Xiaonan Jiang/IBM -- extracted from https://bugs.eclipse.org/bugs/show_bug.cgi?id=206514
- * Cameron Bateman/Oracle - integrated.
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.symbols;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigManager;
-import org.eclipse.jst.jsf.designtime.el.AbstractDTPropertyResolver;
-import org.eclipse.jst.jsf.designtime.el.DefaultDTPropertyResolver;
-import org.eclipse.jst.jsf.designtime.el.IDecorativeResolver;
-import org.eclipse.jst.jsf.designtime.el.IInstancePerProjectResolver;
-
-/**
- * A design time proxy for the runtime ProperyResolver.
- *
- * @author xnjiang
- *
- */
-public class ConfigBasedDTPropertyResolver extends DefaultDTPropertyResolver
- implements IInstancePerProjectResolver
-{
- private IProject _project;
-
- /**
- * Constructor
- *
- */
- public ConfigBasedDTPropertyResolver()
- {
- super();
- }
-
- @Override
- public ISymbol[] getAllProperties(final ISymbol base)
- {
- final Map<String, ISymbol> allSymbols = new HashMap<String, ISymbol>();
- final ISymbol[] superSymbols = super.getAllProperties(base);
- for (final ISymbol superSymbol : superSymbols)
- {
- allSymbols.put(superSymbol.getName(), superSymbol);
- }
-
- if (JSFCorePlugin.hasDecorativePropertyResolvers())
- {
- final List<AbstractDTPropertyResolver> resolvers = retrieveDecorativePropertyResolvers(_project);
- for (final AbstractDTPropertyResolver resolver : resolvers)
- {
- final ISymbol[] otherSymbols = resolver.getAllProperties(base);
- for (final ISymbol otherSymbol : otherSymbols)
- {
- // allow subsequent resolvers to replace symbols by name
- // added previously
- allSymbols.put(otherSymbol.getName(), otherSymbol);
- }
- }
- }
- return allSymbols.values().toArray(ISymbol.EMPTY_SYMBOL_ARRAY);
-
- }
-
- @Override
- public ISymbol getProperty(final ISymbol base, final int offset)
- {
- if (JSFCorePlugin.hasDecorativePropertyResolvers())
- {
- final List<AbstractDTPropertyResolver> resolvers = retrieveDecorativePropertyResolvers(_project);
-
- // we need to iterate backwards through the resolvers, since
- // the we take the first answer we receive.
- for (int i = resolvers.size() - 1; i >= 0; i--)
- {
- final ISymbol symbol = resolvers.get(i).getProperty(base,
- offset);
- if (symbol != null)
- {
- return symbol;
- }
- }
- }
- return super.getProperty(base, offset);
- }
-
- @Override
- public ISymbol getProperty(final ISymbol base, final Object propertyId)
- {
- if (JSFCorePlugin.hasDecorativePropertyResolvers())
- {
- final List<AbstractDTPropertyResolver> resolvers = retrieveDecorativePropertyResolvers(_project);
-
- // we need to iterate backwards through the resolvers, since
- // the we take the first answer we receive.
- for (int i = resolvers.size() - 1; i >= 0; i--)
- {
- final ISymbol symbol = resolvers.get(i).getProperty(base,
- propertyId);
- if (symbol != null)
- {
- return symbol;
- }
- }
- }
- return super.getProperty(base, propertyId);
- }
-
- private List<AbstractDTPropertyResolver> retrieveDecorativePropertyResolvers(
- final IProject project)
- {
- final JSFAppConfigManager manager = JSFAppConfigManager
- .getInstance(project);
- final List<String> propertyResolvers = manager.getPropertyResolvers();
- final List<AbstractDTPropertyResolver> resolvers = new ArrayList<AbstractDTPropertyResolver>();
- for (final String propertyResolver : propertyResolvers)
- {
- final List<String> ids = JSFCorePlugin
- .getPropertyResolversForName(propertyResolver);
-
- for (final String id : ids)
- {
- final AbstractDTPropertyResolver resolver = JSFCorePlugin
- .getPropertyResolver(id).getInstance(_project);
- if (resolver instanceof IDecorativeResolver)
- {
- resolvers.add(resolver);
- }
- else
- {
- JSFCorePlugin.log(new Exception(), String.format("resolver %s must implement the IDecorativeResolver interface to be used", id));
- }
- }
- }
- return resolvers;
- }
-
- public void setProject(final IProject project)
- {
- _project = project;
- }
-
- // private void retrievePropertyResolver() {
- // try {
- // String str =
- // project.getPersistentProperty(PERSIST_PROPERTY_KEY_PROPERTY_RESOLVERS);
- // if (str != null) {
- // resolvers = new ArrayList<AbstractDTPropertyResolver>();
- // StringTokenizer tokenizer = new StringTokenizer(str, ",");//$NON-NLS-1$
- // while (tokenizer.hasMoreTokens()) {
- // AbstractDTPropertyResolver resolver =
- // JSFCorePlugin.getPropertyResolvers().get(tokenizer.nextToken());
- // if (resolver != null) {
- // resolvers.add(resolver);
- // }
- // }
- // } else {
- // checkFacesConfigForPropertyResolver();
- // }
- // } catch (CoreException e) {
- // checkFacesConfigForPropertyResolver();
- // }
- // }
- //
- // private void checkFacesConfigForPropertyResolver() {
- // resolvers = new ArrayList<AbstractDTPropertyResolver>();
- // String str = "";//$NON-NLS-1$
- // boolean bFirst = true;
- // List facesConfigs =
- // JSFAppConfigManager.getInstance(project).getFacesConfigModels();
- // Iterator itFacesConfigs = facesConfigs.iterator();
- // while (itFacesConfigs.hasNext()) {
- // FacesConfigType facesConfig = (FacesConfigType)itFacesConfigs.next();
- // EList applications = facesConfig.getApplication();
- // for (int i=0;i<applications.size();i++) {
- // EList resolvers2 =
- // ((ApplicationType)applications.get(i)).getPropertyResolver();
- // for (int j=0;j<resolvers2.size();j++) {
- // PropertyResolverType resolverType =
- // (PropertyResolverType)resolvers2.get(i);
- // AbstractDTPropertyResolver resolver =
- // JSFCorePlugin.getPropertyResolvers().get(resolverType.getTextContent());
- // if (resolver != null) {
- // resolvers.add(resolver);
- // if (bFirst) {
- // bFirst = false;
- // } else {
- // str += ",";//$NON-NLS-1$
- // }
- // str += resolverType.getTextContent();
- // }
- // }
- // }
- // }
- // try {
- // if (!str.equals("")) {//$NON-NLS-1$
- // project.setPersistentProperty(PERSIST_PROPERTY_KEY_PROPERTY_RESOLVERS,
- // str);
- // } else {
- // project.setPersistentProperty(PERSIST_PROPERTY_KEY_PROPERTY_RESOLVERS,
- // null);
- // }
- // } catch (CoreException e) {
- // e.printStackTrace();
- // }
- // }
- //
- // /**
- // * Called when a change in an application configuration model for which
- // * this listener has been registered occurs.
- // *
- // * @param notification EMF {@link Notification} instance that describes
- // the
- // * model change.
- // */
- // public void notifyChanged(Notification notification) {
- // checkFacesConfigForPropertyResolver();
- // }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/symbols/ConfigBasedDTVariableResolver.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/symbols/ConfigBasedDTVariableResolver.java
deleted file mode 100644
index e39fe1c..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/symbols/ConfigBasedDTVariableResolver.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Xiaonan Jiang/IBM -- extracted from https://bugs.eclipse.org/bugs/show_bug.cgi?id=206514
- * Cameron Bateman/Oracle - integrated.
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.designtime.internal.symbols;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigManager;
-import org.eclipse.jst.jsf.designtime.context.DTFacesContext;
-import org.eclipse.jst.jsf.designtime.el.AbstractDTVariableResolver;
-import org.eclipse.jst.jsf.designtime.el.DefaultDTVariableResolver;
-import org.eclipse.jst.jsf.designtime.el.IDecorativeResolver;
-
-/**
- * A design time proxy for the runtime VariableResolver.
- *
- * @author xnjiang
- *
- */
-public class ConfigBasedDTVariableResolver extends DefaultDTVariableResolver
-// implements IFacesConfigChangeListener
-{
- /**
- * Constructor
- */
- public ConfigBasedDTVariableResolver()
- {
- super();
-
- }
-
- @Override
- public ISymbol[] getAllVariables(final DTFacesContext facesContext,
- final IAdaptable externalContextKey)
- {
- //final long curTime = System.nanoTime();
- final Map<String, ISymbol> allSymbols = new HashMap<String, ISymbol>();
- final ISymbol[] superSymbols = super.getAllVariables(facesContext,
- externalContextKey);
- for (final ISymbol superSymbol : superSymbols)
- {
- allSymbols.put(superSymbol.getName(), superSymbol);
- }
-
- if (JSFCorePlugin.hasDecorativeVariableResolvers())
- {
- final IProject project = getProject(facesContext);
-
- final List<AbstractDTVariableResolver> resolvers = retrieveDecorativeVariableResolvers(project);
- for (final AbstractDTVariableResolver resolver : resolvers)
- {
- final ISymbol[] otherSymbols = resolver.getAllVariables(
- facesContext, externalContextKey);
- for (final ISymbol otherSymbol : otherSymbols)
- {
- // allow subsequent resolvers to replace symbols by name
- // added previously
- allSymbols.put(otherSymbol.getName(), otherSymbol);
- }
- }
- }
- //System.out.printf("totalAllSymbols: %d\n", Long.valueOf(System.nanoTime()- curTime));
- return allSymbols.values().toArray(ISymbol.EMPTY_SYMBOL_ARRAY);
- }
-
- @Override
- public ISymbol resolveVariable(final DTFacesContext context,
- final String name, final IAdaptable externalContextKey)
- {
- //long curTime = System.nanoTime();
- if (JSFCorePlugin.hasDecorativeVariableResolvers())
- {
- final IProject project = getProject(context);
-
- final List<AbstractDTVariableResolver> resolvers = retrieveDecorativeVariableResolvers(project);
-
- // we need to iterate backwards through the resolvers, since
- // the we take the first answer we receive.
- for (int i = resolvers.size() - 1; i >= 0; i--)
- {
- final ISymbol symbol = resolvers.get(i).resolveVariable(
- context, name, externalContextKey);
- if (symbol != null)
- {
- return symbol;
- }
- }
- }
- ISymbol symbol = super.resolveVariable(context, name, externalContextKey);
- //System.out.printf("totalSymbol: %d\n", Long.valueOf(System.nanoTime()- curTime));
- return symbol;
- }
-
- private List<AbstractDTVariableResolver> retrieveDecorativeVariableResolvers(
- final IProject project)
- {
- //final long curTime = System.nanoTime();
- final JSFAppConfigManager manager = JSFAppConfigManager
- .getInstance(project);
- final List<String> variableResolvers = manager.getVariableResolvers();
- final List<AbstractDTVariableResolver> resolvers = new ArrayList<AbstractDTVariableResolver>();
- for (final String variableResolver : variableResolvers)
- {
- final List<String> ids = JSFCorePlugin
- .getVariableResolversForName(variableResolver);
-
- for (final String id : ids)
- {
- final AbstractDTVariableResolver resolver = JSFCorePlugin
- .getVariableResolvers(id).getInstance(project);
- if (resolver instanceof IDecorativeResolver)
- {
- resolvers.add(resolver);
- }
- else
- {
- JSFCorePlugin.log(new Exception(), String.format("resolver %s must implement the IDecorativeResolver interface to be used", id));
- }
- }
- }
- //System.out.printf("retrieveDecorativeVariable: %d\n", Long.valueOf(System.nanoTime()- curTime));
- return resolvers;
- }
-
- private IProject getProject(final DTFacesContext facesContext)
- {
- final IResource res = facesContext.adaptContextObject();
-
- if (res != null)
- {
- return res.getProject();
- }
- return null;
- }
-
- // private void checkFacesConfigForVariableResolver(final IProject project)
- // {
- // resolvers = new ArrayList<AbstractDTVariableResolver>();
- // String str = "";//$NON-NLS-1$
- // boolean bFirst = true;
- // final List facesConfigs =
- // JSFAppConfigManager.getInstance(project).getFacesConfigModels();
- // final Iterator itFacesConfigs = facesConfigs.iterator();
- // while (itFacesConfigs.hasNext()) {
- // final FacesConfigType facesConfig =
- // (FacesConfigType)itFacesConfigs.next();
- // final EList applications = facesConfig.getApplication();
- // for (int i=0;i<applications.size();i++) {
- // final EList resolvers2 =
- // ((ApplicationType)applications.get(i)).getVariableResolver();
- // for (int j=0;j<resolvers2.size();j++) {
- // final VariableResolverType resolverType =
- // (VariableResolverType)resolvers2.get(i);
- // final AbstractDTVariableResolver resolver =
- // JSFCorePlugin.getVariableResolvers().get(resolverType.getTextContent());
- // if (resolver != null) {
- // resolvers.add(resolver);
- // if (bFirst) {
- // bFirst = false;
- // } else {
- // str += ",";//$NON-NLS-1$
- // }
- // str += resolverType.getTextContent();
- // }
- // }
- // }
- // }
- // try {
- // if (!str.equals("")) {//$NON-NLS-1$
- // project.setPersistentProperty(PERSIST_PROPERTY_KEY_VARIABLE_RESOLVERS,
- // str);
- // } else {
- // project.setPersistentProperty(PERSIST_PROPERTY_KEY_VARIABLE_RESOLVERS,
- // null);
- // }
- // } catch (final CoreException e) {
- // e.printStackTrace();
- // }
- // }
- //
- // public void notifyChanged(final Notification notification) {
- // checkFacesConfigForVariableResolver();
- // }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/symbols/DataModelVariableTestFacade.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/symbols/DataModelVariableTestFacade.java
deleted file mode 100644
index 7dc1801..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/symbols/DataModelVariableTestFacade.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.symbols;
-
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jst.jsf.common.internal.types.ValueType;
-import org.eclipse.jst.jsf.context.symbol.ERuntimeSource;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.designtime.symbols.AbstractDataModelVariableFactory;
-
-/**
- * Used to expose protected final members of AbstractDataModelVariableFactory
- * for testing purposes. May change without notice, should *never* be used in
- * production code.
- *
- * @author cbateman
- *
- */
-public final class DataModelVariableTestFacade extends AbstractDataModelVariableFactory
-{
- /**
- * Test facade for createArraySymbol
- *
- * @param symbolName
- * @param signature
- * @param javaProject
- * @return super.createArraySymbol()
- */
- public final ISymbol testCreateArraySymbol(final String symbolName, final String signature, final IJavaProject javaProject)
- {
- return getSymbolFactory().createArraySymbol(symbolName, signature, ERuntimeSource.TAG_INSTANTIATED_SYMBOL_LITERAL, javaProject);
- }
-
- /**
- * Test facade for createFromList
- *
- * @param symbolName
- * @param valueType
- * @param javaProject
- * @return super.createFromList()
- */
- public final ISymbol testCreateFromList(String symbolName, ValueType valueType, IJavaProject javaProject)
- {
- return getSymbolFactory().createFromList(symbolName, valueType, ERuntimeSource.TAG_INSTANTIATED_SYMBOL_LITERAL, null, javaProject);
- }
-
- /**
- * @param symbolName
- * @param signature
- * @param javaProject
- * @return a symbol assuming a scalar type wrapping
- */
- public ISymbol testCreateScalarSymbol(String symbolName, String signature, IJavaProject javaProject)
- {
- return getSymbolFactory().createScalarSymbol(symbolName, signature, ERuntimeSource.TAG_INSTANTIATED_SYMBOL_LITERAL, javaProject);
- }
-
-
- /**
- * @param symbolName
- * @param valueType
- * @param javaProject
- * @return a symbol from a proxied call to super.createFromType
- */
- public ISymbol testCreateFromType(String symbolName, ValueType valueType,
- IJavaProject javaProject) {
- return super.createFromType(symbolName, valueType, javaProject);
- }
-
- @Override
- protected final String getVariableSourceName()
- {
- return "testFacade -- SHOULD NOT BE USED IN PRODUCTION CODE"; //$NON-NLS-1$
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/symbols/JSPTagVariableSymbolSourceProvider.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/symbols/JSPTagVariableSymbolSourceProvider.java
deleted file mode 100644
index ca109f7..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/symbols/JSPTagVariableSymbolSourceProvider.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.designtime.internal.symbols;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.context.symbol.source.AbstractSymbolSourceProviderFactory;
-import org.eclipse.jst.jsf.context.symbol.source.ISymbolConstants;
-import org.eclipse.jst.jsf.context.symbol.source.ISymbolSourceProvider;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.designtime.internal.jsp.JSPModelProcessor;
-import org.eclipse.jst.jsf.designtime.symbols.FileContextUtil;
-import org.eclipse.jst.jsf.designtime.symbols.SymbolUtil;
-
-
-/**
- * Self-factory for a symbol provider that derives symbol information from
- * meta-data annotations on tag attributes that declare runtime EL variables
- *
- * @author cbateman
- *
- */
-public class JSPTagVariableSymbolSourceProvider extends
- AbstractSymbolSourceProviderFactory implements ISymbolSourceProvider
-{
- protected ISymbolSourceProvider create(IProject project)
- {
- return this;
- }
-
- public ISymbol[] getSymbols(IAdaptable context, int symbolScopeMask)
- {
- final IFile fileContext = FileContextUtil.deriveIFileFromContext(context);
-
- if (isProvider(fileContext))
- {
- JSPModelProcessor modelProcessor = null;
-
- try
- {
- modelProcessor = JSPModelProcessor.get(fileContext);
-
- // ensure internal model is sync'ed with document
- // but don't force refresh
- modelProcessor.refresh(false);
- final List<ISymbol> symbols = new ArrayList();
-
- if ((symbolScopeMask & ISymbolConstants.SYMBOL_SCOPE_REQUEST) != 0)
- {
- symbols.addAll(modelProcessor.getMapForScope(ISymbolConstants.SYMBOL_SCOPE_REQUEST_STRING).values());
- }
- if ((symbolScopeMask & ISymbolConstants.SYMBOL_SCOPE_SESSION) != 0)
- {
- symbols.addAll(modelProcessor.getMapForScope(ISymbolConstants.SYMBOL_SCOPE_SESSION_STRING).values());
- }
- if ((symbolScopeMask & ISymbolConstants.SYMBOL_SCOPE_APPLICATION) != 0)
- {
- symbols.addAll(modelProcessor.getMapForScope(ISymbolConstants.SYMBOL_SCOPE_APPLICATION_STRING).values());
- }
- if ((symbolScopeMask & ISymbolConstants.SYMBOL_SCOPE_NONE) != 0)
- {
- symbols.addAll(modelProcessor.getMapForScope(ISymbolConstants.SYMBOL_SCOPE_NONE_STRING).values());
- }
-
- return symbols.toArray(ISymbol.EMPTY_SYMBOL_ARRAY);
- }
- catch (Exception e)
- {
- JSFCorePlugin.getDefault().getLog().log(new Status(IStatus.ERROR, JSFCorePlugin.PLUGIN_ID, 0, "Error acquiring model processor",e)); //$NON-NLS-1$
- // fall-through to empty symbol array
- }
- }
-
- return ISymbol.EMPTY_SYMBOL_ARRAY;
- }
-
- public ISymbol[] getSymbols(String prefix, IAdaptable context,
- int symbolScopeMask) {
- return SymbolUtil.
- filterSymbolsByPrefix(getSymbols(context, symbolScopeMask), prefix);
- }
-
- public boolean isProvider(IAdaptable context)
- {
- IFile file = FileContextUtil.deriveIFileFromContext(context);
-
- return (file != null
- && file.getProject() == this.getProject());
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/symbols/Messages.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/symbols/Messages.java
deleted file mode 100644
index f555477..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/symbols/Messages.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.designtime.internal.symbols;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Message resource class
- *
- * @author cbateman
- *
- */
-/*package*/ final class Messages {
- private static final String BUNDLE_NAME = "org.eclipse.jst.jsf.designtime.messages"; //$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
- .getBundle(BUNDLE_NAME);
-
- private Messages() {
- // no external instatiation
- }
-
- /**
- * @param key
- * @return the message string for key or !key! if not found
- */
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/symbols/ResourceBundleMapSource.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/symbols/ResourceBundleMapSource.java
deleted file mode 100644
index 4e7d66c..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/symbols/ResourceBundleMapSource.java
+++ /dev/null
@@ -1,246 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.symbols;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.AbstractMap;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IStorage;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jst.jsf.common.internal.resource.IResourceLifecycleListener;
-import org.eclipse.jst.jsf.common.internal.resource.LifecycleListener;
-import org.eclipse.jst.jsf.common.internal.resource.ResourceLifecycleEvent;
-import org.eclipse.jst.jsf.common.internal.resource.ResourceLifecycleEvent.EventType;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.core.internal.tld.LoadBundleUtil;
-
-class ResourceBundleMapSource extends AbstractMap
-{
- private static final String PROPERTY_QUALIFIER =
- "org.eclipse.jst.jsf.designtime.internal.jsp"; //$NON-NLS-1$
- private static final String SESSION_PROPERTY_NAME_PROJECT =
- "ResourceBundleMapSource"; //$NON-NLS-1$
- private static final QualifiedName SESSION_PROPERTY_KEY_PROJECT =
- new QualifiedName(PROPERTY_QUALIFIER, SESSION_PROPERTY_NAME_PROJECT);
-
- private static IFile getCachedBundleFile(final IProject project, final String baseName)
- {
- if (project != null)
- {
- Map bundleFileCache = getBundleFileCache(project);
-
- if (bundleFileCache != null)
- {
- return (IFile) bundleFileCache.get(baseName);
- }
- }
-
- return null;
- }
-
- private static Map getBundleFileCache(final IProject project)
- {
- synchronized(project)
- {
- Map bundleFileCache = null;
-
- try
- {
- bundleFileCache =
- (Map) project.getSessionProperty(SESSION_PROPERTY_KEY_PROJECT);
-
- if (bundleFileCache == null)
- {
- bundleFileCache = new HashMap();
- LifecycleListener listener = new LifecycleListener(project);
- listener.addListener(new IResourceLifecycleListener()
- {
- public EventResult acceptEvent(ResourceLifecycleEvent event)
- {
- EventResult result = EventResult.getDefaultEventResult();
-
- if (event.getEventType() == EventType.RESOURCE_INACCESSIBLE)
- {
- try
- {
- Map bundleCache =
- (Map) project.getSessionProperty(SESSION_PROPERTY_KEY_PROJECT);
- bundleCache.clear();
- project.setSessionProperty(SESSION_PROPERTY_KEY_PROJECT, null);
- }
- catch (CoreException ce)
- {
- JSFCorePlugin.log("Error clearing bundle file cache", ce); //$NON-NLS-1$
- }
- result = EventResult.getDisposeAfterEventResult();
- }
-
- return result;
- }
- }
- );
-
- project.setSessionProperty(SESSION_PROPERTY_KEY_PROJECT, bundleFileCache);
- }
- }
- catch (CoreException ce)
- {
- JSFCorePlugin.log("Error creating bundle file cache", ce); //$NON-NLS-1$
- }
-
- return bundleFileCache;
- }
- }
-
- private static IFile createCachedBundleFile(final IProject project,
- final String resourcePathStr)
- throws IOException, CoreException
- {
- IStorage storage =
- LoadBundleUtil.getLoadBundleResource(project, resourcePathStr);
-
- IFile bundleRes = null;
-
- if (storage != null
- && storage.getAdapter(IFile.class) != null)
- {
- bundleRes = (IFile) storage.getAdapter(IFile.class);
- getBundleFileCache(project).put(resourcePathStr, bundleRes);
- return bundleRes;
- }
-
- throw new IOException("Bundle "+resourcePathStr+" not found in classpath for project: "+project.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- private Properties _resourceBundle; // = null; set on first access or changes
- private final IFile _bundleFile; // the resource
- private final String _resourcePathStr; // the key used in the file cache
- // as returned by IResource.getModificationStamp()
- // the last time _resourceBundle was loaded
- private long _lastModificationStamp;
-
- ResourceBundleMapSource(final IProject context,
- final String resourcePathStr)
- throws IOException, JavaModelException, CoreException
- {
- IFile cachedBundleFile = getCachedBundleFile(context, resourcePathStr);
-
- if (cachedBundleFile == null)
- {
- cachedBundleFile = createCachedBundleFile(context, resourcePathStr);
- }
-
- _bundleFile = cachedBundleFile;
- _resourcePathStr = resourcePathStr;
- }
-
- private void checkAndRefreshBundle()
- {
- if (_bundleFile.isAccessible())
- {
- if (_resourceBundle == null // doesn't exist yet
- // exists but ws is out of sync
- || !_bundleFile.isSynchronized(IResource.DEPTH_ZERO)
- // exists but user has changed in workspace
- || _bundleFile.getModificationStamp()
- != _lastModificationStamp)
- {
- InputStream bundleStream = null;
- try
- {
- // force refresh if out of sync
- bundleStream = _bundleFile.getContents(true);
- _resourceBundle = new Properties();
- _resourceBundle.load(bundleStream);
- _lastModificationStamp = _bundleFile.getModificationStamp();
- }
- catch (CoreException ce)
- {
- JSFCorePlugin.log("Error refreshing bundle", ce); //$NON-NLS-1$
- }
- catch (IOException ioe)
- {
- JSFCorePlugin.log("Error refreshing bundle", ioe); //$NON-NLS-1$
- }
- finally
- {
- if (bundleStream != null)
- {
- try
- {
- bundleStream.close();
- }
- catch (IOException ioe)
- {
- JSFCorePlugin.log("Error closing bundle", ioe); //$NON-NLS-1$
- }
- }
- }
- }
- }
- else
- {
- // bundle no longer exists so remove it
- Map bundleFileCache = getBundleFileCache(_bundleFile.getProject());
-
- if (bundleFileCache != null &&
- bundleFileCache.containsKey(_resourcePathStr))
- {
- bundleFileCache.remove(_resourcePathStr);
- }
- // in either case, clear the bundle entry
- if (_resourceBundle != null)
- {
- _resourceBundle.clear();
- _resourceBundle = null;
- }
- }
- }
-
- public Set entrySet()
- {
- checkAndRefreshBundle();
-
- if (_resourceBundle == null)
- {
- return Collections.EMPTY_SET;
- }
- return _resourceBundle.entrySet();
- }
-
- /**
- * @see java.util.AbstractMap#get(java.lang.Object)
- * @overrride to optimize for the fact that we are doing a hash get
- */
- //
- public Object get(Object key)
- {
- checkAndRefreshBundle();
-
- if (_resourceBundle == null)
- {
- return null;
- }
- return _resourceBundle.get(key);
- }
-}
\ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/symbols/ResourceBundleMapSourceFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/symbols/ResourceBundleMapSourceFactory.java
deleted file mode 100644
index dc2209c..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/symbols/ResourceBundleMapSourceFactory.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.designtime.internal.symbols;
-
-import java.io.IOException;
-import java.util.Map;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.JavaModelException;
-
-/**
- * Factory class for acquiring a ResourceBundleMapSourceFactory outside the local
- * package. This is intended only for internal testing and related use and
- * should not be used for normal feature development
- *
- * @author cbateman
- *
- */
-public class ResourceBundleMapSourceFactory
-{
- /**
- * @param project
- * @param resourcePathStr
- * @return a ResourceBundleMapSource
- * @throws CoreException
- * @throws IOException
- * @throws JavaModelException
- */
- public static Map getResourceBundleMapSource(final IProject project,
- final String resourcePathStr)
- throws JavaModelException, IOException, CoreException
- {
- return new ResourceBundleMapSource(project, resourcePathStr);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/symbols/ResourceBundleSymbolSourceProvider.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/symbols/ResourceBundleSymbolSourceProvider.java
deleted file mode 100644
index b96b8a8..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/symbols/ResourceBundleSymbolSourceProvider.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.symbols;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jst.jsf.context.symbol.IComponentSymbol;
-import org.eclipse.jst.jsf.context.symbol.IMapTypeDescriptor;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.context.symbol.SymbolFactory;
-import org.eclipse.jst.jsf.context.symbol.source.AbstractSymbolSourceProviderFactory;
-import org.eclipse.jst.jsf.context.symbol.source.ISymbolSourceProvider;
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigManager;
-import org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigUtils;
-import org.eclipse.jst.jsf.designtime.symbols.FileContextUtil;
-import org.eclipse.jst.jsf.designtime.symbols.SymbolUtil;
-import org.eclipse.jst.jsf.facesconfig.emf.BaseNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.ResourceBundleType;
-import org.eclipse.jst.jsf.facesconfig.emf.VarType;
-
-/**
- * WARNING: this is an interim solution to supporting Faces 1.2 resource
- * bundle variables. This class will become obsolete by design once
- * the dt framework for Unified EL symbol resolution is added
- *
- * DO NOT USE THIS CLASS EXTERNALLY, IT WILL BE REMOVED WITHOUT WARNING IN THE FUTURE
- * WITH NO MIGRATION PATH
- *
- * Self-factory for symbol source providers that contribute symbols for
- * the resource bundle variables declared in Faces 1.2 and greater
- * app configuration files.
- *
- * @author cbateman
- *
- */
-public final class ResourceBundleSymbolSourceProvider extends
- AbstractSymbolSourceProviderFactory implements ISymbolSourceProvider {
-
- protected final ISymbolSourceProvider create(IProject project) {
- return this;
- }
-
- public final ISymbol[] getSymbols(IAdaptable context, int symbolScopeMask)
- {
- if (isProvider(context))
- {
- final List symbols = new ArrayList();
- final IFile fileContext = FileContextUtil.deriveIFileFromContext(context);
- final IProject project = fileContext.getProject();
-
- final JSFAppConfigManager appconfigMgr = JSFAppConfigManager.getInstance(project);
- final List resourceBundles = appconfigMgr.getResourceBundles();
-
- for (final Iterator it = resourceBundles.iterator(); it.hasNext();)
- {
- ResourceBundleType resBundle = (ResourceBundleType) it.next();
- final String basename = getBaseName(resBundle);
- final String name = getVarName(resBundle);
-
- if (basename != null && name != null)
- {
- try
- {
- symbols.add(createSymbolForResourceBundle(project, name, basename));
- } catch (JavaModelException e) {
- JSFCorePlugin.log(e, "Error creating base name for: "+basename); //$NON-NLS-1$
- } catch (IOException e) {
- JSFCorePlugin.log(e, "Error creating base name for: "+basename); //$NON-NLS-1$
- } catch (CoreException e) {
- JSFCorePlugin.log(e, "Error creating base name for: "+basename); //$NON-NLS-1$
- }
- }
- }
- return (ISymbol[]) symbols.toArray(ISymbol.EMPTY_SYMBOL_ARRAY);
- }
- return ISymbol.EMPTY_SYMBOL_ARRAY;
- }
-
- private ISymbol createSymbolForResourceBundle(IProject project,
- final String name,
- final String basename) throws JavaModelException, IOException, CoreException
- {
- // TODO: push down into ResourceBundleMapSourceFactory and share
- // with loadBundle
- final Map mapSource = ResourceBundleMapSourceFactory
- .getResourceBundleMapSource(project, basename);
- final IMapTypeDescriptor typeDesc =
- SymbolFactory.eINSTANCE.createIMapTypeDescriptor();
- typeDesc.setMapSource(mapSource);
- final IComponentSymbol symbol =
- SymbolFactory.eINSTANCE.createIComponentSymbol();
- symbol.setName(name);
- symbol.setTypeDescriptor(typeDesc);
- symbol.setDetailedDescription(Messages.getString("ResourceBundleSymbolSourceProvider.DetailedDescription")+basename+"</i>"); //$NON-NLS-1$//$NON-NLS-2$
- return symbol;
- }
-
- private String getBaseName(ResourceBundleType resBundle)
- {
- final BaseNameType baseNameType = resBundle.getBaseName();
- if (baseNameType != null)
- {
- return baseNameType.getTextContent();
- }
- return null;
- }
-
- private String getVarName(ResourceBundleType resBundle)
- {
- final VarType varName = resBundle.getVar();
- if (varName != null)
- {
- return varName.getTextContent();
- }
- return null;
- }
-
- public final ISymbol[] getSymbols(String prefix, IAdaptable context,
- int symbolScopeMask) {
- return SymbolUtil.
- filterSymbolsByPrefix(getSymbols(context, symbolScopeMask), prefix);
- }
-
- public final boolean isProvider(IAdaptable context) {
- IFile file = FileContextUtil.deriveIFileFromContext(context);
-
- if (file != null)
- {
- final IProject project = file.getProject();
-
- if (project != null && project.isAccessible())
- {
- // to be valid, the jsf project must be at least version 1.2
- return JSFAppConfigUtils.isValidJSFProject(project, IJSFCoreConstants.FACET_VERSION_1_2);
- }
- }
-
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/symbols/StaticJavaTypeSymbolFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/symbols/StaticJavaTypeSymbolFactory.java
deleted file mode 100644
index 14d1c93..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/symbols/StaticJavaTypeSymbolFactory.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.designtime.internal.symbols;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.symbol.IJavaTypeDescriptor2;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.context.symbol.source.AbstractContextSymbolFactory;
-import org.eclipse.jst.jsf.context.symbol.source.IAdditionalContextSymbolInfo;
-import org.eclipse.jst.jsf.designtime.symbols.FileContextUtil;
-import org.eclipse.jst.jsf.designtime.symbols.JSFSymbolFactory;
-
-/**
- * Creates symbols using a simple type.
- *
- * @author cbateman
- *
- */
-public class StaticJavaTypeSymbolFactory extends AbstractContextSymbolFactory
-{
- private final JSFSymbolFactory _factory = new JSFSymbolFactory();
-
- @Override
- protected ISymbol internalCreate(String symbolName, int scope,
- IAdaptable context, List problems,
- IAdditionalContextSymbolInfo additionalInfo)
- {
- if (additionalInfo != null)
- {
- final String signature = additionalInfo.getSymbolTypeSignature();
- if (signature != null)
- {
- final IJavaTypeDescriptor2 descriptor = _factory
- .createTypeDescriptorFromSignature(signature,
- getJavaProject(context));
- return _factory.createJavaComponentSymbol(symbolName, descriptor, null);
- }
- }
-
- // can't create
- return null;
- }
-
- @Override
- protected ISymbol internalCreate(String symbolName, int scope,
- IAdaptable context, List problems)
- {
- // need additionInfo to create the symbol
- return null;
- }
-
- @Override
- public boolean supports(IAdaptable context)
- {
- return getJavaProject(context) != null;
- }
-
- private IJavaProject getJavaProject(final IAdaptable context)
- {
- if (context != null)
- {
- final IStructuredDocumentContext sContext = (IStructuredDocumentContext) context
- .getAdapter(IStructuredDocumentContext.class);
- if (sContext != null)
- {
- final IProject project = FileContextUtil
- .getProject((IStructuredDocumentContext) context
- .getAdapter(IStructuredDocumentContext.class));
- if (project != null)
- {
- return JavaCore.create(project);
- }
- }
- }
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/symbols/ValueExpressionSymbolFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/symbols/ValueExpressionSymbolFactory.java
deleted file mode 100644
index 724fd94..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/symbols/ValueExpressionSymbolFactory.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.designtime.internal.symbols;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jst.jsf.common.internal.types.ValueType;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IDOMContextResolver;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContextFactory;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.context.symbol.source.AbstractContextSymbolFactory;
-import org.eclipse.jst.jsf.context.symbol.source.IAdditionalContextSymbolInfo;
-import org.eclipse.jst.jsf.designtime.symbols.FileContextUtil;
-import org.eclipse.jst.jsf.designtime.symbols.JSFSymbolFactory;
-import org.eclipse.jst.jsf.validation.internal.appconfig.AppConfigValidationUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- *
- * @author cbateman
- *
- */
-public class ValueExpressionSymbolFactory extends AbstractContextSymbolFactory
-{
- private final JSFSymbolFactory _factory = new JSFSymbolFactory();
-
- @Override
- protected ISymbol internalCreate(final String symbolName, final int scope,
- final IAdaptable context, final List problems,
- final IAdditionalContextSymbolInfo additionalInfo)
- {
- final Node node = getNode(context);
- final IStructuredDocumentContext sContext = getContext(context);
-
- final String valueAttrName = additionalInfo
- .getValueExpressionAttributeName();
- if (node != null && valueAttrName != null)
- {
- Element element = null;
-
- if (node instanceof Element)
- {
- element = (Element) node;
- }
- else
- {
- element = ((Attr) node).getOwnerElement();
- }
-
- return createSymbol(symbolName, sContext, valueAttrName, element);
- }
-
- return null;
- }
-
-
- private ISymbol createSymbol(final String name,
- final IStructuredDocumentContext sContext,
- final String valueAttrName, Element element)
- {
- if (element instanceof IDOMElement) // implicit null check.
- {
- final Attr attr = element.getAttributeNode(valueAttrName);
-
- if (attr instanceof IDOMAttr && attr.getValue() != null)
- {
- // TODO: the extract expression method belongs in more
- // generic code
- final String elText = AppConfigValidationUtil
- .extractELExpression(attr.getValue()).getElText();
- final IFile file = FileContextUtil
- .deriveIFileFromContext(sContext);
- final IStructuredDocumentContext elContext = IStructuredDocumentContextFactory.INSTANCE
- .getContext(sContext.getStructuredDocument(), attr);
- if (elText != null && file != null && elContext != null)
- {
- final ValueType valueExpr = _factory
- .getValueTypeFromEL(elText, elContext, file);
- if (valueExpr != null)
- {
- final IJavaProject javaProject = getJavaProject(sContext);
- return _factory.createJavaComponentSymbol(name, valueExpr, null, javaProject);
- }
- }
- }
- }
- return null;
- }
-
-
- @Override
- protected ISymbol internalCreate(final String symbolName, final int scope,
- final IAdaptable context, final List problems)
- {
- // need additionalInfo
- return null;
- }
-
- @Override
- public boolean supports(final IAdaptable context)
- {
- final Node node = getNode(context);
- final IJavaProject javaProject = getJavaProject(context);
- return javaProject != null && (node instanceof Element) || (node instanceof Attr);
- }
-
- private Node getNode(final IAdaptable context)
- {
- final IStructuredDocumentContext sContext = getContext(context);
- if (sContext != null)
- {
- final IDOMContextResolver domResolver = IStructuredDocumentContextResolverFactory.INSTANCE
- .getDOMContextResolver(sContext);
- if (domResolver != null)
- {
- return domResolver.getNode();
- }
- }
- return null;
- }
-
- private IJavaProject getJavaProject(final IAdaptable context)
- {
- final IStructuredDocumentContext sContext = getContext(context);
-
- if (sContext != null)
- {
- final IProject project = FileContextUtil
- .getProject((IStructuredDocumentContext) sContext
- .getAdapter(IStructuredDocumentContext.class));
- if (project != null)
- {
- return JavaCore.create(project);
- }
- }
- return null;
- }
-
- private IStructuredDocumentContext getContext(final IAdaptable context)
- {
- if (context != null)
- {
- return (IStructuredDocumentContext) context
- .getAdapter(IStructuredDocumentContext.class);
- }
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/AbstractDTViewHandler.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/AbstractDTViewHandler.java
deleted file mode 100644
index e40b3c4..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/AbstractDTViewHandler.java
+++ /dev/null
@@ -1,319 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view;
-
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jst.jsf.common.internal.resource.ImmutableLifecycleListener;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentTypeInfo;
-import org.eclipse.jst.jsf.designtime.context.DTFacesContext;
-import org.eclipse.jst.jsf.designtime.internal.view.DTUIViewRoot.StalenessAdvisor;
-import org.eclipse.jst.jsf.designtime.internal.view.DTUIViewRoot.StalenessListener;
-import org.eclipse.jst.jsf.designtime.internal.view.DTUIViewRoot.VersionStamp;
-import org.eclipse.jst.jsf.designtime.internal.view.IDTViewHandler.ViewHandlerException.Cause;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-
-/**
- * All IDTViewHandler's must sub-class this abstract class.
- *
- * @author cbateman
- *
- */
-public abstract class AbstractDTViewHandler implements IDTViewHandler
-{
- private final AtomicBoolean _isDisposed = new AtomicBoolean(false);
-
- /**
- * the path separator
- */
- public static final String PATH_SEPARATOR = "/";
-
- public abstract String calculateLocale(DTFacesContext context)
- throws ViewHandlerException;
-
- public final DTUIViewRoot createView(final DTFacesContext facesContext,
- final String viewId) throws ViewHandlerException
- {
- if (_isDisposed.get())
- {
- throw new IllegalStateException("View handler is disposed");
- }
-
- final DTUIViewRoot viewRoot = internalCreateView(facesContext, viewId);
-
- if (viewRoot == null)
- {
- throw new ViewHandlerException("Problem in createView", Cause.UNABLE_TO_CREATE_VIEW);
- }
- viewRoot.setViewId(viewId);
- final VersionStamp versionStamp = createVersionStamp(facesContext,
- viewId);
- if (versionStamp == null)
- {
- throw new ViewHandlerException(new Throwable(
- "Bad version stamp detected"), Cause.BAD_VERSION_STAMP);
- }
- viewRoot.setVersionStamp(versionStamp);
-
- final StalenessAdvisor advisor = createStalenessAdvisor(viewRoot,
- facesContext, viewId);
-
- if (advisor == null)
- {
- throw new ViewHandlerException(new Throwable(
- "Bad staleness advisor"), Cause.BAD_STALENESS_ADVISOR);
- }
- viewRoot.setStalenessAdvisor(advisor);
-
- // lock down the tree
- viewRoot.setSubtreeProtected();
-
- registerView(viewRoot, facesContext, viewId);
-
- return viewRoot;
- }
-
- /**
- * @param facesContext
- * @param viewId
- * @return internal construction of the view root.
- */
- protected abstract DTUIViewRoot internalCreateView(
- final DTFacesContext facesContext, final String viewId);
-
- public abstract IResource getActionDefinition(DTFacesContext context,
- String viewId) throws ViewHandlerException;
-
- public abstract IPath getActionURL(DTFacesContext context,
- IResource resource, IPath requestPath) throws ViewHandlerException;
-
- public abstract IPath getRelativeActionPath(DTFacesContext context,
- String relativeToViewId, String uri) throws ViewHandlerException;
-
- public abstract IViewDefnAdapterFactory getViewMetadataAdapterFactory(
- DTFacesContext context) throws ViewHandlerException;
-
- public abstract boolean supportsViewDefinition(IFile file);
-
-
- public abstract void setLifecycleListener(ImmutableLifecycleListener listener);
-
- public final void dispose()
- {
- if (_isDisposed.compareAndSet(false, true))
- {
- doDispose();
- }
- }
-
- /**
- * Sub-classes should override to add disposal tasks
- */
- protected void doDispose()
- {
- // do nothing by default
- }
-
- /**
- * IMPORTANT: this method must not return null. All view creation will fail
- * for this handler when createVersionStamp() returns null. create() will
- * throw ViewHandlerException.
- *
- * @param facesContext
- * @param viewId
- * @return a new version stamp for the facesContext/viewId. The version
- * stamp needs to be unique for all instances of viewId only, not
- * all instances of component trees everywhere in the system.
- */
- protected abstract VersionStamp createVersionStamp(
- final DTFacesContext facesContext, final String viewId);
-
- /**
- * IMPORTANT: this method must not return null. All view creation will fail
- * for this handler when createStalenessAdvisor returns null.
- *
- * @param viewRoot
- * @param facesContext
- * @param viewId
- * @return a new staleness advisor.
- */
- protected abstract StalenessAdvisor createStalenessAdvisor(
- final DTUIViewRoot viewRoot, DTFacesContext facesContext,
- String viewId);
-
- /**
- * Called by createView immediately before returning. Provides sub-class
- * a chance to register a fully initialized view root with any stateful
- * activities such as automatic change tracking and caching.
- *
- * @param viewRoot
- * @param context
- * @param viewId
- */
- protected void registerView(DTUIViewRoot viewRoot, final DTFacesContext context, final String viewId)
- {
- // do nothing by default
- }
-
- public String getViewId(final DTFacesContext context, final IResource res)
- {
- // TODO: sync with WebrootUtil?
- String strWebrootPath = "";
- final IProject project = res.getProject();
- final IPath path = res.getFullPath();
- final IPath webContentPath = getWebContentPath(project);
- if (webContentPath != null && webContentPath.isPrefixOf(path))
- {
- final int start = path.matchingFirstSegments(webContentPath);
- final String[] segments = path.segments();
- for (int i = start, n = path.segmentCount(); i < n; i++)
- {
- strWebrootPath = strWebrootPath + PATH_SEPARATOR + segments[i];
- }
- }
- return strWebrootPath;
- }
-
- private IPath getWebContentPath(final IProject project)
- {
- if (project != null)
- {
- return ComponentCore.createComponent(project).getRootFolder()
- .getUnderlyingFolder().getFullPath();
- }
- return null;
- }
-
- /**
- * A default DTUIViewRoot that represents an uncreatable or uninitializable
- * view root.
- *
- */
- protected static final class NullViewRoot extends DTUIViewRoot
- {
- /**
- *
- */
- private static final long serialVersionUID = 1187035338610719171L;
-
- /**
- */
- protected NullViewRoot()
- {
- super(null, null, new ComponentTypeInfo("", "", "",""));
- }
-
- @Override
- public IAdaptable getServices()
- {
- return new IAdaptable()
- {
- public Object getAdapter(Class adapter)
- {
- // no services
- return null;
- }
- };
- }
-
- }
-
- /**
- * Provides a simple time-based stamp that makes almost impossible to create
- * the same timestamp twice. To do so, two threads would need to get the
- * same system simulataneously and get same number back from the same
- * gaussian distribution.
- *
- * @author cbateman
- *
- */
- protected static class TimeBasedVersionStamp extends VersionStamp
- {
- /**
- *
- */
- private static final long serialVersionUID = 5557828245936568977L;
- private final long timestamp;
- private final long randomStamp;
-
- /**
- *
- */
- public TimeBasedVersionStamp()
- {
- super();
- // use the millisecond time, since it is offset from a known
- // point on all platform, whereas no guarantee is made about
- // the nano time value.
- this.timestamp = System.currentTimeMillis();
- // this protects against two threads constructing two time
- // stamp objects "simulataneously" and having the same time based
- // stamp. Math.random is thread-safe.
- this.randomStamp = (long) (Long.MAX_VALUE * Math.random());
- }
-
- @Override
- public int hashCode()
- {
- return (int) (timestamp ^ randomStamp);
- }
-
- @Override
- protected boolean isEqual(final VersionStamp other)
- {
- return other instanceof TimeBasedVersionStamp
- && (timestamp == ((TimeBasedVersionStamp) other).timestamp)
- && (randomStamp == ((TimeBasedVersionStamp) other).randomStamp);
- }
- }
-
- /**
- * Returns a default staleness advisor that always returns false.
- *
- * @author cbateman
- *
- */
- protected static final class NullStalenessAdvisor extends StalenessAdvisor
- {
- /**
- *
- */
- private static final long serialVersionUID = 5946420948320047613L;
-
- @Override
- public boolean isStale()
- {
- return false;
- }
-
- @Override
- public void addListener(final StalenessListener listener)
- {
- // do nothing
- }
-
- @Override
- public void removeListener(final StalenessListener listener)
- {
- // do nothing
- }
-
- public boolean isAccessible()
- {
- return true;
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/AbstractViewDefnAdapter.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/AbstractViewDefnAdapter.java
deleted file mode 100644
index a7e620d..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/AbstractViewDefnAdapter.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view;
-
-import java.util.List;
-
-import org.eclipse.jst.jsf.common.runtime.internal.model.ViewObject;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.datatypes.ELExpression;
-import org.eclipse.jst.jsf.context.IModelContext;
-import org.eclipse.jst.jsf.designtime.context.DTFacesContext;
-import org.eclipse.jst.jsf.designtime.internal.view.IDTViewHandler.ViewHandlerException;
-
-/**
- * All view definition adapters must sub-class this abstract class.
- *
- * @author cbateman
- * @param <VIEW_DEFN_BASE_TYPE>
- * @param <VIEW_CONTAINER_TYPE>
- *
- */
-public abstract class AbstractViewDefnAdapter<VIEW_DEFN_BASE_TYPE, VIEW_CONTAINER_TYPE>
- implements IViewDefnAdapter<VIEW_DEFN_BASE_TYPE, VIEW_CONTAINER_TYPE>
-{
- public abstract ViewObject mapToViewObject(
- VIEW_DEFN_BASE_TYPE viewDefnObject,
- ViewObjectConstructionStrategy<? extends VIEW_DEFN_BASE_TYPE> constructionData,
- VIEW_CONTAINER_TYPE viewContainer);
-
- public abstract String getId(VIEW_DEFN_BASE_TYPE viewDefnObject)
- throws IllegalArgumentException;
-
- public abstract VIEW_CONTAINER_TYPE getContainer(DTFacesContext context,
- String viewId);
-
- public abstract List<VIEW_DEFN_BASE_TYPE> getViewDefnRoots(
- VIEW_CONTAINER_TYPE container);
-
- public abstract ELExpression getELExpression(final IModelContext context)
- throws ViewHandlerException;
-
- public abstract ViewObject findViewObject(VIEW_DEFN_BASE_TYPE viewDefnObject,
- ComponentInfo root);
-
- public abstract VIEW_DEFN_BASE_TYPE findViewDefn(ViewObject viewObject,
- ComponentInfo root);
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/AbstractViewDefnAdapterFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/AbstractViewDefnAdapterFactory.java
deleted file mode 100644
index 5c5fdf2..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/AbstractViewDefnAdapterFactory.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.jst.jsf.core.internal.CompositeTagRegistryFactory;
-import org.eclipse.jst.jsf.core.internal.CompositeTagRegistryFactory.TagRegistryIdentifier;
-import org.eclipse.jst.jsf.designtime.context.DTFacesContext;
-import org.eclipse.jst.jsf.designtime.internal.view.model.ITagRegistry;
-
-/**
- * Factories that create view definition adapters must extend this
- * class.
- *
- * @author cbateman
- *
- */
-public abstract class AbstractViewDefnAdapterFactory implements IViewDefnAdapterFactory
-{
- /**
- * @param context
- * @param viewId
- * @return a view adapter for the viewid or null if this factory
- * cannot produce an adapter for the underlying view definition.
- */
- public abstract IViewDefnAdapter createAdapter(DTFacesContext context, String viewId);
-
- /**
- * TODO: since this implicitly, XML-specific, perhaps this belongs
- * in a util class
- * Sub-classes may use to locate a tag registry for their view adapter
- * @param file
- * @return a tag registry for the file (based on class path and
- * content type) or null if none.
- */
- protected final ITagRegistry findTagRegistry(final IFile file)
- {
- final IContentTypeManager typeManager = Platform.getContentTypeManager();
- final IContentType contentType =
- typeManager.findContentTypeFor(file.getName());
- ITagRegistry tagRegistry = null;
- if (contentType != null)
- {
- final TagRegistryIdentifier id =
- new TagRegistryIdentifier(file.getProject(), contentType);
- tagRegistry = CompositeTagRegistryFactory.getInstance().getRegistry(id);
- }
- return tagRegistry;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/ComponentConstructionData.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/ComponentConstructionData.java
deleted file mode 100644
index 914f7ef..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/ComponentConstructionData.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentInfo;
-
-/**
- * Encapsulates information required to construct a component
- *
- * @author cbateman
- *
- */
-public class ComponentConstructionData
-{
- private ComponentInfo _parent;
- private int _idCounter;
- private final IProject _project;
- private final IDocument _document;
- /**
- * @param idCounter
- * @param parent
- * @param project
- * @param document
- */
- public ComponentConstructionData(final int idCounter,
- final ComponentInfo parent, final IProject project, final IDocument document)
- {
- _parent = parent;
- _idCounter = idCounter;
- _project = project;
- _document = document;
- }
-
- /**
- * @return the parent id
- */
- public final ComponentInfo getParent()
- {
- return _parent;
- }
-
- /**
- * @return the id counter
- */
- public final int getIdCounter()
- {
- return _idCounter;
- }
-
- /**
- * Increment the counter by 1 and return the old value
- *
- * @return the old value
- */
- public final int increment()
- {
- return _idCounter++;
- }
-
- /**
- * @param parent
- */
- public final void setParent(final ComponentInfo parent)
- {
- _parent = parent;
- }
-
- /**
- * @param idCounter
- */
- public final void setIdCounter(final int idCounter)
- {
- _idCounter = idCounter;
- }
-
- /**
- * @return the project that this component construction is associated with
- */
- public final IProject getProject()
- {
- return _project;
- }
-
- /**
- * @return the document context for the construction
- */
- public final IDocument getDocument()
- {
- return _document;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/ComponentTreeConstructionStrategy.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/ComponentTreeConstructionStrategy.java
deleted file mode 100644
index 53763da..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/ComponentTreeConstructionStrategy.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view;
-
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentInfo;
-import org.eclipse.jst.jsf.designtime.context.DTFacesContext;
-
-/**
- * @author cbateman
- *
- * @param <VIEW_DEFN_BASE_TYPE>
- * @param <VIEW_CONTAINER_TYPE>
- */
-public abstract class ComponentTreeConstructionStrategy<VIEW_DEFN_BASE_TYPE, VIEW_CONTAINER_TYPE>
-{
- /**
- * @param context
- * @param viewRoot
- * @return a component tree rooted
- * XXX: need to accommodate different cases of fragments, invalid multiple roots
- * etc, perhaps with special surrogate root type
- */
- public abstract ComponentInfo createComponentTree(DTFacesContext context, DTUIViewRoot viewRoot);
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/DTComponentIntrospector.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/DTComponentIntrospector.java
deleted file mode 100644
index 589e05f..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/DTComponentIntrospector.java
+++ /dev/null
@@ -1,392 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jem.internal.proxy.core.IBeanTypeProxy;
-import org.eclipse.jem.internal.proxy.core.IConfigurationContributor;
-import org.eclipse.jem.internal.proxy.core.IStandardBeanTypeProxyFactory;
-import org.eclipse.jem.internal.proxy.core.ProxyFactoryRegistry;
-import org.eclipse.jem.internal.proxy.ide.IDERegistration;
-import org.eclipse.jst.jsf.common.internal.types.TypeInfoCache;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentTypeInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ConverterTypeInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ValidatorTypeInfo;
-import org.eclipse.jst.jsf.common.util.JDTBeanIntrospector;
-import org.eclipse.jst.jsf.common.util.JDTBeanProperty;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.core.internal.JSFCoreTraceOptions;
-import org.eclipse.jst.jsf.core.internal.jem.BeanProxyUtil.BeanProxyWrapper;
-import org.eclipse.jst.jsf.core.internal.jem.BeanProxyUtil.ProxyException;
-import org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigManager;
-import org.eclipse.jst.jsf.facesconfig.emf.ComponentType;
-import org.eclipse.jst.jsf.facesconfig.emf.ConverterType;
-import org.eclipse.jst.jsf.facesconfig.emf.ValidatorType;
-
-/**
- * Utility class for finding and bean introspecting component and related
- * classes.
- *
- * @author cbateman
- *
- */
-public final class DTComponentIntrospector
-{
- /**
- * A shared type cache for doing tag class introspection. The cache stores
- * type hierarchies and updates them on detected changes to reduce the
- * overhead of doing such lookups
- */
- private static TypeInfoCache TYPE_CACHE; // lazily created, don't access
-
- // directly
-
- /**
- * @return the type cache used by all DTComponentIntrospector internally.
- */
- public static TypeInfoCache getSharedTypeCache()
- {
- if (TYPE_CACHE == null)
- {
- TYPE_CACHE = TypeInfoCache.createNewInstance();
- }
- return TYPE_CACHE;
- }
-
- /**
- * @param classType
- * @param className
- * @param project
- * @param contributors may be null
- * @return the component type info for the class type or null if none. Adds
- * contributors to the class path
- */
- public static ComponentTypeInfo getComponent(final String classType,
- final String className, final IProject project,
- final IConfigurationContributor[] contributors)
- {
- final ProxyFactoryRegistry registry = getProxyFactoryRegistry(project,
- contributors);
-
- if (registry != null)
- {
- final IStandardBeanTypeProxyFactory factory = registry
- .getBeanTypeProxyFactory();
- final IBeanTypeProxy classTypeProxy = factory
- .getBeanTypeProxy(className);
- final BeanProxyWrapper classTypeWrapper = new BeanProxyWrapper(
- classTypeProxy);
-
- String family = null;
- String renderer = null;
- try
- {
- classTypeWrapper.init();
- family = classTypeWrapper.callStringMethod("getFamily");
- renderer = classTypeWrapper.callStringMethod("getRendererType");
- }
- catch (ProxyException e1)
- {
- // fall through
- if (JSFCoreTraceOptions.TRACE_JSPTAGINTROSPECTOR)
- {
- JSFCoreTraceOptions.log("DTComponentIntrospector.getComponent:", e1);
- }
- }
-
- IType type = null;
-
- try
- {
- type = JavaCore.create(project).findType(className);
- }
- catch (JavaModelException e)
- {
- // fall through;
- }
-
- List<String> interfaces = new ArrayList<String>();
- List<String> superClasses = new ArrayList<String>();
-
- if (type != null)
- {
- TypeInfoCache typeCache = getSharedTypeCache();
-
- IType[] interfaceTypes = typeCache.cacheInterfaceTypesFor(type);
- for (IType interfaze : interfaceTypes)
- {
- interfaces.add(interfaze.getFullyQualifiedName());
- }
-
- IType[] superClassTypes = typeCache.cacheSupertypesFor(type);
-
- for (IType superClass : superClassTypes)
- {
- superClasses.add(superClass.getFullyQualifiedName());
- }
- }
-
- return new ComponentTypeInfo(classType, className, superClasses
- .toArray(new String[0]), interfaces.toArray(new String[0]),
- family, renderer);
- }
- return null;
- }
-
- /**
- * @param classType
- * @param className
- * @param project
- * @return the component type info with no additional classpath
- * contributions. May return null;
- */
- public static ComponentTypeInfo getComponent(final String classType,
- final String className, final IProject project)
- {
- return getComponent(classType, className, project, null);
- }
-
- /**
- * @param converterId
- * @param converterClass
- * @return a new converter type info for the converter id.
- */
- public static ConverterTypeInfo getConverter(final String converterId,
- final String converterClass)
- {
- return new ConverterTypeInfo(converterClass, converterId);
- }
-
- /**
- * @param validatorId
- * @param validatorClass
- * @return a new validator type info for the validator id
- */
- public static ValidatorTypeInfo getValidator(final String validatorId,
- final String validatorClass)
- {
- return new ValidatorTypeInfo(validatorClass, validatorId);
- }
-
- /**
- * @param componentType
- * @param project
- * @return the configured class name for the JSF component type id or null
- * if not found.
- */
- public static String findComponentClass(final String componentType,
- final IProject project)
- {
- final JSFAppConfigManager manager = JSFAppConfigManager
- .getInstance(project);
- final List components = manager.getComponents();
-
- for (final Iterator it = components.iterator(); it.hasNext();)
- {
- final ComponentType component = (ComponentType) it.next();
- final String type = component.getComponentType().getTextContent()
- .trim();
-
- if (componentType.equals(type))
- {
- return component.getComponentClass().getTextContent().trim();
- }
- }
- return null;
- }
-
- /**
- * @param converterId
- * @param project
- * @return a fully qualified class name corresponding to converterId or null
- * if none.
- */
- public static String findConverterClass(final String converterId,
- final IProject project)
- {
- final JSFAppConfigManager manager = JSFAppConfigManager
- .getInstance(project);
- final List converters = manager.getConverters();
-
- for (final Iterator it = converters.iterator(); it.hasNext();)
- {
- final ConverterType converter = (ConverterType) it.next();
-
- if (converter != null && converter.getConverterId() != null
- && converter.getConverterId().getTextContent() != null)
- {
- final String type = converter.getConverterId().getTextContent()
- .trim();
-
- if (converterId.equals(type))
- {
- if (converter.getConverterClass() != null && converter.getConverterClass().getTextContent()!=null)
- {
- return converter.getConverterClass().getTextContent()
- .trim();
- }
- return null;
- }
- }
- }
- return null;
- }
-
- /**
- * @param validatorId
- * @param project
- * @return a fully qualified class name corresponding to the validatorId or
- * null if none.
- */
- public static String findValidatorClass(final String validatorId,
- final IProject project)
- {
- final JSFAppConfigManager manager = JSFAppConfigManager
- .getInstance(project);
- final List converters = manager.getValidators();
-
- for (final Iterator it = converters.iterator(); it.hasNext();)
- {
- final ValidatorType validatorType = (ValidatorType) it.next();
-
- if (validatorType != null && validatorType.getValidatorId() != null &&
- validatorType.getValidatorId().getTextContent() != null)
- {
- final String type = validatorType.getValidatorId().getTextContent()
- .trim();
-
- if (validatorId.equals(type))
- {
- return validatorType.getValidatorClass().getTextContent()
- .trim();
- }
- }
- }
- return null;
- }
-
- /**
- * @param type
- * @param checkInstanceOf
- * @return true if type resolves to a type that is an instance of one of the
- * types in checkInstanceOf.
- */
- public static boolean isTypeNameInstanceOfClass(final IType type,
- final Set<String> checkInstanceOf)
- {
- if (type != null)
- {
- // first and foremost, are these exactly droids you're
- // looking for and not just their predecessors?
- if (checkInstanceOf.contains(type.getFullyQualifiedName()))
- {
- return true;
- }
-
- for (final IType supertype : getSharedTypeCache()
- .cacheSupertypesFor(type))
- {
- if (checkInstanceOf.contains(supertype.getFullyQualifiedName()))
- {
- return true;
- }
- }
-
- for (final IType interfaces : getSharedTypeCache()
- .cacheInterfaceTypesFor(type))
- {
- if (checkInstanceOf
- .contains(interfaces.getFullyQualifiedName()))
- {
- return true;
- }
- }
- }
-
- return false;
- }
-
- /**
- * @param typeInfo
- * @param project
- * @return a list of all bean properties (using the POJO method) on
- * typeInfo. List may be empty, never null.
- */
- public static Map<String, JDTBeanProperty> getBeanProperties(
- final ComponentTypeInfo typeInfo, final IProject project)
- {
- Map<String, JDTBeanProperty> properties = new HashMap<String, JDTBeanProperty>();
-
- IJavaProject javaProject = JavaCore.create(project);
- try
- {
- IType type = javaProject.findType(typeInfo.getClassName());
-
- if (type != null)
- {
- // TODO: should be able to use type cache for this
- final JDTBeanIntrospector introspector = new JDTBeanIntrospector(
- type);
- properties = introspector.getProperties();
- }
- }
- catch (JavaModelException e)
- {
- JSFCorePlugin.log("Error finding component type", e);
- }
-
- return properties;
- }
-
- /**
- * @param project
- * @return a new proxy factory registry or null;
- *
- * TODO: caching?
- */
- private static ProxyFactoryRegistry getProxyFactoryRegistry(
- final IProject project, final IConfigurationContributor[] contributors)
- {
- try
- {
- return IDERegistration.startAnImplementation(contributors, false, project,
- project.getName(), JSFCorePlugin.PLUGIN_ID,
- new NullProgressMonitor());
- }
- catch (final CoreException e)
- {
- JSFCorePlugin.log("Error starting vm for project: "
- + project.getName(), e);
- }
-
- return null;
- }
-
- private DTComponentIntrospector()
- {
- // no external instantiation
- }
-
- // private static class
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/DTUIViewRoot.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/DTUIViewRoot.java
deleted file mode 100644
index f14121e..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/DTUIViewRoot.java
+++ /dev/null
@@ -1,315 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view;
-
-import java.io.Serializable;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentTypeInfo;
-
-/**
- * The interface for all design view root objects.
- *
- */
-public abstract class DTUIViewRoot extends ComponentInfo
-{
- private StalenessAdvisor _stalenessAdvisor;
-
- private String _viewId;
- private VersionStamp _versionStamp;
-
- /**
- *
- */
- private static final long serialVersionUID = -6375907116774572269L;
-
- /**
- * @param id
- * @param parent
- * @param componentTypeInfo
- */
- protected DTUIViewRoot(final String id, final ComponentInfo parent,
- final ComponentTypeInfo componentTypeInfo)
- {
- super(id, parent, componentTypeInfo, true);
- }
-
- /**
- * @return the view id
- */
- public final String getViewId()
- {
- return _viewId;
- }
-
- /**
- * @param viewId
- *
- */
- final void setViewId(final String viewId)
- {
- _viewId = viewId;
- }
-
- /**
- * <p>
- * Clients may use the version stamp to determine if their instance of a
- * view root is out of date. For example, if a client has cached an instance
- * of a view root and wants to quickly checked if there is a newer version,
- * it may request a new copy and compare version stamps
- * </p>
- *
- * <p>
- * The version stamp must be calculated so that given two instance of a view
- * root for the same view id, v1 and v2:
- * </p>
- *
- * <p>
- * if v1.getVersionStamp().equals(v2.getVersionStamp()) then v1 and v2 are
- * the same even if v1 != v2. Note that this uniqueness must hold true
- * across multiple sessions of the IDE, since v1 or v2 may have been
- * restored from permanent storage. For this reason, running counts should
- * are discouraged unless they too can be reliably stored. Better is
- * something that relies on large random numbers combined with a time stamp
- * or workspace modification stamp
- * </p>
- *
- * @return the unique version stamp of this view root. This may be used as
- * quick check as to whether to view roots are not equal.
- */
- public final VersionStamp getVersionStamp()
- {
- return delegateVersionStamp();
- }
-
- VersionStamp delegateVersionStamp()
- {
- return _versionStamp;
- }
-
- final void setVersionStamp(VersionStamp versionStamp)
- {
- _versionStamp = versionStamp;
- }
-
- /**
- * @return true if the view root is out of sync with its view source.
- */
- public final boolean isStale()
- {
- return _stalenessAdvisor.isStale();
- }
-
- final void setStalenessAdvisor(final StalenessAdvisor stalenessAdvisor)
- {
- _stalenessAdvisor = stalenessAdvisor;
- }
-
- /**
- * Implementations must ensure that listeners are only added if they are
- * not already present.
- *
- * @param listener
- */
- public final void addListener(final StalenessListener listener)
- {
- _stalenessAdvisor.addListener(listener);
- }
-
- /**
- * @param listener
- */
- public final void removeListener(final StalenessListener listener)
- {
- _stalenessAdvisor.removeListener(listener);
- }
-
- /**
- * @return an adapter that can be used to request additional services from
- * the view root instance. This can be used to get services that are
- * not specific to all view roots such as mappings between view
- * definition artifacts and their view objects. Value may be null if
- * a view root chooses not to expose any services.
- */
- public abstract IAdaptable getServices();
-
- /**
- * An abstract versioning stamp that can be used to uniquely identify a
- * version of a DTUIViewRoot.
- *
- * @author cbateman
- *
- */
- public abstract static class VersionStamp implements Serializable
- {
- /**
- *
- */
- private static final long serialVersionUID = -7869336223178326584L;
-
- /**
- * Called by equals to determine absolute equality.
- *
- * @param other
- * @return true if and only if other represents the exact same version
- * as this. Hashcode must be reimplemented in a way to guarantee
- * that the equals() contract is respected.
- */
- protected abstract boolean isEqual(final VersionStamp other);
-
- /**
- * Must reimplement hashCode to match isEqual
- */
- public abstract int hashCode();
-
- @Override
- public final boolean equals(Object obj)
- {
- if (this == obj)
- {
- return true;
- }
-
- // NOTE: instanceof covers obj == null check.
- if (obj instanceof VersionStamp)
- {
- return isEqual((VersionStamp) obj);
- }
- return false;
- }
- }
-
- /**
- * An advisor which allows a view root to bridge to its source to see if its
- * out-of-sync, while keeping it decoupled from what specifically its source
- * is.
- *
- * @author cbateman
- *
- */
- public static abstract class StalenessAdvisor implements Serializable
- {
- /**
- *
- */
- private static final long serialVersionUID = 3449240686744169430L;
-
- /**
- * Implementations must ensure that listeners are only added if they are
- * not already present.
- * @param listener
- */
- public abstract void addListener(StalenessListener listener);
-
- /**
- * @param listener
- */
- public abstract void removeListener(StalenessListener listener);
-
- /**
- * NOTE: it is very dangerous to have an advisor that always returns
- * stale == true since many clients will rely on the staleness flag to
- * determine if they should try to update the model.
- *
- * @return true if we are out of sync with the source that this tree was
- * constructed from.
- */
- public abstract boolean isStale();
-
- /**
- * @return a flag similar to IResource.isAccessible that indicates if
- * the underlying view definition is no longer accessible either
- * due it being deleted or it's source file being unaccessible
- * due to project closure or other issues.
- */
- public abstract boolean isAccessible();
- }
-
- /**
- * A listener that is informed of model staleness events
- *
- */
- public static abstract class StalenessListener
- {
- /**
- * @param event
- */
- protected abstract void stalenessChanged(StalenessEvent event);
- }
-
- /**
- * An event that is fied when a model's staleness changes.
- *
- */
- public final static class StalenessEvent
- {
- private final ChangeType _type;
-
- /**
- * @param type
- */
- protected StalenessEvent(final ChangeType type)
- {
- _type = type;
- }
-
- /**
- * @return true if the event source is now stale.
- */
- public final ChangeType getChangeType()
- {
- return _type;
- }
-
- /**
- * The type of staleness change
- *
- */
- /**
- * @author cbateman
- *
- */
- public enum ChangeType
- {
- /**
- * Indicates that the view definition has been changed in a way that
- * will make existing DTUIViewRoot's stale.
- */
- VIEW_DEFN_CHANGED,
-
- /**
- * Inidicates that the view definition has been deleted.
- */
- VIEW_DEFN_DELETED,
-
- /**
- * Indicates that the view definition's enclosing project will be
- * closed, causing the definition to be made unavailable for an
- * indeterminate amount of time.
- */
- VIEW_DEFN_PROJECT_CLOSED,
-
- /**
- * Indicates that a view root has been invalid due to a project
- * clean. View root should generally be forcibly updated on
- * a project clean even if other staleness preconditions haven't
- * been met.
- */
- PROJECT_CLEANED
- }
-
- /**
- *
- */
- private static final long serialVersionUID = 6765346004772568514L;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/DefaultDTUIViewRoot.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/DefaultDTUIViewRoot.java
deleted file mode 100644
index 29a4219..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/DefaultDTUIViewRoot.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view;
-
-import java.io.Serializable;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentTypeInfo;
-
-/**
- * The default view root implementation. Assumes an XML view definition.
- *
- * @author cbateman
- *
- */
-public class DefaultDTUIViewRoot extends DTUIViewRoot
-{
- /**
- * serializable
- */
- private static final long serialVersionUID = -6948413077931237435L;
- private final DefaultServices _defaultServices;
-
- /**
- */
- public DefaultDTUIViewRoot()
- {
- // TODO: refactor constants
- super(null, null, new ComponentTypeInfo("javax.faces.ViewRoot",
- "javax.faces.component.UIViewRoot", "javax.faces.ViewRoot",
- null));
- _defaultServices = new DefaultServices();
- }
-
- @Override
- public IAdaptable getServices()
- {
- return _defaultServices;
- }
-
- private class DefaultServices implements IAdaptable, Serializable
- {
- /**
- *
- */
- private static final long serialVersionUID = -5220371377352799212L;
- private final XMLViewObjectMappingService _xmlViewObjectMappingService;
-
- private DefaultServices()
- {
- _xmlViewObjectMappingService = new XMLViewObjectMappingService();
- }
-
- public Object getAdapter(final Class adapter)
- {
- if (adapter.equals(XMLViewObjectMappingService.class))
- {
- return _xmlViewObjectMappingService;
- }
- return null;
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/DefaultDTViewHandler.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/DefaultDTViewHandler.java
deleted file mode 100644
index 537355a..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/DefaultDTViewHandler.java
+++ /dev/null
@@ -1,598 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view;
-
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jst.jsf.common.internal.JSPUtil;
-import org.eclipse.jst.jsf.common.internal.resource.IResourceLifecycleListener;
-import org.eclipse.jst.jsf.common.internal.resource.ImmutableLifecycleListener;
-import org.eclipse.jst.jsf.common.internal.resource.ResourceLifecycleEvent;
-import org.eclipse.jst.jsf.common.internal.resource.ResourceLifecycleEvent.ReasonType;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.designtime.context.DTFacesContext;
-import org.eclipse.jst.jsf.designtime.internal.view.DTUIViewRoot.StalenessAdvisor;
-import org.eclipse.jst.jsf.designtime.internal.view.DTUIViewRoot.StalenessEvent;
-import org.eclipse.jst.jsf.designtime.internal.view.DTUIViewRoot.StalenessListener;
-import org.eclipse.jst.jsf.designtime.internal.view.DTUIViewRoot.VersionStamp;
-import org.eclipse.jst.jsf.designtime.internal.view.DTUIViewRoot.StalenessEvent.ChangeType;
-import org.eclipse.jst.jsf.designtime.internal.view.model.ITagRegistry;
-import org.w3c.dom.Node;
-
-/**
- * A default implementation of the design time view handler meant to parallel
- * the default runtime ViewHandler required by the JSF spec.
- *
- */
-public class DefaultDTViewHandler extends AbstractDTViewHandler
-{
- private final MyLifecycleManager _lifecycleManager = new MyLifecycleManager();
-
- @Override
- public String calculateLocale(final DTFacesContext context)
- throws ViewHandlerException
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public IResource getActionDefinition(final DTFacesContext context,
- final String viewId) throws ViewHandlerException
- {
- // TODO: this seems like a bit of a cop out...
- return context.adaptContextObject();
- }
-
- @Override
- public IPath getActionURL(final DTFacesContext context,
- final IResource resource, final IPath requestPath)
- throws ViewHandlerException
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public IPath getRelativeActionPath(final DTFacesContext context,
- final String relativeToViewId, final String uri)
- throws ViewHandlerException
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public IViewDefnAdapterFactory getViewMetadataAdapterFactory(
- final DTFacesContext context) throws ViewHandlerException
- {
- final IResource res = context.adaptContextObject();
-
- if (res instanceof IFile)
- {
- return new DefaultViewDefnAdapterFactory(this);
- }
-
- return null;
- }
-
- @Override
- protected VersionStamp createVersionStamp(
- final DTFacesContext facesContext, final String viewId)
- {
- return new TimeBasedVersionStamp();
- }
-
- static class DefaultViewDefnAdapterFactory extends
- AbstractViewDefnAdapterFactory
- {
- private final DefaultDTViewHandler _myViewHandler;
-
- DefaultViewDefnAdapterFactory(final DefaultDTViewHandler viewHandler)
- {
- _myViewHandler = viewHandler;
- }
-
- @Override
- public IViewDefnAdapter<Node, IDocument> createAdapter(
- final DTFacesContext context, final String viewId)
- {
- try
- {
- final IResource res = _myViewHandler.getActionDefinition(
- context, viewId);
-
- if (res instanceof IFile)
- {
- final IFile srcFile = (IFile) res;
- final ITagRegistry registry = findTagRegistry(srcFile);
- if (JSPUtil.isJSPContentType(srcFile) && registry != null)
- {
- // if we have a jsp file, then return the default
- // adapter
- return new JSPViewDefnAdapter(registry);
- }
- }
- }
- catch (final ViewHandlerException vhe)
- {
- JSFCorePlugin.log(vhe, "While acquiring view adapter");
- }
-
- // not found or failed
- return null;
- }
- }
-
- @Override
- protected DTUIViewRoot internalCreateView(
- final DTFacesContext facesContext, final String viewId)
- {
- IViewDefnAdapterFactory factory;
- try
- {
- factory = getViewMetadataAdapterFactory(facesContext);
- if (factory != null)
- {
- final IViewDefnAdapter<?, ?> adapter = factory.createAdapter(
- facesContext, viewId);
- if (adapter instanceof XMLViewDefnAdapter)
- {
- final IResource res = facesContext.adaptContextObject();
- final DTUIViewRoot root = newView(facesContext, viewId);
- final XMLComponentTreeConstructionStrategy constructionStrategy = createTreeConstructionStrategy(
- (XMLViewDefnAdapter) adapter, res.getProject());
-
- constructionStrategy
- .createComponentTree(facesContext, root);
- return root;
- }
- JSFCorePlugin
- .log(
- IStatus.WARNING,
- String
- .format(
- "Could not get view adapter to construct design time view root for %s",
- viewId));
- }
- else
- {
- JSFCorePlugin
- .log(
- IStatus.WARNING,
- String
- .format(
- "Could not get view adapter factory toconstruct design time view root for %s",
- viewId));
- }
- }
- catch (final ViewHandlerException e)
- {
- JSFCorePlugin.log(e, "While acquiring view defn adapter factory");
- // fall-through
- }
-
- return new NullViewRoot();
- }
-
- /**
- * By default, returns DefaultDTUIViewRoot.
- *
- * @param facesContext
- * @param viewId
- * @return a new instance of a view. Override to change the implementation
- * or configuration of DTUIViewRoot that is used by
- * internalCreateView.
- */
- protected DTUIViewRoot newView(final DTFacesContext facesContext,
- final String viewId)
- {
- return new DefaultDTUIViewRoot();
- }
-
- @Override
- protected void registerView(final DTUIViewRoot viewRoot,
- final DTFacesContext facesContext, final String viewId)
- {
- final IResource res = facesContext.adaptContextObject();
- _lifecycleManager.addViewInfo(viewId, res);
- }
-
- /**
- * Sub-classes may override to provide a different strategy.
- *
- * @param adapter
- * @param project
- * @return the construction strategy used to create this view's component
- * tree
- */
- protected XMLComponentTreeConstructionStrategy createTreeConstructionStrategy(
- final XMLViewDefnAdapter adapter, final IProject project)
- {
- return new XMLComponentTreeConstructionStrategy(adapter, project);
- }
-
- @Override
- public boolean supportsViewDefinition(final IFile file)
- {
- // currently only JSP content type is supported
- return (JSPUtil.isJSPContentType(file));
- }
-
- @Override
- protected StalenessAdvisor createStalenessAdvisor(
- final DTUIViewRoot viewRoot, final DTFacesContext facesContext,
- final String viewId)
- {
- final IResource res = facesContext.adaptContextObject();
- // if the view root is null or the res is null fall through
- // and use the null staleness advisor
- if (!(viewRoot instanceof NullViewRoot) && res != null)
- {
- return new ResourceModStampStalenessAdvisor(viewRoot, res, viewId);
- }
- return new NullStalenessAdvisor();
- }
-
- /**
- * Measures the staleness of a view by comparing the modification stamp on
- * the resource at construction with the current value when isStale is
- * called.
- *
- * @author cbateman
- *
- */
- protected final class ResourceModStampStalenessAdvisor extends
- StalenessAdvisor implements Serializable
- {
- /**
- * version id
- */
- private static final long serialVersionUID = -4982206388722638735L;
- private final long _modificationStamp;
-
- private transient final IResource _res;
- private transient final AtomicBoolean _forcedStale;
- private transient final StalenessListener _myListener;
-
- /**
- * @param viewRoot
- * @param file
- * @param viewId
- */
- public ResourceModStampStalenessAdvisor(final DTUIViewRoot viewRoot,
- final IResource file, final String viewId)
- {
- _res = file;
- _modificationStamp = file.getModificationStamp();
- _forcedStale = new AtomicBoolean(false);
- _myListener = new StalenessListener()
- {
- @Override
- protected void stalenessChanged(final StalenessEvent event)
- {
- if (event.getChangeType() == ChangeType.PROJECT_CLEANED)
- {
- if (_forcedStale.compareAndSet(false, true))
- {
- _lifecycleManager.removeListener(_res, _myListener);
- }
- }
- }
- };
- _lifecycleManager.addViewInfo(viewId, _res);
- _lifecycleManager.addListener(_res, _myListener);
- }
-
- @Override
- public boolean isStale()
- {
- if (!_forcedStale.get())
- {
- final long curStamp = _res.getModificationStamp();
- return curStamp != _modificationStamp;
- }
- // else forced stale
- return true;
- }
-
- @Override
- public void addListener(final StalenessListener listener)
- {
- _lifecycleManager.addListener(_res, listener);
- }
-
- @Override
- public void removeListener(final StalenessListener listener)
- {
- _lifecycleManager.removeListener(_res, listener);
- }
-
- @Override
- public boolean isAccessible()
- {
- return _res.isAccessible();
- }
- }
-
- @Override
- public final void setLifecycleListener(final ImmutableLifecycleListener listener)
- {
- _lifecycleManager.update(listener);
- }
-
- @Override
- protected final void doDispose()
- {
- _lifecycleManager.dispose();
- }
-
- private class MyLifecycleManager implements IResourceLifecycleListener
- {
- private ImmutableLifecycleListener _listener;
- private final Map<IResource, ViewInfo> _stalenessListeners;
- private final IResourceChangeListener _buildListener;
-
- public MyLifecycleManager()
- {
- _stalenessListeners = new HashMap<IResource, ViewInfo>();
- _buildListener = new IResourceChangeListener()
- {
- // on a clean build request, fire staleness for all project-related
- // resources.
- public void resourceChanged(final IResourceChangeEvent event)
- {
- if (event.getType() == IResourceChangeEvent.PRE_BUILD)
- {
- if (event.getBuildKind() == IncrementalProjectBuilder.CLEAN_BUILD)
- {
- if (event.getSource() instanceof IProject)
- {
- cleanProject((IProject) event.getSource());
- }
- else if (event.getSource() instanceof IWorkspace)
- {
- cleanAll();
- }
- }
- }
- }
- };
- ResourcesPlugin.getWorkspace().addResourceChangeListener(_buildListener,
- IResourceChangeEvent.PRE_BUILD);
- }
-
- public void addListener(final IResource res, final StalenessListener listener)
- {
- final ViewInfo viewInfo = getViewInfo(res);
- viewInfo.getListeners().addIfAbsent(listener);
- }
-
- public void removeListener(final IResource res, final StalenessListener listener)
- {
- final ViewInfo viewInfo = getViewInfo(res);
- viewInfo.getListeners().remove(listener);
- }
-
- public EventResult acceptEvent(final ResourceLifecycleEvent event)
- {
- switch (event.getEventType())
- {
- case RESOURCE_CHANGED:
- {
- return handleContentChangeEvent(event);
- }
-
- case RESOURCE_INACCESSIBLE:
- {
- return handleInaccessibleChangeEvent(event);
- }
-
- default:
- // do nothing with other types
- }
-
- return EventResult.getDefaultEventResult();
- }
-
- private EventResult handleContentChangeEvent(
- final ResourceLifecycleEvent event)
- {
- if (event.getReasonType() != ReasonType.RESOURCE_CHANGED_CONTENTS)
- {
- return EventResult.getDefaultEventResult();
- }
-
- final IResource res = event.getAffectedResource();
- final List<StalenessListener> stalenessListeners = getListeners(res);
-
- if (stalenessListeners != null)
- {
- for (final StalenessListener listener : stalenessListeners)
- {
- listener.stalenessChanged(new StalenessEvent(
- ChangeType.VIEW_DEFN_CHANGED));
- }
- }
- return EventResult.getDefaultEventResult();
- }
-
- private EventResult handleInaccessibleChangeEvent(
- final ResourceLifecycleEvent event)
- {
- final IResource res = event.getAffectedResource();
- final ReasonType reasonType = event.getReasonType();
- ChangeType changeType = null;
- if (reasonType == ReasonType.RESOURCE_PROJECT_CLOSED)
- {
- changeType = ChangeType.VIEW_DEFN_PROJECT_CLOSED;
- }
- else if (reasonType == ReasonType.RESOURCE_DELETED)
- {
- changeType = ChangeType.VIEW_DEFN_DELETED;
- }
- else
- {
- return EventResult.getDefaultEventResult();
- }
-
- final List<StalenessListener> listeners = getListeners(res);
-
- if (listeners != null)
- {
- for (final StalenessListener listener : listeners)
- {
- listener.stalenessChanged(new StalenessEvent(
- changeType));
- }
- }
- return EventResult.getDefaultEventResult();
- }
-
- private void cleanAll()
- {
- final StalenessEvent event = new StalenessEvent(ChangeType.PROJECT_CLEANED);
- for (final Map.Entry<IResource, ViewInfo> entry : _stalenessListeners.entrySet())
- {
- final ViewInfo info = entry.getValue();
- for (final StalenessListener listener : info.getListeners())
- {
- listener.stalenessChanged(event);
- }
- }
- }
-
- private void cleanProject(final IProject project)
- {
- final StalenessEvent event = new StalenessEvent(ChangeType.PROJECT_CLEANED);
- for (final Map.Entry<IResource, ViewInfo> entry : _stalenessListeners.entrySet())
- {
- final IResource res = entry.getKey();
-
- if (res.getProject().equals(project))
- {
- final ViewInfo info = entry.getValue();
- for (final StalenessListener listener : info.getListeners())
- {
- listener.stalenessChanged(event);
- }
- }
- }
- }
-
- private List<StalenessListener> getListeners(final IResource res)
- {
- List<StalenessListener> stalenessListeners = null;
-
- synchronized (this)
- {
- final ViewInfo viewInfo = _stalenessListeners.get(res);
-
- if (viewInfo != null)
- {
- stalenessListeners = viewInfo.getListeners();
- }
- }
- return stalenessListeners;
- }
-
- public synchronized void addViewInfo(final String viewId,
- final IResource res)
- {
- ViewInfo viewInfo = _stalenessListeners.get(res);
-
- if (viewInfo == null)
- {
- viewInfo = new ViewInfo(viewId);
- _stalenessListeners.put(res, viewInfo);
- }
- }
-
- public synchronized ViewInfo getViewInfo(final IResource res)
- {
- return _stalenessListeners.get(res);
- }
-
- public synchronized void dispose()
- {
- // updating with null effectively deregisters any existing listener
- // and doesn't register a new one.
- ResourcesPlugin.getWorkspace().removeResourceChangeListener(_buildListener);
- update(null);
- }
-
- public synchronized void update(
- final ImmutableLifecycleListener listener)
- {
- if (listener == _listener)
- {
- return;
- }
-
- final ImmutableLifecycleListener oldListener = _listener;
-
- if (oldListener != null)
- {
- oldListener.removeListener(this);
- }
-
- _listener = listener;
-
- if (_listener != null)
- {
- _listener.addListener(this);
- }
- }
- }
-
- private static class ViewInfo
- {
- private final CopyOnWriteArrayList<StalenessListener> _listeners;
- private final String _viewId;
-
- /**
- * @param listeners
- * @param res
- */
- private ViewInfo(final String viewId)
- {
- super();
- _listeners = new CopyOnWriteArrayList<StalenessListener>();
- _viewId = viewId;
- }
-
- protected final CopyOnWriteArrayList<StalenessListener> getListeners()
- {
- return _listeners;
- }
-
- protected final String getViewId()
- {
- return _viewId;
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/IDTViewHandler.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/IDTViewHandler.java
deleted file mode 100644
index 81e4be6..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/IDTViewHandler.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jst.jsf.common.internal.resource.ImmutableLifecycleListener;
-import org.eclipse.jst.jsf.designtime.context.DTFacesContext;
-
-/**
- * <p>
- * Defines the basic interface for all design time view handlers that parallel
- * custom runtime view handlers (extenders of ViewHandler).
- * </p>
- *
- * @author cbateman
- *
- */
-public interface IDTViewHandler
-{
- /**
- * <p>
- * Creates and returns the view root. This method <i>may</i> optionally
- * intialize the view root with any data that need only be done once per
- * instance. Generally, this will include providing the root access to
- * itself or its IViewDefnAdapterFactory so that it can refresh itself.
- * </p>
- *
- * @param facesContext
- * @param viewId
- * @return a designtime view root instance of viewId under the given faces
- * context
- * @throws ViewHandlerException
- */
- DTUIViewRoot createView(DTFacesContext facesContext, String viewId)
- throws ViewHandlerException;
-
- /**
- * Calculate the locale for the current view context. The return string must
- * conform to the standard format proscribed by java.util.Locale.
- *
- * @param context
- * @return the locale string for the view definition referred to by context
- * @throws ViewHandlerException
- */
- String calculateLocale(DTFacesContext context) throws ViewHandlerException;
-
- /**
- * Given that resource is the view definition source and requestPath is the
- * current servlet uri for a request relative to the web content root, map
- * it to the actual request uri that would be required at runtime to invoke
- * the view definition in resource. DTFacesContext will contain an external
- * context that may be used to derive servlet mapping configuration.
- *
- * @param context
- * @param resource
- * @param requestPath
- * @return the IPath representing the newly mapped request path
- * @throws ViewHandlerException
- */
- IPath getActionURL(DTFacesContext context, IResource resource,
- IPath requestPath) throws ViewHandlerException;
-
- /**
- * TODO: if we already have context, must we already know what the source
- * is?
- *
- * The IResource need not exist.
- *
- * @param context
- * @param viewId
- * @return the resource containing the view definition for viewId.
- * @throws ViewHandlerException
- */
- IResource getActionDefinition(DTFacesContext context, String viewId)
- throws ViewHandlerException;
-
- /**
- * Given that a request is made for uri from within the view named by
- * relativeToViewId at runtime, return the path to the resource containing
- * that view definition. The path need not point to a resource that
- * currently exists.
- *
- * @param context
- * @param relativeToViewId
- * @param uri
- * @return the path to the resource named by uri relative to the view named
- * by relativeToViewId
- * @throws ViewHandlerException
- */
- IPath getRelativeActionPath(DTFacesContext context,
- String relativeToViewId, String uri) throws ViewHandlerException;
-
- /**
- * Translate a workspace resource to the view id it will have at runtime.
- *
- * @param context
- * @param res
- * @return the view id for res or null if there is no meaningful value
- */
- String getViewId(DTFacesContext context, IResource res);
-
- /**
- * @param context
- * @return a view definition adapter
- * @throws ViewHandlerException
- */
- IViewDefnAdapterFactory getViewMetadataAdapterFactory(DTFacesContext context)
- throws ViewHandlerException;
-
- /**
- * @param file
- * @return true if the contents of the file is of a format that this view
- * handler supports. Generally, this is decided by a combination of
- * content type and, in the case of XML formats, schema.
- */
- boolean supportsViewDefinition(final IFile file);
-
- /**
- * Releases the handler's in-memory image.
- */
- void dispose();
-
- /**
- * Called by design time app manager to set a global resource listener
- * for the view handler to use. View handlers should generally use this
- * listener to reduce the overhead of extra resouce change listeners.
- *
- * @param listener
- */
- void setLifecycleListener(final ImmutableLifecycleListener listener);
-
- /**
- * General exception class for problems that a custom view handler wants to
- * propagate to the framework in a well-defined way.
- *
- */
- public static final class ViewHandlerException extends Exception
- {
- private final Cause _causeCode;
-
- /**
- * Enumerates the known failure causes
- *
- */
- public enum Cause
- {
- /**
- * thrown from getELExpression when the context passed does not
- * refer to a parsable EL expression in the view definition
- */
- EL_NOT_FOUND,
- /**
- * thrown from getELExpression when an exception occurs during EL
- * parsing. The ViewHandlerException should wrap the causing
- * exception in this cause
- */
- EL_EXCEPTION_CAUGHT_WHILE_PARSING,
- /**
- * an undefined exception cause indicating something not foreseen by
- * the framework.
- */
- UNDEFINED,
-
- /**
- * indicates that a bad or null version stamp was encountered. The
- * wrapped exception may provide tracing information to the cause.
- */
- BAD_VERSION_STAMP,
-
- /**
- * indicates that a bad or null staleness advisor was encountered.
- * The wrapped exception may provide tracing information to the
- * cause.
- */
- BAD_STALENESS_ADVISOR,
-
- /**
- * a general failure by the view creation to create a new view root.
- */
- UNABLE_TO_CREATE_VIEW
- }
-
- /**
- *
- */
- private static final long serialVersionUID = 2109525340402345111L;
-
- /**
- * Construct an exception with an undefined cause
- */
- public ViewHandlerException()
- {
- this(Cause.UNDEFINED);
- }
-
- /**
- * @param cause
- */
- public ViewHandlerException(final Cause cause)
- {
- super();
- _causeCode = cause;
- }
-
- /**
- * @param message
- * @param caught
- * @param cause
- */
- public ViewHandlerException(final String message,
- final Throwable caught, final Cause cause)
- {
- super(message, caught);
- _causeCode = cause;
- }
-
- /**
- * @param message
- * @param cause
- */
- public ViewHandlerException(final String message, final Cause cause)
- {
- super(message);
- _causeCode = cause;
- }
-
- /**
- * @param caught
- * @param cause
- */
- public ViewHandlerException(final Throwable caught, final Cause cause)
- {
- super(caught);
- _causeCode = cause;
- }
-
- /**
- * @return the cause code
- */
- public final Cause getCauseCode()
- {
- return _causeCode;
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/IViewDefnAdapter.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/IViewDefnAdapter.java
deleted file mode 100644
index 676643a..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/IViewDefnAdapter.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view;
-
-import java.util.List;
-
-import org.eclipse.jst.jsf.common.runtime.internal.model.ViewObject;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.datatypes.ELExpression;
-import org.eclipse.jst.jsf.context.IModelContext;
-import org.eclipse.jst.jsf.designtime.context.DTFacesContext;
-import org.eclipse.jst.jsf.designtime.internal.view.IDTViewHandler.ViewHandlerException;
-
-/**
- * <p>
- * A generic adapter used to adapt arbitrary view definitions to framework
- * objects.
- * </p>
- *
- * @author cbateman
- * @param <VIEW_DEFN_BASE_TYPE>
- * the base type of all view definition objects
- * @param <VIEW_CONTAINER_TYPE>
- * the type of the container that is expeccted to hold the view defn
- *
- */
-public interface IViewDefnAdapter<VIEW_DEFN_BASE_TYPE, VIEW_CONTAINER_TYPE>
-{
- /**
- * @param viewDefnObject
- * @param constructionData
- * @param viewContainer
- * @return a view object corresponding to the viewDefnBaseType object or
- * null if none.
- */
- ViewObject mapToViewObject(
- VIEW_DEFN_BASE_TYPE viewDefnObject,
- ViewObjectConstructionStrategy<? extends VIEW_DEFN_BASE_TYPE> constructionData,
- VIEW_CONTAINER_TYPE viewContainer);
-
- /**
- * This method may be expensive.
- *
- * @param viewDefnObject
- * @param root
- * @return the view object corresponding to viewDefnObject in the
- * component sub-tree rooted at root.
- * <b>May return null if isn't found or can't be found</b>
- */
- ViewObject findViewObject(VIEW_DEFN_BASE_TYPE viewDefnObject, ComponentInfo root);
-
- /**
- * @param viewObject
- * @param root
- * @return the view definition object that viewObject was derived from
- * using root as the component sub-tree root to search in.
- * <b>May return null if isn't found or can't be found</b>
- */
- VIEW_DEFN_BASE_TYPE findViewDefn(ViewObject viewObject, ComponentInfo root);
-
- /**
- * @param viewDefnObject
- * @return the id for the viewDefnObject or null if none. Generally, null
- * should indicate that no id is present but could be. This is
- * distinct from the case where viewDefnObject can never define an
- * id, in which case IllegalArgumentException should be thrown.
- *
- * @throws IllegalArgumentException
- * may be thrown to indicate that viewDefnObject does not
- * correspond to a ViewObject type that has an id.
- *
- */
- String getId(VIEW_DEFN_BASE_TYPE viewDefnObject)
- throws IllegalArgumentException;
-
- /**
- * Normally this is a workspace resource (IFile) or higher level document
- * type like an IDocument.
- *
- * @param context
- * @param viewId
- * @return the container resource for the viewId in context.
- */
- VIEW_CONTAINER_TYPE getContainer(DTFacesContext context, String viewId);
-
- /**
- * @param container
- * @return the view roots for the definition in container or empty if none.
- * MUST NOT BE NULL.
- */
- List<VIEW_DEFN_BASE_TYPE> getViewDefnRoots(VIEW_CONTAINER_TYPE container);
-
- /**
- * <p>
- * The view definition adapter must be able to extract all EL expressions
- * from a view definition. Given a model context that points into the view
- * definition it must return the EL expression in that context.
- * </p>
- *
- * <p>
- * If the model context provided does not refer to a valid view definition
- * for this handler, then ViewHandlerException(EL_NOT_FOUND) should be
- * thrown. If an exception occurs while trying to extract the EL expression
- * at context, then ViewHandlerException(caughtException,
- * EL_EXCEPTION_CAUGHT_WHILE_PARSING) should be thrown.
- * </p>
- *
- * <p>
- * Note that any reference to parsing here means extraction from the
- * document and not building an AST for the expression itself.</p>
- *
- * @param context
- * @return the text (stripped of any escaping such as #{} in JSP) of the EL
- * expression referred to by context or null if there is no valid EL
- * expression at context.
- * @throws ViewHandlerException
- */
- ELExpression getELExpression(IModelContext context) throws ViewHandlerException;
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/IViewDefnAdapterFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/IViewDefnAdapterFactory.java
deleted file mode 100644
index b0aa0f0..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/IViewDefnAdapterFactory.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view;
-
-import org.eclipse.jst.jsf.designtime.context.DTFacesContext;
-
-/**
- * <p>Interface for a factory that creates view definition adapters.</p>
- *
- * @author cbateman
- *
- */
-public interface IViewDefnAdapterFactory
-{
- /**
- * @param context
- * @param viewId
- * @return a view adapter for the viewid or null if this factory
- * cannot produce an adapter for the underlying view definition.
- */
- IViewDefnAdapter<?,?> createAdapter(DTFacesContext context, String viewId);
-}
\ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/IViewRootHandle.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/IViewRootHandle.java
deleted file mode 100644
index c8d3763..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/IViewRootHandle.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view;
-
-import org.eclipse.jst.jsf.designtime.internal.view.DTUIViewRoot.StalenessListener;
-
-/**
- * A handle to a view root.
- *
- * @author cbateman
- *
- */
-public interface IViewRootHandle
-{
- /**
- * <p>
- * This returns the copy of the view root cached by the faces context. If
- * updateViewRoot has never been called (or if it was called but never
- * succeeded) it may return null.
- * </p>
- *
- * <p>
- * This method should be cheap and avoid blocking
- * </p>
- *
- * return null if the value of the view root
- *
- * @return the cached view root. May be null.
- */
- DTUIViewRoot getCachedViewRoot();
-
- /**
- * NOTE: this method may be long running. If you can tolerate a possibly
- * stale value more quickly, use getCachedViewRoot(). NEVER run this method
- * on the main UI thread.
- *
- * A good strategy for invoking is as follows:
- *
- * DTUIViewRoot viewRoot = handle.getCachedViewRoot();
- *
- * <pre>
- * if (viewRoot == null || viewRoot.isStale())
- * {
- * spawnTread that calls updateViewRoot
- * }
- *
- * </pre>
- *
- * @return the view root for the associated context object or null if there
- * is no context object.
- */
- DTUIViewRoot updateViewRoot();
-
- /**
- * Adds a staleness listener to the currently cached view root. If there
- * currently is no cached view root, then the listener will be stored
- * until a updateViewRoot is successfully called.
- * @param listener
- */
- void addListener(final StalenessListener listener);
-
- /**
- * Removes a staleness listener from the currently cached view root. If
- * there is no currently cached root, then the listener will be stored
- * until one is found. The call will then attempt to remove it.
- * @param listener
- */
- void removeListener(final StalenessListener listener);
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/JSPViewDefnAdapter.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/JSPViewDefnAdapter.java
deleted file mode 100644
index 13d9e29..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/JSPViewDefnAdapter.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view;
-
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jst.jsf.context.IModelContext;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.internal.ITextRegionContextResolver;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContextFactory;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.designtime.context.DTFacesContext;
-import org.eclipse.jst.jsf.designtime.internal.view.IDTViewHandler.ViewHandlerException;
-import org.eclipse.jst.jsf.designtime.internal.view.IDTViewHandler.ViewHandlerException.Cause;
-import org.eclipse.jst.jsf.designtime.internal.view.model.ITagRegistry;
-import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TaglibTracker;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDDocument;
-import org.eclipse.jst.jsp.core.internal.domdocument.DOMModelForJSP;
-import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Element;
-
-/**
- * <p>
- * A view definition adapter that adapts JSF view definitions based on the
- * standard JSP view description language.
- * </p>
- *
- * @author cbateman
- *
- */
-public class JSPViewDefnAdapter extends TaglibBasedViewDefnAdapter
-{
- JSPViewDefnAdapter(final ITagRegistry tldTagRegistry)
- {
- super(tldTagRegistry);
- }
-
- @Override
- public IDocument getContainer(final DTFacesContext context,
- final String viewId)
- {
- final IResource viewDefn = context.adaptContextObject();
-
- if (viewDefn instanceof IFile)
- {
- final IFile viewDefnFile = (IFile) viewDefn;
- IStructuredModel model = null;
- try
- {
- model =
- StructuredModelManager.getModelManager()
- .getModelForRead(viewDefnFile);
-
- if (model instanceof DOMModelForJSP)
- {
- return model.getStructuredDocument();
- }
- }
- catch (final IOException e)
- {
- JSFCorePlugin.log(e, "Acquiring model for view root");
- }
- catch (final CoreException e)
- {
- JSFCorePlugin.log(e, "Acquiring model for view root");
- }
- finally
- {
- if (model != null)
- {
- model.releaseFromRead();
- }
- }
- }
- return null;
- }
-
- @Override
- public final String getNamespace(final Element element,
- final IDocument doc)
- {
- final String prefix = element.getPrefix();
-
- // TODO: merge back with JSPUtil.findUri()
- final TLDCMDocumentManager m =
- TaglibController.getTLDCMDocumentManager(doc);
-
- if (prefix == null || m == null)
- {
- return null;
- }
- final List<?> trackers = m.getTaglibTrackers();
- for (final Object name : trackers)
- {
- final TaglibTracker tracker = (TaglibTracker) name;
- if (prefix.equals(tracker.getPrefix()))
- {
- return tracker.getURI();
- }
- }
- return null;
- }
-
-
- @Override
- public DTELExpression getELExpression(final IModelContext genericContext)
- throws ViewHandlerException
- {
- final IStructuredDocumentContext context =
- (IStructuredDocumentContext) genericContext
- .getAdapter(IStructuredDocumentContext.class);
-
- if (context == null)
- {
- throw new ViewHandlerException(Cause.EL_NOT_FOUND);
- }
-
- ITextRegionContextResolver resolver =
- IStructuredDocumentContextResolverFactory.INSTANCE
- .getTextRegionResolver(context);
-
- String elText = null;
-
- if (resolver != null)
- {
- final String regionType = resolver.getRegionType();
-
- if (regionType != null && resolver.matchesRelative(new String[]
- { DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE }))
- {
- // if we are in the EL content, then get the current region
- // text
- if (DOMJSPRegionContexts.JSP_VBL_CONTENT.equals(regionType))
- {
- elText = resolver.getRegionText();
- }
- // otherwise, we may be at the end of a content region but
- // at
- // the beginning of a closing brace so check to see if the
- // previous
- // region was a VBL_CONTENT
- else if (regionType.equals(DOMJSPRegionContexts.JSP_VBL_CLOSE))
- {
- final IStructuredDocumentContext previousContext =
- resolver.getPreviousContext();
-
- final ITextRegionContextResolver prevResolver =
- IStructuredDocumentContextResolverFactory.INSTANCE
- .getTextRegionResolver(previousContext);
-
- if (prevResolver != null)
- {
- if (DOMJSPRegionContexts.JSP_VBL_CONTENT
- .equals(prevResolver.getRegionType()))
- {
- resolver = prevResolver;
- elText = prevResolver.getRegionText();
- }
- else if (DOMJSPRegionContexts.JSP_VBL_OPEN
- .equals(prevResolver.getRegionType()))
- {
- elText = ""; //$NON-NLS-1$
- }
- }
- }
- }
- }
-
- if (elText != null)
- {
- final IStructuredDocumentContext elContext =
- IStructuredDocumentContextFactory.INSTANCE.getContext(
- context.getStructuredDocument(), resolver
- .getStartOffset());
- return new DTELExpression(elContext, elText);
- }
- return null;
- }
-
- @Override
- public String getGeneratedIdPrefix()
- {
- return "_idJsp";
- }
-
- @Override
- public String getPrefix(String namespace, IDocument doc)
- {
- TLDCMDocumentManager m = TaglibController.getTLDCMDocumentManager(doc);
- if (m == null)
- return null;
- List trackers = m.getTaglibTrackers();
- for (Iterator iter = trackers.iterator(); iter.hasNext();) {
- TaglibTracker tracker = (TaglibTracker) iter.next();
- if (namespace.equals(tracker.getURI())) {
- return tracker.getPrefix();
- }
-
- CMDocument cmdoc = tracker.getDocument();
- if (cmdoc instanceof TLDDocument
- && namespace.equals(((TLDDocument) cmdoc).getUri())) {
- return tracker.getPrefix();
- }
- }
- return null;
-
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/TaglibBasedViewDefnAdapter.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/TaglibBasedViewDefnAdapter.java
deleted file mode 100644
index f24c405..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/TaglibBasedViewDefnAdapter.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ITagElement;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.Namespace;
-import org.eclipse.jst.jsf.designtime.internal.view.model.ITagRegistry;
-import org.w3c.dom.Element;
-
-/**
- * A view defintion adapter for XML-based view definition formats that use
- * a well defined tag library system, with associated ITagRegistry, to define
- * tag handlers. Most common view handlers (JSP, Facelets) should use this.
- *
- * @author cbateman
- *
- */
-public abstract class TaglibBasedViewDefnAdapter extends XMLViewDefnAdapter
-{
- private final ITagRegistry _tagRegistry;
-
- /**
- * @param tagRegistry
- */
- protected TaglibBasedViewDefnAdapter(final ITagRegistry tagRegistry)
- {
- _tagRegistry = tagRegistry;
- }
-
- /**
- * @param node
- * @param document
- * @return the tag element for node or null if none.
- */
- @Override
- protected ITagElement findTagElement(final Element node,
- final IDocument document)
- {
- final String uri = getNamespace(node, document);
- final String tagName = node.getLocalName();
-
- if (uri != null)
- {
- final Namespace lib = getTagRegistry().getTagLibrary(uri);
-
- if (lib != null)
- {
- return findTagElement(tagName, lib);
- }
- }
- return null;
- }
-
- /**
- * @return the tag registry
- */
- protected final ITagRegistry getTagRegistry()
- {
- return _tagRegistry;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/ViewObjectConstructionStrategy.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/ViewObjectConstructionStrategy.java
deleted file mode 100644
index ad3a7a2..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/ViewObjectConstructionStrategy.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view;
-
-import org.eclipse.jst.jsf.common.runtime.internal.model.ViewObject;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ITagElement;
-
-/**
- * A strategy for constructing a new view object from a tag element
- * @author cbateman
- * @param <VIEW_DEFN_BASE_TYPE>
- *
- */
-public abstract class ViewObjectConstructionStrategy<VIEW_DEFN_BASE_TYPE>
-{
- /**
- * For a tag element return the corresponding view object or null if
- * there is no such object. XMLViewObjectMappingService must be updated
- * if not null with any attribute->property mappings.
- *
- * @param viewBase the source object in the source
- * @param tagElement
- * @return a new view object or null if we can't do so
- */
- public abstract ViewObject createViewObject(VIEW_DEFN_BASE_TYPE viewBase,
- ITagElement tagElement);
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/XMLComponentTreeConstructionStrategy.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/XMLComponentTreeConstructionStrategy.java
deleted file mode 100644
index 9139646..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/XMLComponentTreeConstructionStrategy.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jst.jsf.common.runtime.internal.model.ViewObject;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentFactory;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentInfo;
-import org.eclipse.jst.jsf.designtime.context.DTFacesContext;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * A component tree construction strategy based on XML view definition
- *
- * @author cbateman
- *
- */
-public class XMLComponentTreeConstructionStrategy extends
- ComponentTreeConstructionStrategy<Node, IDocument>
-{
- private final XMLViewDefnAdapter _adapter;
- // private final XMLViewObjectConstructionStrategy
- // _objectConstructionStrategy;
- private final IProject _project;
-
- /**
- * @param adapter
- * @param project
- */
- public XMLComponentTreeConstructionStrategy(
- final XMLViewDefnAdapter adapter, final IProject project)
- {
- _adapter = adapter;
- _project = project;
- }
-
- @Override
- public ComponentInfo createComponentTree(final DTFacesContext context,
- final DTUIViewRoot viewRoot)
- {
- final IDocument container = _adapter.getContainer(context, viewRoot
- .getViewId());
- final List<Node> roots = _adapter.getViewDefnRoots(container);
-
- if (roots.size() > 0)
- {
- final IAdaptable adaptable = viewRoot.getServices();
-
- XMLViewObjectMappingService tagMappingService = null;
- if (adaptable != null)
- {
- tagMappingService = (XMLViewObjectMappingService) adaptable
- .getAdapter(XMLViewObjectMappingService.class);
- }
- final XMLViewObjectConstructionStrategy objectConstructionStrategy =
- new XMLViewObjectConstructionStrategy(
- _adapter, new ComponentConstructionData(0, null, _project,
- container), tagMappingService);
-
- objectConstructionStrategy.getConstructionData().setIdCounter(0);
- // can only handle a single root for XML; should be the DOM root
- return buildComponentTree(roots.get(0), viewRoot, container,
- objectConstructionStrategy);
- }
-
- return viewRoot;
- }
-
- private ComponentInfo buildComponentTree(final Node root,
- final DTUIViewRoot viewRoot, final IDocument document,
- final XMLViewObjectConstructionStrategy objectConstructionStrategy)
- {
- final ComponentInfo dummyRoot = ComponentFactory.createComponentInfo(
- null, null, null, true);
- // populate the dummy root
- recurseDOMModel(root, dummyRoot, document, objectConstructionStrategy);
-
- // try to extract the view defined root from the dummyRoot and update
- // 'root' with its children.
- populateViewRoot(viewRoot, dummyRoot.getChildren());
- return viewRoot;
- }
-
- /**
- * Tries to find the view defined view root in children and use it populate
- * viewRoot. Children may sub-class to a different algorithm or, in some
- * cases create an implicit (i.e. Facelets does this) view root if one is
- * not explicitly created by the view definition.
- *
- * Regardless of the strategy, the following post-conditions must be true
- *
- * To the extend that children represent the top-level objects in the view
- * under the presumed root, viewRoot must be populated with them either
- * directly if the creation of a view root is implicit (i.e. Facelets) or
- * through a valid view root declaration found in the view definition (i.e.
- * f:view in JSP) found the children list.
- *
- * The default behaviour assumes the JSP case.
- *
- * TODO: add validation cases for missing view roots in JSP.
- *
- * @param viewRoot
- * @param children
- */
- protected void populateViewRoot(final DTUIViewRoot viewRoot,
- final List children)
- {
- ComponentInfo foundRoot = null;
- // TODO: additional cases:
- // 1) Valid case: view is a fragment and has one or more non-view root
- // children
- // 2) Invalid case: not a fragment and has no view root
- // 3) Invalid case: any definition and has more than one view root
- // 4) Invalid case: any definition and has component siblings to the
- // view root
- FIND_VIEWROOT: for (final Iterator it = children.iterator(); it
- .hasNext();)
- {
- final ComponentInfo topLevelChild = (ComponentInfo) it.next();
-
- if ("javax.faces.ViewRoot".equals(topLevelChild
- .getComponentTypeInfo().getComponentType()))
- {
- foundRoot = topLevelChild;
- break FIND_VIEWROOT;
- }
- }
-
- if (foundRoot != null)
- {
- for (final Iterator it = foundRoot.getChildren().iterator(); it
- .hasNext();)
- {
- final ComponentInfo child = (ComponentInfo) it.next();
- final String facetName = foundRoot.getFacetName(child);
-
- // if not a facet, add as a normal child
- if (facetName == null)
- {
- viewRoot.addChild(child);
- }
- // if it is a facet, add as a facet
- else
- {
- viewRoot.addFacet(facetName, child);
- }
- }
- }
- }
-
- private void recurseDOMModel(final Node node, final ComponentInfo parent,
- final IDocument document,
- XMLViewObjectConstructionStrategy objectConstructionStrategy)
- {
- ViewObject mappedObject = null;
-
- objectConstructionStrategy.getConstructionData().setParent(parent);
-
- mappedObject = _adapter.mapToViewObject(node,
- objectConstructionStrategy, document);
-
- ComponentInfo newParent = parent;
-
- if (mappedObject instanceof ComponentInfo)
- {
- parent.addChild((ComponentInfo) mappedObject);
- newParent = (ComponentInfo) mappedObject;
- }
-
- final NodeList children = node.getChildNodes();
- final int numChildren = children.getLength();
-
- for (int i = 0; i < numChildren; i++)
- {
- recurseDOMModel(children.item(i), newParent, document,
- objectConstructionStrategy);
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/XMLViewDefnAdapter.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/XMLViewDefnAdapter.java
deleted file mode 100644
index 842f92c..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/XMLViewDefnAdapter.java
+++ /dev/null
@@ -1,319 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jst.jsf.common.runtime.internal.model.ViewObject;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.datatypes.ELExpression;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ITagElement;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.Namespace;
-import org.eclipse.jst.jsf.context.IModelContext;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IDOMContextResolver;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContextFactory;
-import org.eclipse.jst.jsf.designtime.context.DTFacesContext;
-import org.eclipse.jst.jsf.designtime.internal.view.IDTViewHandler.ViewHandlerException;
-import org.eclipse.jst.jsf.designtime.internal.view.XMLViewObjectMappingService.ElementData;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * A view definition adapter base class for view definition that use XML to
- * define the view.
- *
- * @author cbateman
- *
- */
-public abstract class XMLViewDefnAdapter extends
- AbstractViewDefnAdapter<Node, IDocument>
-{
- private static final String GENERATED_ID = "_generatedId";
-
- @Override
- public abstract IDocument getContainer(DTFacesContext context, String viewId);
-
- @Override
- public String getId(final Node viewDefnObject)
- throws IllegalArgumentException
- {
- if (viewDefnObject instanceof Element)
- {
- return ((Element) viewDefnObject).getAttribute("id");
- }
- throw new IllegalArgumentException(
- "Only Elements can define view object ids");
- }
-
- @Override
- public ViewObject mapToViewObject(
- final Node viewDefnObject,
- final ViewObjectConstructionStrategy<? extends Node> constructionData,
- final IDocument document)
- {
- switch (viewDefnObject.getNodeType())
- {
- case Node.ELEMENT_NODE:
- return createFromElement(
- (Element) viewDefnObject,
- (ViewObjectConstructionStrategy<Element>) constructionData,
- document);
- }
-
- return null;
- }
-
- /**
- * @param viewDefnObject
- * @param viewContainer
- * @return the tag element corresponding to viewDefnObject in the context of
- * viewContainer or null if not found. Node must be an Element in
- * order for this work.
- */
- public ITagElement mapToTagElement(final Node viewDefnObject,
- final IDocument viewContainer)
- {
- if (viewDefnObject instanceof Element)
- {
- return findTagElement((Element) viewDefnObject, viewContainer);
- }
- return null;
- }
-
- @Override
- public List<Node> getViewDefnRoots(final IDocument container)
- {
- final List<Node> roots = new ArrayList<Node>();
-
- final IStructuredDocumentContext context = IStructuredDocumentContextFactory.INSTANCE
- .getContext(container, -1);
-
- if (context != null)
- {
- final IDOMContextResolver resolver = IStructuredDocumentContextResolverFactory.INSTANCE
- .getDOMContextResolver(context);
-
- if (resolver != null)
- {
- final Document doc = resolver.getDOMDocument();
-
- if (doc != null)
- {
- roots.add(doc);
- }
- }
- }
-
- return roots;
- }
-
- @Override
- public ViewObject findViewObject(final Node viewDefnObject,
- final ComponentInfo root)
- {
- if (root instanceof DTUIViewRoot && viewDefnObject instanceof Element)
- {
- final IAdaptable services = ((DTUIViewRoot) root).getServices();
- final Object serviceAdapter = services
- .getAdapter(XMLViewObjectMappingService.class);
- if (serviceAdapter instanceof XMLViewObjectMappingService)
- {
- final IStructuredDocumentContext context = getContext(viewDefnObject);
-
- if (context != null)
- {
- final String uri = getNamespace((Element) viewDefnObject,
- context.getStructuredDocument());
- final ElementData elementData = XMLViewObjectMappingService
- .createElementData(uri, viewDefnObject
- .getLocalName(), context,
- Collections.EMPTY_MAP);
- return ((XMLViewObjectMappingService) serviceAdapter)
- .findViewObject(elementData);
- }
- }
- }
- return null;
- }
-
- private IStructuredDocumentContext getContext(final Node viewDefnObject)
- {
- if (viewDefnObject instanceof IDOMNode)
- {
- final IStructuredDocument sdoc = ((IDOMNode) viewDefnObject)
- .getStructuredDocument();
- return IStructuredDocumentContextFactory.INSTANCE.getContext(sdoc,
- viewDefnObject);
- }
- return null;
- }
-
- @Override
- public Node findViewDefn(final ViewObject viewObject,
- final ComponentInfo root)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public abstract DTELExpression getELExpression(IModelContext context)
- throws ViewHandlerException;
-
- // TODO: need to extend to other objects
- /**
- * @param element
- * @param constructionData
- * @param document
- * @return the component info for element
- */
- protected ViewObject createFromElement(final Element element,
- final ViewObjectConstructionStrategy<Element> constructionData,
- final IDocument document)
- {
- final ITagElement tagElement = findTagElement(element, document);
- return constructionData.createViewObject(element, tagElement);
- }
-
- /**
- * @param element
- * @param doc
- * @return the namespace uri for element in doc
- */
- public abstract String getNamespace(Element element, IDocument doc);
-
- /**
- * @param namespace
- * @param doc
- * @return the prefix in doc for namespace or null if none.
- */
- public abstract String getPrefix(final String namespace, IDocument doc);
-
- /**
- * @param node
- * @param document
- * @return the tag element for node in document or null if none
- */
- protected abstract ITagElement findTagElement(final Element node,
- final IDocument document);
-
- /**
- * @param nodeName
- * @param lib
- * @return the tag element with local name nodeName in lib or null if none.
- */
- protected static ITagElement findTagElement(final String nodeName,
- final Namespace lib)
- {
- return lib.getViewElement(nodeName);
- }
-
- /**
- * @param namespaces
- * @param uri
- * @return the namespace object in namespaces with uri, 'uri', or null if
- * none.
- */
- protected static Namespace getTaglib(
- final Collection<? extends Namespace> namespaces, final String uri)
- {
- for (final Namespace namespace : namespaces)
- {
- if (uri.equals(namespace.getNSUri()))
- {
- return namespace;
- }
- }
- return null;
- }
-
- /**
- * @return the prefix string to which a running count will be added to
- * produced the default generated id
- */
- public String getGeneratedIdPrefix()
- {
- return GENERATED_ID;
- }
-
- /**
- * @param element
- * @param componentAttrName
- * @return the attribute on element matching the component attribute called
- * componentAttrName or null if not found (this may indicate either
- * no such attribute or that it simply not populated on element; no
- * guarantee is made as to which it is)
- */
- public Attr mapAttributeToComponent(final Element element,
- final String componentAttrName)
- {
- // TODO: need to make meta-data type driven and validate bad conversion
-
- final boolean mapByBeanName = true; // TODO: getMetadata for mapping
- // instead
-
- if (mapByBeanName)
- {
- return element.getAttributeNode(componentAttrName);
- }
-
- return null;
- }
-
- /**
- * A design time EL expression
- *
- */
- public static class DTELExpression extends ELExpression
- {
- private final IStructuredDocumentContext _documentContext;
- private final String _originalText;
-
- /**
- * @param doc
- * @param text
- */
- public DTELExpression(final IStructuredDocumentContext doc,
- final String text)
- {
- _documentContext = doc;
- _originalText = text;
- }
-
- @Override
- public String getText()
- {
- return _originalText;
- }
-
- /**
- * @return the document context. The document relative position of the
- * start of the EL expression is used
- *
- */
- public IStructuredDocumentContext getDocumentContext()
- {
- return _documentContext;
- }
-
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/XMLViewObjectConstructionStrategy.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/XMLViewObjectConstructionStrategy.java
deleted file mode 100644
index a30295a..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/XMLViewObjectConstructionStrategy.java
+++ /dev/null
@@ -1,519 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jst.jsf.common.internal.types.TypeConstants;
-import org.eclipse.jst.jsf.common.runtime.internal.model.ViewObject;
-import org.eclipse.jst.jsf.common.runtime.internal.model.behavioural.ActionSourceInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.behavioural.ActionSourceInfo2;
-import org.eclipse.jst.jsf.common.runtime.internal.model.behavioural.EditableValueHolderInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.behavioural.INamingContainerInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.behavioural.ValueHolderInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentFactory;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentTypeInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ConverterDecorator;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ConverterTypeInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ValidatorDecorator;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ValidatorTypeInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.IComponentPropertyHandler;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.IComponentTagElement;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.IConverterTagElement;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ITagAttributeHandler;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ITagElement;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.IValidatorTagElement;
-import org.eclipse.jst.jsf.common.util.JDTBeanProperty;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContextFactory;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.designtime.internal.view.XMLViewObjectMappingService.ElementData;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.ICustomViewMapper;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.ICustomViewMapper.PropertyMapping;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.CustomViewMapperExtensionLoader;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-
-/**
- * A strategy for constructing view objects.
- *
- * @author cbateman
- *
- */
-public class XMLViewObjectConstructionStrategy extends
- ViewObjectConstructionStrategy<Element>
-{
- private static final String GENERATED_ID = "_generatedId";
- private final ComponentConstructionData _constructionData;
- private final XMLViewDefnAdapter _adapter;
- private final XMLViewObjectMappingService _mappingService;
-
- /**
- * @param adapter
- * MUST NOT BE NULL
- * @param constructionData
- * MUST NOT BE NULL
- * @param mappingService
- * MAY BE NULL
- */
- public XMLViewObjectConstructionStrategy(final XMLViewDefnAdapter adapter,
- final ComponentConstructionData constructionData,
- final XMLViewObjectMappingService mappingService)
- {
- super();
- if (adapter == null || constructionData == null)
- {
- throw new IllegalArgumentException(
- "adapter and constructionData must not be null");
- }
- _constructionData = constructionData;
- _adapter = adapter;
- _mappingService = mappingService;
- }
-
- @Override
- public ViewObject createViewObject(final Element element,
- final ITagElement tagElement)
- {
- try
- {
- if (tagElement instanceof IComponentTagElement)
- {
- String id = null;
-
- // only generate ids for non-viewroot components. This will
- // make the generated id's more faithful to runtime since the
- // running count won't be incremented for view roots (as they
- // won't at runtime).
- final ComponentTypeInfo typeInfo = ((IComponentTagElement) tagElement)
- .getComponent();
-
- if (!"javax.faces.ViewRoot".equals(typeInfo.getComponentType()))
- {
- id = calculateId(element, _constructionData);
- }
- return findBestComponent(tagElement.getUri(), element, id,
- (IComponentTagElement) tagElement);
- }
- else if (tagElement instanceof IConverterTagElement)
- {
- final ConverterTypeInfo typeInfo = ((IConverterTagElement) tagElement)
- .getConverter();
- // TODO: validate when no parent
- ComponentInfo parent = _constructionData.getParent();
- parent = findFirstParent(
- ComponentFactory.INTERFACE_VALUEHOLDER, parent);
- if (parent != null)
- {
- parent.addDecorator(
- new ConverterDecorator(parent, typeInfo),
- ComponentFactory.CONVERTER);
- }
- // TODO: else validate problem
- }
- else if (tagElement instanceof IValidatorTagElement)
- {
- final ValidatorTypeInfo typeInfo = ((IValidatorTagElement) tagElement)
- .getValidator();
- ComponentInfo parent = _constructionData.getParent();
- parent = findFirstParent(
- ComponentFactory.INTERFACE_EDITABLEVALUEHOLDER, parent);
- if (parent != null)
- {
- parent.addDecorator(
- new ValidatorDecorator(parent, typeInfo),
- ComponentFactory.VALIDATOR);
- }
- // TODO :else validate problem
- }
- }
- catch (final Exception e)
- {
- // log and ignore if an individual construction fails
- JSFCorePlugin.log(e, "Error constructing view object");
- }
- return null;
- }
-
- private ComponentInfo findFirstParent(final String matchingType,
- final ComponentInfo start)
- {
- ComponentInfo parent = start;
-
- while (parent != null && parent.getComponentTypeInfo() != null
- && !parent.getComponentTypeInfo().isInstanceOf(matchingType))
- {
- parent = parent.getParent();
- }
- return parent;
- }
-
- private ComponentInfo findBestComponent(final String uri,
- final Element srcElement, final String id,
- final IComponentTagElement tagElement)
- {
- ComponentInfo bestComponent = null;
-
- final ComponentInfo parent = _constructionData.getParent();
-
- final Map<String, Object> initMap = new HashMap<String, Object>();
- final Map<String, String> attributeToPropertyMap = new HashMap<String, String>();
- populateInitMap(uri, initMap, srcElement, tagElement,
- attributeToPropertyMap);
-
- if (initMap.get("id") == null)
- {
- // id must be set
- initMap.put("id", id);
- }
-
- final ComponentTypeInfo typeInfo = tagElement.getComponent();
-
- // if we have a well-established base type, try that first
- // sub-classes must occur before superclasses to ensure most accurate
- // detection.
- if (typeInfo.isInstanceOf(ComponentFactory.BASE_CLASS_UIINPUT))
- {
- bestComponent = ComponentFactory.createUIInputInfo(parent,
- typeInfo, initMap);
- }
- else if (typeInfo.isInstanceOf(ComponentFactory.BASE_CLASS_UIOUTPUT))
- {
- bestComponent = ComponentFactory.createUIOutputInfo(parent,
- typeInfo, initMap);
- }
- else if (typeInfo.isInstanceOf(ComponentFactory.BASE_CLASS_UICOMMAND))
- {
- bestComponent = ComponentFactory.createUICommandInfo(parent,
- typeInfo, initMap);
- }
- else if (typeInfo.isInstanceOf(ComponentFactory.BASE_CLASS_UIDATA))
- {
- bestComponent = ComponentFactory.createUIDataInfo(parent, typeInfo,
- initMap);
- }
- else if (typeInfo.isInstanceOf(ComponentFactory.BASE_CLASS_UIFORM))
- {
- // TODO: how handle prepend ids?
- bestComponent = ComponentFactory.createUIFormInfo(parent, typeInfo,
- initMap);
- }
- else
- {
- // default
- bestComponent = ComponentFactory.createComponentInfo(
- _constructionData.getParent(), typeInfo, initMap);
- }
-
- addTypeAdapters(bestComponent);
- maybeMapXMLToViewObjects(bestComponent, srcElement,
- attributeToPropertyMap, _constructionData.getDocument());
- maybeUpdateViewObject(bestComponent, srcElement, tagElement);
- return bestComponent;
- }
-
- // TODO: move to view definition adapter?
- private void populateInitMap(final String uri,
- final Map<String, Object> initMap, final Element srcElement,
- final IComponentTagElement tagElement,
- final Map<String, String> attributeToPropertyMap)
- {
- final ComponentTypeInfo typeInfo = tagElement.getComponent();
- final Map<String, JDTBeanProperty> properties = DTComponentIntrospector
- .getBeanProperties(typeInfo, _constructionData.getProject());
- final Map<String, ITagAttributeHandler> attributeHandlers = tagElement
- .getAttributeHandlers();
-
- final NamedNodeMap nodeMap = srcElement.getAttributes();
-
- if (nodeMap != null && attributeHandlers != null)
- {
- for (int i = 0; i < nodeMap.getLength(); i++)
- {
- final Attr attr = (Attr) nodeMap.item(i);
- if (attr != null)
- {
- final String name = attr.getLocalName();
-
- if (name != null)
- {
- final ITagAttributeHandler attrHandler = attributeHandlers
- .get(name);
- if (attrHandler instanceof IComponentPropertyHandler)
- {
- mapComponentProperty(uri, srcElement, properties,
- (IComponentPropertyHandler) attrHandler,
- attr, name, initMap, attributeHandlers,
- attributeToPropertyMap);
- }
- }
- }
- }
- }
- }
-
- private void mapComponentProperty(final String uri,
- final Element srcElement,
- final Map<String, JDTBeanProperty> properties,
- final IComponentPropertyHandler attrHandler, final Attr attr,
- final String attributeName, final Map initMap,
- final Map<String, ITagAttributeHandler> attributeHandlers,
- final Map<String, String> attributeToPropertyMap)
- {
- final String propertyName = attrHandler.getPropertyName();
- if (properties.containsKey(propertyName))
- {
- final String id = attrHandler.getCustomHandler();
-
- ICustomViewMapper mapper = null;
-
- if (id != null)
- {
- mapper = CustomViewMapperExtensionLoader
- .getCustomViewMapper(id);
- if (mapper != null)
- {
- final PropertyMapping mapping = mapper
- .mapToComponentProperty(uri, srcElement, attr);
- if (mapping != null)
- {
- initMap.put(mapping.getName(), mapping.getProperty());
- attributeToPropertyMap.put(attributeName, mapping
- .getName());
- return;
- }
- }
- }
-
- final String value = attr.getValue();
- if (value != null)
- {
- final Object convertedValue = convertFromString(value,
- properties.get(propertyName));
- initMap.put(propertyName, convertedValue);
- }
- attributeToPropertyMap.put(attributeName, propertyName);
- }
- }
-
- private void maybeMapXMLToViewObjects(final ViewObject mappedObject,
- final Element node,
- final Map<String, String> attributeToProperties,
- final IDocument document)
- {
- if (mappedObject != null && _mappingService != null)
- {
- final String uri = _adapter.getNamespace(node, document);
- final IStructuredDocumentContext context = IStructuredDocumentContextFactory.INSTANCE
- .getContext(document, node);
- final ElementData elementData = XMLViewObjectMappingService
- .createElementData(uri, node.getLocalName(), context,
- attributeToProperties);
-
- _mappingService.createMapping(elementData, mappedObject);
- }
- }
-
- private void maybeUpdateViewObject(final ComponentInfo bestComponent,
- final Element srcElement, final ITagElement tagElement)
- {
- if (srcElement.getAttributes() == null)
- return;
-
- for (int i = 0; i < srcElement.getAttributes().getLength(); i++)
- {
- final Attr attr = (Attr) srcElement.getAttributes().item(i);
- final Map<String, ITagAttributeHandler> attributeHandlers = tagElement
- .getAttributeHandlers();
-
- if (attributeHandlers != null)
- {
- final ITagAttributeHandler handler = attributeHandlers.get(attr
- .getLocalName());
-
- if (handler != null)
- {
- final String id = handler.getCustomHandler();
-
- ICustomViewMapper mapper = null;
-
- if (id != null)
- {
- mapper = CustomViewMapperExtensionLoader
- .getCustomViewMapper(id);
- if (mapper != null)
- {
- mapper.doAttributeActions(bestComponent,
- srcElement, attr);
- }
- }
- }
- }
- }
- }
-
- private Object convertFromString(final String convertValue,
- final JDTBeanProperty ofThisType)
- {
- final String signature = ofThisType.getTypeSignature();
-
- Object result = null;
- switch (Signature.getTypeSignatureKind(signature))
- {
- case Signature.BASE_TYPE_SIGNATURE:
- result = convertFromBaseType(convertValue, signature);
- break;
-
- case Signature.CLASS_TYPE_SIGNATURE:
- if (TypeConstants.TYPE_STRING.equals(signature))
- {
- result = convertValue;
- }
- else if (TypeConstants.TYPE_JAVAOBJECT.equals(signature))
- {
- result = convertValue;
- }
- break;
- }
-
- return result;
- }
-
- // TODO: does this belong somewhere else?
- private Object convertFromBaseType(final String convertValue,
- final String signature)
- {
- if (Signature.SIG_BOOLEAN.equals(signature))
- {
- return Boolean.valueOf(convertValue);
- }
- else if (Signature.SIG_INT.equals(signature)
- || Signature.SIG_BYTE.equals(signature)
- || Signature.SIG_SHORT.equals(signature))
- {
- try
- {
- return Integer.valueOf(convertValue);
- }
- catch (final NumberFormatException nfe)
- {
- return null;
- }
- }
- else if (Signature.SIG_LONG.equals(convertValue))
- {
- try
- {
- return Long.valueOf(convertValue);
- }
- catch (final NumberFormatException nfe)
- {
- return null;
- }
- }
-
- return null;
- }
-
- private void addTypeAdapters(final ComponentInfo component)
- {
- final String[] interfaceNames = component.getComponentTypeInfo()
- .getInterfaces();
- final Set interfaceNameSets = new HashSet();
-
- for (final String interfaceName : interfaceNames)
- {
- interfaceNameSets.add(interfaceName);
- }
-
- // don't replace intrinsic adapters
- if (interfaceNameSets.contains(ComponentFactory.INTERFACE_ACTIONSOURCE))
- {
- // an ActionSource2 is-a ActionSource
- if (interfaceNameSets
- .contains(ComponentFactory.INTERFACE_ACTIONSOURCE2)
- && component.getAdapter(ComponentFactory.ACTION_SOURCE2) == null)
- {
- component.addAdapter(ComponentFactory.ACTION_SOURCE2,
- new ActionSourceInfo2(null, null, false, null));
- }
-
- if (component.getAdapter(ComponentFactory.ACTION_SOURCE) == null)
- {
- component.addAdapter(ComponentFactory.ACTION_SOURCE,
- new ActionSourceInfo(null, null, false));
- }
- }
-
- if (interfaceNameSets.contains(ComponentFactory.INTERFACE_VALUEHOLDER))
- {
- // a EditableValueHolder is-a ValueHolder
- if (interfaceNameSets
- .contains(ComponentFactory.INTERFACE_EDITABLEVALUEHOLDER)
- && component
- .getAdapter(ComponentFactory.EDITABLE_VALUE_HOLDER) == null)
- {
- component.addAdapter(ComponentFactory.EDITABLE_VALUE_HOLDER,
- new EditableValueHolderInfo(null, null, null, false,
- false, true, false, null, null, null));
- }
-
- if (component.getAdapter(ComponentFactory.VALUE_HOLDER) == null)
- {
- component.addAdapter(ComponentFactory.VALUE_HOLDER,
- new ValueHolderInfo(null, null, null));
- }
- }
-
- if (interfaceNameSets
- .contains(ComponentFactory.INTERFACE_NAMINGCONTAINER)
- && component.getAdapter(ComponentFactory.NAMING_CONTAINER) == null)
- {
- component.addAdapter(ComponentFactory.NAMING_CONTAINER,
- INamingContainerInfo.ADAPTER);
- }
- }
-
- /**
- * @param element
- * @param constructionData
- * @return the id for element either derived from the element using getId or
- * if not present, using a generation algorithm
- */
- protected String calculateId(final Element element,
- final ComponentConstructionData constructionData)
- {
- final String id = _adapter.getId(element);
- if (id != null)
- {
- return id;
- }
- // TODO: improve this
- final String prefix = _adapter.getGeneratedIdPrefix();
- return (prefix != null ? prefix : GENERATED_ID)
- + constructionData.increment();
- }
-
- /**
- * @return the construction data for this strategy
- */
- public final ComponentConstructionData getConstructionData()
- {
- return _constructionData;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/XMLViewObjectMappingService.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/XMLViewObjectMappingService.java
deleted file mode 100644
index 362fc56..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/XMLViewObjectMappingService.java
+++ /dev/null
@@ -1,382 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view;
-
-import java.io.IOException;
-import java.io.Serializable;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jst.jsf.common.dom.TagIdentifier;
-import org.eclipse.jst.jsf.common.runtime.internal.model.ViewObject;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IWorkspaceContextResolver;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.core.internal.region.Region2ElementAdapter;
-import org.eclipse.jst.jsf.core.internal.region.Region2ElementAdapter.NoElementException;
-import org.eclipse.jst.jsf.core.internal.tld.TagIdentifierFactory;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.w3c.dom.Element;
-
-/**
- * @author cbateman
- *
- */
-public final class XMLViewObjectMappingService implements Serializable
-{
- /**
- *
- */
- private static final long serialVersionUID = -5371998199186683997L;
- private final Map<ElementData, ViewObject> _elementToViewObjMap;
- private final Map<ViewObject, ElementData> _viewObjToElementMap;
-
- /**
- *
- */
- public XMLViewObjectMappingService()
- {
- _elementToViewObjMap = new HashMap<ElementData, ViewObject>();
- _viewObjToElementMap = new HashMap<ViewObject, ElementData>();
- }
-
- /**
- * @param elementData
- * @param viewObject
- */
- public void createMapping(final ElementData elementData,
- final ViewObject viewObject)
- {
- if (elementData == null)
- {
- throw new IllegalArgumentException("elementData cannot be null");
- }
- else if (viewObject == null)
- {
- throw new IllegalArgumentException("viewObject cannot be null");
- }
-
- synchronized(this)
- {
- _elementToViewObjMap.put(elementData, viewObject);
- _viewObjToElementMap.put(viewObject, elementData);
- }
- }
-
- /**
- * Remove all mappings
- */
- public void clearMappings()
- {
- synchronized (this)
- {
- _elementToViewObjMap.clear();
- _viewObjToElementMap.clear();
- }
- }
-
- /**
- * @param elementData
- * @return the view object for which the mapping was removed
- */
- public ViewObject removeMapping(final ElementData elementData)
- {
- if (elementData == null)
- {
- throw new IllegalArgumentException("elementData mustn't be null");
- }
-
- ViewObject viewObject = null;
- synchronized(this)
- {
- viewObject = _elementToViewObjMap.remove(elementData);
- if (viewObject != null)
- {
- _viewObjToElementMap.remove(viewObject);
- }
- }
- return viewObject;
- }
-
- /**
- * @param viewObject
- * @return the element data for which the mapping was removed
- */
- public ElementData removeMapping(final ViewObject viewObject)
- {
- if (viewObject == null)
- {
- throw new IllegalArgumentException("elementData mustn't be null");
- }
-
- ElementData elementData = null;
- synchronized(this)
- {
- elementData = _viewObjToElementMap.remove(viewObject);
- if (elementData != null)
- {
- _elementToViewObjMap.remove(elementData);
- }
- }
- return elementData;
- }
-
- /**
- * @param viewObject
- * @return the element data for the view object
- */
- public synchronized ElementData findElementData(final ViewObject viewObject)
- {
- return _viewObjToElementMap.get(viewObject);
- }
-
- /**
- * @param viewObject
- * @return the element for the viewObject
- */
- public Element findElement(final ViewObject viewObject)
- {
- final ElementData elementData = findElementData(viewObject);
-
- if (elementData != null)
- {
- final IFile file = ResourcesPlugin.getWorkspace().getRoot()
- .getFile(new Path(elementData.getDocumentPath()));
-
- if (file != null && file.isAccessible())
- {
- IStructuredModel model = null;
- try
- {
- model = StructuredModelManager.getModelManager()
- .getModelForRead(file);
- final IStructuredDocument sDoc = model
- .getStructuredDocument();
- final IStructuredDocumentRegion region = sDoc
- .getRegionAtCharacterOffset(elementData
- .getStartOffset());
- final Region2ElementAdapter adapter = new Region2ElementAdapter(
- region);
- final TagIdentifier tagId = adapter.getTagId();
- if (tagId.equals(elementData.getTagId()))
- {
- return adapter.getElement();
- }
- }
- catch (CoreException ce)
- {
- JSFCorePlugin.log(ce,
- "While finding element for viewObject: "
- + viewObject.toString() + " in "
- + file.getFullPath());
- }
- catch (IOException e)
- {
- JSFCorePlugin.log(e,
- "While finding element for viewObject: "
- + viewObject.toString() + " in "
- + file.getFullPath());
- }
- catch (NoElementException e)
- {
- JSFCorePlugin.log(e,
- "While finding element for viewObject: "
- + viewObject.toString() + " in "
- + file.getFullPath());
- }
- finally
- {
- if (model != null)
- {
- model.releaseFromRead();
- }
- }
- }
- }
- return null;
- }
-
- /**
- * @param elementData
- * @return the mapped view object for elementData or null if not found.
- */
- public synchronized ViewObject findViewObject(final ElementData elementData)
- {
- return _elementToViewObjMap.get(elementData);
- }
-
- /**
- * @param namespace
- * @param tagName
- * @param context
- * @param attributeToPropertyMap
- * @return a new Element data for the namespace/element name in 'context'
- */
- public static ElementData createElementData(final String namespace,
- final String tagName, final IStructuredDocumentContext context,
- final Map<String, String> attributeToPropertyMap)
- {
- final IFile file = getFile(context);
- final int offset = context.getDocumentPosition();
-
- if (file != null && file.isAccessible() && offset > -1
- && tagName != null && namespace != null)
- {
- return new ElementData(offset, file.getFullPath().toString(),
- TagIdentifierFactory
- .createJSPTagWrapper(namespace, tagName),
- attributeToPropertyMap);
- }
- return null;
- }
-
- private static IFile getFile(final IStructuredDocumentContext context)
- {
- final IWorkspaceContextResolver resolver = IStructuredDocumentContextResolverFactory.INSTANCE
- .getWorkspaceContextResolver(context);
- IResource res = resolver.getResource();
- if (res instanceof IFile)
- {
- return (IFile) res;
- }
- // fall through.
- return null;
- }
-
- /**
- * Describes enough information about an element instance to look it up
- * again, without storing possibly transient references to it.
- *
- * @author cbateman
- *
- */
- public final static class ElementData implements Serializable
- {
- /**
- * serializable id
- */
- private static final long serialVersionUID = 7937312530318827977L;
-
- private transient TagIdentifier _tagId;
- private Map<String, String> _attributeToPropertyMap;
- private String _documentPath;
- private int _startOffset;
-
- /**
- * @param startOffset
- * @param documentPath
- * @param tagId
- * @param attributeToPropertyMap constructor takes copy of map
- */
- private ElementData(final int startOffset, final String documentPath,
- final TagIdentifier tagId, Map<String, String> attributeToPropertyMap)
- {
- super();
- _startOffset = startOffset;
-
- _tagId = tagId;
- _documentPath = documentPath;
- _attributeToPropertyMap = Collections.unmodifiableMap(
- new HashMap<String,String>(attributeToPropertyMap));
- }
-
- /**
- * Default constructor
- */
- protected ElementData()
- {
- // for serialization
- }
-
- /**
- * @return the tag identifier for this element
- */
- public final TagIdentifier getTagId()
- {
- return _tagId;
- }
-
- /**
- * @param forTagAttribute
- * @return the name of the view object property that forTagAttribute
- * maps to on this element or null if none.
- */
- public final String getPropertyName(final String forTagAttribute)
- {
- return _attributeToPropertyMap.get(forTagAttribute);
- }
-
- final int getStartOffset()
- {
- return _startOffset;
- }
-
- final String getDocumentPath()
- {
- return _documentPath;
- }
-
- private void writeObject(final java.io.ObjectOutputStream out)
- throws IOException
- {
- out.defaultWriteObject();
- out.writeObject(_tagId.getUri());
- out.writeObject(_tagId.getTagName());
- }
-
- private void readObject(final java.io.ObjectInputStream in)
- throws IOException, ClassNotFoundException
- {
- in.defaultReadObject();
- final String uri = (String) in.readObject();
- final String tagName = (String) in.readObject();
- _tagId = TagIdentifierFactory.createJSPTagWrapper(uri, tagName);
- }
-
- @Override
- public boolean equals(final Object obj)
- {
- if (this == obj)
- {
- return true;
- }
- if (obj instanceof ElementData)
- {
- final ElementData other = (ElementData) obj;
- return _startOffset == other._startOffset
- && _documentPath.equals(other._documentPath)
- && _tagId.equals(other._tagId);
- }
- return false;
- }
-
- @Override
- public int hashCode()
- {
- int hashCode = _tagId.hashCode();
- hashCode ^= _documentPath.hashCode();
- // startOffsets will generally fit in the first 10 bits, so mix
- // it up a bit.
- hashCode ^= ~(_startOffset * 104551);
- return hashCode;
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/AbstractCustomViewMapper.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/AbstractCustomViewMapper.java
deleted file mode 100644
index f50a460..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/AbstractCustomViewMapper.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view.mapping;
-
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentInfo;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-
-/**
- * Must be sub-classed by all ICustomViewMapper's.
- *
- * @author cbateman
- *
- */
-public abstract class AbstractCustomViewMapper implements ICustomViewMapper
-{
- public abstract PropertyMapping mapToComponentProperty(final String uri,
- final Element srcElement, final Attr attr);
-
- public abstract void doAttributeActions(final ComponentInfo bestComponent,
- final Element srcElement, final Attr attr);
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/CustomViewMappingAdapter.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/CustomViewMappingAdapter.java
deleted file mode 100644
index 4d3830b..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/CustomViewMappingAdapter.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view.mapping;
-
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentInfo;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-
-/**
- * A no-op implementation that sub-classes can selectively override.
- *
- * @author cbateman
- *
- */
-public class CustomViewMappingAdapter extends AbstractCustomViewMapper
-{
-
- @Override
- public void doAttributeActions(ComponentInfo bestComponent,
- Element srcElement, Attr attr)
- {
- // do nothing
- }
-
- @Override
- public PropertyMapping mapToComponentProperty(String uri,
- Element srcElement, Attr attr)
- {
- // no mappings
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/ICustomViewMapper.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/ICustomViewMapper.java
deleted file mode 100644
index 954167e..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/ICustomViewMapper.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view.mapping;
-
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentInfo;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-
-/**
- * A custom view mapper to map from elements and attributes to view objects and
- * properties.
- *
- * @author cbateman
- *
- */
-public interface ICustomViewMapper
-{
- /**
- * @param uri
- * @param srcElement
- * @param attr
- * @return the name/value of the component property or null if no mapping.
- */
- PropertyMapping mapToComponentProperty(final String uri,
- final Element srcElement, final Attr attr);
-
- /**
- * Allows a mapper to make updates to a component based on its attribute.
- * May choose to do nothing.
- *
- * @param bestComponent
- * @param srcElement
- * @param attr
- */
- void doAttributeActions(ComponentInfo bestComponent, Element srcElement,
- Attr attr);
-
- /**
- * The name/value pair of a component property mapping.
- *
- * @author cbateman
- *
- */
- public static class PropertyMapping
- {
- private final String _name;
- private final Object _property;
-
- /**
- * @param name
- * @param property
- */
- public PropertyMapping(final String name, final Object property)
- {
- _name = name;
- _property = property;
- }
-
- /**
- * @return the property name
- */
- public final String getName()
- {
- return _name;
- }
-
- /**
- * @return the property value
- */
- public final Object getProperty()
- {
- return _property;
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/ViewMetadataGenerator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/ViewMetadataGenerator.java
deleted file mode 100644
index 919d54f..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/ViewMetadataGenerator.java
+++ /dev/null
@@ -1,202 +0,0 @@
-package org.eclipse.jst.jsf.designtime.internal.view.mapping;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.emf.ecore.util.BasicExtendedMetaData;
-import org.eclipse.emf.ecore.util.ExtendedMetaData;
-import org.eclipse.emf.ecore.xmi.XMLHelper;
-import org.eclipse.emf.ecore.xmi.XMLResource;
-import org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl;
-import org.eclipse.emf.ecore.xmi.impl.XMLResourceFactoryImpl;
-import org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl;
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.MetadataFactory;
-import org.eclipse.jst.jsf.common.metadata.MetadataPackage;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.runtime.internal.model.types.ClassTypeInfo;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ClassTypeInfo_;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingFactory;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagMapping;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagToViewObjectMapping;
-
-/**
- * Generates View metadata from common.runtime objects.
- *
- * @author cbateman
- *
- */
-public class ViewMetadataGenerator
-{
- private final ResourceSet _resourceSet;
- private final ExtendedMetaData _extendedMetadata;
- private final Model _root;
- private final ViewMetadataMapper _mapper;
-
- /**
- * @param uri
- */
- public ViewMetadataGenerator(final String uri)
- {
- _root = MetadataFactory.eINSTANCE.createModel();
- _root.setId(uri);
- _root.setType("tagFile");
- _resourceSet = new ResourceSetImpl();
- _mapper = new ViewMetadataMapper();
- _extendedMetadata = new BasicExtendedMetaData(_resourceSet
- .getPackageRegistry());
-
- // Register the appropriate resource factory to handle all file
- // extensions.
- //
- _resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap()
- .put(Resource.Factory.Registry.DEFAULT_EXTENSION,
- new XMLResourceFactoryImpl());
- }
-
- /**
- * The format of the strings should match OSGI version:
- *
- * MAJOR . MINOR . BUILD . QUALIFIER
- *
- * @param tagName
- * @param typeInfo
- * @param minJSFVersion
- * the minimum JSF version, null for DEFAULT.
- * @param minLibVersion
- * the minimum library version, null for NONE.
- */
- public void addTagToViewObjectMapping(final String tagName,
- final ClassTypeInfo typeInfo, final String minJSFVersion,
- final String minLibVersion)
- {
- final ClassTypeInfo_ metadata = _mapper.mapToMetadata(typeInfo);
-
- if (metadata != null)
- {
- final TagToViewObjectMapping viewMapping =
- ComponentMappingFactory.eINSTANCE.createTagToViewObjectMapping();
- if (minJSFVersion != null)
- {
- viewMapping.setMinJSFVersion(minJSFVersion);
- }
- viewMapping.setMinLibraryVersion(minLibVersion);
- viewMapping.setTypeInfo(metadata);
-
- final TagMapping tagMapping = findOrCreateTagMapping(tagName);
- tagMapping.getVersionedTagToViewMappings().add(viewMapping);
-
- final Trait trait = MetadataFactory.eINSTANCE.createTrait();
- trait.setId(ViewMetadataMapper.DEFAULT_MAPPING_TRAIT_ID);
- trait.setValue(tagMapping);
-
- final Entity entity = MetadataFactory.eINSTANCE.createEntity();
- entity.setId(tagName);
- entity.setType("tag");
- entity.getTraits().add(trait);
-
- _root.getChildEntities().add(entity);
- }
- }
-
- private TagMapping findOrCreateTagMapping(final String tagName)
- {
- for (final Entity entity : (List<Entity>)_root.getChildEntities())
- {
- if (entity.getId().equals(tagName))
- {
- for (final Trait trait : (List<Trait>)entity.getTraits())
- {
- if (trait.getId().equals(ViewMetadataMapper.DEFAULT_MAPPING_TRAIT_ID))
- {
- return (TagMapping) trait.getValue();
- }
- }
- }
- }
- return ComponentMappingFactory.eINSTANCE.createTagMapping();
- }
-
- /**
- * @param out
- * @throws IOException
- */
- public void save(final OutputStream out) throws IOException
- {
- final Resource res = new XMLResourceImpl()
- {
- @Override
- protected XMLHelper createXMLHelper()
- {
- return new XMLHelperImpl()
- {
- public String getHREF(EObject obj)
- {
- return ComponentMappingPackage.eNS_URI;
- }
-
- @Override
- public EPackage getNoNamespacePackage()
- {
- return MetadataPackage.eINSTANCE;
- }
- };
- }
- };// _resourceSet.createResource(URI.createURI("foo.xml"));
- res.getContents().add(_root);
- // res.setURI(uri);
- // resourceSet.getResources().add(res);
- // setLoadOptions(res);
- Map options = new HashMap();
- options.put(XMLResource.OPTION_SCHEMA_LOCATION, Boolean.TRUE);
- options.put(XMLResource.OPTION_EXTENDED_META_DATA, _extendedMetadata);
- // options.put(XMLResource.OPTION_RESOURCE_HANDLER, res);
- options.put(XMLResource.OPTION_LAX_FEATURE_PROCESSING, Boolean.TRUE);
- options.put(XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, Boolean.FALSE);// turning
- // this
- // off
- // so
- // that
- // res.getErrors()
- // has
- // values
- // to
- // check!
- // bizarre
- // that
- // I
- // should
- // need
- // to
- // do
- // this.
- res.save(out, options);
- }
-
- // private void printHeader(final OutputStream out) throws IOException
- // {
- // final String header = "<md:metadatamodel \n"
- // + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""
- // + "xmlns:ecore=\"http://www.eclipse.org/emf/2002/Ecore\""
- // +
- // "xmlns:md=\"http://org.eclipse.jst.jsf.common.metadata/metadata.ecore\""
- // +
- // "xmlns:mdt=\"http://org.eclipse.jst.jsf.common.metadata/metadataTraitTypes.ecore\"
- // "
- // +
- // "xmlns:viewMap=\"http://org.eclipse.jst.jsf.core/componentMapping.ecore\""
- // + "id=\"http://java.sun.com/jsf/html\""
- // + "type\"tagFile\">";
- // out.write(header.getBytes());
- // }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/ViewMetadataLoader.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/ViewMetadataLoader.java
deleted file mode 100644
index b422bb8..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/ViewMetadataLoader.java
+++ /dev/null
@@ -1,96 +0,0 @@
-package org.eclipse.jst.jsf.designtime.internal.view.mapping;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.jsf.common.dom.TagIdentifier;
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.query.ITaglibDomainMetaDataModelContext;
-import org.eclipse.jst.jsf.common.metadata.query.TaglibDomainMetaDataQueryHelper;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.AttributeToPropertyMapping;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagMapping;
-
-/**
- * Loader class for view metadata.
- *
- * @author cbateman
- *
- */
-public class ViewMetadataLoader
-{
- private final IProject _project;
- private final Map<String, ITaglibDomainMetaDataModelContext> _metadataContexts;
-
- /**
- * @param project
- */
- public ViewMetadataLoader(final IProject project)
- {
- _project = project;
- _metadataContexts = new HashMap<String, ITaglibDomainMetaDataModelContext>();
- }
-
- /**
- * @param tagId
- * @return the tag to view object mapping metadata for a tag in a particular
- * metadata context or null if not found.
- */
- public TagMapping getTagToViewMapping(final TagIdentifier tagId)
- {
- final ITaglibDomainMetaDataModelContext modelContext = createMetadataContext(tagId
- .getUri());
- final Entity entity = TaglibDomainMetaDataQueryHelper.getEntity(
- modelContext, tagId.getTagName());
- if (entity != null)
- {
- final Trait trait = TaglibDomainMetaDataQueryHelper.getTrait(
- entity, ViewMetadataMapper.DEFAULT_MAPPING_TRAIT_ID);
- if (trait != null)
- {
- return (TagMapping) trait.getValue();
- }
- }
- return null;
- }
-
- private ITaglibDomainMetaDataModelContext createMetadataContext(
- final String uri)
- {
- ITaglibDomainMetaDataModelContext modelContext = _metadataContexts
- .get(uri);
-
- if (modelContext == null)
- {
- modelContext = TaglibDomainMetaDataQueryHelper
- .createMetaDataModelContext(_project, uri);
- _metadataContexts.put(uri, modelContext);
- }
- return modelContext;
- }
-
- /**
- * @param tagId
- * @param name
- * @return the attribute mapping for name on tagId or null if known
- */
- public AttributeToPropertyMapping getAttributeMapping(
- final TagIdentifier tagId, final String name)
- {
- final ITaglibDomainMetaDataModelContext modelContext = createMetadataContext(tagId
- .getUri());
- final Entity entity = TaglibDomainMetaDataQueryHelper.getEntity(
- modelContext, tagId.getTagName()+"/"+name);
- if (entity != null)
- {
- final Trait trait = TaglibDomainMetaDataQueryHelper.getTrait(
- entity, ViewMetadataMapper.DEFAULT_ATTRIBUTE_TRAIT_ID);
- if (trait != null)
- {
- return (AttributeToPropertyMapping) trait.getValue();
- }
- }
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/ViewMetadataMapper.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/ViewMetadataMapper.java
deleted file mode 100644
index a4bb00f..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/ViewMetadataMapper.java
+++ /dev/null
@@ -1,170 +0,0 @@
-package org.eclipse.jst.jsf.designtime.internal.view.mapping;
-
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentTypeInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ConverterTypeInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ValidatorTypeInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.types.ClassTypeInfo;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ClassTypeInfo_;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingFactory;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentTypeInfo_;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ConverterTypeInfo_;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ValidatorTypeInfo_;
-
-/**
- * Maps meta-data to and from common.runtime data. In future, we may eliminate
- * this class by making the EMF meta-data structures into the common.runtime
- * data.
- *
- * @author cbateman
- *
- */
-public final class ViewMetadataMapper
-{
-
- /**
- * The default trait id where meta-data will annotated
- */
- public final static String DEFAULT_MAPPING_TRAIT_ID = "viewElementMapping"; //$NON-NLS-1$
- /**
- * The default trait id where meta-data will be annotated.
- */
- public final static String DEFAULT_ATTRIBUTE_TRAIT_ID = "attributeMapping"; //$NON-NLS-1$
-
- /**
- * @param classTypeInfo
- * @return a framework ClassTypeInfo equivalent to classTypeInfo or null if
- * none.
- */
- public ClassTypeInfo mapToFrameworkData(final ClassTypeInfo_ classTypeInfo)
- {
- if (classTypeInfo instanceof ComponentTypeInfo_)
- {
- return createComponentTypeInfo_((ComponentTypeInfo_) classTypeInfo);
- }
- else if (classTypeInfo instanceof ConverterTypeInfo_)
- {
- return createConverterTypeInfo_((ConverterTypeInfo_) classTypeInfo);
- }
- else if (classTypeInfo instanceof ValidatorTypeInfo_)
- {
- return createValidatorTypeInfo_((ValidatorTypeInfo_) classTypeInfo);
- }
- return null;
- }
-
- private ClassTypeInfo createValidatorTypeInfo_(
- ValidatorTypeInfo_ classTypeInfo)
- {
- final String[] superClasses = classTypeInfo.getSuperClasses().toArray(
- new String[0]);
- final String[] interfaces = classTypeInfo.getInterfaces().toArray(
- new String[0]);
- if (classTypeInfo.getClassName()==null && classTypeInfo.getValidatorId() == null)
- {
- return ValidatorTypeInfo.UNKNOWN;
- }
-
- return new ValidatorTypeInfo(classTypeInfo.getClassName(),
- superClasses, interfaces, classTypeInfo.getValidatorId());
- }
-
- private ClassTypeInfo createConverterTypeInfo_(
- ConverterTypeInfo_ classTypeInfo)
- {
- final String[] superClasses = classTypeInfo.getSuperClasses().toArray(
- new String[0]);
- final String[] interfaces = classTypeInfo.getInterfaces().toArray(
- new String[0]);
- if (classTypeInfo.getClassName() == null
- && classTypeInfo.getConverterId() == null)
- {
- return ConverterTypeInfo.UNKNOWN;
- }
- final String[] forClasses = classTypeInfo.getForClasses().toArray(
- new String[0]);
- return new ConverterTypeInfo(classTypeInfo.getClassName(),
- superClasses, interfaces, classTypeInfo.getConverterId(),
- forClasses);
- }
-
- private ClassTypeInfo createComponentTypeInfo_(
- ComponentTypeInfo_ classTypeInfo)
- {
- final String[] superClasses = classTypeInfo.getSuperClasses().toArray(
- new String[0]);
- final String[] interfaces = classTypeInfo.getInterfaces().toArray(
- new String[0]);
- return new ComponentTypeInfo(classTypeInfo.getComponentType(),
- classTypeInfo.getClassName(), superClasses, interfaces,
- classTypeInfo.getComponentFamily(), classTypeInfo
- .getRenderType());
- }
-
- /**
- * @param classTypeInfo
- * @return a metadata type info matching classTypeInfo or null if
- * classTypeInfo isn't of a supported concrete type.
- */
- public ClassTypeInfo_ mapToMetadata(final ClassTypeInfo classTypeInfo)
- {
- if (classTypeInfo instanceof ComponentTypeInfo)
- {
- return createComponentTypeInfo((ComponentTypeInfo) classTypeInfo);
- }
- else if (classTypeInfo instanceof ConverterTypeInfo)
- {
- return createConverterTypeInfo((ConverterTypeInfo) classTypeInfo);
- }
- else if (classTypeInfo instanceof ValidatorTypeInfo)
- {
- return createValidatorTypeInfo((ValidatorTypeInfo) classTypeInfo);
- }
- return null;
- }
-
- private ClassTypeInfo_ createComponentTypeInfo(
- final ComponentTypeInfo typeInfo)
- {
- final ComponentTypeInfo_ metadata = ComponentMappingFactory.eINSTANCE
- .createComponentTypeInfo_();
- metadata.setComponentFamily(typeInfo.getComponentFamily());
- metadata.setComponentType(typeInfo.getComponentType());
- metadata.setRenderType(typeInfo.getRenderFamily());
- copy(typeInfo, metadata);
- return metadata;
- }
-
- private ClassTypeInfo_ createConverterTypeInfo(
- final ConverterTypeInfo typeInfo)
- {
- final ConverterTypeInfo_ metadata = ComponentMappingFactory.eINSTANCE
- .createConverterTypeInfo_();
- copy(typeInfo, metadata);
- metadata.setConverterId(typeInfo.getConverterId());
- return metadata;
- }
-
- private ClassTypeInfo_ createValidatorTypeInfo(
- final ValidatorTypeInfo typeInfo)
- {
- final ValidatorTypeInfo_ metadata = ComponentMappingFactory.eINSTANCE
- .createValidatorTypeInfo_();
- copy(typeInfo, metadata);
- metadata.setValidatorId(typeInfo.getValidatorId());
- return metadata;
- }
-
- private void copy(ClassTypeInfo source, ClassTypeInfo_ dest)
- {
- dest.setClassName(source.getClassName());
- for (final String interfaze : source.getInterfaces())
- {
- dest.getInterfaces().add(interfaze);
- }
-
- for (final String superClass : source.getSuperClasses())
- {
- dest.getSuperClasses().add(superClass);
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/mappers/ValueHolderAttributeMapper.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/mappers/ValueHolderAttributeMapper.java
deleted file mode 100644
index 7a27536..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/mappers/ValueHolderAttributeMapper.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view.mapping.mappers;
-
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentFactory;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ConverterDecorator;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ConverterTypeInfo;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.CustomViewMappingAdapter;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-
-/**
- * Default mapper for value holders.
- *
- * @author cbateman
- *
- */
-public class ValueHolderAttributeMapper extends CustomViewMappingAdapter
-{
- @Override
- public void doAttributeActions(ComponentInfo bestComponent,
- Element srcElement, Attr attr)
- {
- final String name = attr.getNodeName();
-
- if ("converter".equals(name)
- && bestComponent.getComponentTypeInfo().isInstanceOf(
- ComponentFactory.INTERFACE_VALUEHOLDER))
- {
- final String value = attr.getValue();
-
- if (value != null)
- {
- ConverterTypeInfo typeInfo = null;
-
- if (!value.startsWith("#{"))
- {
- typeInfo = new ConverterTypeInfo(null, value);
-
- }
- else
- {
- typeInfo = ConverterTypeInfo.UNKNOWN;
- }
- ConverterDecorator decorator = new ConverterDecorator(
- bestComponent, typeInfo);
- bestComponent.addDecorator(decorator,
- ComponentFactory.CONVERTER);
- }
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/AttributeToPropertyMapping.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/AttributeToPropertyMapping.java
deleted file mode 100644
index a304915..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/AttributeToPropertyMapping.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: AttributeToPropertyMapping.java,v 1.1 2008/05/12 17:42:19 cbateman Exp $
- */
-package org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Attribute To Property Mapping</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.AttributeToPropertyMapping#getPropertyName <em>Property Name</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.AttributeToPropertyMapping#isElAllowed <em>El Allowed</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.AttributeToPropertyMapping#getCustomConversionFactoryId <em>Custom Conversion Factory Id</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage#getAttributeToPropertyMapping()
- * @model
- * @generated
- */
-public interface AttributeToPropertyMapping extends EObject
-{
- /**
- * Returns the value of the '<em><b>Property Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Property Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Property Name</em>' attribute.
- * @see #setPropertyName(String)
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage#getAttributeToPropertyMapping_PropertyName()
- * @model extendedMetaData="kind='element' name='propertyName'"
- * @generated
- */
- String getPropertyName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.AttributeToPropertyMapping#getPropertyName <em>Property Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Property Name</em>' attribute.
- * @see #getPropertyName()
- * @generated
- */
- void setPropertyName(String value);
-
- /**
- * Returns the value of the '<em><b>El Allowed</b></em>' attribute.
- * The default value is <code>"true"</code>.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>El Allowed</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>El Allowed</em>' attribute.
- * @see #setElAllowed(boolean)
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage#getAttributeToPropertyMapping_ElAllowed()
- * @model default="true"
- * extendedMetaData="kind='element' name='elAllowed'"
- * @generated
- */
- boolean isElAllowed();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.AttributeToPropertyMapping#isElAllowed <em>El Allowed</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>El Allowed</em>' attribute.
- * @see #isElAllowed()
- * @generated
- */
- void setElAllowed(boolean value);
-
- /**
- * Returns the value of the '<em><b>Custom Conversion Factory Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Custom Conversion Factory Id</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Custom Conversion Factory Id</em>' attribute.
- * @see #setCustomConversionFactoryId(String)
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage#getAttributeToPropertyMapping_CustomConversionFactoryId()
- * @model extendedMetaData="kind='element' name='customConversionFactoryId'"
- * @generated
- */
- String getCustomConversionFactoryId();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.AttributeToPropertyMapping#getCustomConversionFactoryId <em>Custom Conversion Factory Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Custom Conversion Factory Id</em>' attribute.
- * @see #getCustomConversionFactoryId()
- * @generated
- */
- void setCustomConversionFactoryId(String value);
-
-} // AttributeToPropertyMapping
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/ClassTypeInfo_.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/ClassTypeInfo_.java
deleted file mode 100644
index bad2651..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/ClassTypeInfo_.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: ClassTypeInfo_.java,v 1.1 2008/05/12 17:42:19 cbateman Exp $
- */
-package org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping;
-
-import org.eclipse.emf.common.util.EList;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Class Type Info </b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ClassTypeInfo_#getClassName <em>Class Name</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ClassTypeInfo_#getSuperClasses <em>Super Classes</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ClassTypeInfo_#getInterfaces <em>Interfaces</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage#getClassTypeInfo_()
- * @model
- * @generated
- */
-public interface ClassTypeInfo_ extends EObject
-{
- /**
- * Returns the value of the '<em><b>Class Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Class Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Class Name</em>' attribute.
- * @see #setClassName(String)
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage#getClassTypeInfo__ClassName()
- * @model extendedMetaData="kind='element' name='className'"
- * @generated
- */
- String getClassName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ClassTypeInfo_#getClassName <em>Class Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Class Name</em>' attribute.
- * @see #getClassName()
- * @generated
- */
- void setClassName(String value);
-
- /**
- * Returns the value of the '<em><b>Super Classes</b></em>' attribute list.
- * The list contents are of type {@link java.lang.String}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Super Classes</em>' attribute list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Super Classes</em>' attribute list.
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage#getClassTypeInfo__SuperClasses()
- * @model extendedMetaData="kind='element' name='superClasses'"
- * @generated
- */
- EList<String> getSuperClasses();
-
- /**
- * Returns the value of the '<em><b>Interfaces</b></em>' attribute list.
- * The list contents are of type {@link java.lang.String}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Interfaces</em>' attribute list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Interfaces</em>' attribute list.
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage#getClassTypeInfo__Interfaces()
- * @model extendedMetaData="kind='element' name='interfaces'"
- * @generated
- */
- EList<String> getInterfaces();
-
-} // ClassTypeInfo_
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/ComponentMappingFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/ComponentMappingFactory.java
deleted file mode 100644
index 9a45fa0..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/ComponentMappingFactory.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: ComponentMappingFactory.java,v 1.1 2008/05/12 17:42:19 cbateman Exp $
- */
-package org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping;
-
-import org.eclipse.emf.ecore.EFactory;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Factory</b> for the model.
- * It provides a create method for each non-abstract class of the model.
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage
- * @generated
- */
-public interface ComponentMappingFactory extends EFactory
-{
- /**
- * The singleton instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- ComponentMappingFactory eINSTANCE = org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ComponentMappingFactoryImpl.init();
-
- /**
- * Returns a new object of class '<em>Tag Mapping</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Tag Mapping</em>'.
- * @generated
- */
- TagMapping createTagMapping();
-
- /**
- * Returns a new object of class '<em>Tag To View Object Mapping</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Tag To View Object Mapping</em>'.
- * @generated
- */
- TagToViewObjectMapping createTagToViewObjectMapping();
-
- /**
- * Returns a new object of class '<em>Class Type Info </em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Class Type Info </em>'.
- * @generated
- */
- ClassTypeInfo_ createClassTypeInfo_();
-
- /**
- * Returns a new object of class '<em>Component Type Info </em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Component Type Info </em>'.
- * @generated
- */
- ComponentTypeInfo_ createComponentTypeInfo_();
-
- /**
- * Returns a new object of class '<em>Converter Type Info </em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Converter Type Info </em>'.
- * @generated
- */
- ConverterTypeInfo_ createConverterTypeInfo_();
-
- /**
- * Returns a new object of class '<em>Validator Type Info </em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Validator Type Info </em>'.
- * @generated
- */
- ValidatorTypeInfo_ createValidatorTypeInfo_();
-
- /**
- * Returns a new object of class '<em>Attribute To Property Mapping</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Attribute To Property Mapping</em>'.
- * @generated
- */
- AttributeToPropertyMapping createAttributeToPropertyMapping();
-
- /**
- * Returns the package supported by this factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the package supported by this factory.
- * @generated
- */
- ComponentMappingPackage getComponentMappingPackage();
-
-} //ComponentMappingFactory
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/ComponentMappingPackage.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/ComponentMappingPackage.java
deleted file mode 100644
index e340b4f..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/ComponentMappingPackage.java
+++ /dev/null
@@ -1,949 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: ComponentMappingPackage.java,v 1.1 2008/05/12 17:42:19 cbateman Exp $
- */
-package org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Package</b> for the model.
- * It contains accessors for the meta objects to represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingFactory
- * @model kind="package"
- * @generated
- */
-public interface ComponentMappingPackage extends EPackage
-{
- /**
- * The package name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String eNAME = "viewmapping";
-
- /**
- * The package namespace URI.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String eNS_URI = "http://org.eclipse.jst.jsf.core/componentMapping.ecore";
-
- /**
- * The package namespace name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String eNS_PREFIX = "viewMap";
-
- /**
- * The singleton instance of the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- ComponentMappingPackage eINSTANCE = org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ComponentMappingPackageImpl.init();
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.TagMappingImpl <em>Tag Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.TagMappingImpl
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ComponentMappingPackageImpl#getTagMapping()
- * @generated
- */
- int TAG_MAPPING = 0;
-
- /**
- * The feature id for the '<em><b>Versioned Tag To View Mappings</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TAG_MAPPING__VERSIONED_TAG_TO_VIEW_MAPPINGS = 0;
-
- /**
- * The feature id for the '<em><b>Custom Conversion Factory Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TAG_MAPPING__CUSTOM_CONVERSION_FACTORY_ID = 1;
-
- /**
- * The feature id for the '<em><b>Bean Mapped Properties</b></em>' attribute list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TAG_MAPPING__BEAN_MAPPED_PROPERTIES = 2;
-
- /**
- * The number of structural features of the '<em>Tag Mapping</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TAG_MAPPING_FEATURE_COUNT = 3;
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.TagToViewObjectMappingImpl <em>Tag To View Object Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.TagToViewObjectMappingImpl
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ComponentMappingPackageImpl#getTagToViewObjectMapping()
- * @generated
- */
- int TAG_TO_VIEW_OBJECT_MAPPING = 1;
-
- /**
- * The feature id for the '<em><b>Type Info</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TAG_TO_VIEW_OBJECT_MAPPING__TYPE_INFO = 0;
-
- /**
- * The feature id for the '<em><b>Min JSF Version</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TAG_TO_VIEW_OBJECT_MAPPING__MIN_JSF_VERSION = 1;
-
- /**
- * The feature id for the '<em><b>Min Library Version</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TAG_TO_VIEW_OBJECT_MAPPING__MIN_LIBRARY_VERSION = 2;
-
- /**
- * The number of structural features of the '<em>Tag To View Object Mapping</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TAG_TO_VIEW_OBJECT_MAPPING_FEATURE_COUNT = 3;
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ClassTypeInfo_Impl <em>Class Type Info </em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ClassTypeInfo_Impl
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ComponentMappingPackageImpl#getClassTypeInfo_()
- * @generated
- */
- int CLASS_TYPE_INFO_ = 2;
-
- /**
- * The feature id for the '<em><b>Class Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int CLASS_TYPE_INFO___CLASS_NAME = 0;
-
- /**
- * The feature id for the '<em><b>Super Classes</b></em>' attribute list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int CLASS_TYPE_INFO___SUPER_CLASSES = 1;
-
- /**
- * The feature id for the '<em><b>Interfaces</b></em>' attribute list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int CLASS_TYPE_INFO___INTERFACES = 2;
-
- /**
- * The number of structural features of the '<em>Class Type Info </em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int CLASS_TYPE_INFO__FEATURE_COUNT = 3;
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ComponentTypeInfo_Impl <em>Component Type Info </em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ComponentTypeInfo_Impl
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ComponentMappingPackageImpl#getComponentTypeInfo_()
- * @generated
- */
- int COMPONENT_TYPE_INFO_ = 3;
-
- /**
- * The feature id for the '<em><b>Class Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int COMPONENT_TYPE_INFO___CLASS_NAME = CLASS_TYPE_INFO___CLASS_NAME;
-
- /**
- * The feature id for the '<em><b>Super Classes</b></em>' attribute list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int COMPONENT_TYPE_INFO___SUPER_CLASSES = CLASS_TYPE_INFO___SUPER_CLASSES;
-
- /**
- * The feature id for the '<em><b>Interfaces</b></em>' attribute list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int COMPONENT_TYPE_INFO___INTERFACES = CLASS_TYPE_INFO___INTERFACES;
-
- /**
- * The feature id for the '<em><b>Component Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int COMPONENT_TYPE_INFO___COMPONENT_TYPE = CLASS_TYPE_INFO__FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Component Family</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int COMPONENT_TYPE_INFO___COMPONENT_FAMILY = CLASS_TYPE_INFO__FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Render Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int COMPONENT_TYPE_INFO___RENDER_TYPE = CLASS_TYPE_INFO__FEATURE_COUNT + 2;
-
- /**
- * The number of structural features of the '<em>Component Type Info </em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int COMPONENT_TYPE_INFO__FEATURE_COUNT = CLASS_TYPE_INFO__FEATURE_COUNT + 3;
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ConverterTypeInfo_Impl <em>Converter Type Info </em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ConverterTypeInfo_Impl
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ComponentMappingPackageImpl#getConverterTypeInfo_()
- * @generated
- */
- int CONVERTER_TYPE_INFO_ = 4;
-
- /**
- * The feature id for the '<em><b>Class Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int CONVERTER_TYPE_INFO___CLASS_NAME = CLASS_TYPE_INFO___CLASS_NAME;
-
- /**
- * The feature id for the '<em><b>Super Classes</b></em>' attribute list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int CONVERTER_TYPE_INFO___SUPER_CLASSES = CLASS_TYPE_INFO___SUPER_CLASSES;
-
- /**
- * The feature id for the '<em><b>Interfaces</b></em>' attribute list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int CONVERTER_TYPE_INFO___INTERFACES = CLASS_TYPE_INFO___INTERFACES;
-
- /**
- * The feature id for the '<em><b>Converter Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int CONVERTER_TYPE_INFO___CONVERTER_ID = CLASS_TYPE_INFO__FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>For Classes</b></em>' attribute list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int CONVERTER_TYPE_INFO___FOR_CLASSES = CLASS_TYPE_INFO__FEATURE_COUNT + 1;
-
- /**
- * The number of structural features of the '<em>Converter Type Info </em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int CONVERTER_TYPE_INFO__FEATURE_COUNT = CLASS_TYPE_INFO__FEATURE_COUNT + 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ValidatorTypeInfo_Impl <em>Validator Type Info </em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ValidatorTypeInfo_Impl
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ComponentMappingPackageImpl#getValidatorTypeInfo_()
- * @generated
- */
- int VALIDATOR_TYPE_INFO_ = 5;
-
- /**
- * The feature id for the '<em><b>Class Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int VALIDATOR_TYPE_INFO___CLASS_NAME = CLASS_TYPE_INFO___CLASS_NAME;
-
- /**
- * The feature id for the '<em><b>Super Classes</b></em>' attribute list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int VALIDATOR_TYPE_INFO___SUPER_CLASSES = CLASS_TYPE_INFO___SUPER_CLASSES;
-
- /**
- * The feature id for the '<em><b>Interfaces</b></em>' attribute list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int VALIDATOR_TYPE_INFO___INTERFACES = CLASS_TYPE_INFO___INTERFACES;
-
- /**
- * The feature id for the '<em><b>Validator Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int VALIDATOR_TYPE_INFO___VALIDATOR_ID = CLASS_TYPE_INFO__FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Validator Type Info </em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int VALIDATOR_TYPE_INFO__FEATURE_COUNT = CLASS_TYPE_INFO__FEATURE_COUNT + 1;
-
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.AttributeToPropertyMappingImpl <em>Attribute To Property Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.AttributeToPropertyMappingImpl
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ComponentMappingPackageImpl#getAttributeToPropertyMapping()
- * @generated
- */
- int ATTRIBUTE_TO_PROPERTY_MAPPING = 6;
-
- /**
- * The feature id for the '<em><b>Property Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int ATTRIBUTE_TO_PROPERTY_MAPPING__PROPERTY_NAME = 0;
-
- /**
- * The feature id for the '<em><b>El Allowed</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int ATTRIBUTE_TO_PROPERTY_MAPPING__EL_ALLOWED = 1;
-
- /**
- * The feature id for the '<em><b>Custom Conversion Factory Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int ATTRIBUTE_TO_PROPERTY_MAPPING__CUSTOM_CONVERSION_FACTORY_ID = 2;
-
- /**
- * The number of structural features of the '<em>Attribute To Property Mapping</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int ATTRIBUTE_TO_PROPERTY_MAPPING_FEATURE_COUNT = 3;
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagMapping <em>Tag Mapping</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Tag Mapping</em>'.
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagMapping
- * @generated
- */
- EClass getTagMapping();
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagMapping#getVersionedTagToViewMappings <em>Versioned Tag To View Mappings</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Versioned Tag To View Mappings</em>'.
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagMapping#getVersionedTagToViewMappings()
- * @see #getTagMapping()
- * @generated
- */
- EReference getTagMapping_VersionedTagToViewMappings();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagMapping#getCustomConversionFactoryId <em>Custom Conversion Factory Id</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Custom Conversion Factory Id</em>'.
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagMapping#getCustomConversionFactoryId()
- * @see #getTagMapping()
- * @generated
- */
- EAttribute getTagMapping_CustomConversionFactoryId();
-
- /**
- * Returns the meta object for the attribute list '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagMapping#getBeanMappedProperties <em>Bean Mapped Properties</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute list '<em>Bean Mapped Properties</em>'.
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagMapping#getBeanMappedProperties()
- * @see #getTagMapping()
- * @generated
- */
- EAttribute getTagMapping_BeanMappedProperties();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagToViewObjectMapping <em>Tag To View Object Mapping</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Tag To View Object Mapping</em>'.
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagToViewObjectMapping
- * @generated
- */
- EClass getTagToViewObjectMapping();
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagToViewObjectMapping#getTypeInfo <em>Type Info</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Type Info</em>'.
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagToViewObjectMapping#getTypeInfo()
- * @see #getTagToViewObjectMapping()
- * @generated
- */
- EReference getTagToViewObjectMapping_TypeInfo();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagToViewObjectMapping#getMinJSFVersion <em>Min JSF Version</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Min JSF Version</em>'.
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagToViewObjectMapping#getMinJSFVersion()
- * @see #getTagToViewObjectMapping()
- * @generated
- */
- EAttribute getTagToViewObjectMapping_MinJSFVersion();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagToViewObjectMapping#getMinLibraryVersion <em>Min Library Version</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Min Library Version</em>'.
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagToViewObjectMapping#getMinLibraryVersion()
- * @see #getTagToViewObjectMapping()
- * @generated
- */
- EAttribute getTagToViewObjectMapping_MinLibraryVersion();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ClassTypeInfo_ <em>Class Type Info </em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Class Type Info </em>'.
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ClassTypeInfo_
- * @generated
- */
- EClass getClassTypeInfo_();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ClassTypeInfo_#getClassName <em>Class Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Class Name</em>'.
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ClassTypeInfo_#getClassName()
- * @see #getClassTypeInfo_()
- * @generated
- */
- EAttribute getClassTypeInfo__ClassName();
-
- /**
- * Returns the meta object for the attribute list '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ClassTypeInfo_#getSuperClasses <em>Super Classes</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute list '<em>Super Classes</em>'.
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ClassTypeInfo_#getSuperClasses()
- * @see #getClassTypeInfo_()
- * @generated
- */
- EAttribute getClassTypeInfo__SuperClasses();
-
- /**
- * Returns the meta object for the attribute list '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ClassTypeInfo_#getInterfaces <em>Interfaces</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute list '<em>Interfaces</em>'.
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ClassTypeInfo_#getInterfaces()
- * @see #getClassTypeInfo_()
- * @generated
- */
- EAttribute getClassTypeInfo__Interfaces();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentTypeInfo_ <em>Component Type Info </em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Component Type Info </em>'.
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentTypeInfo_
- * @generated
- */
- EClass getComponentTypeInfo_();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentTypeInfo_#getComponentType <em>Component Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Component Type</em>'.
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentTypeInfo_#getComponentType()
- * @see #getComponentTypeInfo_()
- * @generated
- */
- EAttribute getComponentTypeInfo__ComponentType();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentTypeInfo_#getComponentFamily <em>Component Family</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Component Family</em>'.
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentTypeInfo_#getComponentFamily()
- * @see #getComponentTypeInfo_()
- * @generated
- */
- EAttribute getComponentTypeInfo__ComponentFamily();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentTypeInfo_#getRenderType <em>Render Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Render Type</em>'.
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentTypeInfo_#getRenderType()
- * @see #getComponentTypeInfo_()
- * @generated
- */
- EAttribute getComponentTypeInfo__RenderType();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ConverterTypeInfo_ <em>Converter Type Info </em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Converter Type Info </em>'.
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ConverterTypeInfo_
- * @generated
- */
- EClass getConverterTypeInfo_();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ConverterTypeInfo_#getConverterId <em>Converter Id</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Converter Id</em>'.
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ConverterTypeInfo_#getConverterId()
- * @see #getConverterTypeInfo_()
- * @generated
- */
- EAttribute getConverterTypeInfo__ConverterId();
-
- /**
- * Returns the meta object for the attribute list '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ConverterTypeInfo_#getForClasses <em>For Classes</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute list '<em>For Classes</em>'.
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ConverterTypeInfo_#getForClasses()
- * @see #getConverterTypeInfo_()
- * @generated
- */
- EAttribute getConverterTypeInfo__ForClasses();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ValidatorTypeInfo_ <em>Validator Type Info </em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Validator Type Info </em>'.
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ValidatorTypeInfo_
- * @generated
- */
- EClass getValidatorTypeInfo_();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ValidatorTypeInfo_#getValidatorId <em>Validator Id</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Validator Id</em>'.
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ValidatorTypeInfo_#getValidatorId()
- * @see #getValidatorTypeInfo_()
- * @generated
- */
- EAttribute getValidatorTypeInfo__ValidatorId();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.AttributeToPropertyMapping <em>Attribute To Property Mapping</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Attribute To Property Mapping</em>'.
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.AttributeToPropertyMapping
- * @generated
- */
- EClass getAttributeToPropertyMapping();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.AttributeToPropertyMapping#getPropertyName <em>Property Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Property Name</em>'.
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.AttributeToPropertyMapping#getPropertyName()
- * @see #getAttributeToPropertyMapping()
- * @generated
- */
- EAttribute getAttributeToPropertyMapping_PropertyName();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.AttributeToPropertyMapping#isElAllowed <em>El Allowed</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>El Allowed</em>'.
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.AttributeToPropertyMapping#isElAllowed()
- * @see #getAttributeToPropertyMapping()
- * @generated
- */
- EAttribute getAttributeToPropertyMapping_ElAllowed();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.AttributeToPropertyMapping#getCustomConversionFactoryId <em>Custom Conversion Factory Id</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Custom Conversion Factory Id</em>'.
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.AttributeToPropertyMapping#getCustomConversionFactoryId()
- * @see #getAttributeToPropertyMapping()
- * @generated
- */
- EAttribute getAttributeToPropertyMapping_CustomConversionFactoryId();
-
- /**
- * Returns the factory that creates the instances of the model.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the factory that creates the instances of the model.
- * @generated
- */
- ComponentMappingFactory getComponentMappingFactory();
-
- /**
- * <!-- begin-user-doc -->
- * Defines literals for the meta objects that represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("hiding")
- interface Literals
- {
- /**
- * The meta object literal for the '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.TagMappingImpl <em>Tag Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.TagMappingImpl
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ComponentMappingPackageImpl#getTagMapping()
- * @generated
- */
- EClass TAG_MAPPING = eINSTANCE.getTagMapping();
-
- /**
- * The meta object literal for the '<em><b>Versioned Tag To View Mappings</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EReference TAG_MAPPING__VERSIONED_TAG_TO_VIEW_MAPPINGS = eINSTANCE.getTagMapping_VersionedTagToViewMappings();
-
- /**
- * The meta object literal for the '<em><b>Custom Conversion Factory Id</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute TAG_MAPPING__CUSTOM_CONVERSION_FACTORY_ID = eINSTANCE.getTagMapping_CustomConversionFactoryId();
-
- /**
- * The meta object literal for the '<em><b>Bean Mapped Properties</b></em>' attribute list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute TAG_MAPPING__BEAN_MAPPED_PROPERTIES = eINSTANCE.getTagMapping_BeanMappedProperties();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.TagToViewObjectMappingImpl <em>Tag To View Object Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.TagToViewObjectMappingImpl
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ComponentMappingPackageImpl#getTagToViewObjectMapping()
- * @generated
- */
- EClass TAG_TO_VIEW_OBJECT_MAPPING = eINSTANCE.getTagToViewObjectMapping();
-
- /**
- * The meta object literal for the '<em><b>Type Info</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EReference TAG_TO_VIEW_OBJECT_MAPPING__TYPE_INFO = eINSTANCE.getTagToViewObjectMapping_TypeInfo();
-
- /**
- * The meta object literal for the '<em><b>Min JSF Version</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute TAG_TO_VIEW_OBJECT_MAPPING__MIN_JSF_VERSION = eINSTANCE.getTagToViewObjectMapping_MinJSFVersion();
-
- /**
- * The meta object literal for the '<em><b>Min Library Version</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute TAG_TO_VIEW_OBJECT_MAPPING__MIN_LIBRARY_VERSION = eINSTANCE.getTagToViewObjectMapping_MinLibraryVersion();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ClassTypeInfo_Impl <em>Class Type Info </em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ClassTypeInfo_Impl
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ComponentMappingPackageImpl#getClassTypeInfo_()
- * @generated
- */
- EClass CLASS_TYPE_INFO_ = eINSTANCE.getClassTypeInfo_();
-
- /**
- * The meta object literal for the '<em><b>Class Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute CLASS_TYPE_INFO___CLASS_NAME = eINSTANCE.getClassTypeInfo__ClassName();
-
- /**
- * The meta object literal for the '<em><b>Super Classes</b></em>' attribute list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute CLASS_TYPE_INFO___SUPER_CLASSES = eINSTANCE.getClassTypeInfo__SuperClasses();
-
- /**
- * The meta object literal for the '<em><b>Interfaces</b></em>' attribute list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute CLASS_TYPE_INFO___INTERFACES = eINSTANCE.getClassTypeInfo__Interfaces();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ComponentTypeInfo_Impl <em>Component Type Info </em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ComponentTypeInfo_Impl
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ComponentMappingPackageImpl#getComponentTypeInfo_()
- * @generated
- */
- EClass COMPONENT_TYPE_INFO_ = eINSTANCE.getComponentTypeInfo_();
-
- /**
- * The meta object literal for the '<em><b>Component Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute COMPONENT_TYPE_INFO___COMPONENT_TYPE = eINSTANCE.getComponentTypeInfo__ComponentType();
-
- /**
- * The meta object literal for the '<em><b>Component Family</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute COMPONENT_TYPE_INFO___COMPONENT_FAMILY = eINSTANCE.getComponentTypeInfo__ComponentFamily();
-
- /**
- * The meta object literal for the '<em><b>Render Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute COMPONENT_TYPE_INFO___RENDER_TYPE = eINSTANCE.getComponentTypeInfo__RenderType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ConverterTypeInfo_Impl <em>Converter Type Info </em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ConverterTypeInfo_Impl
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ComponentMappingPackageImpl#getConverterTypeInfo_()
- * @generated
- */
- EClass CONVERTER_TYPE_INFO_ = eINSTANCE.getConverterTypeInfo_();
-
- /**
- * The meta object literal for the '<em><b>Converter Id</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute CONVERTER_TYPE_INFO___CONVERTER_ID = eINSTANCE.getConverterTypeInfo__ConverterId();
-
- /**
- * The meta object literal for the '<em><b>For Classes</b></em>' attribute list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute CONVERTER_TYPE_INFO___FOR_CLASSES = eINSTANCE.getConverterTypeInfo__ForClasses();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ValidatorTypeInfo_Impl <em>Validator Type Info </em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ValidatorTypeInfo_Impl
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ComponentMappingPackageImpl#getValidatorTypeInfo_()
- * @generated
- */
- EClass VALIDATOR_TYPE_INFO_ = eINSTANCE.getValidatorTypeInfo_();
-
- /**
- * The meta object literal for the '<em><b>Validator Id</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute VALIDATOR_TYPE_INFO___VALIDATOR_ID = eINSTANCE.getValidatorTypeInfo__ValidatorId();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.AttributeToPropertyMappingImpl <em>Attribute To Property Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.AttributeToPropertyMappingImpl
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ComponentMappingPackageImpl#getAttributeToPropertyMapping()
- * @generated
- */
- EClass ATTRIBUTE_TO_PROPERTY_MAPPING = eINSTANCE.getAttributeToPropertyMapping();
-
- /**
- * The meta object literal for the '<em><b>Property Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute ATTRIBUTE_TO_PROPERTY_MAPPING__PROPERTY_NAME = eINSTANCE.getAttributeToPropertyMapping_PropertyName();
-
- /**
- * The meta object literal for the '<em><b>El Allowed</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute ATTRIBUTE_TO_PROPERTY_MAPPING__EL_ALLOWED = eINSTANCE.getAttributeToPropertyMapping_ElAllowed();
-
- /**
- * The meta object literal for the '<em><b>Custom Conversion Factory Id</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute ATTRIBUTE_TO_PROPERTY_MAPPING__CUSTOM_CONVERSION_FACTORY_ID = eINSTANCE.getAttributeToPropertyMapping_CustomConversionFactoryId();
-
- }
-
-} //ComponentMappingPackage
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/ComponentTypeInfo_.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/ComponentTypeInfo_.java
deleted file mode 100644
index e537498..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/ComponentTypeInfo_.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: ComponentTypeInfo_.java,v 1.1 2008/05/12 17:42:19 cbateman Exp $
- */
-package org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Component Type Info </b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentTypeInfo_#getComponentType <em>Component Type</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentTypeInfo_#getComponentFamily <em>Component Family</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentTypeInfo_#getRenderType <em>Render Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage#getComponentTypeInfo_()
- * @model
- * @generated
- */
-public interface ComponentTypeInfo_ extends ClassTypeInfo_
-{
- /**
- * Returns the value of the '<em><b>Component Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Component Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Component Type</em>' attribute.
- * @see #setComponentType(String)
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage#getComponentTypeInfo__ComponentType()
- * @model extendedMetaData="kind='element' name='componentType'"
- * @generated
- */
- String getComponentType();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentTypeInfo_#getComponentType <em>Component Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Component Type</em>' attribute.
- * @see #getComponentType()
- * @generated
- */
- void setComponentType(String value);
-
- /**
- * Returns the value of the '<em><b>Component Family</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Component Family</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Component Family</em>' attribute.
- * @see #setComponentFamily(String)
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage#getComponentTypeInfo__ComponentFamily()
- * @model extendedMetaData="kind='element' name='componentFamily'"
- * @generated
- */
- String getComponentFamily();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentTypeInfo_#getComponentFamily <em>Component Family</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Component Family</em>' attribute.
- * @see #getComponentFamily()
- * @generated
- */
- void setComponentFamily(String value);
-
- /**
- * Returns the value of the '<em><b>Render Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Render Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Render Type</em>' attribute.
- * @see #setRenderType(String)
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage#getComponentTypeInfo__RenderType()
- * @model extendedMetaData="kind='element' name='renderType'"
- * @generated
- */
- String getRenderType();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentTypeInfo_#getRenderType <em>Render Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Render Type</em>' attribute.
- * @see #getRenderType()
- * @generated
- */
- void setRenderType(String value);
-
-} // ComponentTypeInfo_
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/ConverterTypeInfo_.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/ConverterTypeInfo_.java
deleted file mode 100644
index d7dbc54..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/ConverterTypeInfo_.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: ConverterTypeInfo_.java,v 1.1 2008/05/12 17:42:19 cbateman Exp $
- */
-package org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping;
-
-import org.eclipse.emf.common.util.EList;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Converter Type Info </b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ConverterTypeInfo_#getConverterId <em>Converter Id</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ConverterTypeInfo_#getForClasses <em>For Classes</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage#getConverterTypeInfo_()
- * @model
- * @generated
- */
-public interface ConverterTypeInfo_ extends ClassTypeInfo_
-{
- /**
- * Returns the value of the '<em><b>Converter Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Converter Id</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Converter Id</em>' attribute.
- * @see #setConverterId(String)
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage#getConverterTypeInfo__ConverterId()
- * @model extendedMetaData="kind='element' name='converterId'"
- * @generated
- */
- String getConverterId();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ConverterTypeInfo_#getConverterId <em>Converter Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Converter Id</em>' attribute.
- * @see #getConverterId()
- * @generated
- */
- void setConverterId(String value);
-
- /**
- * Returns the value of the '<em><b>For Classes</b></em>' attribute list.
- * The list contents are of type {@link java.lang.String}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>For Classes</em>' attribute list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>For Classes</em>' attribute list.
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage#getConverterTypeInfo__ForClasses()
- * @model extendedMetaData="kind='element' name='forClass'"
- * @generated
- */
- EList<String> getForClasses();
-
-} // ConverterTypeInfo_
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/CustomViewMapperExtensionLoader.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/CustomViewMapperExtensionLoader.java
deleted file mode 100644
index 540a761..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/CustomViewMapperExtensionLoader.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.ICustomViewMapper;
-
-/**
- * @author cbateman
- *
- */
-public class CustomViewMapperExtensionLoader
-{
- private final static String EXTENSION_ID = "customViewMapper";
- private final static String ELEMENT_NAME = "customViewMapper";
-
- private static Map<String, ICustomViewMapper> _extensions;
-
- /**
- * @param id
- * @return the list of handlers. The list is not modifiable and will throw
- * exceptions if it is attempted.
- */
- public static synchronized ICustomViewMapper getCustomViewMapper(
- final String id)
- {
- if (_extensions == null)
- {
- _extensions = Collections.unmodifiableMap(readAllHandlers());
- }
- return _extensions.get(id);
- }
-
- private static Map<String, ICustomViewMapper> readAllHandlers()
- {
- final Map<String, ICustomViewMapper> handlers = new HashMap<String, ICustomViewMapper>();
- final IExtensionPoint extensionPoint = JSFCorePlugin.getDefault()
- .getExtension(EXTENSION_ID);
- final IExtension[] extensions = extensionPoint.getExtensions();
-
- for (final IExtension ext : extensions)
- {
- final IConfigurationElement[] configElements = ext
- .getConfigurationElements();
-
- for (final IConfigurationElement element : configElements)
- {
- if (ELEMENT_NAME.equals(element.getName()))
- {
- try
- {
- final String pluginId = element.getContributor()
- .getName();
- final String name = element.getAttribute("id");
- final Object customHandler = element
- .createExecutableExtension("class");
- if (customHandler instanceof ICustomViewMapper
- && name != null)
- {
- handlers.put(pluginId + "." + name,
- (ICustomViewMapper) customHandler);
- }
- else
- {
- JSFCorePlugin.log(
- "Error loading tag registry extension: "
- + element.getContributor().getName()
- + "." + element.getAttribute("id")
- , new Throwable("No exception: stack trace only"));
- }
- }
- catch (final CoreException e)
- {
- JSFCorePlugin.log(e,
- "Error loading tag registry extension: "
- + element.getContributor().getName()
- + "." + element.getAttribute("id"));
- }
- }
- }
- }
- return handlers;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/TagMapping.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/TagMapping.java
deleted file mode 100644
index 4f824a1..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/TagMapping.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: TagMapping.java,v 1.1 2008/05/12 17:42:19 cbateman Exp $
- */
-package org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping;
-
-import org.eclipse.emf.common.util.EList;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Tag Mapping</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagMapping#getVersionedTagToViewMappings <em>Versioned Tag To View Mappings</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagMapping#getCustomConversionFactoryId <em>Custom Conversion Factory Id</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagMapping#getBeanMappedProperties <em>Bean Mapped Properties</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage#getTagMapping()
- * @model
- * @generated
- */
-public interface TagMapping extends EObject
-{
- /**
- * Returns the value of the '<em><b>Versioned Tag To View Mappings</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagToViewObjectMapping}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Versioned Tag To View Mappings</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Versioned Tag To View Mappings</em>' containment reference list.
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage#getTagMapping_VersionedTagToViewMappings()
- * @model containment="true"
- * extendedMetaData="kind='element' name='versionedTagToViewMappings'"
- * @generated
- */
- EList<TagToViewObjectMapping> getVersionedTagToViewMappings();
-
- /**
- * Returns the value of the '<em><b>Custom Conversion Factory Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Custom Conversion Factory Id</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Custom Conversion Factory Id</em>' attribute.
- * @see #setCustomConversionFactoryId(String)
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage#getTagMapping_CustomConversionFactoryId()
- * @model extendedMetaData="kind='element' name='customConversionFactoryId'"
- * @generated
- */
- String getCustomConversionFactoryId();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagMapping#getCustomConversionFactoryId <em>Custom Conversion Factory Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Custom Conversion Factory Id</em>' attribute.
- * @see #getCustomConversionFactoryId()
- * @generated
- */
- void setCustomConversionFactoryId(String value);
-
- /**
- * Returns the value of the '<em><b>Bean Mapped Properties</b></em>' attribute list.
- * The list contents are of type {@link java.lang.String}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Bean Mapped Properties</em>' attribute list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Bean Mapped Properties</em>' attribute list.
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage#getTagMapping_BeanMappedProperties()
- * @model default=""
- * extendedMetaData="kind='element' name='beanMappedProperties'"
- * @generated
- */
- EList<String> getBeanMappedProperties();
-
- /**
- * <!-- begin-user-doc -->
- * @param jsfVersion
- * @param libVersion
- * <!-- end-user-doc -->
- * @model
- * @generated
- */
- void findBestMapping(String jsfVersion, String libVersion);
-
-} // TagMapping
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/TagToViewObjectMapping.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/TagToViewObjectMapping.java
deleted file mode 100644
index 608ba0f..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/TagToViewObjectMapping.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: TagToViewObjectMapping.java,v 1.1 2008/05/12 17:42:19 cbateman Exp $
- */
-package org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Tag To View Object Mapping</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagToViewObjectMapping#getTypeInfo <em>Type Info</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagToViewObjectMapping#getMinJSFVersion <em>Min JSF Version</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagToViewObjectMapping#getMinLibraryVersion <em>Min Library Version</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage#getTagToViewObjectMapping()
- * @model
- * @generated
- */
-public interface TagToViewObjectMapping extends EObject
-{
- /**
- * Returns the value of the '<em><b>Type Info</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type Info</em>' reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type Info</em>' containment reference.
- * @see #setTypeInfo(ClassTypeInfo_)
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage#getTagToViewObjectMapping_TypeInfo()
- * @model containment="true"
- * extendedMetaData="kind='element' name='typeInfo'"
- * @generated
- */
- ClassTypeInfo_ getTypeInfo();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagToViewObjectMapping#getTypeInfo <em>Type Info</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Type Info</em>' containment reference.
- * @see #getTypeInfo()
- * @generated
- */
- void setTypeInfo(ClassTypeInfo_ value);
-
- /**
- * Returns the value of the '<em><b>Min JSF Version</b></em>' attribute.
- * The default value is <code>"1.1"</code>.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Min JSF Version</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Min JSF Version</em>' attribute.
- * @see #setMinJSFVersion(String)
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage#getTagToViewObjectMapping_MinJSFVersion()
- * @model default="1.1"
- * extendedMetaData="kind='element' name='minVersion'"
- * @generated
- */
- String getMinJSFVersion();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagToViewObjectMapping#getMinJSFVersion <em>Min JSF Version</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Min JSF Version</em>' attribute.
- * @see #getMinJSFVersion()
- * @generated
- */
- void setMinJSFVersion(String value);
-
- /**
- * Returns the value of the '<em><b>Min Library Version</b></em>' attribute.
- * The default value is <code>""</code>.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Min Library Version</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Min Library Version</em>' attribute.
- * @see #setMinLibraryVersion(String)
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage#getTagToViewObjectMapping_MinLibraryVersion()
- * @model default=""
- * extendedMetaData="kind='element' name='minLibraryVersion'"
- * @generated
- */
- String getMinLibraryVersion();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagToViewObjectMapping#getMinLibraryVersion <em>Min Library Version</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Min Library Version</em>' attribute.
- * @see #getMinLibraryVersion()
- * @generated
- */
- void setMinLibraryVersion(String value);
-
-} // TagToViewObjectMapping
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/ValidatorTypeInfo_.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/ValidatorTypeInfo_.java
deleted file mode 100644
index 6085684..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/ValidatorTypeInfo_.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: ValidatorTypeInfo_.java,v 1.1 2008/05/12 17:42:19 cbateman Exp $
- */
-package org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Validator Type Info </b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ValidatorTypeInfo_#getValidatorId <em>Validator Id</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage#getValidatorTypeInfo_()
- * @model
- * @generated
- */
-public interface ValidatorTypeInfo_ extends ClassTypeInfo_
-{
- /**
- * Returns the value of the '<em><b>Validator Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Validator Id</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Validator Id</em>' attribute.
- * @see #setValidatorId(String)
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage#getValidatorTypeInfo__ValidatorId()
- * @model extendedMetaData="kind='element' name='validatorId'"
- * @generated
- */
- String getValidatorId();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ValidatorTypeInfo_#getValidatorId <em>Validator Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Validator Id</em>' attribute.
- * @see #getValidatorId()
- * @generated
- */
- void setValidatorId(String value);
-
-} // ValidatorTypeInfo_
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/impl/AttributeToPropertyMappingImpl.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/impl/AttributeToPropertyMappingImpl.java
deleted file mode 100644
index b399158..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/impl/AttributeToPropertyMappingImpl.java
+++ /dev/null
@@ -1,293 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: AttributeToPropertyMappingImpl.java,v 1.1 2008/05/12 17:42:20 cbateman Exp $
- */
-package org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.AttributeToPropertyMapping;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Attribute To Property Mapping</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.AttributeToPropertyMappingImpl#getPropertyName <em>Property Name</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.AttributeToPropertyMappingImpl#isElAllowed <em>El Allowed</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.AttributeToPropertyMappingImpl#getCustomConversionFactoryId <em>Custom Conversion Factory Id</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class AttributeToPropertyMappingImpl extends EObjectImpl implements AttributeToPropertyMapping
-{
- /**
- * The default value of the '{@link #getPropertyName() <em>Property Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPropertyName()
- * @generated
- * @ordered
- */
- protected static final String PROPERTY_NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getPropertyName() <em>Property Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPropertyName()
- * @generated
- * @ordered
- */
- protected String propertyName = PROPERTY_NAME_EDEFAULT;
-
- /**
- * The default value of the '{@link #isElAllowed() <em>El Allowed</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isElAllowed()
- * @generated
- * @ordered
- */
- protected static final boolean EL_ALLOWED_EDEFAULT = true;
-
- /**
- * The cached value of the '{@link #isElAllowed() <em>El Allowed</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isElAllowed()
- * @generated
- * @ordered
- */
- protected boolean elAllowed = EL_ALLOWED_EDEFAULT;
-
- /**
- * The default value of the '{@link #getCustomConversionFactoryId() <em>Custom Conversion Factory Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCustomConversionFactoryId()
- * @generated
- * @ordered
- */
- protected static final String CUSTOM_CONVERSION_FACTORY_ID_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCustomConversionFactoryId() <em>Custom Conversion Factory Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCustomConversionFactoryId()
- * @generated
- * @ordered
- */
- protected String customConversionFactoryId = CUSTOM_CONVERSION_FACTORY_ID_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected AttributeToPropertyMappingImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return ComponentMappingPackage.Literals.ATTRIBUTE_TO_PROPERTY_MAPPING;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getPropertyName()
- {
- return propertyName;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setPropertyName(String newPropertyName)
- {
- String oldPropertyName = propertyName;
- propertyName = newPropertyName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ComponentMappingPackage.ATTRIBUTE_TO_PROPERTY_MAPPING__PROPERTY_NAME, oldPropertyName, propertyName));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean isElAllowed()
- {
- return elAllowed;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setElAllowed(boolean newElAllowed)
- {
- boolean oldElAllowed = elAllowed;
- elAllowed = newElAllowed;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ComponentMappingPackage.ATTRIBUTE_TO_PROPERTY_MAPPING__EL_ALLOWED, oldElAllowed, elAllowed));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getCustomConversionFactoryId()
- {
- return customConversionFactoryId;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setCustomConversionFactoryId(String newCustomConversionFactoryId)
- {
- String oldCustomConversionFactoryId = customConversionFactoryId;
- customConversionFactoryId = newCustomConversionFactoryId;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ComponentMappingPackage.ATTRIBUTE_TO_PROPERTY_MAPPING__CUSTOM_CONVERSION_FACTORY_ID, oldCustomConversionFactoryId, customConversionFactoryId));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case ComponentMappingPackage.ATTRIBUTE_TO_PROPERTY_MAPPING__PROPERTY_NAME:
- return getPropertyName();
- case ComponentMappingPackage.ATTRIBUTE_TO_PROPERTY_MAPPING__EL_ALLOWED:
- return isElAllowed() ? Boolean.TRUE : Boolean.FALSE;
- case ComponentMappingPackage.ATTRIBUTE_TO_PROPERTY_MAPPING__CUSTOM_CONVERSION_FACTORY_ID:
- return getCustomConversionFactoryId();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case ComponentMappingPackage.ATTRIBUTE_TO_PROPERTY_MAPPING__PROPERTY_NAME:
- setPropertyName((String)newValue);
- return;
- case ComponentMappingPackage.ATTRIBUTE_TO_PROPERTY_MAPPING__EL_ALLOWED:
- setElAllowed(((Boolean)newValue).booleanValue());
- return;
- case ComponentMappingPackage.ATTRIBUTE_TO_PROPERTY_MAPPING__CUSTOM_CONVERSION_FACTORY_ID:
- setCustomConversionFactoryId((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case ComponentMappingPackage.ATTRIBUTE_TO_PROPERTY_MAPPING__PROPERTY_NAME:
- setPropertyName(PROPERTY_NAME_EDEFAULT);
- return;
- case ComponentMappingPackage.ATTRIBUTE_TO_PROPERTY_MAPPING__EL_ALLOWED:
- setElAllowed(EL_ALLOWED_EDEFAULT);
- return;
- case ComponentMappingPackage.ATTRIBUTE_TO_PROPERTY_MAPPING__CUSTOM_CONVERSION_FACTORY_ID:
- setCustomConversionFactoryId(CUSTOM_CONVERSION_FACTORY_ID_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case ComponentMappingPackage.ATTRIBUTE_TO_PROPERTY_MAPPING__PROPERTY_NAME:
- return PROPERTY_NAME_EDEFAULT == null ? propertyName != null : !PROPERTY_NAME_EDEFAULT.equals(propertyName);
- case ComponentMappingPackage.ATTRIBUTE_TO_PROPERTY_MAPPING__EL_ALLOWED:
- return elAllowed != EL_ALLOWED_EDEFAULT;
- case ComponentMappingPackage.ATTRIBUTE_TO_PROPERTY_MAPPING__CUSTOM_CONVERSION_FACTORY_ID:
- return CUSTOM_CONVERSION_FACTORY_ID_EDEFAULT == null ? customConversionFactoryId != null : !CUSTOM_CONVERSION_FACTORY_ID_EDEFAULT.equals(customConversionFactoryId);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (propertyName: ");
- result.append(propertyName);
- result.append(", elAllowed: ");
- result.append(elAllowed);
- result.append(", customConversionFactoryId: ");
- result.append(customConversionFactoryId);
- result.append(')');
- return result.toString();
- }
-
-} //AttributeToPropertyMappingImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/impl/ClassTypeInfo_Impl.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/impl/ClassTypeInfo_Impl.java
deleted file mode 100644
index b5607fb..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/impl/ClassTypeInfo_Impl.java
+++ /dev/null
@@ -1,264 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: ClassTypeInfo_Impl.java,v 1.1 2008/05/12 17:42:20 cbateman Exp $
- */
-package org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl;
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.common.util.EList;
-
-import org.eclipse.emf.ecore.EClass;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-
-import org.eclipse.emf.ecore.util.EDataTypeUniqueEList;
-
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ClassTypeInfo_;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Class Type Info </b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ClassTypeInfo_Impl#getClassName <em>Class Name</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ClassTypeInfo_Impl#getSuperClasses <em>Super Classes</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ClassTypeInfo_Impl#getInterfaces <em>Interfaces</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class ClassTypeInfo_Impl extends EObjectImpl implements ClassTypeInfo_
-{
- /**
- * The default value of the '{@link #getClassName() <em>Class Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getClassName()
- * @generated
- * @ordered
- */
- protected static final String CLASS_NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getClassName() <em>Class Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getClassName()
- * @generated
- * @ordered
- */
- protected String className = CLASS_NAME_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getSuperClasses() <em>Super Classes</em>}' attribute list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSuperClasses()
- * @generated
- * @ordered
- */
- protected EList<String> superClasses;
-
- /**
- * The cached value of the '{@link #getInterfaces() <em>Interfaces</em>}' attribute list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getInterfaces()
- * @generated
- * @ordered
- */
- protected EList<String> interfaces;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected ClassTypeInfo_Impl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return ComponentMappingPackage.Literals.CLASS_TYPE_INFO_;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getClassName()
- {
- return className;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setClassName(String newClassName)
- {
- String oldClassName = className;
- className = newClassName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ComponentMappingPackage.CLASS_TYPE_INFO___CLASS_NAME, oldClassName, className));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EList<String> getSuperClasses()
- {
- if (superClasses == null)
- {
- superClasses = new EDataTypeUniqueEList<String>(String.class, this, ComponentMappingPackage.CLASS_TYPE_INFO___SUPER_CLASSES);
- }
- return superClasses;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EList<String> getInterfaces()
- {
- if (interfaces == null)
- {
- interfaces = new EDataTypeUniqueEList<String>(String.class, this, ComponentMappingPackage.CLASS_TYPE_INFO___INTERFACES);
- }
- return interfaces;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case ComponentMappingPackage.CLASS_TYPE_INFO___CLASS_NAME:
- return getClassName();
- case ComponentMappingPackage.CLASS_TYPE_INFO___SUPER_CLASSES:
- return getSuperClasses();
- case ComponentMappingPackage.CLASS_TYPE_INFO___INTERFACES:
- return getInterfaces();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case ComponentMappingPackage.CLASS_TYPE_INFO___CLASS_NAME:
- setClassName((String)newValue);
- return;
- case ComponentMappingPackage.CLASS_TYPE_INFO___SUPER_CLASSES:
- getSuperClasses().clear();
- getSuperClasses().addAll((Collection<? extends String>)newValue);
- return;
- case ComponentMappingPackage.CLASS_TYPE_INFO___INTERFACES:
- getInterfaces().clear();
- getInterfaces().addAll((Collection<? extends String>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case ComponentMappingPackage.CLASS_TYPE_INFO___CLASS_NAME:
- setClassName(CLASS_NAME_EDEFAULT);
- return;
- case ComponentMappingPackage.CLASS_TYPE_INFO___SUPER_CLASSES:
- getSuperClasses().clear();
- return;
- case ComponentMappingPackage.CLASS_TYPE_INFO___INTERFACES:
- getInterfaces().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case ComponentMappingPackage.CLASS_TYPE_INFO___CLASS_NAME:
- return CLASS_NAME_EDEFAULT == null ? className != null : !CLASS_NAME_EDEFAULT.equals(className);
- case ComponentMappingPackage.CLASS_TYPE_INFO___SUPER_CLASSES:
- return superClasses != null && !superClasses.isEmpty();
- case ComponentMappingPackage.CLASS_TYPE_INFO___INTERFACES:
- return interfaces != null && !interfaces.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (className: ");
- result.append(className);
- result.append(", superClasses: ");
- result.append(superClasses);
- result.append(", interfaces: ");
- result.append(interfaces);
- result.append(')');
- return result.toString();
- }
-
-} //ClassTypeInfo_Impl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/impl/ComponentMappingFactoryImpl.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/impl/ComponentMappingFactoryImpl.java
deleted file mode 100644
index 5cb0817..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/impl/ComponentMappingFactoryImpl.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: ComponentMappingFactoryImpl.java,v 1.1 2008/05/12 17:42:20 cbateman Exp $
- */
-package org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-
-import org.eclipse.emf.ecore.impl.EFactoryImpl;
-
-import org.eclipse.emf.ecore.plugin.EcorePlugin;
-
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.*;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model <b>Factory</b>.
- * <!-- end-user-doc -->
- * @generated
- */
-public class ComponentMappingFactoryImpl extends EFactoryImpl implements ComponentMappingFactory
-{
- /**
- * Creates the default factory implementation.
- * <!-- begin-user-doc -->
- * @return the factory
- * <!-- end-user-doc -->
- * @generated
- */
- public static ComponentMappingFactory init()
- {
- try
- {
- ComponentMappingFactory theComponentMappingFactory = (ComponentMappingFactory)EPackage.Registry.INSTANCE.getEFactory("http://org.eclipse.jst.jsf.core/componentMapping.ecore");
- if (theComponentMappingFactory != null)
- {
- return theComponentMappingFactory;
- }
- }
- catch (Exception exception)
- {
- EcorePlugin.INSTANCE.log(exception);
- }
- return new ComponentMappingFactoryImpl();
- }
-
- /**
- * Creates an instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public ComponentMappingFactoryImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public EObject create(EClass eClass)
- {
- switch (eClass.getClassifierID())
- {
- case ComponentMappingPackage.TAG_MAPPING: return createTagMapping();
- case ComponentMappingPackage.TAG_TO_VIEW_OBJECT_MAPPING: return createTagToViewObjectMapping();
- case ComponentMappingPackage.CLASS_TYPE_INFO_: return createClassTypeInfo_();
- case ComponentMappingPackage.COMPONENT_TYPE_INFO_: return createComponentTypeInfo_();
- case ComponentMappingPackage.CONVERTER_TYPE_INFO_: return createConverterTypeInfo_();
- case ComponentMappingPackage.VALIDATOR_TYPE_INFO_: return createValidatorTypeInfo_();
- case ComponentMappingPackage.ATTRIBUTE_TO_PROPERTY_MAPPING: return createAttributeToPropertyMapping();
- default:
- throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public TagMapping createTagMapping()
- {
- TagMappingImpl tagMapping = new TagMappingImpl();
- return tagMapping;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public TagToViewObjectMapping createTagToViewObjectMapping()
- {
- TagToViewObjectMappingImpl tagToViewObjectMapping = new TagToViewObjectMappingImpl();
- return tagToViewObjectMapping;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public ClassTypeInfo_ createClassTypeInfo_()
- {
- ClassTypeInfo_Impl classTypeInfo_ = new ClassTypeInfo_Impl();
- return classTypeInfo_;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public ComponentTypeInfo_ createComponentTypeInfo_()
- {
- ComponentTypeInfo_Impl componentTypeInfo_ = new ComponentTypeInfo_Impl();
- return componentTypeInfo_;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public ConverterTypeInfo_ createConverterTypeInfo_()
- {
- ConverterTypeInfo_Impl converterTypeInfo_ = new ConverterTypeInfo_Impl();
- return converterTypeInfo_;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public ValidatorTypeInfo_ createValidatorTypeInfo_()
- {
- ValidatorTypeInfo_Impl validatorTypeInfo_ = new ValidatorTypeInfo_Impl();
- return validatorTypeInfo_;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public AttributeToPropertyMapping createAttributeToPropertyMapping()
- {
- AttributeToPropertyMappingImpl attributeToPropertyMapping = new AttributeToPropertyMappingImpl();
- return attributeToPropertyMapping;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public ComponentMappingPackage getComponentMappingPackage()
- {
- return (ComponentMappingPackage)getEPackage();
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the package
- * <!-- end-user-doc -->
- * @deprecated
- * @generated
- */
- @Deprecated
- public static ComponentMappingPackage getPackage()
- {
- return ComponentMappingPackage.eINSTANCE;
- }
-
-} //ComponentMappingFactoryImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/impl/ComponentMappingPackageImpl.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/impl/ComponentMappingPackageImpl.java
deleted file mode 100644
index 5d73875..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/impl/ComponentMappingPackageImpl.java
+++ /dev/null
@@ -1,699 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: ComponentMappingPackageImpl.java,v 1.1 2008/05/12 17:42:20 cbateman Exp $
- */
-package org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EOperation;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.AttributeToPropertyMapping;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ClassTypeInfo_;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingFactory;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentTypeInfo_;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ConverterTypeInfo_;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagMapping;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagToViewObjectMapping;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ValidatorTypeInfo_;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model <b>Package</b>.
- * <!-- end-user-doc -->
- * @generated
- */
-public class ComponentMappingPackageImpl extends EPackageImpl implements ComponentMappingPackage
-{
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass tagMappingEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass tagToViewObjectMappingEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass classTypeInfo_EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass componentTypeInfo_EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass converterTypeInfo_EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass validatorTypeInfo_EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass attributeToPropertyMappingEClass = null;
-
- /**
- * Creates an instance of the model <b>Package</b>, registered with
- * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
- * package URI value.
- * <p>Note: the correct way to create the package is via the static
- * factory method {@link #init init()}, which also performs
- * initialization of the package, or returns the registered package,
- * if one already exists.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.emf.ecore.EPackage.Registry
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage#eNS_URI
- * @see #init()
- * @generated
- */
- private ComponentMappingPackageImpl()
- {
- super(eNS_URI, ComponentMappingFactory.eINSTANCE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static boolean isInited = false;
-
- /**
- * Creates, registers, and initializes the <b>Package</b> for this
- * model, and for any others upon which it depends. Simple
- * dependencies are satisfied by calling this method on all
- * dependent packages before doing anything else. This method drives
- * initialization for interdependent packages directly, in parallel
- * with this package, itself.
- * <p>Of this package and its interdependencies, all packages which
- * have not yet been registered by their URI values are first created
- * and registered. The packages are then initialized in two steps:
- * meta-model objects for all of the packages are created before any
- * are initialized, since one package's meta-model objects may refer to
- * those of another.
- * <p>Invocation of this method will not affect any packages that have
- * already been initialized.
- * <!-- begin-user-doc -->
- * @return the initialized package
- * <!-- end-user-doc -->
- * @see #eNS_URI
- * @see #createPackageContents()
- * @see #initializePackageContents()
- * @generated
- */
- public static ComponentMappingPackage init()
- {
- if (isInited) return (ComponentMappingPackage)EPackage.Registry.INSTANCE.getEPackage(ComponentMappingPackage.eNS_URI);
-
- // Obtain or create and register package
- ComponentMappingPackageImpl theComponentMappingPackage = (ComponentMappingPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof ComponentMappingPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new ComponentMappingPackageImpl());
-
- isInited = true;
-
- // Create package meta-data objects
- theComponentMappingPackage.createPackageContents();
-
- // Initialize created meta-data
- theComponentMappingPackage.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- theComponentMappingPackage.freeze();
-
- return theComponentMappingPackage;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getTagMapping()
- {
- return tagMappingEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EReference getTagMapping_VersionedTagToViewMappings()
- {
- return (EReference)tagMappingEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getTagMapping_CustomConversionFactoryId()
- {
- return (EAttribute)tagMappingEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getTagMapping_BeanMappedProperties()
- {
- return (EAttribute)tagMappingEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getTagToViewObjectMapping()
- {
- return tagToViewObjectMappingEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EReference getTagToViewObjectMapping_TypeInfo()
- {
- return (EReference)tagToViewObjectMappingEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getTagToViewObjectMapping_MinJSFVersion()
- {
- return (EAttribute)tagToViewObjectMappingEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getTagToViewObjectMapping_MinLibraryVersion()
- {
- return (EAttribute)tagToViewObjectMappingEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getClassTypeInfo_()
- {
- return classTypeInfo_EClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getClassTypeInfo__ClassName()
- {
- return (EAttribute)classTypeInfo_EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getClassTypeInfo__SuperClasses()
- {
- return (EAttribute)classTypeInfo_EClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getClassTypeInfo__Interfaces()
- {
- return (EAttribute)classTypeInfo_EClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getComponentTypeInfo_()
- {
- return componentTypeInfo_EClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getComponentTypeInfo__ComponentType()
- {
- return (EAttribute)componentTypeInfo_EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getComponentTypeInfo__ComponentFamily()
- {
- return (EAttribute)componentTypeInfo_EClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getComponentTypeInfo__RenderType()
- {
- return (EAttribute)componentTypeInfo_EClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getConverterTypeInfo_()
- {
- return converterTypeInfo_EClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getConverterTypeInfo__ConverterId()
- {
- return (EAttribute)converterTypeInfo_EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getConverterTypeInfo__ForClasses()
- {
- return (EAttribute)converterTypeInfo_EClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getValidatorTypeInfo_()
- {
- return validatorTypeInfo_EClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getValidatorTypeInfo__ValidatorId()
- {
- return (EAttribute)validatorTypeInfo_EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getAttributeToPropertyMapping()
- {
- return attributeToPropertyMappingEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getAttributeToPropertyMapping_PropertyName()
- {
- return (EAttribute)attributeToPropertyMappingEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getAttributeToPropertyMapping_ElAllowed()
- {
- return (EAttribute)attributeToPropertyMappingEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getAttributeToPropertyMapping_CustomConversionFactoryId()
- {
- return (EAttribute)attributeToPropertyMappingEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public ComponentMappingFactory getComponentMappingFactory()
- {
- return (ComponentMappingFactory)getEFactoryInstance();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isCreated = false;
-
- /**
- * Creates the meta-model objects for the package. This method is
- * guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void createPackageContents()
- {
- if (isCreated) return;
- isCreated = true;
-
- // Create classes and their features
- tagMappingEClass = createEClass(TAG_MAPPING);
- createEReference(tagMappingEClass, TAG_MAPPING__VERSIONED_TAG_TO_VIEW_MAPPINGS);
- createEAttribute(tagMappingEClass, TAG_MAPPING__CUSTOM_CONVERSION_FACTORY_ID);
- createEAttribute(tagMappingEClass, TAG_MAPPING__BEAN_MAPPED_PROPERTIES);
-
- tagToViewObjectMappingEClass = createEClass(TAG_TO_VIEW_OBJECT_MAPPING);
- createEReference(tagToViewObjectMappingEClass, TAG_TO_VIEW_OBJECT_MAPPING__TYPE_INFO);
- createEAttribute(tagToViewObjectMappingEClass, TAG_TO_VIEW_OBJECT_MAPPING__MIN_JSF_VERSION);
- createEAttribute(tagToViewObjectMappingEClass, TAG_TO_VIEW_OBJECT_MAPPING__MIN_LIBRARY_VERSION);
-
- classTypeInfo_EClass = createEClass(CLASS_TYPE_INFO_);
- createEAttribute(classTypeInfo_EClass, CLASS_TYPE_INFO___CLASS_NAME);
- createEAttribute(classTypeInfo_EClass, CLASS_TYPE_INFO___SUPER_CLASSES);
- createEAttribute(classTypeInfo_EClass, CLASS_TYPE_INFO___INTERFACES);
-
- componentTypeInfo_EClass = createEClass(COMPONENT_TYPE_INFO_);
- createEAttribute(componentTypeInfo_EClass, COMPONENT_TYPE_INFO___COMPONENT_TYPE);
- createEAttribute(componentTypeInfo_EClass, COMPONENT_TYPE_INFO___COMPONENT_FAMILY);
- createEAttribute(componentTypeInfo_EClass, COMPONENT_TYPE_INFO___RENDER_TYPE);
-
- converterTypeInfo_EClass = createEClass(CONVERTER_TYPE_INFO_);
- createEAttribute(converterTypeInfo_EClass, CONVERTER_TYPE_INFO___CONVERTER_ID);
- createEAttribute(converterTypeInfo_EClass, CONVERTER_TYPE_INFO___FOR_CLASSES);
-
- validatorTypeInfo_EClass = createEClass(VALIDATOR_TYPE_INFO_);
- createEAttribute(validatorTypeInfo_EClass, VALIDATOR_TYPE_INFO___VALIDATOR_ID);
-
- attributeToPropertyMappingEClass = createEClass(ATTRIBUTE_TO_PROPERTY_MAPPING);
- createEAttribute(attributeToPropertyMappingEClass, ATTRIBUTE_TO_PROPERTY_MAPPING__PROPERTY_NAME);
- createEAttribute(attributeToPropertyMappingEClass, ATTRIBUTE_TO_PROPERTY_MAPPING__EL_ALLOWED);
- createEAttribute(attributeToPropertyMappingEClass, ATTRIBUTE_TO_PROPERTY_MAPPING__CUSTOM_CONVERSION_FACTORY_ID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isInitialized = false;
-
- /**
- * Complete the initialization of the package and its meta-model. This
- * method is guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void initializePackageContents()
- {
- if (isInitialized) return;
- isInitialized = true;
-
- // Initialize package
- setName(eNAME);
- setNsPrefix(eNS_PREFIX);
- setNsURI(eNS_URI);
-
- // Create type parameters
-
- // Set bounds for type parameters
-
- // Add supertypes to classes
- componentTypeInfo_EClass.getESuperTypes().add(this.getClassTypeInfo_());
- converterTypeInfo_EClass.getESuperTypes().add(this.getClassTypeInfo_());
- validatorTypeInfo_EClass.getESuperTypes().add(this.getClassTypeInfo_());
-
- // Initialize classes and features; add operations and parameters
- initEClass(tagMappingEClass, TagMapping.class, "TagMapping", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getTagMapping_VersionedTagToViewMappings(), this.getTagToViewObjectMapping(), null, "versionedTagToViewMappings", null, 0, -1, TagMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getTagMapping_CustomConversionFactoryId(), ecorePackage.getEString(), "customConversionFactoryId", null, 0, 1, TagMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getTagMapping_BeanMappedProperties(), ecorePackage.getEString(), "beanMappedProperties", "", 0, -1, TagMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- EOperation op = addEOperation(tagMappingEClass, null, "findBestMapping", 0, 1, IS_UNIQUE, IS_ORDERED);
- addEParameter(op, ecorePackage.getEString(), "jsfVersion", 0, 1, IS_UNIQUE, IS_ORDERED);
- addEParameter(op, ecorePackage.getEString(), "libVersion", 0, 1, IS_UNIQUE, IS_ORDERED);
-
- initEClass(tagToViewObjectMappingEClass, TagToViewObjectMapping.class, "TagToViewObjectMapping", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getTagToViewObjectMapping_TypeInfo(), this.getClassTypeInfo_(), null, "typeInfo", null, 0, 1, TagToViewObjectMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getTagToViewObjectMapping_MinJSFVersion(), ecorePackage.getEString(), "minJSFVersion", "1.1", 0, 1, TagToViewObjectMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getTagToViewObjectMapping_MinLibraryVersion(), ecorePackage.getEString(), "minLibraryVersion", "", 0, 1, TagToViewObjectMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(classTypeInfo_EClass, ClassTypeInfo_.class, "ClassTypeInfo_", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getClassTypeInfo__ClassName(), ecorePackage.getEString(), "className", null, 0, 1, ClassTypeInfo_.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getClassTypeInfo__SuperClasses(), ecorePackage.getEString(), "superClasses", null, 0, -1, ClassTypeInfo_.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getClassTypeInfo__Interfaces(), ecorePackage.getEString(), "interfaces", null, 0, -1, ClassTypeInfo_.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(componentTypeInfo_EClass, ComponentTypeInfo_.class, "ComponentTypeInfo_", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getComponentTypeInfo__ComponentType(), ecorePackage.getEString(), "componentType", null, 0, 1, ComponentTypeInfo_.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getComponentTypeInfo__ComponentFamily(), ecorePackage.getEString(), "componentFamily", null, 0, 1, ComponentTypeInfo_.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getComponentTypeInfo__RenderType(), ecorePackage.getEString(), "renderType", null, 0, 1, ComponentTypeInfo_.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(converterTypeInfo_EClass, ConverterTypeInfo_.class, "ConverterTypeInfo_", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getConverterTypeInfo__ConverterId(), ecorePackage.getEString(), "converterId", null, 0, 1, ConverterTypeInfo_.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getConverterTypeInfo__ForClasses(), ecorePackage.getEString(), "forClasses", null, 0, -1, ConverterTypeInfo_.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(validatorTypeInfo_EClass, ValidatorTypeInfo_.class, "ValidatorTypeInfo_", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getValidatorTypeInfo__ValidatorId(), ecorePackage.getEString(), "validatorId", null, 0, 1, ValidatorTypeInfo_.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(attributeToPropertyMappingEClass, AttributeToPropertyMapping.class, "AttributeToPropertyMapping", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getAttributeToPropertyMapping_PropertyName(), ecorePackage.getEString(), "propertyName", null, 0, 1, AttributeToPropertyMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getAttributeToPropertyMapping_ElAllowed(), ecorePackage.getEBoolean(), "elAllowed", "true", 0, 1, AttributeToPropertyMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getAttributeToPropertyMapping_CustomConversionFactoryId(), ecorePackage.getEString(), "customConversionFactoryId", null, 0, 1, AttributeToPropertyMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- // Create resource
- createResource(eNS_URI);
-
- // Create annotations
- // http:///org/eclipse/emf/ecore/util/ExtendedMetaData
- createExtendedMetaDataAnnotations();
- }
-
- /**
- * Initializes the annotations for <b>http:///org/eclipse/emf/ecore/util/ExtendedMetaData</b>.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected void createExtendedMetaDataAnnotations()
- {
- String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData";
- addAnnotation
- (getTagMapping_VersionedTagToViewMappings(),
- source,
- new String[]
- {
- "kind", "element",
- "name", "versionedTagToViewMappings"
- });
- addAnnotation
- (getTagMapping_CustomConversionFactoryId(),
- source,
- new String[]
- {
- "kind", "element",
- "name", "customConversionFactoryId"
- });
- addAnnotation
- (getTagMapping_BeanMappedProperties(),
- source,
- new String[]
- {
- "kind", "element",
- "name", "beanMappedProperties"
- });
- addAnnotation
- (getTagToViewObjectMapping_TypeInfo(),
- source,
- new String[]
- {
- "kind", "element",
- "name", "typeInfo"
- });
- addAnnotation
- (getTagToViewObjectMapping_MinJSFVersion(),
- source,
- new String[]
- {
- "kind", "element",
- "name", "minVersion"
- });
- addAnnotation
- (getTagToViewObjectMapping_MinLibraryVersion(),
- source,
- new String[]
- {
- "kind", "element",
- "name", "minLibraryVersion"
- });
- addAnnotation
- (getClassTypeInfo__ClassName(),
- source,
- new String[]
- {
- "kind", "element",
- "name", "className"
- });
- addAnnotation
- (getClassTypeInfo__SuperClasses(),
- source,
- new String[]
- {
- "kind", "element",
- "name", "superClasses"
- });
- addAnnotation
- (getClassTypeInfo__Interfaces(),
- source,
- new String[]
- {
- "kind", "element",
- "name", "interfaces"
- });
- addAnnotation
- (getComponentTypeInfo__ComponentType(),
- source,
- new String[]
- {
- "kind", "element",
- "name", "componentType"
- });
- addAnnotation
- (getComponentTypeInfo__ComponentFamily(),
- source,
- new String[]
- {
- "kind", "element",
- "name", "componentFamily"
- });
- addAnnotation
- (getComponentTypeInfo__RenderType(),
- source,
- new String[]
- {
- "kind", "element",
- "name", "renderType"
- });
- addAnnotation
- (getConverterTypeInfo__ConverterId(),
- source,
- new String[]
- {
- "kind", "element",
- "name", "converterId"
- });
- addAnnotation
- (getConverterTypeInfo__ForClasses(),
- source,
- new String[]
- {
- "kind", "element",
- "name", "forClass"
- });
- addAnnotation
- (getValidatorTypeInfo__ValidatorId(),
- source,
- new String[]
- {
- "kind", "element",
- "name", "validatorId"
- });
- addAnnotation
- (getAttributeToPropertyMapping_PropertyName(),
- source,
- new String[]
- {
- "kind", "element",
- "name", "propertyName"
- });
- addAnnotation
- (getAttributeToPropertyMapping_ElAllowed(),
- source,
- new String[]
- {
- "kind", "element",
- "name", "elAllowed"
- });
- addAnnotation
- (getAttributeToPropertyMapping_CustomConversionFactoryId(),
- source,
- new String[]
- {
- "kind", "element",
- "name", "customConversionFactoryId"
- });
- }
-
-} //ComponentMappingPackageImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/impl/ComponentTypeInfo_Impl.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/impl/ComponentTypeInfo_Impl.java
deleted file mode 100644
index ceae1a8..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/impl/ComponentTypeInfo_Impl.java
+++ /dev/null
@@ -1,292 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: ComponentTypeInfo_Impl.java,v 1.1 2008/05/12 17:42:20 cbateman Exp $
- */
-package org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentTypeInfo_;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Component Type Info </b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ComponentTypeInfo_Impl#getComponentType <em>Component Type</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ComponentTypeInfo_Impl#getComponentFamily <em>Component Family</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ComponentTypeInfo_Impl#getRenderType <em>Render Type</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class ComponentTypeInfo_Impl extends ClassTypeInfo_Impl implements ComponentTypeInfo_
-{
- /**
- * The default value of the '{@link #getComponentType() <em>Component Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getComponentType()
- * @generated
- * @ordered
- */
- protected static final String COMPONENT_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getComponentType() <em>Component Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getComponentType()
- * @generated
- * @ordered
- */
- protected String componentType = COMPONENT_TYPE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getComponentFamily() <em>Component Family</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getComponentFamily()
- * @generated
- * @ordered
- */
- protected static final String COMPONENT_FAMILY_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getComponentFamily() <em>Component Family</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getComponentFamily()
- * @generated
- * @ordered
- */
- protected String componentFamily = COMPONENT_FAMILY_EDEFAULT;
-
- /**
- * The default value of the '{@link #getRenderType() <em>Render Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRenderType()
- * @generated
- * @ordered
- */
- protected static final String RENDER_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getRenderType() <em>Render Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRenderType()
- * @generated
- * @ordered
- */
- protected String renderType = RENDER_TYPE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected ComponentTypeInfo_Impl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return ComponentMappingPackage.Literals.COMPONENT_TYPE_INFO_;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getComponentType()
- {
- return componentType;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setComponentType(String newComponentType)
- {
- String oldComponentType = componentType;
- componentType = newComponentType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ComponentMappingPackage.COMPONENT_TYPE_INFO___COMPONENT_TYPE, oldComponentType, componentType));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getComponentFamily()
- {
- return componentFamily;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setComponentFamily(String newComponentFamily)
- {
- String oldComponentFamily = componentFamily;
- componentFamily = newComponentFamily;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ComponentMappingPackage.COMPONENT_TYPE_INFO___COMPONENT_FAMILY, oldComponentFamily, componentFamily));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getRenderType()
- {
- return renderType;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setRenderType(String newRenderType)
- {
- String oldRenderType = renderType;
- renderType = newRenderType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ComponentMappingPackage.COMPONENT_TYPE_INFO___RENDER_TYPE, oldRenderType, renderType));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case ComponentMappingPackage.COMPONENT_TYPE_INFO___COMPONENT_TYPE:
- return getComponentType();
- case ComponentMappingPackage.COMPONENT_TYPE_INFO___COMPONENT_FAMILY:
- return getComponentFamily();
- case ComponentMappingPackage.COMPONENT_TYPE_INFO___RENDER_TYPE:
- return getRenderType();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case ComponentMappingPackage.COMPONENT_TYPE_INFO___COMPONENT_TYPE:
- setComponentType((String)newValue);
- return;
- case ComponentMappingPackage.COMPONENT_TYPE_INFO___COMPONENT_FAMILY:
- setComponentFamily((String)newValue);
- return;
- case ComponentMappingPackage.COMPONENT_TYPE_INFO___RENDER_TYPE:
- setRenderType((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case ComponentMappingPackage.COMPONENT_TYPE_INFO___COMPONENT_TYPE:
- setComponentType(COMPONENT_TYPE_EDEFAULT);
- return;
- case ComponentMappingPackage.COMPONENT_TYPE_INFO___COMPONENT_FAMILY:
- setComponentFamily(COMPONENT_FAMILY_EDEFAULT);
- return;
- case ComponentMappingPackage.COMPONENT_TYPE_INFO___RENDER_TYPE:
- setRenderType(RENDER_TYPE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case ComponentMappingPackage.COMPONENT_TYPE_INFO___COMPONENT_TYPE:
- return COMPONENT_TYPE_EDEFAULT == null ? componentType != null : !COMPONENT_TYPE_EDEFAULT.equals(componentType);
- case ComponentMappingPackage.COMPONENT_TYPE_INFO___COMPONENT_FAMILY:
- return COMPONENT_FAMILY_EDEFAULT == null ? componentFamily != null : !COMPONENT_FAMILY_EDEFAULT.equals(componentFamily);
- case ComponentMappingPackage.COMPONENT_TYPE_INFO___RENDER_TYPE:
- return RENDER_TYPE_EDEFAULT == null ? renderType != null : !RENDER_TYPE_EDEFAULT.equals(renderType);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (componentType: ");
- result.append(componentType);
- result.append(", componentFamily: ");
- result.append(componentFamily);
- result.append(", renderType: ");
- result.append(renderType);
- result.append(')');
- return result.toString();
- }
-
-} //ComponentTypeInfo_Impl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/impl/ConverterTypeInfo_Impl.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/impl/ConverterTypeInfo_Impl.java
deleted file mode 100644
index 9885320..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/impl/ConverterTypeInfo_Impl.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: ConverterTypeInfo_Impl.java,v 1.1 2008/05/12 17:42:20 cbateman Exp $
- */
-package org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.emf.ecore.util.EDataTypeUniqueEList;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ConverterTypeInfo_;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Converter Type Info </b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ConverterTypeInfo_Impl#getConverterId <em>Converter Id</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ConverterTypeInfo_Impl#getForClasses <em>For Classes</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class ConverterTypeInfo_Impl extends ClassTypeInfo_Impl implements ConverterTypeInfo_
-{
- /**
- * The default value of the '{@link #getConverterId() <em>Converter Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConverterId()
- * @generated
- * @ordered
- */
- protected static final String CONVERTER_ID_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getConverterId() <em>Converter Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConverterId()
- * @generated
- * @ordered
- */
- protected String converterId = CONVERTER_ID_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getForClasses() <em>For Classes</em>}' attribute list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getForClasses()
- * @generated
- * @ordered
- */
- protected EList<String> forClasses;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected ConverterTypeInfo_Impl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return ComponentMappingPackage.Literals.CONVERTER_TYPE_INFO_;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getConverterId()
- {
- return converterId;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setConverterId(String newConverterId)
- {
- String oldConverterId = converterId;
- converterId = newConverterId;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ComponentMappingPackage.CONVERTER_TYPE_INFO___CONVERTER_ID, oldConverterId, converterId));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EList<String> getForClasses()
- {
- if (forClasses == null)
- {
- forClasses = new EDataTypeUniqueEList<String>(String.class, this, ComponentMappingPackage.CONVERTER_TYPE_INFO___FOR_CLASSES);
- }
- return forClasses;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case ComponentMappingPackage.CONVERTER_TYPE_INFO___CONVERTER_ID:
- return getConverterId();
- case ComponentMappingPackage.CONVERTER_TYPE_INFO___FOR_CLASSES:
- return getForClasses();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case ComponentMappingPackage.CONVERTER_TYPE_INFO___CONVERTER_ID:
- setConverterId((String)newValue);
- return;
- case ComponentMappingPackage.CONVERTER_TYPE_INFO___FOR_CLASSES:
- getForClasses().clear();
- getForClasses().addAll((Collection<? extends String>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case ComponentMappingPackage.CONVERTER_TYPE_INFO___CONVERTER_ID:
- setConverterId(CONVERTER_ID_EDEFAULT);
- return;
- case ComponentMappingPackage.CONVERTER_TYPE_INFO___FOR_CLASSES:
- getForClasses().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case ComponentMappingPackage.CONVERTER_TYPE_INFO___CONVERTER_ID:
- return CONVERTER_ID_EDEFAULT == null ? converterId != null : !CONVERTER_ID_EDEFAULT.equals(converterId);
- case ComponentMappingPackage.CONVERTER_TYPE_INFO___FOR_CLASSES:
- return forClasses != null && !forClasses.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (converterId: ");
- result.append(converterId);
- result.append(", forClasses: ");
- result.append(forClasses);
- result.append(')');
- return result.toString();
- }
-
-} //ConverterTypeInfo_Impl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/impl/TagMappingImpl.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/impl/TagMappingImpl.java
deleted file mode 100644
index fedaf67..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/impl/TagMappingImpl.java
+++ /dev/null
@@ -1,294 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: TagMappingImpl.java,v 1.1 2008/05/12 17:42:20 cbateman Exp $
- */
-package org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl;
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-
-import org.eclipse.emf.common.util.EList;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-
-import org.eclipse.emf.ecore.util.EDataTypeUniqueEList;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagMapping;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagToViewObjectMapping;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Tag Mapping</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.TagMappingImpl#getVersionedTagToViewMappings <em>Versioned Tag To View Mappings</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.TagMappingImpl#getCustomConversionFactoryId <em>Custom Conversion Factory Id</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.TagMappingImpl#getBeanMappedProperties <em>Bean Mapped Properties</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class TagMappingImpl extends EObjectImpl implements TagMapping
-{
- /**
- * The cached value of the '{@link #getVersionedTagToViewMappings() <em>Versioned Tag To View Mappings</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getVersionedTagToViewMappings()
- * @generated
- * @ordered
- */
- protected EList<TagToViewObjectMapping> versionedTagToViewMappings;
-
- /**
- * The default value of the '{@link #getCustomConversionFactoryId() <em>Custom Conversion Factory Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCustomConversionFactoryId()
- * @generated
- * @ordered
- */
- protected static final String CUSTOM_CONVERSION_FACTORY_ID_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getCustomConversionFactoryId() <em>Custom Conversion Factory Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCustomConversionFactoryId()
- * @generated
- * @ordered
- */
- protected String customConversionFactoryId = CUSTOM_CONVERSION_FACTORY_ID_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getBeanMappedProperties() <em>Bean Mapped Properties</em>}' attribute list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getBeanMappedProperties()
- * @generated
- * @ordered
- */
- protected EList<String> beanMappedProperties;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected TagMappingImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return ComponentMappingPackage.Literals.TAG_MAPPING;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EList<TagToViewObjectMapping> getVersionedTagToViewMappings()
- {
- if (versionedTagToViewMappings == null)
- {
- versionedTagToViewMappings = new EObjectContainmentEList<TagToViewObjectMapping>(TagToViewObjectMapping.class, this, ComponentMappingPackage.TAG_MAPPING__VERSIONED_TAG_TO_VIEW_MAPPINGS);
- }
- return versionedTagToViewMappings;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getCustomConversionFactoryId()
- {
- return customConversionFactoryId;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setCustomConversionFactoryId(String newCustomConversionFactoryId)
- {
- String oldCustomConversionFactoryId = customConversionFactoryId;
- customConversionFactoryId = newCustomConversionFactoryId;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ComponentMappingPackage.TAG_MAPPING__CUSTOM_CONVERSION_FACTORY_ID, oldCustomConversionFactoryId, customConversionFactoryId));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EList<String> getBeanMappedProperties()
- {
- if (beanMappedProperties == null)
- {
- beanMappedProperties = new EDataTypeUniqueEList<String>(String.class, this, ComponentMappingPackage.TAG_MAPPING__BEAN_MAPPED_PROPERTIES);
- }
- return beanMappedProperties;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void findBestMapping(String jsfVersion, String libVersion)
- {
- // TODO: implement this method
- // Ensure that you remove @generated or mark it @generated NOT
- throw new UnsupportedOperationException();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case ComponentMappingPackage.TAG_MAPPING__VERSIONED_TAG_TO_VIEW_MAPPINGS:
- return ((InternalEList<?>)getVersionedTagToViewMappings()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case ComponentMappingPackage.TAG_MAPPING__VERSIONED_TAG_TO_VIEW_MAPPINGS:
- return getVersionedTagToViewMappings();
- case ComponentMappingPackage.TAG_MAPPING__CUSTOM_CONVERSION_FACTORY_ID:
- return getCustomConversionFactoryId();
- case ComponentMappingPackage.TAG_MAPPING__BEAN_MAPPED_PROPERTIES:
- return getBeanMappedProperties();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case ComponentMappingPackage.TAG_MAPPING__VERSIONED_TAG_TO_VIEW_MAPPINGS:
- getVersionedTagToViewMappings().clear();
- getVersionedTagToViewMappings().addAll((Collection<? extends TagToViewObjectMapping>)newValue);
- return;
- case ComponentMappingPackage.TAG_MAPPING__CUSTOM_CONVERSION_FACTORY_ID:
- setCustomConversionFactoryId((String)newValue);
- return;
- case ComponentMappingPackage.TAG_MAPPING__BEAN_MAPPED_PROPERTIES:
- getBeanMappedProperties().clear();
- getBeanMappedProperties().addAll((Collection<? extends String>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case ComponentMappingPackage.TAG_MAPPING__VERSIONED_TAG_TO_VIEW_MAPPINGS:
- getVersionedTagToViewMappings().clear();
- return;
- case ComponentMappingPackage.TAG_MAPPING__CUSTOM_CONVERSION_FACTORY_ID:
- setCustomConversionFactoryId(CUSTOM_CONVERSION_FACTORY_ID_EDEFAULT);
- return;
- case ComponentMappingPackage.TAG_MAPPING__BEAN_MAPPED_PROPERTIES:
- getBeanMappedProperties().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case ComponentMappingPackage.TAG_MAPPING__VERSIONED_TAG_TO_VIEW_MAPPINGS:
- return versionedTagToViewMappings != null && !versionedTagToViewMappings.isEmpty();
- case ComponentMappingPackage.TAG_MAPPING__CUSTOM_CONVERSION_FACTORY_ID:
- return CUSTOM_CONVERSION_FACTORY_ID_EDEFAULT == null ? customConversionFactoryId != null : !CUSTOM_CONVERSION_FACTORY_ID_EDEFAULT.equals(customConversionFactoryId);
- case ComponentMappingPackage.TAG_MAPPING__BEAN_MAPPED_PROPERTIES:
- return beanMappedProperties != null && !beanMappedProperties.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (customConversionFactoryId: ");
- result.append(customConversionFactoryId);
- result.append(", beanMappedProperties: ");
- result.append(beanMappedProperties);
- result.append(')');
- return result.toString();
- }
-
-} //TagMappingImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/impl/TagToViewObjectMappingImpl.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/impl/TagToViewObjectMappingImpl.java
deleted file mode 100644
index dbaaa73..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/impl/TagToViewObjectMappingImpl.java
+++ /dev/null
@@ -1,314 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: TagToViewObjectMappingImpl.java,v 1.1 2008/05/12 17:42:20 cbateman Exp $
- */
-package org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ClassTypeInfo_;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagToViewObjectMapping;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Tag To View Object Mapping</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.TagToViewObjectMappingImpl#getTypeInfo <em>Type Info</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.TagToViewObjectMappingImpl#getMinJSFVersion <em>Min JSF Version</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.TagToViewObjectMappingImpl#getMinLibraryVersion <em>Min Library Version</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class TagToViewObjectMappingImpl extends EObjectImpl implements TagToViewObjectMapping
-{
- /**
- * The cached value of the '{@link #getTypeInfo() <em>Type Info</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTypeInfo()
- * @generated
- * @ordered
- */
- protected ClassTypeInfo_ typeInfo;
-
- /**
- * The default value of the '{@link #getMinJSFVersion() <em>Min JSF Version</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMinJSFVersion()
- * @generated
- * @ordered
- */
- protected static final String MIN_JSF_VERSION_EDEFAULT = "1.1";
-
- /**
- * The cached value of the '{@link #getMinJSFVersion() <em>Min JSF Version</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMinJSFVersion()
- * @generated
- * @ordered
- */
- protected String minJSFVersion = MIN_JSF_VERSION_EDEFAULT;
-
- /**
- * The default value of the '{@link #getMinLibraryVersion() <em>Min Library Version</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMinLibraryVersion()
- * @generated
- * @ordered
- */
- protected static final String MIN_LIBRARY_VERSION_EDEFAULT = "";
-
- /**
- * The cached value of the '{@link #getMinLibraryVersion() <em>Min Library Version</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMinLibraryVersion()
- * @generated
- * @ordered
- */
- protected String minLibraryVersion = MIN_LIBRARY_VERSION_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected TagToViewObjectMappingImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return ComponentMappingPackage.Literals.TAG_TO_VIEW_OBJECT_MAPPING;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public ClassTypeInfo_ getTypeInfo()
- {
- return typeInfo;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @param newTypeInfo
- * @param msgs
- * @return the notification chain
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetTypeInfo(ClassTypeInfo_ newTypeInfo, NotificationChain msgs)
- {
- ClassTypeInfo_ oldTypeInfo = typeInfo;
- typeInfo = newTypeInfo;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ComponentMappingPackage.TAG_TO_VIEW_OBJECT_MAPPING__TYPE_INFO, oldTypeInfo, newTypeInfo);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setTypeInfo(ClassTypeInfo_ newTypeInfo)
- {
- if (newTypeInfo != typeInfo)
- {
- NotificationChain msgs = null;
- if (typeInfo != null)
- msgs = ((InternalEObject)typeInfo).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ComponentMappingPackage.TAG_TO_VIEW_OBJECT_MAPPING__TYPE_INFO, null, msgs);
- if (newTypeInfo != null)
- msgs = ((InternalEObject)newTypeInfo).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ComponentMappingPackage.TAG_TO_VIEW_OBJECT_MAPPING__TYPE_INFO, null, msgs);
- msgs = basicSetTypeInfo(newTypeInfo, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ComponentMappingPackage.TAG_TO_VIEW_OBJECT_MAPPING__TYPE_INFO, newTypeInfo, newTypeInfo));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getMinJSFVersion()
- {
- return minJSFVersion;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setMinJSFVersion(String newMinJSFVersion)
- {
- String oldMinJSFVersion = minJSFVersion;
- minJSFVersion = newMinJSFVersion;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ComponentMappingPackage.TAG_TO_VIEW_OBJECT_MAPPING__MIN_JSF_VERSION, oldMinJSFVersion, minJSFVersion));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getMinLibraryVersion()
- {
- return minLibraryVersion;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setMinLibraryVersion(String newMinLibraryVersion)
- {
- String oldMinLibraryVersion = minLibraryVersion;
- minLibraryVersion = newMinLibraryVersion;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ComponentMappingPackage.TAG_TO_VIEW_OBJECT_MAPPING__MIN_LIBRARY_VERSION, oldMinLibraryVersion, minLibraryVersion));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case ComponentMappingPackage.TAG_TO_VIEW_OBJECT_MAPPING__TYPE_INFO:
- return basicSetTypeInfo(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case ComponentMappingPackage.TAG_TO_VIEW_OBJECT_MAPPING__TYPE_INFO:
- return getTypeInfo();
- case ComponentMappingPackage.TAG_TO_VIEW_OBJECT_MAPPING__MIN_JSF_VERSION:
- return getMinJSFVersion();
- case ComponentMappingPackage.TAG_TO_VIEW_OBJECT_MAPPING__MIN_LIBRARY_VERSION:
- return getMinLibraryVersion();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case ComponentMappingPackage.TAG_TO_VIEW_OBJECT_MAPPING__TYPE_INFO:
- setTypeInfo((ClassTypeInfo_)newValue);
- return;
- case ComponentMappingPackage.TAG_TO_VIEW_OBJECT_MAPPING__MIN_JSF_VERSION:
- setMinJSFVersion((String)newValue);
- return;
- case ComponentMappingPackage.TAG_TO_VIEW_OBJECT_MAPPING__MIN_LIBRARY_VERSION:
- setMinLibraryVersion((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case ComponentMappingPackage.TAG_TO_VIEW_OBJECT_MAPPING__TYPE_INFO:
- setTypeInfo((ClassTypeInfo_)null);
- return;
- case ComponentMappingPackage.TAG_TO_VIEW_OBJECT_MAPPING__MIN_JSF_VERSION:
- setMinJSFVersion(MIN_JSF_VERSION_EDEFAULT);
- return;
- case ComponentMappingPackage.TAG_TO_VIEW_OBJECT_MAPPING__MIN_LIBRARY_VERSION:
- setMinLibraryVersion(MIN_LIBRARY_VERSION_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case ComponentMappingPackage.TAG_TO_VIEW_OBJECT_MAPPING__TYPE_INFO:
- return typeInfo != null;
- case ComponentMappingPackage.TAG_TO_VIEW_OBJECT_MAPPING__MIN_JSF_VERSION:
- return MIN_JSF_VERSION_EDEFAULT == null ? minJSFVersion != null : !MIN_JSF_VERSION_EDEFAULT.equals(minJSFVersion);
- case ComponentMappingPackage.TAG_TO_VIEW_OBJECT_MAPPING__MIN_LIBRARY_VERSION:
- return MIN_LIBRARY_VERSION_EDEFAULT == null ? minLibraryVersion != null : !MIN_LIBRARY_VERSION_EDEFAULT.equals(minLibraryVersion);
- }
- return super.eIsSet(featureID);
- }
-
- @Override
- public String toString()
- {
- return "TagToViewObjectMapping: typeInfo="+getTypeInfo();
- }
-} //TagToViewObjectMappingImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/impl/ValidatorTypeInfo_Impl.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/impl/ValidatorTypeInfo_Impl.java
deleted file mode 100644
index bcfcfdb..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/impl/ValidatorTypeInfo_Impl.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: ValidatorTypeInfo_Impl.java,v 1.1 2008/05/12 17:42:20 cbateman Exp $
- */
-package org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ValidatorTypeInfo_;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Validator Type Info </b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.impl.ValidatorTypeInfo_Impl#getValidatorId <em>Validator Id</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class ValidatorTypeInfo_Impl extends ClassTypeInfo_Impl implements ValidatorTypeInfo_
-{
- /**
- * The default value of the '{@link #getValidatorId() <em>Validator Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValidatorId()
- * @generated
- * @ordered
- */
- protected static final String VALIDATOR_ID_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getValidatorId() <em>Validator Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValidatorId()
- * @generated
- * @ordered
- */
- protected String validatorId = VALIDATOR_ID_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected ValidatorTypeInfo_Impl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return ComponentMappingPackage.Literals.VALIDATOR_TYPE_INFO_;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getValidatorId()
- {
- return validatorId;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setValidatorId(String newValidatorId)
- {
- String oldValidatorId = validatorId;
- validatorId = newValidatorId;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ComponentMappingPackage.VALIDATOR_TYPE_INFO___VALIDATOR_ID, oldValidatorId, validatorId));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case ComponentMappingPackage.VALIDATOR_TYPE_INFO___VALIDATOR_ID:
- return getValidatorId();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case ComponentMappingPackage.VALIDATOR_TYPE_INFO___VALIDATOR_ID:
- setValidatorId((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case ComponentMappingPackage.VALIDATOR_TYPE_INFO___VALIDATOR_ID:
- setValidatorId(VALIDATOR_ID_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case ComponentMappingPackage.VALIDATOR_TYPE_INFO___VALIDATOR_ID:
- return VALIDATOR_ID_EDEFAULT == null ? validatorId != null : !VALIDATOR_ID_EDEFAULT.equals(validatorId);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (validatorId: ");
- result.append(validatorId);
- result.append(')');
- return result.toString();
- }
-
-} //ValidatorTypeInfo_Impl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/util/ComponentMappingAdapterFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/util/ComponentMappingAdapterFactory.java
deleted file mode 100644
index 7676879..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/util/ComponentMappingAdapterFactory.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: ComponentMappingAdapterFactory.java,v 1.1 2008/05/12 17:42:21 cbateman Exp $
- */
-package org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.util;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-
-import org.eclipse.emf.ecore.EObject;
-
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.*;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Adapter Factory</b> for the model.
- * It provides an adapter <code>createXXX</code> method for each class of the model.
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage
- * @generated
- */
-public class ComponentMappingAdapterFactory extends AdapterFactoryImpl
-{
- /**
- * The cached model package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected static ComponentMappingPackage modelPackage;
-
- /**
- * Creates an instance of the adapter factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public ComponentMappingAdapterFactory()
- {
- if (modelPackage == null)
- {
- modelPackage = ComponentMappingPackage.eINSTANCE;
- }
- }
-
- /**
- * Returns whether this factory is applicable for the type of the object.
- * <!-- begin-user-doc -->
- * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
- * <!-- end-user-doc -->
- * @return whether this factory is applicable for the type of the object.
- * @generated
- */
- @Override
- public boolean isFactoryForType(Object object)
- {
- if (object == modelPackage)
- {
- return true;
- }
- if (object instanceof EObject)
- {
- return ((EObject)object).eClass().getEPackage() == modelPackage;
- }
- return false;
- }
-
- /**
- * The switch that delegates to the <code>createXXX</code> methods.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected ComponentMappingSwitch<Adapter> modelSwitch =
- new ComponentMappingSwitch<Adapter>()
- {
- @Override
- public Adapter caseTagMapping(TagMapping object)
- {
- return createTagMappingAdapter();
- }
- @Override
- public Adapter caseTagToViewObjectMapping(TagToViewObjectMapping object)
- {
- return createTagToViewObjectMappingAdapter();
- }
- @Override
- public Adapter caseClassTypeInfo_(ClassTypeInfo_ object)
- {
- return createClassTypeInfo_Adapter();
- }
- @Override
- public Adapter caseComponentTypeInfo_(ComponentTypeInfo_ object)
- {
- return createComponentTypeInfo_Adapter();
- }
- @Override
- public Adapter caseConverterTypeInfo_(ConverterTypeInfo_ object)
- {
- return createConverterTypeInfo_Adapter();
- }
- @Override
- public Adapter caseValidatorTypeInfo_(ValidatorTypeInfo_ object)
- {
- return createValidatorTypeInfo_Adapter();
- }
- @Override
- public Adapter caseAttributeToPropertyMapping(AttributeToPropertyMapping object)
- {
- return createAttributeToPropertyMappingAdapter();
- }
- @Override
- public Adapter defaultCase(EObject object)
- {
- return createEObjectAdapter();
- }
- };
-
- /**
- * Creates an adapter for the <code>target</code>.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param target the object to adapt.
- * @return the adapter for the <code>target</code>.
- * @generated
- */
- @Override
- public Adapter createAdapter(Notifier target)
- {
- return modelSwitch.doSwitch((EObject)target);
- }
-
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagMapping <em>Tag Mapping</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagMapping
- * @generated
- */
- public Adapter createTagMappingAdapter()
- {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagToViewObjectMapping <em>Tag To View Object Mapping</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagToViewObjectMapping
- * @generated
- */
- public Adapter createTagToViewObjectMappingAdapter()
- {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ClassTypeInfo_ <em>Class Type Info </em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ClassTypeInfo_
- * @generated
- */
- public Adapter createClassTypeInfo_Adapter()
- {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentTypeInfo_ <em>Component Type Info </em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentTypeInfo_
- * @generated
- */
- public Adapter createComponentTypeInfo_Adapter()
- {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ConverterTypeInfo_ <em>Converter Type Info </em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ConverterTypeInfo_
- * @generated
- */
- public Adapter createConverterTypeInfo_Adapter()
- {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ValidatorTypeInfo_ <em>Validator Type Info </em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ValidatorTypeInfo_
- * @generated
- */
- public Adapter createValidatorTypeInfo_Adapter()
- {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.AttributeToPropertyMapping <em>Attribute To Property Mapping</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.AttributeToPropertyMapping
- * @generated
- */
- public Adapter createAttributeToPropertyMappingAdapter()
- {
- return null;
- }
-
- /**
- * Creates a new adapter for the default case.
- * <!-- begin-user-doc -->
- * This default implementation returns null.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @generated
- */
- public Adapter createEObjectAdapter()
- {
- return null;
- }
-
-} //ComponentMappingAdapterFactory
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/util/ComponentMappingResourceFactoryImpl.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/util/ComponentMappingResourceFactoryImpl.java
deleted file mode 100644
index 08f2fbf..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/util/ComponentMappingResourceFactoryImpl.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: ComponentMappingResourceFactoryImpl.java,v 1.1 2008/05/12 17:42:21 cbateman Exp $
- */
-package org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.util;
-
-import org.eclipse.emf.common.util.URI;
-
-import org.eclipse.emf.ecore.resource.Resource;
-
-import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl;
-
-import org.eclipse.emf.ecore.xmi.XMLResource;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Resource Factory</b> associated with the package.
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.util.ComponentMappingResourceImpl
- * @generated
- */
-public class ComponentMappingResourceFactoryImpl extends ResourceFactoryImpl
-{
- /**
- * Creates an instance of the resource factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public ComponentMappingResourceFactoryImpl()
- {
- super();
- }
-
- /**
- * Creates an instance of the resource.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Resource createResource(URI uri)
- {
- XMLResource result = new ComponentMappingResourceImpl(uri);
- result.getDefaultSaveOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE);
- result.getDefaultLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE);
-
- result.getDefaultSaveOptions().put(XMLResource.OPTION_SCHEMA_LOCATION, Boolean.TRUE);
-
- result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE);
- result.getDefaultSaveOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE);
-
- result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_LEXICAL_HANDLER, Boolean.TRUE);
- return result;
- }
-
-} //ComponentMappingResourceFactoryImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/util/ComponentMappingResourceImpl.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/util/ComponentMappingResourceImpl.java
deleted file mode 100644
index 8d3c819..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/util/ComponentMappingResourceImpl.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: ComponentMappingResourceImpl.java,v 1.1 2008/05/12 17:42:21 cbateman Exp $
- */
-package org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.util;
-
-import org.eclipse.emf.common.util.URI;
-
-import org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Resource </b> associated with the package.
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.util.ComponentMappingResourceFactoryImpl
- * @generated
- */
-public class ComponentMappingResourceImpl extends XMLResourceImpl
-{
- /**
- * Creates an instance of the resource.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param uri the URI of the new resource.
- * @generated
- */
- public ComponentMappingResourceImpl(URI uri)
- {
- super(uri);
- }
-
-} //ComponentMappingResourceImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/util/ComponentMappingSwitch.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/util/ComponentMappingSwitch.java
deleted file mode 100644
index 3de4106..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/util/ComponentMappingSwitch.java
+++ /dev/null
@@ -1,286 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: ComponentMappingSwitch.java,v 1.1 2008/05/12 17:42:21 cbateman Exp $
- */
-package org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.util;
-
-import java.util.List;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.*;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Switch</b> for the model's inheritance hierarchy.
- * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
- * to invoke the <code>caseXXX</code> method for each class of the model,
- * starting with the actual class of the object
- * and proceeding up the inheritance hierarchy
- * until a non-null result is returned,
- * which is the result of the switch.
- * @param <T>
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage
- * @generated
- */
-public class ComponentMappingSwitch<T>
-{
- /**
- * The cached model package
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected static ComponentMappingPackage modelPackage;
-
- /**
- * Creates an instance of the switch.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public ComponentMappingSwitch()
- {
- if (modelPackage == null)
- {
- modelPackage = ComponentMappingPackage.eINSTANCE;
- }
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc -->
- * @param theEObject
- * <!-- end-user-doc -->
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * @generated
- */
- public T doSwitch(EObject theEObject)
- {
- return doSwitch(theEObject.eClass(), theEObject);
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc -->
- * @param theEClass
- * @param theEObject
- * <!-- end-user-doc -->
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * @generated
- */
- protected T doSwitch(EClass theEClass, EObject theEObject)
- {
- if (theEClass.eContainer() == modelPackage)
- {
- return doSwitch(theEClass.getClassifierID(), theEObject);
- }
- List<EClass> eSuperTypes = theEClass.getESuperTypes();
- return
- eSuperTypes.isEmpty() ?
- defaultCase(theEObject) :
- doSwitch(eSuperTypes.get(0), theEObject);
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc -->
- * @param classifierID
- * @param theEObject
- * <!-- end-user-doc -->
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * @generated
- */
- protected T doSwitch(int classifierID, EObject theEObject)
- {
- switch (classifierID)
- {
- case ComponentMappingPackage.TAG_MAPPING:
- {
- TagMapping tagMapping = (TagMapping)theEObject;
- T result = caseTagMapping(tagMapping);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case ComponentMappingPackage.TAG_TO_VIEW_OBJECT_MAPPING:
- {
- TagToViewObjectMapping tagToViewObjectMapping = (TagToViewObjectMapping)theEObject;
- T result = caseTagToViewObjectMapping(tagToViewObjectMapping);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case ComponentMappingPackage.CLASS_TYPE_INFO_:
- {
- ClassTypeInfo_ classTypeInfo_ = (ClassTypeInfo_)theEObject;
- T result = caseClassTypeInfo_(classTypeInfo_);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case ComponentMappingPackage.COMPONENT_TYPE_INFO_:
- {
- ComponentTypeInfo_ componentTypeInfo_ = (ComponentTypeInfo_)theEObject;
- T result = caseComponentTypeInfo_(componentTypeInfo_);
- if (result == null) result = caseClassTypeInfo_(componentTypeInfo_);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case ComponentMappingPackage.CONVERTER_TYPE_INFO_:
- {
- ConverterTypeInfo_ converterTypeInfo_ = (ConverterTypeInfo_)theEObject;
- T result = caseConverterTypeInfo_(converterTypeInfo_);
- if (result == null) result = caseClassTypeInfo_(converterTypeInfo_);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case ComponentMappingPackage.VALIDATOR_TYPE_INFO_:
- {
- ValidatorTypeInfo_ validatorTypeInfo_ = (ValidatorTypeInfo_)theEObject;
- T result = caseValidatorTypeInfo_(validatorTypeInfo_);
- if (result == null) result = caseClassTypeInfo_(validatorTypeInfo_);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case ComponentMappingPackage.ATTRIBUTE_TO_PROPERTY_MAPPING:
- {
- AttributeToPropertyMapping attributeToPropertyMapping = (AttributeToPropertyMapping)theEObject;
- T result = caseAttributeToPropertyMapping(attributeToPropertyMapping);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- default: return defaultCase(theEObject);
- }
- }
-
- /**
- * Returns the result of interpreting the object as an instance of '<em>Tag Mapping</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpreting the object as an instance of '<em>Tag Mapping</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public T caseTagMapping(TagMapping object)
- {
- return null;
- }
-
- /**
- * Returns the result of interpreting the object as an instance of '<em>Tag To View Object Mapping</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpreting the object as an instance of '<em>Tag To View Object Mapping</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public T caseTagToViewObjectMapping(TagToViewObjectMapping object)
- {
- return null;
- }
-
- /**
- * Returns the result of interpreting the object as an instance of '<em>Class Type Info </em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpreting the object as an instance of '<em>Class Type Info </em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public T caseClassTypeInfo_(ClassTypeInfo_ object)
- {
- return null;
- }
-
- /**
- * Returns the result of interpreting the object as an instance of '<em>Component Type Info </em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpreting the object as an instance of '<em>Component Type Info </em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public T caseComponentTypeInfo_(ComponentTypeInfo_ object)
- {
- return null;
- }
-
- /**
- * Returns the result of interpreting the object as an instance of '<em>Converter Type Info </em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpreting the object as an instance of '<em>Converter Type Info </em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public T caseConverterTypeInfo_(ConverterTypeInfo_ object)
- {
- return null;
- }
-
- /**
- * Returns the result of interpreting the object as an instance of '<em>Validator Type Info </em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpreting the object as an instance of '<em>Validator Type Info </em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public T caseValidatorTypeInfo_(ValidatorTypeInfo_ object)
- {
- return null;
- }
-
- /**
- * Returns the result of interpreting the object as an instance of '<em>Attribute To Property Mapping</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpreting the object as an instance of '<em>Attribute To Property Mapping</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public T caseAttributeToPropertyMapping(AttributeToPropertyMapping object)
- {
- return null;
- }
-
- /**
- * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch, but this is the last case anyway.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject)
- * @generated
- */
- public T defaultCase(EObject object)
- {
- return null;
- }
-
-} //ComponentMappingSwitch
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/util/ComponentMappingXMLProcessor.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/util/ComponentMappingXMLProcessor.java
deleted file mode 100644
index 0280c4e..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/mapping/viewmapping/util/ComponentMappingXMLProcessor.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: ComponentMappingXMLProcessor.java,v 1.1 2008/05/12 17:42:21 cbateman Exp $
- */
-package org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.util;
-
-import java.util.Map;
-
-import org.eclipse.emf.ecore.EPackage;
-
-import org.eclipse.emf.ecore.resource.Resource;
-
-import org.eclipse.emf.ecore.xmi.util.XMLProcessor;
-
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.ComponentMappingPackage;
-
-/**
- * This class contains helper methods to serialize and deserialize XML documents
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-public class ComponentMappingXMLProcessor extends XMLProcessor
-{
-
- /**
- * Public constructor to instantiate the helper.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public ComponentMappingXMLProcessor()
- {
- super((EPackage.Registry.INSTANCE));
- ComponentMappingPackage.eINSTANCE.eClass();
- }
-
- /**
- * Register for "*" and "xml" file extensions the ComponentMappingResourceFactoryImpl factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected Map<String, Resource.Factory> getRegistrations()
- {
- if (registrations == null)
- {
- super.getRegistrations();
- registrations.put(XML_EXTENSION, new ComponentMappingResourceFactoryImpl());
- registrations.put(STAR_EXTENSION, new ComponentMappingResourceFactoryImpl());
- }
- return registrations;
- }
-
-} //ComponentMappingXMLProcessor
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/AbstractTagRegistry.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/AbstractTagRegistry.java
deleted file mode 100644
index edc4118..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/AbstractTagRegistry.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view.model;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jst.jsf.common.internal.RunOnCompletionPattern;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.Namespace;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-
-/**
- * The abstract registry that all implementations of ITagRegistry should
- * sub-class.
- *
- * @author cbateman
- *
- */
-public abstract class AbstractTagRegistry implements ITagRegistry
-{
- private final List<ITagRegistryListener> _listeners;
- private final AtomicBoolean _isDisposed = new AtomicBoolean(
- false);
-
- /**
- *
- */
- protected AbstractTagRegistry()
- {
- super();
- _listeners = new CopyOnWriteArrayList<ITagRegistryListener>();
- }
-
- public final void addListener(final ITagRegistryListener listener)
- {
- if (!_listeners.contains(listener))
- {
- _listeners.add(listener);
- }
- }
-
- public final void removeListener(final ITagRegistryListener listener)
- {
- _listeners.remove(listener);
- }
-
- /**
- * @param event
- */
- protected final void fireEvent(final TagRegistryChangeEvent event)
- {
- for (final ITagRegistryListener listener : _listeners)
- {
- try
- {
- listener.registryChanged(event);
- }
- catch (final Exception e)
- {
- JSFCorePlugin.log(new Exception(e),
- "During change event notification");
- }
- }
- }
-
- public abstract Collection<? extends Namespace> getAllTagLibraries();
-
- public abstract Namespace getTagLibrary(String uri);
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.jsf.designtime.internal.view.model.jsp.registry.ITagRegistry#isDisposed()
- */
- public final boolean isDisposed()
- {
- return _isDisposed.get();
- }
-
- /**
- *
- */
- public final void destroy()
- {
- cleanupPersistentState();
- dispose();
- }
-
- /**
- * Called by destroy before it calls dispose. Sub-class should
- * invalidate, and ideally delete, any persistent state.
- *
- * NOTE: DO NOT call dispose functionality from this call. The framework
- * will call dispose() immediately after cleanupPersistentState.
- */
- protected abstract void cleanupPersistentState();
-
- /**
- * Must be factories or caches when disposing the registry. Instances
- * must implement doDispose to provide their specific disposal operations.
- */
- public final void dispose()
- {
- // latch on the isDisposed flag so this block can only ever
- // execute once
- if (_isDisposed.compareAndSet(false, true))
- {
- fireEvent(new TagRegistryChangeEvent(this,
- TagRegistryChangeEvent.EventType.REGISTRY_DISPOSED));
- doDispose();
- }
- }
-
- /**
- * Implement with instance specific disposal operations. Do do not fire
- * the REGISTRY_DISPOSED event from this method (it is done in dispose.
- *
- * Implementer must assume that this method be called at most once and that
- * it is error to access the registry instance after it is called
- */
- protected abstract void doDispose();
-
- public final void refresh(final Runnable runAfter, final boolean flushCaches)
- {
- final Job refreshJob = getRefreshJob(flushCaches);
-
- final RunOnCompletionPattern runPattern = new RunOnCompletionPattern(
- refreshJob, runAfter);
- runPattern.run();
- }
-
- /**
- * @param flushCaches
- * @return a job that, when run, will perform the registry refresh. Job
- * must do any necessary synchronizing of internal state.
- */
- protected abstract Job getRefreshJob(final boolean flushCaches);
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/ITagRegistry.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/ITagRegistry.java
deleted file mode 100644
index 7bb3dde..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/ITagRegistry.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view.model;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.EventListener;
-import java.util.EventObject;
-import java.util.List;
-
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.Namespace;
-
-/**
- * A registry for tags for a given context TODO: generally tied to project, but
- * may also need a tie to specific tag-in-use type. For example, if JSPs and
- * Facelets are used at the same time?
- *
- * @author cbateman
- *
- */
-public interface ITagRegistry
-{
-
- /**
- * @return true if this registry is disposed. It is an error to use a
- * disposed registry and behaviour of such a registry is not
- * guaranteed.
- */
- public abstract boolean isDisposed();
-
- /**
- * This method may cause long-running operations to be executed. If runAfter
- * is non-null, any long running operations will schedule asynchronously on
- * a separate thread and on successful completion, runAfter will be executed
- * (no assumption should be made about what thread it is run on).
- *
- * @param runAfter
- * @param flushCaches true indicates that any cached data should be flushed.
- *
- */
- public abstract void refresh(final Runnable runAfter, final boolean flushCaches);
-
- /**
- * Callers should assume the collection is not modifiable. Implementers
- * may return a collection whose mutator operations throw exceptions.
- *
- * @return all tag libraries for a project tag registry
- */
- public abstract Collection<? extends Namespace> getAllTagLibraries();
-
- /**
- * @param uri
- * @return the tag library corresponding to uri or null if none.
- */
- public abstract Namespace getTagLibrary(final String uri);
-
- /**
- * Adds the listener to the list of objects that receive change events
- * from this tag registry instance. If listener is already in the list,
- * it will not be added again.
- *
- * @param listener
- */
- public abstract void addListener(ITagRegistryListener listener);
-
- /**
- * Remove listener from the list of objects that receive change events
- * from this tag registry instance.
- *
- * @param listener
- */
- public abstract void removeListener(ITagRegistryListener listener);
-
-
- /**
- * Marks a listener that receives tag registry change events
- *
- */
- interface ITagRegistryListener extends EventListener
- {
- /**
- * @param changeEvent
- */
- void registryChanged(final TagRegistryChangeEvent changeEvent);
- }
-
- /**
- * A change event object that communicates a single type of change to
- * a single tag registry
- *
- */
- static class TagRegistryChangeEvent extends EventObject
- {
- public enum EventType
- {
- // if the type is any of these three, then getAffectedObjects()
- // will return one or more Namespace objects that have changed.
- ADDED_NAMESPACE,
- REMOVED_NAMESPACE,
- CHANGED_NAMESPACE,
-
- // if the type is is this one, then the event is being called
- // before dispose operation on getSource().
- REGISTRY_DISPOSED
- }
- /**
- *
- */
- private static final long serialVersionUID = 6559096306615373552L;
- private final List<? extends Namespace> _affectedObjects;
- private final EventType _type;
-
- public TagRegistryChangeEvent(ITagRegistry source, EventType type)
- {
- this(source, type, Collections.EMPTY_LIST);
- }
-
- public TagRegistryChangeEvent(ITagRegistry source, EventType type,
- List<? extends Namespace> affectedObjects)
- {
- super(source);
- _affectedObjects = affectedObjects;
- _type = type;
- }
-
- @Override
- public ITagRegistry getSource()
- {
- return (ITagRegistry) super.getSource();
- }
-
- public List<? extends Namespace> getAffectedObjects()
- {
- return _affectedObjects;
- }
-
- public EventType getType()
- {
- return _type;
- }
- }
-}
\ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/TagRegistryFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/TagRegistryFactory.java
deleted file mode 100644
index a994a56..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/TagRegistryFactory.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view.model;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.jsf.common.internal.strategy.IIdentifiableStrategy;
-
-/**
- * Creates a tag registry for the given project. The factory may use
- * whatever mechanism it chooses and the tag registry may or may not be a
- * single instance for project.
- *
- * @author cbateman
- *
- */
-public abstract class TagRegistryFactory implements IIdentifiableStrategy<IProject, ITagRegistry, String>
-{
- private static final ITagRegistry NO_RESULT = null;
-
- private static final String ID = "org.eclipse.jst.jsf.designtime.view.model.TagRegistryFactory";
-
-
- /**
- * @param project
- * @return a tag registry for project. This instance may be a common
- * shared per-project singleton. The factory must ensure that the registry
- * is cleaned up if the associated project becomes inaccessible (see IProject.isAccessible).
- * Return null if none.
- *
- * @throws TagRegistryFactoryException
- */
- public abstract ITagRegistry createTagRegistry(final IProject project) throws TagRegistryFactoryException;
-
-
-
- public final ITagRegistry getNoResult()
- {
- return NO_RESULT;
- }
-
- public final ITagRegistry perform(IProject project) throws Exception
- {
- return createTagRegistry(project);
- }
-
-
-
- public String getId()
- {
- return ID;
- }
-
-
- /**
- * Wraps exceptions generated by trying to create a tag registry
- */
- public static class TagRegistryFactoryException extends Exception
- {
- /**
- * serializable id
- */
- private static final long serialVersionUID = 1361229535611361339L;
-
- /**
- * @param cause
- */
- public TagRegistryFactoryException(Throwable cause)
- {
- super("Problem during tag registry construction", cause);
- }
-
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/AbstractTagResolvingStrategy.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/AbstractTagResolvingStrategy.java
deleted file mode 100644
index 637ec96..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/AbstractTagResolvingStrategy.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view.model.jsp;
-
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ITagElement;
-
-/**
- * Implements the tag resolving strategy.
- *
- * @author cbateman
- *
- * @param <TLDELEMENT>
- * @param <IDTYPE>
- */
-public abstract class AbstractTagResolvingStrategy<TLDELEMENT, IDTYPE>
- implements ITagResolvingStrategy<TLDELEMENT, IDTYPE>
-{
- private final static ITagElement NOT_FOUND_INDICATOR = null;
-
- public ITagElement getNotFoundIndicator()
- {
- return NOT_FOUND_INDICATOR;
- }
-
- public abstract ITagElement resolve(TLDELEMENT element);
-
- public abstract IDTYPE getId();
-
- /**
- * Must always be the same as resolve.
- */
- public final ITagElement perform(TLDELEMENT element)
- {
- return resolve(element);
- }
-
- /**
- * Must always be the same as getNotFoundIndicator.
- */
- public final ITagElement getNoResult()
- {
- return getNotFoundIndicator();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/CMNodeNamedMapAdapter.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/CMNodeNamedMapAdapter.java
deleted file mode 100644
index 4a2ab0f..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/CMNodeNamedMapAdapter.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view.model.jsp;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ITagAttributeHandler;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.IAttributeAdvisor.UnknownAttributeException;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-
-/**
- * Adapts TLDDocument attributes to a simple map of ITagAttributeHandler. Map is
- * unmodifiable.
- *
- * @author cbateman
- *
- */
-public class CMNodeNamedMapAdapter implements
- Map<String, ITagAttributeHandler>, Serializable
-{
- /**
- * serializable id
- */
- private static final long serialVersionUID = -4188412823197830484L;
- private transient final TLDElementDeclaration _tldElement;
- private transient final IAttributeAdvisor _advisor;
- private transient AtomicBoolean _isInitialized = new AtomicBoolean(false);
- private final Map<String, ITagAttributeHandler> _cache;
-
- /**
- * @param tldDoc
- * @param advisor
- */
- public CMNodeNamedMapAdapter(final TLDElementDeclaration tldDoc,
- final IAttributeAdvisor advisor)
- {
- _tldElement = tldDoc;
- _advisor = advisor;
- _cache = new HashMap<String, ITagAttributeHandler>();
- }
-
- public boolean containsKey(Object key)
- {
- ensureAllAttributes();
- return _cache.containsKey(key);
- }
-
- public boolean containsValue(Object value)
- {
- ensureAllAttributes();
- return _cache.containsValue(value);
- }
-
- public Set<java.util.Map.Entry<String, ITagAttributeHandler>> entrySet()
- {
- ensureAllAttributes();
- return _cache.entrySet();
- }
-
-
- public ITagAttributeHandler get(Object key)
- {
- if (key instanceof String)
- {
- return getOrCreateAttribute((String) key);
- }
- return null;
- }
-
- public boolean isEmpty()
- {
- return size() == 0;
- }
-
- public Set<String> keySet()
- {
- ensureAllAttributes();
- return Collections.unmodifiableSet(_cache.keySet());
- }
-
- public int size()
- {
- if (_tldElement != null)
- {
- return _tldElement.getAttributes().getLength();
- }
- return _cache.size();
- }
-
- public Collection<ITagAttributeHandler> values()
- {
- ensureAllAttributes();
- return Collections.unmodifiableCollection(_cache.values());
- }
-
- private synchronized ITagAttributeHandler getOrCreateAttribute(final String name)
- {
- ITagAttributeHandler tagAttr = _cache.get(name);
-
- if (tagAttr == null)
- {
- try
- {
- tagAttr = _advisor.createAttributeHandler(name);
- _cache.put(name, tagAttr);
- }
- catch (UnknownAttributeException e)
- {
- JSFCorePlugin.log(e, "Trying to get attribute for "+name);
- }
- }
-
- return tagAttr;
- }
-
- private void ensureAllAttributes()
- {
- if (_isInitialized.compareAndSet(false, true))
- {
- for (final Iterator it = _tldElement.getAttributes().iterator(); it.hasNext();)
- {
- final CMAttributeDeclaration attrDecl = (CMAttributeDeclaration) it.next();
- getOrCreateAttribute(attrDecl.getAttrName());
- }
- }
- }
-
- public void clear()
- {
- throw new UnsupportedOperationException("Cannot modify map");
- }
-
- public ITagAttributeHandler put(String key, ITagAttributeHandler value)
- {
- throw new UnsupportedOperationException("Cannot modify map");
- }
-
- public void putAll(Map<? extends String, ? extends ITagAttributeHandler> t)
- {
- throw new UnsupportedOperationException("Cannot modify map");
- }
-
- public ITagAttributeHandler remove(Object key)
- {
- throw new UnsupportedOperationException("Cannot modify map");
- }
-
- private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException
- {
- in.defaultReadObject();
- _isInitialized = new AtomicBoolean(true);
- }
-
- private void writeObject(final ObjectOutputStream out) throws IOException
- {
- ensureAllAttributes();
- out.defaultWriteObject();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/CompositeTagResolvingStrategy.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/CompositeTagResolvingStrategy.java
deleted file mode 100644
index bfcf32d..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/CompositeTagResolvingStrategy.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view.model.jsp;
-
-import org.eclipse.jst.jsf.common.internal.policy.IIdentifiable;
-import org.eclipse.jst.jsf.common.internal.policy.IIteratorPolicy;
-import org.eclipse.jst.jsf.common.internal.strategy.IteratorPolicyBasedStrategyComposite;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ITagElement;
-
-/**
- * @author cbateman
- *
- * @param <TLDELEMENT>
- */
-public class CompositeTagResolvingStrategy<TLDELEMENT>
- extends
- IteratorPolicyBasedStrategyComposite<TLDELEMENT, ITagElement, String, ITagResolvingStrategy<TLDELEMENT, String>>
- implements IIdentifiable<String>,
- ITagResolvingStrategy<TLDELEMENT, String>
-{
- private static final String ID = "org.eclipse.jst.jsf.designtime.CompositeTagResolvingStrategy";
-
- /**
- * @param policy
- *
- */
- public CompositeTagResolvingStrategy(final IIteratorPolicy<String> policy)
- {
- super(policy);
- }
-
- public final String getId()
- {
- return ID;
- }
-
- public final String getDisplayName()
- {
- return "Composite Tag Resolving Strategies";
- }
-
- @Override
- public ITagElement getNoResult()
- {
- return null;
- }
-
- public final ITagElement getNotFoundIndicator()
- {
- return getNoResult();
- }
-
- public final ITagElement resolve(TLDELEMENT element)
- {
- return perform(element);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/DefaultJSPTagResolver.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/DefaultJSPTagResolver.java
deleted file mode 100644
index a1dfc16..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/DefaultJSPTagResolver.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view.model.jsp;
-
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jst.jsf.common.dom.TagIdentifier;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentTypeInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ConverterTypeInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ValidatorTypeInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.types.TypeInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ITagElement;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.IHandlerTagElement.TagHandlerType;
-import org.eclipse.jst.jsf.core.internal.tld.TagIdentifierFactory;
-import org.eclipse.jst.jsf.designtime.internal.Messages;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.ViewMetadataLoader;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.ViewMetadataMapper;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagMapping;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagToViewObjectMapping;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.IAttributeAdvisor.NullAttributeAdvisor;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDElementDeclaration;
-import org.osgi.framework.Version;
-
-/**
- * ** TEMPORARY CLASS UNTIL META-DATA STRATEGY IS AVAILABLE **
- *
- * @author cbateman
- *
- */
-public class DefaultJSPTagResolver extends JSPTagResolvingStrategy
-{
- /**
- * strategy id
- */
- public final static String ID = "org.eclipse.jst.jsf.metadata.DefaultJSPTagResolver"; //$NON-NLS-1$
- /**
- * displayable nameb
- */
- public final static String DISPLAY_NAME = Messages.DefaultJSPTagResolver_DisplayName;
-
- private final ViewMetadataLoader _loader;
- private final ViewMetadataMapper _mapper;
-
- /**
- * @param project
- */
- public DefaultJSPTagResolver(final IProject project)
- {
- _loader = new ViewMetadataLoader(project);
- _mapper = new ViewMetadataMapper();
- }
-
- @Override
- public ITagElement resolve(final TLDElementDeclaration elementDecl)
- {
- // final IProjectFacetVersion version = JSFAppConfigUtils
- // .getProjectFacet(_project);
- // final String versionAsString = version.getVersionString();
- // final JSFVersion jsfVersion = JSFVersion.valueOfString(versionAsString);
-
- final TagIdentifier tagId = TagIdentifierFactory
- .createTLDTagWrapper(elementDecl);
- // final DefaultTagTypeInfo defaultTagTypeInfo = new DefaultTagTypeInfo();
- final TagMapping mapping = _loader.getTagToViewMapping(tagId);
-
- TypeInfo elementType = null;
- if (mapping != null)
- {
- elementType = findTypeInfo(mapping, "1.1", null); //$NON-NLS-1$
- }
-
- if (elementType instanceof ComponentTypeInfo)
- {
- return new TLDComponentTagElement(elementDecl,
- (ComponentTypeInfo) elementType, new MetadataAttributeAdvisor(tagId, _loader));
- }
- else if (elementType instanceof ConverterTypeInfo)
- {
- return new TLDConverterTagElement(elementDecl,
- (ConverterTypeInfo) elementType, new MetadataAttributeAdvisor(tagId, _loader));
- }
- else if (elementType instanceof ValidatorTypeInfo)
- {
- return new TLDValidatorTagElement(elementDecl,
- (ValidatorTypeInfo) elementType, new MetadataAttributeAdvisor(tagId, _loader));
- }
- else if (elementType instanceof TagHandlerType)
- {
- return new TLDTagHandlerElement(elementDecl,
- (TagHandlerType) elementType, new MetadataAttributeAdvisor(tagId, _loader));
- }
- else if (DefaultTagTypeInfo.isDefaultLib(tagId.getUri()))
- {
- return new TLDTagElement(elementDecl, new NullAttributeAdvisor());
- }
-
- // not found
- return null;
- }
-
- private TypeInfo findTypeInfo(final TagMapping mapping, final String jsfVersion,
- final String libVersion)
- {
- final EList list = mapping.getVersionedTagToViewMappings();
-
- FIND_BY_VERSION : for (final Iterator<?> it = list.iterator(); it.hasNext();)
- {
- Object obj = it.next();
-
- if (obj instanceof TagToViewObjectMapping)
- {
- final TagToViewObjectMapping viewMapping = (TagToViewObjectMapping) obj;
-
- final String minJsfVersionString = viewMapping.getMinJSFVersion();
- if (minJsfVersionString != null)
- {
- try
- {
- final Version version = new Version(jsfVersion);
- final Version minVersion = Version.parseVersion(minJsfVersionString);
-
- if (version.compareTo(minVersion) < 0)
- {
- // my version is less than the minimum specified
- // by this meta-data
- continue FIND_BY_VERSION;
- }
- }
- catch (final IllegalArgumentException iae)
- {
- continue FIND_BY_VERSION;
- }
- }
- final String minLibVersionString = viewMapping.getMinLibraryVersion();
- if (libVersion != null && minLibVersionString != null)
- {
- try
- {
- final Version version = new Version(libVersion);
- final Version minLibVersion = Version.parseVersion(minLibVersionString);
-
- if (version.compareTo(minLibVersion) < 0)
- {
- // my lib version is less than the minimum specified
- // by the meta-data
- continue FIND_BY_VERSION;
- }
- }
- catch (IllegalArgumentException iae)
- {
- continue FIND_BY_VERSION;
- }
- }
- return _mapper.mapToFrameworkData(viewMapping.getTypeInfo());
- }
- }
- return null;
- }
-
- @Override
- public String getId()
- {
- return ID;
- }
-
- public String getDisplayName()
- {
- return DISPLAY_NAME;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/DefaultTagTypeInfo.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/DefaultTagTypeInfo.java
deleted file mode 100644
index 989e03b..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/DefaultTagTypeInfo.java
+++ /dev/null
@@ -1,655 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view.model.jsp;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.jst.jsf.common.dom.TagIdentifier;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentTypeInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ConverterTypeInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ValidatorTypeInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.types.TypeInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.IHandlerTagElement.TagHandlerType;
-import org.eclipse.jst.jsf.core.JSFVersion;
-import org.eclipse.jst.jsf.core.internal.tld.IJSFConstants;
-import org.eclipse.jst.jsf.core.internal.tld.ITLDConstants;
-
-/**
- * Hard-coded TypeInfo for default core and html JSF tags.
- *
- * @author cbateman
- *
- */
-public final class DefaultTagTypeInfo
-{
- private final static Set<String> URI_IS_A_JSF_LIB;
-
- static
- {
- final Set<String> libs = new HashSet<String>();
- libs.add(ITLDConstants.URI_JSF_CORE);
- libs.add(ITLDConstants.URI_JSF_HTML);
- URI_IS_A_JSF_LIB = Collections.unmodifiableSet(libs);
- }
-
- /**
- * @param tagId
- * @param jsfVersion
- * @return a type info for the tag id in jsf version or null if none.
- */
- public TypeInfo getTypeInfo(final TagIdentifier tagId,
- final JSFVersion jsfVersion)
- {
-
- switch (jsfVersion)
- {
- case V1_0:
- case V1_1:
- return JSF11_ELEMENTS.get(tagId);
-
- case V1_2:
- return JSF12_ELEMENTS.get(tagId);
-
- default:
- return null;
- }
- }
-
- /**
- * @param uri
- * @return true if uri is covered by this class
- */
- public static boolean isDefaultLib(final String uri)
- {
- return URI_IS_A_JSF_LIB.contains(uri);
- }
-
- private static final ComponentTypeInfo COMPINFO_PARAM = new ComponentTypeInfo(
- "javax.faces.Parameter",
- "javax.faces.component.UIParameter",
- new String[]
- {
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- { "javax.faces.component.StateHolder", },
- "javax.faces.Parameter",
- null);
-
- private static final ComponentTypeInfo COMPINFO_SELECTITEM = new ComponentTypeInfo(
- "javax.faces.SelectItem",
- "javax.faces.component.UISelectItem",
- new String[]
- {
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- { "javax.faces.component.StateHolder", },
- "javax.faces.SelectItem",
- null);
-
- private static final ComponentTypeInfo COMPINFO_SELECTITEMS = new ComponentTypeInfo(
- "javax.faces.SelectItems",
- "javax.faces.component.UISelectItems",
- new String[]
- {
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- { "javax.faces.component.StateHolder", },
- "javax.faces.SelectItems",
- null);
-
- private static final ComponentTypeInfo COMPINFO_SUBVIEW = new ComponentTypeInfo(
- "javax.faces.NamingContainer",
- "javax.faces.component.UINamingContainer",
- new String[]
- {
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- {
- "javax.faces.component.NamingContainer",
- "javax.faces.component.StateHolder", },
- "javax.faces.NamingContainer",
- null);
-
- private static final ComponentTypeInfo COMPINFO_VERBATIM = new ComponentTypeInfo(
- "javax.faces.Output",
- "javax.faces.component.UIOutput",
- new String[]
- {
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- {
- "javax.faces.component.ValueHolder",
- "javax.faces.component.StateHolder", },
- "javax.faces.Output",
- "javax.faces.Text");
-
- private static final ComponentTypeInfo COMPINFO_VIEW = new ComponentTypeInfo(
- "javax.faces.ViewRoot",
- "javax.faces.component.UIViewRoot",
- new String[]
- {
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- { "javax.faces.component.StateHolder", },
- "javax.faces.ViewRoot",
- null);
-
- // expected type info for jsf/html components
- private static final ComponentTypeInfo COMPINFO_COLUMN = new ComponentTypeInfo(
- "javax.faces.Column",
- "javax.faces.component.UIColumn",
- new String[]
- {
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object" },
- new String[]
- { "javax.faces.component.StateHolder" },
- "javax.faces.Column",
- null);
- private static final ComponentTypeInfo COMPINFO_COMMAND = new ComponentTypeInfo(
- "javax.faces.HtmlCommandButton",
- "javax.faces.component.html.HtmlCommandButton",
- new String[]
- {
- "javax.faces.component.UICommand",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object" },
- new String[]
- {
- "javax.faces.component.ActionSource",
- "javax.faces.component.StateHolder" },
- "javax.faces.Command",
- "javax.faces.Button");
- private static final ComponentTypeInfo COMPINFO_COMMANDLINK = new ComponentTypeInfo(
- "javax.faces.HtmlCommandLink",
- "javax.faces.component.html.HtmlCommandLink",
- new String[]
- {
- "javax.faces.component.UICommand",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object" },
- new String[]
- {
- "javax.faces.component.ActionSource",
- "javax.faces.component.StateHolder" },
- "javax.faces.Command",
- "javax.faces.Link");
- private static final ComponentTypeInfo COMPINFO_DATATABLE = new ComponentTypeInfo(
- "javax.faces.HtmlDataTable",
- "javax.faces.component.html.HtmlDataTable",
- new String[]
- {
- "javax.faces.component.UIData",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object" },
- new String[]
- {
- "javax.faces.component.NamingContainer",
- "javax.faces.component.StateHolder" },
- "javax.faces.Data",
- "javax.faces.Table");
- private static final ComponentTypeInfo COMPINFO_FORM = new ComponentTypeInfo(
- "javax.faces.HtmlForm",
- "javax.faces.component.html.HtmlForm",
- new String[]
- {
- "javax.faces.component.UIForm",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object" },
- new String[]
- {
- "javax.faces.component.NamingContainer",
- "javax.faces.component.StateHolder" },
- "javax.faces.Form",
- "javax.faces.Form");
- private static final ComponentTypeInfo COMPINFO_GRAPHIC = new ComponentTypeInfo(
- "javax.faces.HtmlGraphicImage",
- "javax.faces.component.html.HtmlGraphicImage",
- new String[]
- {
- "javax.faces.component.UIGraphic",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- { "javax.faces.component.StateHolder", },
- "javax.faces.Graphic",
- "javax.faces.Image");
- private static final ComponentTypeInfo COMPINFO_HIDDEN = new ComponentTypeInfo(
- "javax.faces.HtmlInputHidden",
- "javax.faces.component.html.HtmlInputHidden",
- new String[]
- {
- "javax.faces.component.UIInput", "javax.faces.component.UIOutput",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- {
- "javax.faces.component.EditableValueHolder",
- "javax.faces.component.ValueHolder",
- "javax.faces.component.StateHolder", },
- "javax.faces.Input",
- "javax.faces.Hidden");
- private static final ComponentTypeInfo COMPINFO_SECRET = new ComponentTypeInfo(
- "javax.faces.HtmlInputSecret",
- "javax.faces.component.html.HtmlInputSecret",
- new String[]
- {
- "javax.faces.component.UIInput", "javax.faces.component.UIOutput",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- {
- "javax.faces.component.EditableValueHolder",
- "javax.faces.component.ValueHolder",
- "javax.faces.component.StateHolder" },
- "javax.faces.Input",
- "javax.faces.Secret");
- private static final ComponentTypeInfo COMPINFO_INPUTTEXT = new ComponentTypeInfo(
- "javax.faces.HtmlInputText",
- "javax.faces.component.html.HtmlInputText",
- new String[]
- {
- "javax.faces.component.UIInput", "javax.faces.component.UIOutput",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object" },
- new String[]
- {
- "javax.faces.component.EditableValueHolder",
- "javax.faces.component.ValueHolder",
- "javax.faces.component.StateHolder" },
- "javax.faces.Input",
- "javax.faces.Text");
- private static final ComponentTypeInfo COMPINFO_INPUTTEXTAREA = new ComponentTypeInfo(
- "javax.faces.HtmlInputTextarea",
- "javax.faces.component.html.HtmlInputTextarea",
- new String[]
- {
- "javax.faces.component.UIInput", "javax.faces.component.UIOutput",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- {
- "javax.faces.component.EditableValueHolder",
- "javax.faces.component.ValueHolder",
- "javax.faces.component.StateHolder", },
- "javax.faces.Input",
- "javax.faces.Textarea");
- private static final ComponentTypeInfo COMPINFO_MESSAGE = new ComponentTypeInfo(
- "javax.faces.HtmlMessage",
- "javax.faces.component.html.HtmlMessage",
- new String[]
- {
- "javax.faces.component.UIMessage",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- { "javax.faces.component.StateHolder", },
- "javax.faces.Message",
- "javax.faces.Message");
- private static final ComponentTypeInfo COMPINFO_MESSAGES = new ComponentTypeInfo(
- "javax.faces.HtmlMessages",
- "javax.faces.component.html.HtmlMessages",
- new String[]
- {
- "javax.faces.component.UIMessages",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- { "javax.faces.component.StateHolder", },
- "javax.faces.Messages",
- "javax.faces.Messages");
- private static final ComponentTypeInfo COMPINFO_OUTPUTFORMAT = new ComponentTypeInfo(
- "javax.faces.HtmlOutputFormat",
- "javax.faces.component.html.HtmlOutputFormat",
- new String[]
- {
- "javax.faces.component.UIOutput",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- {
- "javax.faces.component.ValueHolder",
- "javax.faces.component.StateHolder", },
- "javax.faces.Output",
- "javax.faces.Format");
- private static final ComponentTypeInfo COMPINFO_OUTPUTLABEL = new ComponentTypeInfo(
- "javax.faces.HtmlOutputLabel",
- "javax.faces.component.html.HtmlOutputLabel",
- new String[]
- {
- "javax.faces.component.UIOutput",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- {
- "javax.faces.component.ValueHolder",
- "javax.faces.component.StateHolder", },
- "javax.faces.Output",
- "javax.faces.Label");
- private static final ComponentTypeInfo COMPINFO_OUTPUTLINK = new ComponentTypeInfo(
- "javax.faces.HtmlOutputLink",
- "javax.faces.component.html.HtmlOutputLink",
- new String[]
- {
- "javax.faces.component.UIOutput",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- {
- "javax.faces.component.ValueHolder",
- "javax.faces.component.StateHolder", },
- "javax.faces.Output",
- "javax.faces.Link");
- private static final ComponentTypeInfo COMPINFO_OUTPUTTEXT = new ComponentTypeInfo(
- "javax.faces.HtmlOutputText",
- "javax.faces.component.html.HtmlOutputText",
- new String[]
- {
- "javax.faces.component.UIOutput",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- {
- "javax.faces.component.ValueHolder",
- "javax.faces.component.StateHolder", },
- "javax.faces.Output",
- "javax.faces.Text");
- private static final ComponentTypeInfo COMPINFO_PANELGRID = new ComponentTypeInfo(
- "javax.faces.HtmlPanelGrid",
- "javax.faces.component.html.HtmlPanelGrid",
- new String[]
- {
- "javax.faces.component.UIPanel",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- { "javax.faces.component.StateHolder", },
- "javax.faces.Panel",
- "javax.faces.Grid");
- private static final ComponentTypeInfo COMPINFO_PANELGROUP = new ComponentTypeInfo(
- "javax.faces.HtmlPanelGroup",
- "javax.faces.component.html.HtmlPanelGroup",
- new String[]
- {
- "javax.faces.component.UIPanel",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- { "javax.faces.component.StateHolder", },
- "javax.faces.Panel",
- "javax.faces.Group");
- private static final ComponentTypeInfo COMPINFO_SELECTBOOLEANCHECKBOX = new ComponentTypeInfo(
- "javax.faces.HtmlSelectBooleanCheckbox",
- "javax.faces.component.html.HtmlSelectBooleanCheckbox",
- new String[]
- {
- "javax.faces.component.UISelectBoolean",
- "javax.faces.component.UIInput", "javax.faces.component.UIOutput",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- {
- "javax.faces.component.EditableValueHolder",
- "javax.faces.component.ValueHolder",
- "javax.faces.component.StateHolder", },
- "javax.faces.SelectBoolean",
- "javax.faces.Checkbox");
- private static final ComponentTypeInfo COMPINFO_SELECTMANYCHECKBOX = new ComponentTypeInfo(
- "javax.faces.HtmlSelectManyCheckbox",
- "javax.faces.component.html.HtmlSelectManyCheckbox",
- new String[]
- {
- "javax.faces.component.UISelectMany",
- "javax.faces.component.UIInput", "javax.faces.component.UIOutput",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- {
- "javax.faces.component.EditableValueHolder",
- "javax.faces.component.ValueHolder",
- "javax.faces.component.StateHolder", },
- "javax.faces.SelectMany",
- "javax.faces.Checkbox");
- private static final ComponentTypeInfo COMPINFO_SELECTMANYLISTBOX = new ComponentTypeInfo(
- "javax.faces.HtmlSelectManyListbox",
- "javax.faces.component.html.HtmlSelectManyListbox",
- new String[]
- {
- "javax.faces.component.UISelectMany",
- "javax.faces.component.UIInput", "javax.faces.component.UIOutput",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- {
- "javax.faces.component.EditableValueHolder",
- "javax.faces.component.ValueHolder",
- "javax.faces.component.StateHolder", },
- "javax.faces.SelectMany",
- "javax.faces.Listbox");
- private static final ComponentTypeInfo COMPINFO_SELECTMANYMENU = new ComponentTypeInfo(
- "javax.faces.HtmlSelectManyMenu",
- "javax.faces.component.html.HtmlSelectManyMenu",
- new String[]
- {
- "javax.faces.component.UISelectMany",
- "javax.faces.component.UIInput", "javax.faces.component.UIOutput",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- {
- "javax.faces.component.EditableValueHolder",
- "javax.faces.component.ValueHolder",
- "javax.faces.component.StateHolder", },
- "javax.faces.SelectMany",
- "javax.faces.Menu");
- private static final ComponentTypeInfo COMPINFO_SELECTONELISTBOX = new ComponentTypeInfo(
- "javax.faces.HtmlSelectOneListbox",
- "javax.faces.component.html.HtmlSelectOneListbox",
- new String[]
- {
- "javax.faces.component.UISelectOne",
- "javax.faces.component.UIInput", "javax.faces.component.UIOutput",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- {
- "javax.faces.component.EditableValueHolder",
- "javax.faces.component.ValueHolder",
- "javax.faces.component.StateHolder", },
- "javax.faces.SelectOne",
- "javax.faces.Listbox");
- private static final ComponentTypeInfo COMPINFO_SELECTONEMENU = new ComponentTypeInfo(
- "javax.faces.HtmlSelectOneMenu",
- "javax.faces.component.html.HtmlSelectOneMenu",
- new String[]
- {
- "javax.faces.component.UISelectOne",
- "javax.faces.component.UIInput", "javax.faces.component.UIOutput",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- {
- "javax.faces.component.EditableValueHolder",
- "javax.faces.component.ValueHolder",
- "javax.faces.component.StateHolder", },
- "javax.faces.SelectOne",
- "javax.faces.Menu");
- private static final ComponentTypeInfo COMPINFO_SELECTONERADIO = new ComponentTypeInfo(
- "javax.faces.HtmlSelectOneRadio",
- "javax.faces.component.html.HtmlSelectOneRadio",
- new String[]
- {
- "javax.faces.component.UISelectOne",
- "javax.faces.component.UIInput", "javax.faces.component.UIOutput",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- {
- "javax.faces.component.EditableValueHolder",
- "javax.faces.component.ValueHolder",
- "javax.faces.component.StateHolder", },
- "javax.faces.SelectOne",
- "javax.faces.Radio");
-
- // default converters
- private static final ConverterTypeInfo CONVERTERINFO_DATETIME = new ConverterTypeInfo(
- "javax.faces.convert.DateTimeConverter",
- "javax.faces.DateTime");
-
- private static final ConverterTypeInfo CONVERTERINFO_NUMBER = new ConverterTypeInfo(
- "javax.faces.convert.NumberConverter",
- "javax.faces.Number");
-
- // default validators
- private static final ValidatorTypeInfo VALIDATORINFO_DOUBLERANGE = new ValidatorTypeInfo(
- "javax.faces.validator.DoubleRangeValidator",
- "javax.faces.DoubleRange");
-
- private static final ValidatorTypeInfo VALIDATORINFO_LENGTH = new ValidatorTypeInfo(
- "javax.faces.validator.LengthValidator",
- "javax.faces.Length");
-
- private static final ValidatorTypeInfo VALIDATORINFO_LONGRANGE = new ValidatorTypeInfo(
- "javax.faces.validator.LongRangeValidator",
- "javax.faces.LongRange");
-
- private static Map<TagIdentifier, TypeInfo> JSF11_ELEMENTS;
- private static Map<TagIdentifier, TypeInfo> JSF12_ELEMENTS;
-
- static
- {
- final Map<TagIdentifier, TypeInfo> commonElements = new HashMap<TagIdentifier, TypeInfo>();
- // IJSFConstants.TAG_IDENTIFIER_PHASELISTENER);
- // IJSFConstants.TAG_IDENTIFIER_SETPROPERTYACTIONLISTENER);
-
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_ACTIONLISTENER,
- TagHandlerType.ACTIONLISTENER);
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_ATTRIBUTE,
- TagHandlerType.ATTRIBUTE);
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_CONVERTDATETIME,
- CONVERTERINFO_DATETIME);
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_CONVERTER,
- ConverterTypeInfo.UNKNOWN);
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_CONVERTNUMBER,
- CONVERTERINFO_NUMBER);
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_FACET, TagHandlerType.FACET);
- // elements.put(IJSFConstants.TAG_IDENTIFIER_LOADBUNDLE,
- // TagHandlerType.);
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_PARAM, COMPINFO_PARAM);
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_SELECTITEM,
- COMPINFO_SELECTITEM);
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_SELECTITEMS,
- COMPINFO_SELECTITEMS);
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_SUBVIEW, COMPINFO_SUBVIEW);
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_VALIDATEDOUBLERANGE,
- VALIDATORINFO_DOUBLERANGE);
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_VALIDATELENGTH,
- VALIDATORINFO_LENGTH);
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_VALIDATELONGRANGE,
- VALIDATORINFO_LONGRANGE);
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_VALIDATOR,
- ValidatorTypeInfo.UNKNOWN);
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_VALUECHANGELISTENER,
- TagHandlerType.VALUECHANGELISTENER);
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_VERBATIM, COMPINFO_VERBATIM);
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_VIEW, COMPINFO_VIEW);
-
- // JSF 1.2 core elements
- // none currently...
-
- // JSF 1.1/1.2 HTML tags
- // html verifier
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_COLUMN, COMPINFO_COLUMN);
-
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_COMMANDBUTTON,
- COMPINFO_COMMAND);
-
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_COMMANDLINK,
- COMPINFO_COMMANDLINK);
-
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_DATA_TABLE,
- COMPINFO_DATATABLE);
-
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_FORM, COMPINFO_FORM);
-
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_GRAPHICIMAGE,
- COMPINFO_GRAPHIC);
-
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_INPUTHIDDEN, COMPINFO_HIDDEN);
-
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_INPUTSECRET, COMPINFO_SECRET);
-
- commonElements
- .put(IJSFConstants.TAG_IDENTIFIER_INPUTTEXT, COMPINFO_INPUTTEXT);
-
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_INPUTTEXTAREA,
- COMPINFO_INPUTTEXTAREA);
-
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_MESSAGE, COMPINFO_MESSAGE);
-
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_MESSAGES, COMPINFO_MESSAGES);
-
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_OUTPUTFORMAT,
- COMPINFO_OUTPUTFORMAT);
-
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_OUTPUTLABEL,
- COMPINFO_OUTPUTLABEL);
-
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_OUTPUTLINK,
- COMPINFO_OUTPUTLINK);
-
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_OUTPUTTEXT,
- COMPINFO_OUTPUTTEXT);
-
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_PANEL_GRID,
- COMPINFO_PANELGRID);
-
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_PANEL_GROUP,
- COMPINFO_PANELGROUP);
-
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_SELECTBOOLEANCHECKBOX,
- COMPINFO_SELECTBOOLEANCHECKBOX);
-
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_SELECTMANYCHECKBOX,
- COMPINFO_SELECTMANYCHECKBOX);
-
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_SELECTMANYLISTBOX,
- COMPINFO_SELECTMANYLISTBOX);
-
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_SELECTMANYMENU,
- COMPINFO_SELECTMANYMENU);
-
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_SELECTONELISTBOX,
- COMPINFO_SELECTONELISTBOX);
-
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_SELECTONEMENU,
- COMPINFO_SELECTONEMENU);
-
- commonElements.put(IJSFConstants.TAG_IDENTIFIER_SELECTONERADIO,
- COMPINFO_SELECTONERADIO);
-
- JSF11_ELEMENTS = Collections.unmodifiableMap(commonElements);
-
- JSF12_ELEMENTS = Collections
- .unmodifiableMap(new HashMap<TagIdentifier, TypeInfo>(commonElements));
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/IAttributeAdvisor.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/IAttributeAdvisor.java
deleted file mode 100644
index f473ab3..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/IAttributeAdvisor.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view.model.jsp;
-
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ITagAttributeHandler;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.TagAttributeHandler;
-
-/**
- * @author cbateman
- *
- */
-public interface IAttributeAdvisor
-{
-
- /**
- * @param name
- * @return a tag attribute handler for the name.
- * @throws UnknownAttributeException if name does not match a known attribute.
- */
- ITagAttributeHandler createAttributeHandler(String name) throws UnknownAttributeException;
-
- /**
- * @author cbateman
- *
- */
- public static class NullAttributeAdvisor implements IAttributeAdvisor
- {
- public ITagAttributeHandler createAttributeHandler(String name)
- throws UnknownAttributeException
- {
- return new TagAttributeHandler(null, name, false);
- }
- }
-
- /**
- * Indicates an unknown attribute was requested or encountered
- * @author cbateman
- *
- */
- public static class UnknownAttributeException extends Exception
- {
- /**
- *
- */
- private static final long serialVersionUID = -988838913707929315L;
-
- /**
- *
- */
- public UnknownAttributeException()
- {
- super();
- }
-
- /**
- * @param message
- * @param cause
- */
- public UnknownAttributeException(String message, Throwable cause)
- {
- super(message, cause);
- }
-
- /**
- * @param message
- */
- public UnknownAttributeException(String message)
- {
- super(message);
- }
-
- /**
- * @param cause
- */
- public UnknownAttributeException(Throwable cause)
- {
- super(cause);
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/ITagResolvingStrategy.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/ITagResolvingStrategy.java
deleted file mode 100644
index 4befb22..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/ITagResolvingStrategy.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view.model.jsp;
-
-import org.eclipse.jst.jsf.common.internal.strategy.IIdentifiableStrategy;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ITagElement;
-
-/**
- * Describes an algorithm that can produce ITagElements from <TLD> objects.
- *
- * @author cbateman
- * @param <TLDELEMENT> the object type that describes a tag library.
- * @param <IDTYPE>
- *
- */
-public interface ITagResolvingStrategy<TLDELEMENT, IDTYPE> extends
- IIdentifiableStrategy<TLDELEMENT, ITagElement, IDTYPE>
-{
- /**
- * @param element
- * @return a new tag element or {@link #getNotFoundIndicator()} if not found
- */
- ITagElement resolve(TLDELEMENT element);
-
- /**
- * @return the ITagElement (may be null) that indicates that
- * resolve(TLDELEMENT) could not resolve a tag. The return
- * must be testable with standard "==" operator and not equals().
- */
- ITagElement getNotFoundIndicator();
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/JSPTagResolvingStrategy.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/JSPTagResolvingStrategy.java
deleted file mode 100644
index ad7a0f9..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/JSPTagResolvingStrategy.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view.model.jsp;
-
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ITagElement;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDElementDeclaration;
-
-/**
- * A strategy for resolving JSP TLDs.
- *
- * @author cbateman
- *
- */
-public abstract class JSPTagResolvingStrategy extends
- AbstractTagResolvingStrategy<TLDElementDeclaration, String>
-{
- @Override
- public abstract ITagElement resolve(TLDElementDeclaration element);
-
- public abstract String getId();
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/MetadataAttributeAdvisor.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/MetadataAttributeAdvisor.java
deleted file mode 100644
index c85ec8a..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/MetadataAttributeAdvisor.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view.model.jsp;
-
-import org.eclipse.jst.jsf.common.dom.TagIdentifier;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ComponentPropertyHandler;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ITagAttributeHandler;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.TagAttributeHandler;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.ViewMetadataLoader;
-import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.AttributeToPropertyMapping;
-
-/* package */class MetadataAttributeAdvisor implements IAttributeAdvisor
-{
- private final TagIdentifier _tagId;
- private final ViewMetadataLoader _loader;
-
- public MetadataAttributeAdvisor(final TagIdentifier tagId,
- final ViewMetadataLoader loader)
- {
- _tagId = tagId;
- _loader = loader;
- }
-
- public ITagAttributeHandler createAttributeHandler(final String name)
- throws UnknownAttributeException
- {
- final AttributeToPropertyMapping mapping = _loader.getAttributeMapping(
- _tagId, name);
- if (mapping != null)
- {
- final String customHandler = mapping.getCustomConversionFactoryId();
- final boolean isELAllowed = mapping.isElAllowed();
- final String propertyName = mapping.getPropertyName();
- if (propertyName != null)
- {
- return new ComponentPropertyHandler(customHandler, name,
- isELAllowed, propertyName);
- }
- return new TagAttributeHandler(customHandler, name, isELAllowed);
- }
- return new TagAttributeHandler(null, name, false);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/TLDComponentTagElement.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/TLDComponentTagElement.java
deleted file mode 100644
index 4e081bd..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/TLDComponentTagElement.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view.model.jsp;
-
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentTypeInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.IComponentTagElement;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDElementDeclaration;
-
-
-
-/**
- * A TLD-defined tag (i.e. JSP) that maps one-to-one with a JSF UIComponent
- * @author cbateman
- *
- */
-public class TLDComponentTagElement extends TLDJSFTagElement implements
-IComponentTagElement
-{
- /**
- *
- */
- private static final long serialVersionUID = -6479445622102799425L;
- private final ComponentTypeInfo _componentTypeInfo;
-
- /**
- * @param elementDecl
- * @param componentTypeInfo
- * @param advisor
- */
- public TLDComponentTagElement(final TLDElementDeclaration elementDecl
- , final ComponentTypeInfo componentTypeInfo, final IAttributeAdvisor advisor)
- {
- super(elementDecl, advisor);
- _componentTypeInfo = componentTypeInfo;
- }
-
- public ComponentTypeInfo getComponent()
- {
- return _componentTypeInfo;
- }
-
- @Override
- public TagType getType()
- {
- return TagType.COMPONENT;
- }
-
- @Override
- public String toString()
- {
- final String attributes = constructAttributesString();
- return _componentTypeInfo.toString() +
- (!"".equals(attributes) ? "\n" + attributes : "");
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/TLDConverterTagElement.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/TLDConverterTagElement.java
deleted file mode 100644
index 257a6f4..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/TLDConverterTagElement.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view.model.jsp;
-
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ConverterTypeInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.IConverterTagElement;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDElementDeclaration;
-
-/**
- * A TLD-defined tag (i.e. JSP) that maps one-to-one with a JSF Converter
- *
- * @author cbateman
- *
- */
-public class TLDConverterTagElement extends TLDJSFTagElement implements IConverterTagElement
-{
- /**
- *
- */
- private static final long serialVersionUID = 2854457220470229847L;
- private final ConverterTypeInfo _converterTypeInfo;
-
- /**
- * @param elementDecl
- * @param converterTypeInfo
- * @param advisor
- */
- public TLDConverterTagElement(final TLDElementDeclaration elementDecl, final ConverterTypeInfo converterTypeInfo, final IAttributeAdvisor advisor)
- {
- super(elementDecl, advisor);
- _converterTypeInfo = converterTypeInfo;
- }
-
- @Override
- public TagType getType()
- {
- return TagType.CONVERTER;
- }
-
- /**
- * @return the type info for this converter
- */
- public final ConverterTypeInfo getConverter()
- {
- return _converterTypeInfo;
- }
-
- @Override
- public String toString()
- {
- return _converterTypeInfo.toString();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/TLDJSFTagElement.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/TLDJSFTagElement.java
deleted file mode 100644
index 58f88a8..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/TLDJSFTagElement.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view.model.jsp;
-
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.IJSFTagElement;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDElementDeclaration;
-
-/**
- * A JSF tag element.
- *
- * @author cbateman
- *
- */
-public abstract class TLDJSFTagElement extends TLDTagElement implements
- IJSFTagElement
-{
- /**
- *
- */
- private static final long serialVersionUID = -7629153104201317346L;
-
- /**
- * @param elementDecl
- * @param advisor
- */
- public TLDJSFTagElement(final TLDElementDeclaration elementDecl
- , final IAttributeAdvisor advisor)
- {
- super(elementDecl, advisor);
- }
-
- public abstract TagType getType();
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/TLDNamespace.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/TLDNamespace.java
deleted file mode 100644
index b2721db..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/TLDNamespace.java
+++ /dev/null
@@ -1,314 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view.model.jsp;
-
-import java.io.Serializable;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.jobs.ILock;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ITagElement;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.Namespace;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.persistence.SerializableTLDNamespace;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDDocument;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Represents a JSP tag library namespace
- *
- * @author cbateman
- *
- */
-public class TLDNamespace extends Namespace
-{
- /**
- *
- */
- private static final long serialVersionUID = 9206460825737988441L;
- private TLDNamespaceData _tldData;
-
- /**
- * @param tldDoc
- * @param tagResolver
- */
- public TLDNamespace(
- final TLDDocument tldDoc,
- final ITagResolvingStrategy<TLDElementDeclaration, String> tagResolver)
- {
- _tldData = new DocumentTLDNamespaceData(tldDoc, tagResolver);
- }
-
- @Override
- public final String getDisplayName()
- {
- return _tldData.getDisplayName();
- }
-
- @Override
- public final String getNSUri()
- {
- return _tldData.getUri();
- }
-
- @Override
- public boolean isInitialized()
- {
- return _tldData.isInitialized();
- }
-
- public final ITagElement getViewElement(final String name)
- {
- // // bias the table small if this creates it
- // final Map<String, ITagElement> tags = getOrCreateMap(3);
- //
- // return _tldData.getOrCreateTagElement(name, tags);
- return _tldData.getViewElement(name);
- }
-
- @Override
- public final Collection<? extends ITagElement> getViewElements()
- {
- return Collections.unmodifiableCollection(_tldData.getAllViewElements().values());
- }
-
- /**
- * Differs from getViewElements because it won't include those elements
- * that haven't been lazily loaded.
- *
- * @return an unmodifiable map of all elements currently calculated for
- * this namespaces
- */
- public final Map<String, ITagElement> getCurrentElements()
- {
- return Collections.unmodifiableMap(_tldData.getCurrentElements());
- }
-
- @Override
- public final boolean hasViewElements()
- {
- return _tldData.getNumTags() > 0;
- }
-
-
- private Object writeReplace()
- {
- return new SerializableTLDNamespace(this);
- }
-
- private static class DocumentTLDNamespaceData extends TLDNamespaceData
- {
- /**
- *
- */
- private static final long serialVersionUID = -1098872687238068584L;
- private final transient TLDDocument _tldDoc;
- private final transient ITagResolvingStrategy<TLDElementDeclaration, String> _tagResolver;
- private final transient ILock _tagMapReadWriteLock;
- // should only be accessed directly in getOrCreateMap;
- private Map<String, ITagElement> _tags; // lazy init in initializeTags
-
- public DocumentTLDNamespaceData(
- final TLDDocument tldDoc,
- final ITagResolvingStrategy<TLDElementDeclaration, String> tagResolver)
- {
- _tldDoc = tldDoc;
- _tagResolver = tagResolver;
- _tagMapReadWriteLock = Job.getJobManager().newLock();
- }
-
- @Override
- public String getDisplayName()
- {
- String displayName = _tldDoc.getDisplayName();
- if (displayName == null || "".equals(displayName.trim()))
- {
- displayName = getUri();
- }
- return displayName;
- }
-
- @Override
- public String getUri()
- {
- return _tldDoc.getUri();
- }
-
- @Override
- public int getNumTags()
- {
- return _tldDoc.getElements().getLength();
- }
-
- private ITagElement createTagElement(final String name)
- {
- CMNode cmNode = _tldDoc.getElements().getNamedItem(name);
- ITagElement tagElement = null;
- if (cmNode instanceof TLDElementDeclaration)
- {
- tagElement = _tagResolver
- .resolve((TLDElementDeclaration) cmNode);
-
- if (tagElement == _tagResolver.getNotFoundIndicator())
- {
- // the not-found indicator may not be null.
- tagElement = null;
- }
- }
- return tagElement;
- }
-
- public final Map<String, ITagElement> getAllViewElements()
- {
- final CMNamedNodeMap elementMap = _tldDoc.getElements();
- final Map<String, ITagElement> tags = getOrCreateMap(elementMap
- .getLength());
- if (!isInitialized())
- {
- // if we create the table with this call, bias the table size
- // to be 1 bigger than the number of tags, since we know if it's
- // smaller, it'll cause at least one buffer resize
-
-
- for (int i = 0; i < elementMap.getLength(); i++)
- {
- final CMNode cmNode = elementMap.item(i);
- getViewElement(cmNode.getNodeName());
- }
- }
- return tags;
- }
-
- public ITagElement getViewElement(final String name)
- {
- ITagElement tagElement = null;
-
- _tagMapReadWriteLock.acquire();
- final Map<String, ITagElement> tags = getOrCreateMap(_tldDoc.getElements().getLength());
- try
- {
- tagElement = tags.get(name);
-
- if (tagElement == null)
- {
- tagElement = createTagElement(name);
-
- if (tagElement != null)
- {
- tags.put(tagElement.getName(), tagElement);
- }
- }
- }
- finally
- {
- _tagMapReadWriteLock.release();
- }
-
- return tagElement;
- }
-
- /**
- * mapSizeHint will be used
- *
- * @param mapSizeHint
- * @return the map
- */
- private synchronized Map<String, ITagElement> getOrCreateMap(
- final int mapSizeHint)
- {
- if (_tags == null)
- {
- final float loadFactor = 0.75f;
- final int initSize = ((int) (mapSizeHint / loadFactor)) + 1;
- _tags = Collections
- .synchronizedMap(new HashMap<String, ITagElement>(
- initSize));
- }
- return _tags;
- }
-
- @Override
- public boolean isInitialized()
- {
- int numTags = getNumTags();
- int tagMapSize = getOrCreateMap(3).size();
-
- // we are only initialized if the tag map is the equal in size
- // to the number of tags in the tld.
- return numTags == tagMapSize;
- }
-
- @Override
- public Map<String, ITagElement> getCurrentElements()
- {
- return getOrCreateMap(3);
- }
- }
-
- /**
- * Encapsulates all the data for a TLDNamespace. Allows the model
- * to be separated from the Namespace interface for ease of serialization and
- * controlled subclassing.
- *
- */
- public abstract static class TLDNamespaceData implements Serializable
- {
- /**
- *
- */
- private static final long serialVersionUID = -1284294636936289804L;
-
- /**
- * @return the displayb
- */
- public abstract String getDisplayName();
-
-// public abstract ITagElement getOrCreateTagElement(String name,
-// Map<String, ITagElement> tags);
-
- /**
- * @return the number of tags
- */
- public abstract int getNumTags();
-
- /**
- * @return the namespace uri
- */
- public abstract String getUri();
-
- /**
- * @param name
- * @return the view element for name or null if not found.
- */
- public abstract ITagElement getViewElement(final String name);
-
- /**
- * May be long running since it will lazily calculate all unloaded
- * tags.
- * @return all view elements for this namespace
- */
- public abstract Map<String, ITagElement> getAllViewElements();
-
- /**
- * @return true if all elements have been lazily loaded
- */
- public abstract boolean isInitialized();
-
- /**
- * @return just the currently loaded elements for this namespace.
- */
- public abstract Map<String, ITagElement> getCurrentElements();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/TLDTagElement.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/TLDTagElement.java
deleted file mode 100644
index f7ad766..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/TLDTagElement.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view.model.jsp;
-
-import java.io.Serializable;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ITagAttributeHandler;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.TagElement;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDDocument;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-
-
-/**
- * A tag element for a JSP tag (TLD-defined)
- *
- * @author cbateman
- *
- */
-public class TLDTagElement extends TagElement
-{
- /**
- *
- */
- private static final long serialVersionUID = -874272538404837105L;
- private final TLDElementData _tldData;
-
- /**
- * @param elementDecl
- * @param advisor
- */
- public TLDTagElement(final TLDElementDeclaration elementDecl
- , final IAttributeAdvisor advisor)
- {
- _tldData = new DocumentElementData(elementDecl, advisor);
- }
-
- @Override
- public String getName()
- {
- return _tldData.getName();
- }
-
- @Override
- public String getUri()
- {
- return _tldData.getUri();
- }
-
- @Override
- public String getTagHandlerClassName() {
- return _tldData.getTagHandlerClassName();
- }
-
- @Override
- public String toString()
- {
- return String.format("Tag: Tag Handler: name=%s, uri=%s, tagHandlerClassName=%s\n"
- , getName(), getUri(), getTagHandlerClassName())
- + constructAttributesString();
- }
-
- /**
- * @return a string representation of the attributes.
- */
- protected String constructAttributesString()
- {
- String attributes = "";
-
- for (final Iterator it = getAttributeHandlers().entrySet().iterator(); it.hasNext();)
- {
- final Map.Entry entry = (Entry) it.next();
- final String name = (String) entry.getKey();
- final ITagAttributeHandler handler = (ITagAttributeHandler) entry.getValue();
-
- attributes += String.format("\t\t\tAttribute: name=%s, customHandler=%s, propertyName=%s, isELAllowed=%b\n",
- name, handler.getCustomHandler(), handler.getName(),
- Boolean.valueOf(handler.isELAllowed()));
- }
- return attributes;
- }
-
- @Override
- public Map getAttributeHandlers()
- {
- return _tldData.getAttributes();
- }
-
- private static class DocumentElementData extends TLDElementData
- {
- /**
- * serialization id
- */
- private static final long serialVersionUID = -6160324802818766058L;
- private final TLDElementDeclaration _tldDoc;
- private final CMNodeNamedMapAdapter _adapter;
-
- public DocumentElementData(final TLDElementDeclaration tldDoc,
- final IAttributeAdvisor advisor)
- {
- _tldDoc = tldDoc;
- _adapter = new CMNodeNamedMapAdapter(tldDoc, advisor);
- }
-
- @Override
- public String getName()
- {
- return _tldDoc.getElementName();
- }
-
- @Override
- public String getTagHandlerClassName()
- {
- return _tldDoc.getTagclass();
- }
-
- @Override
- public String getUri()
- {
- final CMDocument owner = _tldDoc.getOwnerDocument();
-
- if (owner instanceof TLDDocument)
- {
- return ((TLDDocument)owner).getUri();
- }
- return null;
- }
-
- private Object writeReplace()
- {
- return new SerializedTLDElementData(getName(), getTagHandlerClassName(), getUri()
- , _adapter);
- }
-
- @Override
- public Map<String, ? extends ITagAttributeHandler> getAttributes()
- {
- return _adapter;
- }
- }
-
- /**
- * @author cbateman
- *
- */
- private static class SerializedTLDElementData extends TLDElementData
- {
- /**
- *
- */
- private static final long serialVersionUID = 4008084060638384114L;
- private final String _name;
- private final String _uri;
- private final String _tagHandlerClassName;
- private final Map<String, ? extends ITagAttributeHandler> _tagAttributes;
-
- /**
- * @param name
- * @param tagHandlerClassName
- * @param uri
- * @param tagAttributes
- */
- private SerializedTLDElementData(final String name,
- final String tagHandlerClassName, final String uri,
- final Map<String, ? extends ITagAttributeHandler> tagAttributes)
- {
- super();
- _name = name;
- _tagHandlerClassName = tagHandlerClassName;
- _uri = uri;
- _tagAttributes = tagAttributes;
- }
-
- @Override
- public String getName()
- {
- return _name;
- }
-
- @Override
- public String getTagHandlerClassName()
- {
- return _tagHandlerClassName;
- }
-
- @Override
- public String getUri()
- {
- return _uri;
- }
-
- @Override
- public Map<String, ? extends ITagAttributeHandler> getAttributes()
- {
- return _tagAttributes;
- }
- }
-
- private static abstract class TLDElementData implements Serializable
- {
- /**
- *
- */
- private static final long serialVersionUID = -2494388738109839064L;
- public abstract String getTagHandlerClassName();
- public abstract String getName();
- public abstract String getUri();
- public abstract Map<String, ? extends ITagAttributeHandler> getAttributes();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/TLDTagHandlerElement.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/TLDTagHandlerElement.java
deleted file mode 100644
index d637f49..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/TLDTagHandlerElement.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view.model.jsp;
-
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.IHandlerTagElement;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDElementDeclaration;
-
-/**
- * A TLD-defined tag (i.e. JSP) that maps to a known tag handler.
- *
- * @author cbateman
- *
- */
-public class TLDTagHandlerElement extends TLDJSFTagElement implements
-IHandlerTagElement
-{
- /**
- *
- */
- private static final long serialVersionUID = 8984277085824995102L;
- private final TagHandlerType _tagHandlerType;
-
- /**
- * @param elementDecl
- * @param tagHandlerType
- * @param advisor
- */
- public TLDTagHandlerElement(final TLDElementDeclaration elementDecl, final TagHandlerType tagHandlerType, final IAttributeAdvisor advisor)
- {
- super(elementDecl, advisor);
- _tagHandlerType = tagHandlerType;
- }
-
- public TagHandlerType getTagHandlerType()
- {
- return _tagHandlerType;
- }
-
- @Override
- public TagType getType()
- {
- return TagType.HANDLER;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/TLDValidatorTagElement.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/TLDValidatorTagElement.java
deleted file mode 100644
index e99d97b..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/TLDValidatorTagElement.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view.model.jsp;
-
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ValidatorTypeInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.IValidatorTagElement;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDElementDeclaration;
-
-/**
- * A TLD-defined tag (i.e. JSP) that maps one-to-one with a JSF Converter
- *
- * @author cbateman
- *
- */
-public class TLDValidatorTagElement extends TLDJSFTagElement implements IValidatorTagElement
-{
- /**
- *
- */
- private static final long serialVersionUID = 4251223772554969477L;
- private final ValidatorTypeInfo _validator;
-
- /**
- * @param elementDecl
- * @param validatorTypeInfo
- * @param advisor
- */
- public TLDValidatorTagElement(final TLDElementDeclaration elementDecl, final ValidatorTypeInfo validatorTypeInfo, final IAttributeAdvisor advisor)
- {
- super(elementDecl, advisor);
- _validator = validatorTypeInfo;
- }
-
- public final ValidatorTypeInfo getValidator()
- {
- return _validator;
- }
-
- @Override
- public final TagType getType()
- {
- return TagType.VALIDATOR;
- }
-
- @Override
- public String toString()
- {
- return _validator.toString();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/TagIntrospectingStrategy.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/TagIntrospectingStrategy.java
deleted file mode 100644
index 6608cf6..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/TagIntrospectingStrategy.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view.model.jsp;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ITagElement;
-import org.eclipse.jst.jsf.designtime.internal.Messages;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.analyzer.TagAnalyzer;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDElementDeclaration;
-
-/**
- * A resolving strategy that uses tag introspection.
- *
- * @author cbateman
- *
- */
-public final class TagIntrospectingStrategy extends JSPTagResolvingStrategy
-{
- /**
- * the identifier of this strategy
- */
- public final static String ID = "org.eclipse.jst.jsf.designtime.TagIntrospectingStrategy"; //$NON-NLS-1$
- /**
- * the display name
- */
- public final static String DISPLAY_NAME = Messages.TagIntrospectingStrategy_DisplayName;
-
- private final IProject _project;
-
- /**
- * @param project
- */
- public TagIntrospectingStrategy(final IProject project)
- {
- // TODO: would it be better to have a model context on the resolve?
- _project = project;
- }
-
- @Override
- public String getId()
- {
- return ID;
- }
-
- public String getDisplayName()
- {
- return DISPLAY_NAME;
- }
-
- @Override
- public ITagElement resolve(TLDElementDeclaration element)
- {
- return TagAnalyzer.createTLDTagElement(element, _project);
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/UnresolvedJSPTagResolvingStrategy.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/UnresolvedJSPTagResolvingStrategy.java
deleted file mode 100644
index 29accf1..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/UnresolvedJSPTagResolvingStrategy.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view.model.jsp;
-
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ITagElement;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.IAttributeAdvisor.NullAttributeAdvisor;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDElementDeclaration;
-
-/**
- * This a fallback strategy that always creates an element for a tld decl. This
- * can be tacked to the end of a composite strategy (or used alone) to ensure
- * that a basic ITagElement is always created for a TLDElementDeclaration.
- *
- * @author cbateman
- *
- */
-public class UnresolvedJSPTagResolvingStrategy extends JSPTagResolvingStrategy
-{
- /**
- * the identifier of this strategy
- */
- public final static String ID = "org.eclipse.jst.jsf.designtime.UnresolvedJSPTagResolvingStrategy";
- /**
- * the displayable name
- */
- public final static String DISPLAY_NAME = "Unresolved Tag Resolver";
-
- @Override
- public String getId()
- {
- return ID;
- }
-
- public String getDisplayName()
- {
- return DISPLAY_NAME;
- }
-
- @Override
- public ITagElement resolve(TLDElementDeclaration element)
- {
- // just create a tag element
- return new TLDTagElement(element, new NullAttributeAdvisor());
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/analyzer/ServletBeanProxyContributor.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/analyzer/ServletBeanProxyContributor.java
deleted file mode 100644
index 7baa4a0..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/analyzer/ServletBeanProxyContributor.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-/**
- *
- */
-package org.eclipse.jst.jsf.designtime.internal.view.model.jsp.analyzer;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jem.internal.proxy.core.ConfigurationContributorAdapter;
-import org.eclipse.jem.internal.proxy.core.IConfigurationContributionController;
-import org.eclipse.jst.jsf.core.JSFVersion;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework;
-import org.osgi.framework.Bundle;
-
-class ServletBeanProxyContributor extends ConfigurationContributorAdapter
-{
- private final IProject _project;
- private final JSFVersion _jsfVersion;
-
- public ServletBeanProxyContributor(final IProject project)
- {
- _project = project;
- _jsfVersion = getProjectVersion(project);
- if (_jsfVersion == null)
- {
- throw new IllegalArgumentException("jsfVersion must not be null");
- }
-
- }
-
- @Override
- public void contributeClasspaths(
- final IConfigurationContributionController controller)
- throws CoreException
- {
- if (_jsfVersion != JSFVersion.V1_2)
- {
- final Bundle servletBundle = Platform.getBundle("javax.servlet");
- controller.contributeClasspath(servletBundle, (IPath) null,
- IConfigurationContributionController.APPEND_USER_CLASSPATH,
- true);
-
- final Bundle jspBundle = Platform.getBundle("javax.servlet.jsp");
- controller.contributeClasspath(jspBundle, (IPath) null,
- IConfigurationContributionController.APPEND_USER_CLASSPATH,
- true);
- }
- else
- {
- final Bundle coreBundle = JSFCorePlugin.getDefault().getBundle();
- final IJavaProject javaProject = JavaCore.create(_project);
- maybeAddJar(controller, "javax.servlet.jsp.tagext.JspIdConsumer",
- javaProject, coreBundle, "/jars/fake_jsp_21.jar");
- maybeAddJar(controller, "javax.el.ELException", javaProject,
- coreBundle, "/jars/fake_el.jar");
- }
- }
-
- private void maybeAddJar(
- final IConfigurationContributionController controller,
- final String addIfTypeNameNotFound, final IJavaProject javaProject,
- final Bundle bundle, final String path)
- {
- try
- {
- final IType type = javaProject.findType(addIfTypeNameNotFound);
- // if we can't find the type name on the classpath,then inject
- // our fake jar to aid linkage while introspecting facelet libs
- if (type == null)
- {
-
- controller
- .contributeClasspath(
- bundle,
- path,
- IConfigurationContributionController.APPEND_USER_CLASSPATH,
- false);
- }
- }
- catch (final JavaModelException jme)
- {
- // suppress
- }
- }
-
- static JSFVersion getProjectVersion(final IProject project)
- {
- try
- {
- if (FacetedProjectFramework.hasProjectFacet(project, "jst.jsf",
- "1.0"))
- {
- return JSFVersion.V1_0;
- }
- else if (FacetedProjectFramework.hasProjectFacet(project,
- "jst.jsf", "1.1"))
- {
- return JSFVersion.V1_1;
- }
- else if (FacetedProjectFramework.hasProjectFacet(project,
- "jst.jsf", "1.2"))
- {
- return JSFVersion.V1_2;
- }
- }
- catch (final CoreException e)
- {
- JSFCorePlugin.log("checking project version", e);
- // fall-through
- }
-
- return null;
- }
-
-}
\ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/analyzer/TagAnalyzer.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/analyzer/TagAnalyzer.java
deleted file mode 100644
index 468907c..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/analyzer/TagAnalyzer.java
+++ /dev/null
@@ -1,830 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view.model.jsp.analyzer;
-
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaConventions;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jem.internal.proxy.core.IBeanProxy;
-import org.eclipse.jem.internal.proxy.core.IBeanTypeProxy;
-import org.eclipse.jem.internal.proxy.core.IConfigurationContributor;
-import org.eclipse.jem.internal.proxy.core.IStandardBeanTypeProxyFactory;
-import org.eclipse.jem.internal.proxy.core.ProxyFactoryRegistry;
-import org.eclipse.jem.internal.proxy.ide.IDERegistration;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentTypeInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ConverterTypeInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ValidatorTypeInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.IJSFTagElement;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.IHandlerTagElement.TagHandlerType;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.IJSFTagElement.TagType;
-import org.eclipse.jst.jsf.core.JSFVersion;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.core.internal.JSFCoreTraceOptions;
-import org.eclipse.jst.jsf.core.internal.jem.BeanProxyUtil.BeanProxyWrapper;
-import org.eclipse.jst.jsf.core.internal.jem.BeanProxyUtil.ProxyException;
-import org.eclipse.jst.jsf.designtime.internal.view.DTComponentIntrospector;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.TLDComponentTagElement;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.TLDConverterTagElement;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.TLDTagElement;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.TLDTagHandlerElement;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.TLDValidatorTagElement;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.IAttributeAdvisor.NullAttributeAdvisor;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDElementDeclaration;
-
-/**
- * Utility class supporting methods to derive information from JSP tag
- * definitions (TLD)
- *
- * @author cbateman
- *
- */
-public final class TagAnalyzer
-{
- private static final String JAVAX_FACES_WEBAPP_CONVERTER_TAG = "javax.faces.webapp.ConverterTag";
- private static final String JAVAX_FACES_WEBAPP_CONVERTER_ELTAG = "javax.faces.webapp.ConverterELTag";
- private static final String JAVAX_FACES_WEBAPP_VALIDATOR_TAG = "javax.faces.webapp.ValidatorTag";
- private static final String JAVAX_FACES_WEBAPP_VALIDATOR_ELTAG = "javax.faces.webapp.ValidatorELTag";
- private static final String JAVAX_FACES_WEBAPP_FACET_TAG = "javax.faces.webapp.FacetTag";
-
- // private static final String JAVAX_FACES_WEBAPP_ACTIONLISTENER_TAG =
- // "javax.faces.webapp.ActionListenerTag";
- // private static final String JAVAX_FACES_WEBAPP_VALUECHANGELISTENER_TAG =
- // "javax.faces.webapp.ValueChangeListenerTag";
- private static final String JAVAX_FACES_WEBAPP_ATTRIBUTE_TAG = "javax.faces.webapp.AttributeTag";
-
- private final static Set<String> COMPONENT_TAG_HANDLER_TYPES_JSF11;
- private final static Set<String> COMPONENT_TAG_HANDLER_TYPES_JSF12;
-
- private final static Set<String> CONVERTER_TAG_HANDLER_TYPES_JSF11 = Collections
- .singleton(JAVAX_FACES_WEBAPP_CONVERTER_TAG);
- private final static Set<String> CONVERTER_TAG_HANDLER_TYPES_JSF12;
-
- private final static Set<String> VALIDATOR_TAG_HANDLER_TYPES_JSF11 = Collections
- .singleton(JAVAX_FACES_WEBAPP_VALIDATOR_TAG);
- private final static Set<String> VALIDATOR_TAG_HANDLER_TYPES_JSF12;
-
- private final static Set<String> FACET_TAG_HANDLER = Collections
- .singleton(JAVAX_FACES_WEBAPP_FACET_TAG);
- private final static Set<String> ATTRIBUTE_TAG_HANDLER = Collections
- .singleton(JAVAX_FACES_WEBAPP_ATTRIBUTE_TAG);
- // private final static Set<String> ACTIONLISTENER_TAG_HANDLER = Collections
- // .singleton(JAVAX_FACES_WEBAPP_ACTIONLISTENER_TAG);
- // private final static Set<String> VALUECHANGELISTENER_TAG_HANDLER =
- // Collections
- // .singleton(JAVAX_FACES_WEBAPP_VALUECHANGELISTENER_TAG);
-
- private final static Set<String> ALL_HANDLER_TAGS;
-
- static
- {
- // components
- // JSF 1.1
- Set<String> set = new HashSet<String>(8);
- set.add("javax.faces.webapp.UIComponentTag");
- set.add("javax.faces.webapp.UIComponentBodyTag");
- COMPONENT_TAG_HANDLER_TYPES_JSF11 = Collections.unmodifiableSet(set);
-
- // JSF 1.2
- set = new HashSet<String>(8);
- set.add("javax.faces.webapp.UIComponentTag");
- set.add("javax.faces.webapp.UIComponentBodyTag");
- set.add("javax.faces.webapp.UIComponentELTag");
- COMPONENT_TAG_HANDLER_TYPES_JSF12 = Collections.unmodifiableSet(set);
-
- // converters
- set = new HashSet<String>(8);
- set.add(JAVAX_FACES_WEBAPP_CONVERTER_TAG);
- set.add(JAVAX_FACES_WEBAPP_CONVERTER_ELTAG);
- CONVERTER_TAG_HANDLER_TYPES_JSF12 = Collections.unmodifiableSet(set);
-
- // validators
- set = new HashSet<String>(8);
- set.add(JAVAX_FACES_WEBAPP_VALIDATOR_TAG);
- set.add(JAVAX_FACES_WEBAPP_VALIDATOR_ELTAG);
- VALIDATOR_TAG_HANDLER_TYPES_JSF12 = Collections.unmodifiableSet(set);
-
- // tag handlers
- ALL_HANDLER_TAGS = new HashSet<String>();
- ALL_HANDLER_TAGS.addAll(FACET_TAG_HANDLER);
- ALL_HANDLER_TAGS.addAll(ATTRIBUTE_TAG_HANDLER);
- // ALL_HANDLER_TAGS.addAll(VALUECHANGELISTENER_TAG_HANDLER);
- // ALL_HANDLER_TAGS.addAll(ACTIONLISTENER_TAG_HANDLER);
- }
-
- /**
- * Tries to determine the component type of the component that corresponds
- * to the JSP tag defined by tldDecl.
- *
- * @param tldDecl
- * @param project
- * @return get the component type from the tag definition or null if none.
- */
- public static String findComponentType(final TLDElementDeclaration tldDecl,
- final IProject project)
- {
- final String className = tldDecl.getTagclass();
-
- final IConfigurationContributor[] contributor = new IConfigurationContributor[]
- { new ServletBeanProxyContributor(project) };
- final ProxyFactoryRegistry registry = getProxyFactoryRegistry(
- contributor, project);
-
- if (registry != null)
- {
- final IStandardBeanTypeProxyFactory factory = registry
- .getBeanTypeProxyFactory();
- final IBeanTypeProxy classTypeProxy = factory
- .getBeanTypeProxy(className);
- final BeanProxyWrapper classTypeWrapper = new BeanProxyWrapper(
- classTypeProxy);
-
- try
- {
- classTypeWrapper.init();
- return classTypeWrapper.callStringMethod("getComponentType");
- }
- catch (final ProxyException tp)
- {
- if (JSFCoreTraceOptions.TRACE_JSPTAGINTROSPECTOR)
- {
- JSFCoreTraceOptions.log("TagAnalyzer.findComponentType", tp);
- }
- }
- }
-
- return null;
- }
-
- /**
- * Tries to introspect tldDecl's tag class to determine what the identifier
- * of the underlying Converter that is used to register it in the app config
- *
- * @param tldDecl
- * @param project
- * @return the converter type identifier for the tldDecl or null if not
- * found
- */
- public static String findConverterType(final TLDElementDeclaration tldDecl,
- final IProject project)
- {
- // TODO: allow for pluggable resolver?
-
- // This one is more hacky and less prone to success than the component
- // type finder because the ConverterTag doesn't initialize its type
- // field on construction. Instead, both MyFaces and RI seem to do it
- // based on the doStartTag method. They also don't provide a standard
- // interface for acquiring the id so instead we make some guess on
- // the internal field name.
- final String className = tldDecl.getTagclass();
-
- final IConfigurationContributor[] contributor = new IConfigurationContributor[]
- { new ServletBeanProxyContributor(project) };
- final ProxyFactoryRegistry registry = getProxyFactoryRegistry(
- contributor, project);
-
- if (registry != null)
- {
- final IStandardBeanTypeProxyFactory factory = registry
- .getBeanTypeProxyFactory();
- final IBeanTypeProxy classTypeProxy = factory
- .getBeanTypeProxy(className);
-
- try
- {
- final IType type = JavaCore.create(project).findType(className);
-
- if (type != null
- && DTComponentIntrospector
- .isTypeNameInstanceOfClass(
- type,
- Collections
- .singleton(JAVAX_FACES_WEBAPP_CONVERTER_ELTAG)))
- {
- return findConverterType_InELTag(factory, classTypeProxy);
- }
- // the assumption is that this is a component tag, so we assume
- // it is one.
- else if (type != null
- && DTComponentIntrospector
- .isTypeNameInstanceOfClass(
- type,
- Collections
- .singleton(JAVAX_FACES_WEBAPP_CONVERTER_TAG)))
- {
- return findConverterType_InTag(factory, classTypeProxy);
- }
- }
- catch (final JavaModelException jme)
- {
- // suppress for now
- }
- }
-
- return null;
- }
-
- private static String findConverterType_InTag(
- final IStandardBeanTypeProxyFactory factory,
- final IBeanTypeProxy classTypeProxy)
- {
- final IBeanTypeProxy nullPageContextType = factory
- .getBeanTypeProxy("javax.servlet.jsp.PageContext");
- final BeanProxyWrapper classTypeWrapper = new BeanProxyWrapper(
- classTypeProxy);
-
- try
- {
- classTypeWrapper.init();
-
- callSuppressExceptions(classTypeWrapper, "setPageContext",
- new IBeanProxy[]
- { null }, new IBeanTypeProxy[]
- { nullPageContextType });
- callSuppressExceptions(classTypeWrapper, "doStartTag");
-
- final IBeanTypeProxy converterProxy = factory
- .getBeanTypeProxy(JAVAX_FACES_WEBAPP_CONVERTER_TAG);
-
- // hopefully doStartTag set the converter field before it
- // failed.
- // now try to guess what it's called
- String converterId = getStringField(classTypeWrapper,
- converterProxy, "converterId");
-
- if (converterId != null)
- {
- return converterId;
- }
-
- converterId = getStringField(classTypeWrapper, converterProxy,
- "_converterId");
-
- if (converterId != null)
- {
- return converterId;
- }
-
- // no? look for a CONVERTER_ID
- converterId = getStringField(classTypeWrapper, classTypeProxy,
- "CONVERTER_ID");
- }
- catch (final ProxyException tp)
- {
- // fall through
- }
- return null;
- }
-
- private static String findConverterType_InELTag(
- final IStandardBeanTypeProxyFactory factory,
- final IBeanTypeProxy classTypeProxy)
- {
- final BeanProxyWrapper classTypeWrapper = new BeanProxyWrapper(
- classTypeProxy);
- final IBeanTypeProxy elExpressionType = factory
- .getBeanTypeProxy("javax.el.ValueExpression");
-
- if (elExpressionType == null)
- {
- return null;
- }
-
- try
- {
- classTypeWrapper.init();
-
- callSuppressExceptions(classTypeWrapper, "doStartTag");
-
- // no? look for a CONVERTER_ID
- final IBeanProxy converterId = getFieldInParents(classTypeWrapper,
- classTypeProxy, "CONVERTER_ID_EXPR");
-
- if (converterId != null)
- {
- converterId.getTypeProxy().isKindOf(elExpressionType);
- final BeanProxyWrapper elExprValue = new BeanProxyWrapper(
- converterId.getTypeProxy());
- final String value = elExprValue
- .callStringMethod("getExpressionString");
- System.out.println("Expression string:" + value);
- }
-
- //
- //
- // final IBeanTypeProxy converterProxy = factory
- // .getBeanTypeProxy(JAVAX_FACES_WEBAPP_CONVERTER_TAG);
-
- }
- catch (final ProxyException tp)
- {
- // fall through
- }
- return null;
- }
-
- /**
- * @param tldDecl
- * @param project
- * @return the validator type identifier for the tldDecl or null if not
- * found
- */
- public static String findValidatorType(final TLDElementDeclaration tldDecl,
- final IProject project)
- {
- // TODO: allow for pluggable resolver?
-
- // This one is more hacky and less prone to success than the component
- // type finder because the Validator doesn't initialize its type
- // field on construction. Instead, both MyFaces and RI seem to do it
- // based on the doStartTag method. They also don't provide a standard
- // interface for acquiring the id so instead we make some guess on
- // the internal field name.
- final String className = tldDecl.getTagclass();
-
- final IConfigurationContributor[] contributor = new IConfigurationContributor[]
- { new ServletBeanProxyContributor(project) };
- final ProxyFactoryRegistry registry = getProxyFactoryRegistry(
- contributor, project);
-
- if (registry != null)
- {
- final IStandardBeanTypeProxyFactory factory = registry
- .getBeanTypeProxyFactory();
- final IBeanTypeProxy classTypeProxy = factory
- .getBeanTypeProxy(className);
- final BeanProxyWrapper classTypeWrapper = new BeanProxyWrapper(
- classTypeProxy);
- final IBeanTypeProxy converterProxy = factory
- .getBeanTypeProxy(JAVAX_FACES_WEBAPP_VALIDATOR_TAG);
- try
- {
- classTypeWrapper.init();
-
- callSuppressExceptions(classTypeWrapper, "doStartTag");
- callSuppressExceptions(classTypeWrapper, "createValidator");
-
- // hopefully doStartTag set the converter field before it
- // failed.
- // now try to guess what it's called
- String validatorId = getStringField(classTypeWrapper,
- converterProxy, "validatorId");
-
- if (validatorId != null)
- {
- return validatorId;
- }
-
- validatorId = getStringField(classTypeWrapper, converterProxy,
- "_validatorId");
-
- if (validatorId != null)
- {
- return validatorId;
- }
-
- // no? then see if there's a VALIDATOR_ID field *on the tag*
- validatorId = getStringField(classTypeWrapper, classTypeProxy,
- "VALIDATOR_ID");
-
- if (validatorId != null)
- {
- return validatorId;
- }
- }
- catch (final ProxyException tp)
- {
- // fall through
- }
- }
-
- return null;
-
- }
-
- private static IBeanProxy getFieldInParents(
- final BeanProxyWrapper classTypeWrapper,
- final IBeanTypeProxy typeProxy, final String fieldName)
- {
- try
- {
- return classTypeWrapper.getFieldValueIncludeParents(fieldName,
- typeProxy);
- }
- catch (final ProxyException e)
- {
- // suppress
- }
-
- return null;
- }
-
- private static String getStringField(
- final BeanProxyWrapper classTypeWrapper,
- final IBeanTypeProxy typeProxy, final String fieldName)
- {
- try
- {
- return classTypeWrapper.getStringFieldValue(fieldName, typeProxy);
- }
- catch (final ProxyException e)
- {
- // suppress
- }
-
- return null;
- }
-
- private static void callSuppressExceptions(
- final BeanProxyWrapper classTypeWrapper, final String methodName)
- {
- try
- {
- classTypeWrapper.call(methodName);
- }
- catch (final ProxyException tp)
- {
- // suppress this since it may well throw an exception
- // depending on what assumptions the tag class is making
- // that won't be true because we're not in a servlet
- }
- }
-
- private static void callSuppressExceptions(
- final BeanProxyWrapper classTypeWrapper, final String methodName,
- final IBeanProxy[] args, final IBeanTypeProxy[] argTypes)
- {
- try
- {
- classTypeWrapper.call(methodName, args, argTypes);
- }
- catch (final ProxyException tp)
- {
- // suppress this since it may well throw an exception
- // depending on what assumptions the tag class is making
- // that won't be true because we're not in a servlet
- }
-
- }
-
- /**
- * @param project
- * @return a new proxy factory registry or null;
- *
- * TODO: caching?
- */
- private static ProxyFactoryRegistry getProxyFactoryRegistry(
- final IConfigurationContributor[] configuration,
- final IProject project)
- {
- try
- {
- return IDERegistration.startAnImplementation(configuration, false,
- project, project.getName(), JSFCorePlugin.PLUGIN_ID,
- new NullProgressMonitor());
- }
- catch (final CoreException e)
- {
- JSFCorePlugin.log("Error starting vm for project: "
- + project.getName(), e);
- }
-
- return null;
- }
-
- /**
- * @param tldDecl
- * @param project
- * @return the tag element for the tldDecl
- */
- public static TLDTagElement createTLDTagElement(
- final TLDElementDeclaration tldDecl, final IProject project)
- {
- if (JSFCoreTraceOptions.TRACE_JSPTAGINTROSPECTOR)
- {
- JSFCoreTraceOptions
- .log(String
- .format(
- "TagAnalyzer.createTLDTagElement: Start tld=%s, project=%s",
- tldDecl.getNodeName(), project.getName()));
- }
- long startTime = 0;
- if (JSFCoreTraceOptions.TRACE_JSPTAGINTROSPECTOR_PERF)
- {
- startTime = System.nanoTime();
- }
-
- try
- {
- final IJavaProject javaProject = JavaCore.create(project);
- final String typeName = tldDecl.getTagclass();
-
- if (typeName == null
- || JavaConventions.validateJavaTypeName(typeName,
- JavaCore.VERSION_1_3,
- JavaCore.VERSION_1_3).getSeverity() == IStatus.ERROR)
- {
- JSFCorePlugin.log(
- "Bad tag class name in " + tldDecl.toString(),
- new Throwable());
- return null;
- }
-
- final IType type = javaProject.findType(typeName);
-
- if (type == null)
- {
- if (JSFCoreTraceOptions.TRACE_JSPTAGINTROSPECTOR)
- {
- JSFCoreTraceOptions.log("Type not found for: "+typeName);
- }
- return null;
- }
- final TagType tagType = getJSFComponentTagType(type, project);
-
- if (JSFCoreTraceOptions.TRACE_JSPTAGINTROSPECTOR)
- {
- JSFCoreTraceOptions.log(String.format(
- "Tag class type=%s\nTag type=%s", type, tagType));
- }
-
- if (tagType == TagType.COMPONENT)
- {
- final TLDTagElement element = createComponentTagElement(tldDecl, project);
-
- if (JSFCoreTraceOptions.TRACE_JSPTAGINTROSPECTOR_PERF)
- {
- String name = element != null ? element.toString()
- : "<none>";
- System.out.printf(
- "Time to create component tag element %s was %d\n",
- name, Long.valueOf(System.nanoTime() - startTime));
- }
- return element;
- }
- else if (tagType == TagType.CONVERTER)
- {
- final TLDTagElement element = createConverterTagElement(tldDecl, project);
- if (JSFCoreTraceOptions.TRACE_JSPTAGINTROSPECTOR_PERF)
- {
- String name = element != null ? element.toString()
- : "<none>";
- System.out.printf(
- "Time to create converter tag element %s was %d\n",
- name, Long.valueOf(System.nanoTime() - startTime));
- }
- return element;
- }
- else if (tagType == TagType.VALIDATOR)
- {
- final TLDTagElement element = createValidatorTagElement(tldDecl, project);
- if (JSFCoreTraceOptions.TRACE_JSPTAGINTROSPECTOR_PERF)
- {
- String name = element != null ? element.toString()
- : "<none>";
- System.out.printf(
- "Time to create validator tag element %s was %d\n",
- name, Long.valueOf(System.nanoTime() - startTime));
- }
- return element;
- }
- else if (tagType == TagType.HANDLER)
- {
- final TLDTagElement element = createHandlerTagElement(tldDecl, type);
- if (JSFCoreTraceOptions.TRACE_JSPTAGINTROSPECTOR_PERF)
- {
- String name = element != null ? element.toString()
- : "<none>";
- System.out.printf(
- "Time to create handler tag element %s was %d\n",
- name, Long.valueOf(System.nanoTime() - startTime));
- }
- return element;
- }
- }
- catch (final JavaModelException jme)
- {
- JSFCorePlugin.log(jme, "Trying to get type for TLD");
- }
-
- return null;
- }
-
- /**
- * @param tldDecl
- * @param project
- * @return a component tag element for tldDecl
- */
- public static TLDTagElement createComponentTagElement(
- final TLDElementDeclaration tldDecl, final IProject project)
- {
- final String componentType = findComponentType(tldDecl, project);
-
- if (componentType != null)
- {
- final String componentClass = DTComponentIntrospector
- .findComponentClass(componentType, project);
-
- if (componentClass != null && !"".equals(componentClass.trim()))
- {
- final ComponentTypeInfo typeInfo = DTComponentIntrospector
- .getComponent(componentType, componentClass, project,
- new IConfigurationContributor[]
- {new ServletBeanProxyContributor(project)});
-
- if (typeInfo != null)
- {
- final TLDComponentTagElement tagElement = new TLDComponentTagElement(
- tldDecl, typeInfo, new NullAttributeAdvisor());
- return tagElement;
- }
- }
- }
-
- // TODO: really return null?
- return null;
- }
-
- /**
- * @param tldDecl
- * @param project
- * @return a converter tag element for tldDecl
- */
- public static TLDTagElement createConverterTagElement(
- final TLDElementDeclaration tldDecl, final IProject project)
- {
- final String converterId = findConverterType(tldDecl, project);
-
- if (converterId != null)
- {
- final String converterClass = DTComponentIntrospector
- .findConverterClass(converterId, project);
-
- if (converterClass != null && !"".equals(converterClass.trim()))
- {
- final ConverterTypeInfo typeInfo = DTComponentIntrospector
- .getConverter(converterId, converterClass);
- final TLDConverterTagElement tagElement = new TLDConverterTagElement(
- tldDecl, typeInfo, new NullAttributeAdvisor());
- return tagElement;
- }
- }
-
- // we know (actually we assume by contract) that this a converter
- // so create an unknown converter tag for it
- return new TLDConverterTagElement(tldDecl, ConverterTypeInfo.UNKNOWN, new NullAttributeAdvisor());
- }
-
- /**
- * @param tldDecl
- * @param project
- * @return a validator tag element for the tldDec
- */
- public static TLDTagElement createValidatorTagElement(
- final TLDElementDeclaration tldDecl, final IProject project)
- {
- final String validatorId = findValidatorType(tldDecl, project);
-
- if (validatorId != null)
- {
- final String validatorClass = DTComponentIntrospector
- .findValidatorClass(validatorId, project);
-
- if (validatorClass != null && !"".equals(validatorClass.trim()))
- {
- final ValidatorTypeInfo typeInfo = DTComponentIntrospector
- .getValidator(validatorId, validatorClass);
- final TLDValidatorTagElement tagElement = new TLDValidatorTagElement(
- tldDecl, typeInfo, new NullAttributeAdvisor());
- return tagElement;
- }
- }
- // we know (actually we assume by contract) that this a validator
- // so create an unknown converter tag for it
- return new TLDValidatorTagElement(tldDecl, ValidatorTypeInfo.UNKNOWN, new NullAttributeAdvisor());
- }
-
- /**
- * @param tldDecl
- * @param type
- * @return the tag element for a JSF handler
- */
- public static TLDTagElement createHandlerTagElement(
- final TLDElementDeclaration tldDecl, final IType type)
- {
- if (DTComponentIntrospector.isTypeNameInstanceOfClass(type,
- FACET_TAG_HANDLER))
- {
- return new TLDTagHandlerElement(tldDecl, TagHandlerType.FACET, new NullAttributeAdvisor());
- }
- else if (DTComponentIntrospector.isTypeNameInstanceOfClass(type,
- ATTRIBUTE_TAG_HANDLER))
- {
- return new TLDTagHandlerElement(tldDecl, TagHandlerType.ATTRIBUTE, new NullAttributeAdvisor());
- }
- // else if (isTypeNameInstanceOfClass(type, ACTIONLISTENER_TAG_HANDLER))
- // {
- // return new TLDTagHandlerElement(tldDecl,
- // TagHandlerType.ACTIONLISTENER);
- // }
- // else if (isTypeNameInstanceOfClass(type,
- // VALUECHANGELISTENER_TAG_HANDLER))
- // {
- // return new TLDTagHandlerElement(tldDecl,
- // TagHandlerType.VALUECHANGELISTENER);
- // }
- return null;
- }
-
- /**
- * @param type
- * @param project
- * @return true if type represents a JSF component action class (spec 9.2.2)
- */
- public static IJSFTagElement.TagType getJSFComponentTagType(
- final IType type, final IProject project)
- {
- if (JSFCoreTraceOptions.TRACE_JSPTAGINTROSPECTOR)
- {
- JSFCoreTraceOptions
- .log(String
- .format(
- "TagAnalyzer.getJSFComponentTagType: Determining Tag Type for type %s on project %s",
- type.getFullyQualifiedName(), project
- .toString()));
- }
-
- Set<String> componentTags = null;
- Set<String> converterTags = null;
- Set<String> validatorTags = null;
-
- final JSFVersion jsfVersion = ServletBeanProxyContributor.getProjectVersion(project);
-
- // v1.1(9.2.2): JSF component tags must sub-class one of these
- if (jsfVersion == JSFVersion.V1_0 || jsfVersion == JSFVersion.V1_1)
- {
- componentTags = COMPONENT_TAG_HANDLER_TYPES_JSF11;
- converterTags = CONVERTER_TAG_HANDLER_TYPES_JSF11;
- validatorTags = VALIDATOR_TAG_HANDLER_TYPES_JSF11;
- }
- // v1.2(9.2.2): JSF component tags must sub-class UIComponentELTag
- // the original two are included because we must be backward
- // compatible
- else if (jsfVersion == JSFVersion.V1_2)
- {
- componentTags = COMPONENT_TAG_HANDLER_TYPES_JSF12;
- converterTags = CONVERTER_TAG_HANDLER_TYPES_JSF12;
- validatorTags = VALIDATOR_TAG_HANDLER_TYPES_JSF12;
- }
-
- TagType tagType = null;
-
- if (DTComponentIntrospector.isTypeNameInstanceOfClass(type,
- componentTags))
- {
- tagType = TagType.COMPONENT;
- }
- else if (DTComponentIntrospector.isTypeNameInstanceOfClass(type,
- converterTags))
- {
- tagType = TagType.CONVERTER;
- }
- else if (DTComponentIntrospector.isTypeNameInstanceOfClass(type,
- validatorTags))
- {
- tagType = TagType.VALIDATOR;
- }
- else if (DTComponentIntrospector.isTypeNameInstanceOfClass(type,
- ALL_HANDLER_TAGS))
- {
- tagType = TagType.HANDLER;
- }
-
- if (JSFCoreTraceOptions.TRACE_JSPTAGINTROSPECTOR)
- {
- JSFCoreTraceOptions.log(String.format(
- "TagAnalyzer.getJSFComponentTagType: tag type is %s",
- tagType != null ? tagType.toString() : "null"));
- }
- return tagType;
- }
-
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/persistence/MasterIndex.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/persistence/MasterIndex.java
deleted file mode 100644
index d985699..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/persistence/MasterIndex.java
+++ /dev/null
@@ -1,442 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view.model.jsp.persistence;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.core.internal.JSFCoreTraceOptions;
-import org.osgi.framework.Version;
-
-/**
- * The definitive index of what projects are indexed for JSP tag registry
- * persistence.
- *
- * @author cbateman
- *
- */
-class MasterIndex implements Serializable
-{
- public final static SerializableVersion CURRENT_VERSION = new SerializableVersion(
- 1, 0, 0);
-
- /**
- *
- */
- private static final long serialVersionUID = -2725662604972649316L;
-
- private final transient String _repositoryPath;
- private final transient File _storageFile;
-
- private IndexHeader _header;
- private List<ProjectIndex> _projectIndices;
-
- public MasterIndex(final File storageFile, final String repositoryPath)
- {
- _storageFile = storageFile;
- _repositoryPath = repositoryPath;
- }
-
- public synchronized void create(final SerializableVersion version)
- throws IOException
- {
- if (JSFCoreTraceOptions.TRACE_JSPTAGPERSISTENCE)
- {
- JSFCoreTraceOptions.log("MasterIndex.create, version=:"
- + version.toString());
- }
-
- _header = new IndexHeader(version);
- _projectIndices = new ArrayList<ProjectIndex>();
-
- save(_storageFile);
- }
-
- public synchronized void save(final File file) throws IOException
- {
- FileOutputStream out = null;
-
- try
- {
- if (JSFCoreTraceOptions.TRACE_JSPTAGPERSISTENCE)
- {
- JSFCoreTraceOptions.log("Trying to save master index file: "
- + file.getAbsolutePath());
- }
-
- out = new FileOutputStream(file);
- final ObjectOutputStream objStream = new ObjectOutputStream(out);
- objStream.writeObject(this);
-
- if (JSFCoreTraceOptions.TRACE_JSPTAGPERSISTENCE)
- {
- JSFCoreTraceOptions
- .log("Master index file written successfully: "
- + file.getAbsolutePath());
- }
- }
- finally
- {
- if (out != null)
- {
- out.close();
- }
- }
- }
-
- public synchronized void load(final SerializableVersion expectedVersion)
- throws IOException, ClassNotFoundException
- {
- FileInputStream in = null;
-
- try
- {
- if (JSFCoreTraceOptions.TRACE_JSPTAGPERSISTENCE)
- {
- JSFCoreTraceOptions.log("Trying to load master index file: "
- + _storageFile.getAbsolutePath());
- }
-
- in = new FileInputStream(_storageFile);
- final ObjectInputStream objStream = new ObjectInputStream(in);
- MasterIndex index = (MasterIndex) objStream.readObject();
- _header = index._header;
- _projectIndices = index._projectIndices;
-
- if (JSFCoreTraceOptions.TRACE_JSPTAGPERSISTENCE)
- {
- JSFCoreTraceOptions
- .log("Loaded master index file successfully:"
- + _storageFile.getAbsolutePath());
- JSFCoreTraceOptions.log("Initial contents: ");
- System.out.println(index.toString());
- }
- }
- finally
- {
- if (in != null)
- {
- in.close();
- }
- }
- }
-
- public synchronized String toString()
- {
- StringBuffer buffer = new StringBuffer();
-
- buffer.append(String.format("Header: %s\n\n", _header.toString()));
-
- for (final ProjectIndex projIndex : _projectIndices)
- {
- buffer.append(String.format("\t%s\n", projIndex.toString()));
- }
-
- return buffer.toString();
- }
-
- public synchronized ProjectIndex getProjectIndex(final IProject project)
- {
- ProjectIndex index = findIndex(project);
-
- if (index != null)
- {
- return index;
- }
-
- // otherwise, create.
- index = new ProjectIndex(0, project.getName(), _repositoryPath);
- index.create();
- _projectIndices.add(index);
- try
- {
- save(_storageFile);
- }
- catch (IOException ioe)
- {
- JSFCorePlugin.log(ioe,
- "Failed to save master index. Project Index for "
- + project.toString() + " may not be saved");
- }
- return index;
- }
-
- public synchronized void removeProjectIndex(final IProject project) throws IOException
- {
- final ProjectIndex index = findIndex(project);
- if (index != null)
- {
- _projectIndices.remove(index);
- if (!index.remove())
- {
- throw new IOException("Failed to remove index file");
- }
- }
- }
-
- private ProjectIndex findIndex(final IProject project)
- {
- // check if the project already exists
- for (final ProjectIndex index : _projectIndices)
- {
- if (index.getProjectName().equals(project.getName()))
- {
- return index;
- }
- }
- return null;
- }
-
- private void writeObject(final java.io.ObjectOutputStream out)
- throws IOException
- {
- out.writeObject(_header);
- out.writeObject(_projectIndices);
- }
-
- private void readObject(final java.io.ObjectInputStream in)
- throws IOException, ClassNotFoundException
- {
- _header = (IndexHeader) in.readObject();
- _projectIndices = (List<ProjectIndex>) in.readObject();
- }
-
- private class IndexHeader implements Serializable
- {
- /**
- * serializable
- */
- private static final long serialVersionUID = 40851054201507727L;
-
- private final SerializableVersion _version;
- private long _lastModifiedStamp;
-
- public IndexHeader(final SerializableVersion version)
- {
- _version = version;
- _lastModifiedStamp = 0;
- }
-
- protected final Version getVersion()
- {
- return _version.getVersion();
- }
-
- protected final synchronized long modified()
- {
- return _lastModifiedStamp++;
- }
-
- protected final synchronized long getLastModifiedStamp()
- {
- return _lastModifiedStamp;
- }
-
- public String toString()
- {
- return "Version: " + _version.toString();
- }
- }
-
- static class SerializableVersion implements Serializable
- {
- private Version _version;
- /**
- *
- */
- private static final long serialVersionUID = 5973410328814890568L;
-
- public SerializableVersion(final int major, final int minor,
- final int micro)
- {
- _version = new Version(major, minor, micro);
- }
-
- public SerializableVersion(final String versionString)
- {
- _version = new Version(versionString);
- }
-
- public Version getVersion()
- {
- return _version;
- }
-
- public String toString()
- {
- return _version.toString();
- }
-
- private void writeObject(ObjectOutputStream out) throws IOException
- {
- out.writeObject(_version.toString());
- }
-
- private void readObject(ObjectInputStream in) throws IOException,
- ClassNotFoundException
- {
- final String versionString = (String) in.readObject();
- _version = new Version(versionString);
- }
- }
-
- static class ProjectIndex implements Serializable
- {
- /**
- *
- */
- private static final long serialVersionUID = 2864798175910805380L;
-
- private final String _projectName;
- private final String _relativePath;
- private final long _lastModStampOnProject;
- private File _file;
-
- /**
- * @param lastModStampOnProject
- * @param projectName
- * @param relativePath
- */
- public ProjectIndex(final long lastModStampOnProject,
- final String projectName, final String relativePath)
- {
- super();
- _lastModStampOnProject = lastModStampOnProject;
- _projectName = projectName;
- _relativePath = relativePath;
- }
-
- public boolean remove()
- {
- return _file.delete();
- }
-
- public synchronized void create()
- {
- final long uniqueCode = Math
- .round((Math.random() * Integer.MAX_VALUE));
- final String fileName = String.format("Project_%s_%x.idx",
- _projectName, Long.valueOf(uniqueCode));
- _file = new File(new Path(_relativePath).append(fileName)
- .toOSString());
- }
-
- public synchronized Map<String, SerializableTLDNamespace> getNamespaces()
- throws IOException, ClassNotFoundException
- {
- FileInputStream in = null;
-
- try
- {
- in = new FileInputStream(_file);
- final ObjectInputStream objStream = new ObjectInputStream(in);
- final Map<String, SerializableTLDNamespace> namespaces = (Map<String, SerializableTLDNamespace>) objStream
- .readObject();
- return namespaces;
- }
- catch (FileNotFoundException nfe)
- {
- return new HashMap<String, SerializableTLDNamespace>();
- }
- finally
- {
- if (in != null)
- {
- in.close();
- }
- }
- }
-
- public synchronized void save(
- final Map<String, SerializableTLDNamespace> namespaces)
- throws IOException
- {
- FileOutputStream out = null;
-
- try
- {
- out = new FileOutputStream(_file);
- final ObjectOutputStream objStream = new ObjectOutputStream(out);
- objStream.writeObject(namespaces);
- }
- finally
- {
- if (out != null)
- {
- out.close();
- }
- }
- }
-
- public String toString()
- {
- return "project= " + _projectName + ", relativePath="
- + _relativePath + ", lastModified="
- + _lastModStampOnProject + ", saveFile=" + _file;
- }
-
- // public synchronized void save()
- // {
- // if (_file != null)
- // {
- // doSave();
- // }
- // throw new NullPointerException("_file is null");
- // }
- //
- // private void doSave() throws IOException
- // {
- // FileOutputStream out = null;
- //
- // try
- // {
- // out = new FileOutputStream(_file);
- // final ObjectOutputStream objStream = new ObjectOutputStream(out);
- // objStream.writeObject(this);
- // }
- // finally
- // {
- // if (out != null)
- // {
- // out.close();
- // }
- // }
- // }
-
- protected final String getProjectName()
- {
- return _projectName;
- }
-
- protected final String getRelativePath()
- {
- return _relativePath;
- }
-
- protected final long getLastModStampOnProject()
- {
- return _lastModStampOnProject;
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/persistence/PersistedDataTagStrategy.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/persistence/PersistedDataTagStrategy.java
deleted file mode 100644
index a1eebbe..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/persistence/PersistedDataTagStrategy.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view.model.jsp.persistence;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ITagElement;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.core.internal.JSFCoreTraceOptions;
-import org.eclipse.jst.jsf.designtime.internal.Messages;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.JSPTagResolvingStrategy;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.TLDNamespace;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.TLDTagElement;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDDocument;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-
-/**
- * @author cbateman
- *
- */
-public class PersistedDataTagStrategy extends JSPTagResolvingStrategy
-{
- /**
- * the identifier of this strategy
- */
- public final static String ID = "org.eclipse.jst.jsf.designtime.PersistedDataTagStrategy"; //$NON-NLS-1$
- /**
- * the display name
- */
- public final static String DISPLAY_NAME = Messages.PersistedDataTagStrategy_DisplayName;
-
- private final IProject _project;
- private final TagRepository _repository;
- private Map<String, SerializableTLDNamespace> _namespaces;
- private final transient AtomicBoolean _reentrancyFlag = new AtomicBoolean(
- false);
-
- /**
- * @param project
- */
- public PersistedDataTagStrategy(final IProject project)
- {
- _project = project;
- _repository = new TagRepository(_project);
- }
-
- /**
- *
- */
- public void init()
- {
- if (JSFCoreTraceOptions.TRACE_JSPTAGPERSISTENCE)
- {
- JSFCoreTraceOptions
- .log("Initializing PersistedDataTagStrategy for project: " //$NON-NLS-1$
- + _project.toString());
- }
- try
- {
- _namespaces = _repository.load();
- return;
- }
- catch (final IOException e)
- {
- JSFCorePlugin
- .log(e,
- "JSP tag registry cached failed to load. Strategy will not be used"); //$NON-NLS-1$
- }
- catch (final ClassNotFoundException e)
- {
- JSFCorePlugin
- .log(e,
- "JSP tag registry cached failed to load. Strategy will not be used"); //$NON-NLS-1$
- }
- _namespaces = new HashMap<String, SerializableTLDNamespace>();
- }
-
- /**
- * @param namespace
- * @throws ClassNotFoundException
- * @throws IOException
- */
- public void save(final Map<String, TLDNamespace> namespace)
- throws IOException, ClassNotFoundException
- {
- if (JSFCoreTraceOptions.TRACE_JSPTAGPERSISTENCE)
- {
- JSFCoreTraceOptions
- .log("Saving PersistedDataTagStrategy for project: " //$NON-NLS-1$
- + _project.toString());
- }
-
- // namespace is considered authoritative for every key it contains
- // so copy them all in. However, preserve anything in our own namespace
- // map not found in namespace
- for (final Map.Entry<String, TLDNamespace> namespaceEntry : namespace
- .entrySet())
- {
- final TLDNamespace ns = namespaceEntry.getValue();
- final String nsName = namespaceEntry.getKey();
- final SerializableTLDNamespace myNs = _namespaces.get(nsName);
-
- if (myNs == null)
- {
- if (JSFCoreTraceOptions.TRACE_JSPTAGPERSISTENCE)
- {
- JSFCoreTraceOptions.log(String.format(
- "Adding namespace %s for project", ns.getNSUri(), //$NON-NLS-1$
- _project.toString()));
- }
-
- _namespaces.put(nsName, new SerializableTLDNamespace(ns));
- }
- else
- {
- if (JSFCoreTraceOptions.TRACE_JSPTAGPERSISTENCE)
- {
- JSFCoreTraceOptions.log(String.format(
- "Updating namespace %s for project", ns.getNSUri(), //$NON-NLS-1$
- _project.toString()));
- }
-
- for (final Map.Entry<String, ITagElement> elementEntry : ns
- .getCurrentElements().entrySet())
- {
- if (JSFCoreTraceOptions.TRACE_JSPTAGPERSISTENCE)
- {
- JSFCoreTraceOptions.log(String.format(
- "Putting element %s", elementEntry.getKey())); //$NON-NLS-1$
- }
- myNs.put(elementEntry.getKey(), elementEntry.getValue());
- }
- }
- }
-
- _repository.save(_namespaces);
- }
-
- @Override
- public ITagElement resolve(final TLDElementDeclaration element)
- {
- if (JSFCoreTraceOptions.TRACE_JSPTAGPERSISTENCE)
- {
- JSFCoreTraceOptions.log(String.format(
- "Attempting to resolve element %s for project %s", element //$NON-NLS-1$
- .getElementName(), _project));
- }
-
- try
- {
- if (!_reentrancyFlag.compareAndSet(false, true))
- {
- throw new IllegalStateException("Reentrant call to resolve"); //$NON-NLS-1$
- }
-
- final String uri = getUri(element);
- final String tagName = element.getElementName();
-
- if (uri != null && tagName != null)
- {
- final SerializableTLDNamespace ns = _namespaces.get(uri);
-
- if (ns != null)
- {
- final ITagElement tagElement = ns.getViewElement(tagName);
-
- if (tagElement instanceof TLDTagElement)
- {
- if (JSFCoreTraceOptions.TRACE_JSPTAGPERSISTENCE)
- {
- JSFCoreTraceOptions.log(String.format(
- "Resolved element %s for project %s", //$NON-NLS-1$
- element.getElementName(), _project));
- }
- return tagElement;
- }
- }
- }
- return getNotFoundIndicator();
- }
- finally
- {
- _reentrancyFlag.set(false);
- }
- }
-
- /**
- * Clears all cached data and removes it permanently from disk.
- */
- public void clear()
- {
- if (JSFCoreTraceOptions.TRACE_JSPTAGPERSISTENCE)
- {
- JSFCoreTraceOptions.log(String.format(
- "Flushing all data for project %s", _project)); //$NON-NLS-1$
- }
-
- try
- {
- _repository.clearAll();
- }
- catch (IOException e)
- {
- JSFCorePlugin.log(e, "Failure during cache flushing on project: " //$NON-NLS-1$
- + _project);
- }
- catch (ClassNotFoundException e)
- {
- JSFCorePlugin.log(e, "Failure during cache flushing on project: " //$NON-NLS-1$
- + _project);
- }
- _namespaces.clear();
- }
-
- public String getDisplayName()
- {
- return DISPLAY_NAME;
- }
-
- private static String getUri(final TLDElementDeclaration element)
- {
- final CMDocument owner = element.getOwnerDocument();
-
- if (owner instanceof TLDDocument)
- {
- return ((TLDDocument) owner).getUri();
- }
- return null;
- }
-
- @Override
- public String getId()
- {
- return ID;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/persistence/SerializableTLDNamespace.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/persistence/SerializableTLDNamespace.java
deleted file mode 100644
index b40878a..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/persistence/SerializableTLDNamespace.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view.model.jsp.persistence;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ITagElement;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.Namespace;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.TLDNamespace;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.TLDNamespace.TLDNamespaceData;
-
-/**
- * A serializable tld namespace. This is distinct from TLDNamespace in that it
- * takes a snapshot of a TLDNamespace at a point in time. Any elements not
- * lazily resolved by the TLDNamespace will not be resolved by this namespace.
- *
- */
-public class SerializableTLDNamespace extends Namespace
-{
- private final SerializedNamespaceData _data;
-
- /**
- * @param namespace
- */
- public SerializableTLDNamespace(final TLDNamespace namespace)
- {
- _data = new SerializedNamespaceData(namespace.getDisplayName(),
- namespace.getCurrentElements(), namespace.getNSUri());
- }
-
- /**
- *
- */
- private static final long serialVersionUID = 5364814479459691353L;
-
- @Override
- public String getDisplayName()
- {
- return _data.getDisplayName();
- }
-
- @Override
- public String getNSUri()
- {
- return _data.getUri();
- }
-
- @Override
- public ITagElement getViewElement(String name)
- {
- return _data.getViewElement(name);
- }
-
- @Override
- public Collection<? extends ITagElement> getViewElements()
- {
- return Collections.unmodifiableCollection(_data.getAllViewElements()
- .values());
- }
-
- @Override
- public boolean hasViewElements()
- {
- return _data.getNumTags() > 0;
- }
-
- @Override
- public boolean isInitialized()
- {
- return _data.isInitialized();
- }
-
- /* package */void put(final String name, final ITagElement tagElement)
- {
- _data._tags.put(name, tagElement);
- }
-
- private static class SerializedNamespaceData extends TLDNamespaceData
- {
- /**
- * serializable id
- */
- private static final long serialVersionUID = -6723194339788215607L;
- private final String _displayName;
- private final String _uri;
- private final Map<String, ITagElement> _tags;
-
- /**
- * @param displayName
- * @param tags
- * @param uri
- */
- private SerializedNamespaceData(String displayName,
- Map<String, ITagElement> tags, String uri)
- {
- super();
- _displayName = displayName;
- _tags = new HashMap<String, ITagElement>();
- for (final Map.Entry<String, ITagElement> tagEntry : tags.entrySet())
- {
- _tags.put(tagEntry.getKey(), tagEntry.getValue());
- }
- _uri = uri;
- }
-
- @Override
- public String getDisplayName()
- {
- return _displayName;
- }
-
- @Override
- public int getNumTags()
- {
- return _tags.size();
- }
-
- @Override
- public ITagElement getViewElement(String name)
- {
- return _tags.get(name);
- }
-
- @Override
- public String getUri()
- {
- return _uri;
- }
-
- @Override
- public Map<String, ITagElement> getAllViewElements()
- {
- return _tags;
- }
-
- @Override
- public boolean isInitialized()
- {
- return true;
- }
-
- @Override
- public Map<String, ITagElement> getCurrentElements()
- {
- return _tags;
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/persistence/TagRepository.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/persistence/TagRepository.java
deleted file mode 100644
index df457f8..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/persistence/TagRepository.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-/**
- *
- */
-package org.eclipse.jst.jsf.designtime.internal.view.model.jsp.persistence;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Map;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ITagElement;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.core.internal.JSFCoreTraceOptions;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.persistence.MasterIndex.ProjectIndex;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.persistence.MasterIndex.SerializableVersion;
-
-class TagRepository
-{
- private final static Object GLOBAL_MASTER_INDEX_LOCK = new Object();
- private static MasterIndex GLOBAL_MASTER_INDEX;
- private final static String PATH_TO_REPOSITORY = "/.jsptagregistry";
- private final static String MASTER_INDEX_FILE_NAME = "tagRegistryMasterIndex.idx";
-
- private final IProject _project;
- //private Map<String, SerializableTLDNamespace> _namespaces;
-
- public TagRepository(final IProject project)
- {
- _project = project;
- }
-
- public Map<String, SerializableTLDNamespace> load() throws IOException,
- ClassNotFoundException
- {
- if (JSFCoreTraceOptions.TRACE_JSPTAGPERSISTENCE)
- {
- JSFCoreTraceOptions.log("Loading tag repository for: "
- + _project.toString());
- }
-
- final MasterIndex index = getOrCreateMasterIndex();
-
- final ProjectIndex projIndex = index.getProjectIndex(_project);
- final Map<String, SerializableTLDNamespace> namespaces = projIndex.getNamespaces();
-
- if (JSFCoreTraceOptions.TRACE_JSPTAGPERSISTENCE)
- {
- JSFCoreTraceOptions.log("Contents of repo for: "
- + _project.toString());
-
- for (final Map.Entry<String, SerializableTLDNamespace> nsEntry : namespaces.entrySet())
- {
- JSFCoreTraceOptions.log("\tNamespace: "+nsEntry.getKey());
-
- SerializableTLDNamespace ns = nsEntry.getValue();
- for (final ITagElement element : ns.getViewElements())
- {
- JSFCoreTraceOptions.log("\t\tTag: "+element.toString());
- }
- }
- }
-
- return namespaces;
- }
-
- public void save(Map<String, SerializableTLDNamespace> namespaces) throws IOException,
- ClassNotFoundException
- {
- final MasterIndex index = getOrCreateMasterIndex();
- final ProjectIndex projectIndex = index.getProjectIndex(_project);
- projectIndex.save(namespaces);
- }
-
- public void clearAll() throws IOException, ClassNotFoundException
- {
- final MasterIndex index = getOrCreateMasterIndex();
- index.removeProjectIndex(_project);
- }
-
- private MasterIndex getOrCreateMasterIndex() throws IOException,
- ClassNotFoundException
- {
- final IPath wkspacePath = JSFCorePlugin.getDefault().getStateLocation();
- final IPath repoPath = wkspacePath.append(PATH_TO_REPOSITORY);
- final File repoDir = new File(repoPath.toOSString());
-
- synchronized (GLOBAL_MASTER_INDEX_LOCK)
- {
- if (GLOBAL_MASTER_INDEX != null)
- {
- if (JSFCoreTraceOptions.TRACE_JSPTAGPERSISTENCE)
- {
- JSFCoreTraceOptions
- .log("GLOBAL_MASTER_INDEX already exists for: "
- + _project.toString());
- }
- return GLOBAL_MASTER_INDEX;
- }
-
- if (!repoDir.exists())
- {
- createNewRepo(repoDir);
- }
-
- final File masterIndexFile = new File(new Path(repoDir
- .getAbsolutePath()).append(MASTER_INDEX_FILE_NAME)
- .toOSString());
- final MasterIndex index = new MasterIndex(masterIndexFile, repoDir.getAbsolutePath());
-
- if (!masterIndexFile.exists())
- {
- if (!masterIndexFile.createNewFile())
- {
- throw new IOException(
- "Could not create new master index file: "
- + masterIndexFile.toString());
- }
- if (JSFCoreTraceOptions.TRACE_JSPTAGPERSISTENCE)
- {
- JSFCoreTraceOptions.log("Creating master index file for "
- + _project.toString());
- }
- index.create(new SerializableVersion(1, 0, 0));
- }
- else
- {
- if (JSFCoreTraceOptions.TRACE_JSPTAGPERSISTENCE)
- {
- JSFCoreTraceOptions.log("Loading master index file for "
- + _project.toString());
- }
- index.load(new SerializableVersion(1, 0, 0));
- }
-
- GLOBAL_MASTER_INDEX = index;
- return index;
- }
- }
-
- private static void createNewRepo(final File repoDir) throws IOException
- {
- if (JSFCoreTraceOptions.TRACE_JSPTAGPERSISTENCE)
- {
- JSFCoreTraceOptions.log("Creating repo directory: "
- + repoDir.getAbsolutePath());
- }
-
- if (!repoDir.mkdir())
- {
- throw new IOException("Failed to create repo directory: "
- + repoDir.getAbsolutePath());
- }
- }
-}
\ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/registry/LibraryOperation.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/registry/LibraryOperation.java
deleted file mode 100644
index 31cfeb0..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/registry/LibraryOperation.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-/**
- *
- */
-package org.eclipse.jst.jsf.designtime.internal.view.model.jsp.registry;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsp.core.taglib.ITaglibRecord;
-
-abstract class LibraryOperation implements Runnable
-{
- protected final ITaglibRecord _changeRecord;
- private IStatus _result;
-
- protected LibraryOperation(final ITaglibRecord changeRecord)
- {
- _changeRecord = changeRecord;
- }
-
- public final void run()
- {
- try
- {
- _result = doRun();
- }
- catch (final Exception e)
- {
- _result = new Status(IStatus.ERROR, JSFCorePlugin.PLUGIN_ID,
- "Problem during run", e);
- }
- }
-
- public IStatus getResult()
- {
- return _result;
- }
-
- protected abstract IStatus doRun();
-}
\ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/registry/LibraryOperationFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/registry/LibraryOperationFactory.java
deleted file mode 100644
index 70f5d3f..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/registry/LibraryOperationFactory.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view.model.jsp.registry;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jst.jsp.core.taglib.ITaglibRecord;
-
-class LibraryOperationFactory
-{
- private final TLDTagRegistry _tagRegistry;
-
- public LibraryOperationFactory(final TLDTagRegistry tagRegistry)
- {
- _tagRegistry = tagRegistry;
- }
-
- LibraryOperation createAddOperation(final ITaglibRecord changeRecord)
- {
- return new AddTagLibrary(_tagRegistry, changeRecord);
- }
-
- LibraryOperation createRemoveOperation(final ITaglibRecord changeRecord)
- {
- return new RemoveTagLibrary(_tagRegistry, changeRecord);
- }
-
- LibraryOperation createChangeOperation(final ITaglibRecord changeRecord)
- {
- if (changeRecord == null)
- {
- throw new IllegalArgumentException();
- }
- return new ChangeTagLibrary(_tagRegistry, changeRecord);
- }
-
- private static class AddTagLibrary extends LibraryOperation
- {
- private final TLDTagRegistry _tagRegistry;
-
- public AddTagLibrary(final TLDTagRegistry tagRegistry,
- final ITaglibRecord newRecord)
- {
- super(newRecord);
- _tagRegistry = tagRegistry;
- }
-
- @Override
- protected IStatus doRun()
- {
- synchronized (_tagRegistry)
- {
- // fire change event if applicable
- _tagRegistry.initialize(_changeRecord, true);
- return Status.OK_STATUS;
- }
- }
- }
-
- private static class RemoveTagLibrary extends LibraryOperation
- {
- private final TLDTagRegistry _tagRegistry;
-
- protected RemoveTagLibrary(final TLDTagRegistry tagRegistry,
- final ITaglibRecord changeRecord)
- {
- super(changeRecord);
- _tagRegistry = tagRegistry;
- }
-
- @Override
- protected IStatus doRun()
- {
- _tagRegistry.remove(_changeRecord);
- return Status.OK_STATUS;
-
- }
-
- }
-
- private static class ChangeTagLibrary extends LibraryOperation
- {
- private final TLDTagRegistry _tagRegistry;
-
- protected ChangeTagLibrary(final TLDTagRegistry tagRegistry,
- final ITaglibRecord changeRecord)
- {
- super(changeRecord);
- _tagRegistry = tagRegistry;
- }
-
- @Override
- protected IStatus doRun()
- {
- IStatus result = null;
-
- synchronized (_tagRegistry)
- {
- result = new RemoveTagLibrary(_tagRegistry, _changeRecord).doRun();
-
- if (result.getSeverity() != IStatus.ERROR
- && result.getSeverity() != IStatus.CANCEL)
- {
- result = new AddTagLibrary(_tagRegistry, _changeRecord)
- .doRun();
- }
- }
-
- return result;
- }
-
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/registry/TLDRegistryManager.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/registry/TLDRegistryManager.java
deleted file mode 100644
index 094dff0..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/registry/TLDRegistryManager.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view.model.jsp.registry;
-
-import java.util.Collection;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ISaveContext;
-import org.eclipse.core.resources.ISaveParticipant;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jst.jsf.common.internal.resource.ResourceSingletonObjectManager;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.core.internal.JSFCoreTraceOptions;
-import org.eclipse.jst.jsf.designtime.internal.view.model.ITagRegistry;
-import org.eclipse.jst.jsf.designtime.internal.view.model.TagRegistryFactory;
-
-/**
- * A per-resource singleton manager for TLDTagRegistry's.
- *
- * @author cbateman
- *
- */
-public final class TLDRegistryManager extends
- ResourceSingletonObjectManager<TLDTagRegistry, IProject>
-{
- // STATIC
- private static TLDRegistryManager INSTANCE;
-
- /**
- * @return the singleton instance
- */
- private static TLDRegistryManager getGlobalManager()
- {
- synchronized (TLDRegistryManager.class)
- {
- if (INSTANCE == null)
- {
- if (JSFCoreTraceOptions.TRACE_TLDREGISTRYMANAGER)
- {
- JSFCoreTraceOptions
- .log("TLDRegistryManager: Initializing TLDRegistryManager singleton");
- }
- INSTANCE = new TLDRegistryManager();
- }
-
- return INSTANCE;
- }
- }
-
- private TLDRegistryManager()
- {
- final ISaveParticipant participant = new MyWorkspaceSaveParticipant();
-
- try
- {
- ResourcesPlugin.getWorkspace().addSaveParticipant(JSFCorePlugin.getDefault()
- , participant);
- }
- catch (CoreException e)
- {
- JSFCorePlugin.log(e, "TLDRegistryManager failed to install save participant");
- }
- }
-
- @Override
- protected TLDTagRegistry createNewInstance(final IProject project)
- {
- if (JSFCoreTraceOptions.TRACE_TLDREGISTRYMANAGER)
- {
- JSFCoreTraceOptions
- .log("TLDRegistryManager: creating new instance for "
- + project.toString());
- }
-
- return new TLDTagRegistry(project);
- }
-
- @Override
- protected void runAfterGetInstance(final IProject resource)
- {
- if (JSFCoreTraceOptions.TRACE_TLDREGISTRYMANAGER)
- {
- JSFCoreTraceOptions
- .log("TLDRegistryManager: Acquired instance for "
- + resource.toString());
- }
- }
-
- @Override
- protected void runBeforeGetInstance(final IProject resource)
- {
- if (JSFCoreTraceOptions.TRACE_TLDREGISTRYMANAGER)
- {
- JSFCoreTraceOptions.log("TLDRegistryManager: Getting registry for "
- + resource.toString());
- }
- }
-
- /**
- * Adapter used to allow creation by extension point.
- *
- * @author cbateman
- *
- */
- public static class MyRegistryFactory extends TagRegistryFactory
- {
- @Override
- public ITagRegistry createTagRegistry(IProject project)
- throws TagRegistryFactoryException
- {
- try
- {
- return getGlobalManager().getInstance(project);
- }
- catch (ManagedObjectException e)
- {
- throw new TagRegistryFactoryException(e);
- }
- }
-
- public String getDisplayName()
- {
- return "JSP Registry Factory";
- }
-
- }
-
- private class MyWorkspaceSaveParticipant implements ISaveParticipant
- {
- public void saving(ISaveContext context) throws CoreException
- {
- if (JSFCoreTraceOptions.TRACE_TLDREGISTRYMANAGER)
- {
- JSFCoreTraceOptions.log("MyWorkspaceSaveParticipant.saving: Kind="+context.getKind());
- }
- try
- {
- if (context.getKind() == ISaveContext.FULL_SAVE)
- {
- final Collection<IProject> projects = TLDRegistryManager.this
- .getManagedResources();
-
- for (final IProject project : projects)
- {
- saveProject(project);
- }
- }
- else if (context.getKind() == ISaveContext.PROJECT_SAVE)
- {
- saveProject(context.getProject());
- }
-
- }
- catch (ManagedObjectException moe)
- {
- throw new CoreException(new Status(IStatus.ERROR,
- JSFCorePlugin.PLUGIN_ID, "Couldn't commit workspace",
- moe));
- }
- }
-
- private void saveProject(final IProject project)
- throws ManagedObjectException
- {
- if (JSFCoreTraceOptions.TRACE_TLDREGISTRYMANAGER)
- {
- JSFCoreTraceOptions.log("MyWorkspaceSaveParticipant.saveProject: Project="+project.toString());
- }
-
- // check that there is already instance -- don't do anything if there
- // isn't already an instance for project.
- if (TLDRegistryManager.this.isInstance(project))
- {
- final TLDTagRegistry registry = TLDRegistryManager.this
- .getInstance(project);
- if (JSFCoreTraceOptions.TRACE_TLDREGISTRYMANAGER)
- {
- JSFCoreTraceOptions.log("MyWorkspaceSaveParticipant.saveProject: calling checkpoint on registry: "+registry.toString());
- }
-
- registry.checkpoint();
- }
- }
-
- public void doneSaving(ISaveContext context)
- {
- // nothing to do
- }
-
- public void prepareToSave(ISaveContext context) throws CoreException
- {
- // nothing to do
- }
-
- public void rollback(ISaveContext context)
- {
- // nothing to do
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/registry/TLDRegistryPreferences.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/registry/TLDRegistryPreferences.java
deleted file mode 100644
index aa0ed8f5..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/registry/TLDRegistryPreferences.java
+++ /dev/null
@@ -1,277 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view.model.jsp.registry;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jst.jsf.common.internal.policy.OrderedListProvider;
-import org.eclipse.jst.jsf.common.internal.policy.OrderedListProvider.OrderableObject;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.DefaultJSPTagResolver;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.TagIntrospectingStrategy;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.persistence.PersistedDataTagStrategy;
-
-/**
- * Preferences model for the TLD registry
- *
- * @author cbateman
- *
- */
-public class TLDRegistryPreferences
-{
- private final IPreferenceStore _prefStore;
-
- private final static String KEY_STRATEGY_ID_ORDER = "org.eclipse.jst.jsf.designtime.jsp.registry.StrategyIDOrder";
-
- private final static List<OrderableObject> DEFAULT_STRATEGY_ORDER;
-
- static
- {
- final List<OrderableObject> list = new ArrayList<OrderableObject>();
- list.add(new OrderableObject(new StrategyIdentifier(PersistedDataTagStrategy.DISPLAY_NAME,
- PersistedDataTagStrategy.ID), true));
- list.add(new OrderableObject(new StrategyIdentifier(DefaultJSPTagResolver.DISPLAY_NAME,
- DefaultJSPTagResolver.ID), true));
- list.add(new OrderableObject(new StrategyIdentifier(TagIntrospectingStrategy.DISPLAY_NAME,
- TagIntrospectingStrategy.ID), true));
- // list.add(UnresolvedJSPTagResolvingStrategy.ID);
- DEFAULT_STRATEGY_ORDER = Collections.unmodifiableList(list);
- }
-
- private List<OrderableObject> _ids;
- private List<OrderableObject> _originalIds;
-
- /**
- * Constructor
- *
- * @param prefStore
- */
- public TLDRegistryPreferences(final IPreferenceStore prefStore)
- {
- _prefStore = prefStore;
- _ids = new ArrayList<OrderableObject>();
- }
-
- /**
- * IPreferenceStore The default preference loader
- */
- public void load()
- {
- load(_prefStore);
- }
-
- /**
- * @return the ordered list provider for the strategy id ordering
- */
- public OrderedListProvider getOrderedListProvider()
- {
- return new MyOrderedListProvider();
- }
-
- /**
- * @return the strategy id ordering
- */
- public List<OrderableObject> getStrategyIdOrdering()
- {
- return _ids;
- }
-
- /**
- * @param ids
- */
- public void setStrategyIdOrdering(final List<OrderableObject> ids)
- {
- _ids = ids;
- }
-
- /**
- * @return the list of strategy ids in the order they should be consulted
- */
- public List<String> getEnabledIds()
- {
- final List<String> strategies = new ArrayList<String>();
-
- for (final OrderableObject id : _ids)
- {
- if (id.isEnabled())
- {
- StrategyIdentifier strategyId = (StrategyIdentifier) id.getObject();
- strategies.add(strategyId.getId());
- }
- }
- return strategies;
- }
-
- /**
- * Loads preferences from prefStore
- *
- * @param prefStore
- */
- private void load(final IPreferenceStore prefStore)
- {
- if (!prefStore.contains(KEY_STRATEGY_ID_ORDER))
- {
- prefStore.setDefault(KEY_STRATEGY_ID_ORDER,
- serialize(DEFAULT_STRATEGY_ORDER));
- }
- List<OrderableObject> ids = deserialize(prefStore
- .getString(KEY_STRATEGY_ID_ORDER));
- if (ids == null)
- {
- ids = deserialize(serialize(DEFAULT_STRATEGY_ORDER));
- }
- _ids = ids;
- final List<OrderableObject> originalList = new ArrayList<OrderableObject>();
- for (final OrderableObject id : _ids)
- {
- final OrderableObject copy = id.clone();
- originalList.add(copy);
- }
- _originalIds = Collections.unmodifiableList(originalList);
- }
-
- private String serialize(final List<OrderableObject> ids)
- {
- final StringBuffer buffer = new StringBuffer();
-
- for (final OrderableObject id : ids)
- {
- StrategyIdentifier strategyId = (StrategyIdentifier) id.getObject();
- buffer.append(strategyId.getDisplayName());
- buffer.append(",");
- buffer.append(strategyId.getId());
- buffer.append(",");
- buffer.append(id.isEnabled());
- buffer.append(",");
- }
- return buffer.toString();
- }
-
- private List<OrderableObject> deserialize(final String serializedList)
- {
- final List<OrderableObject> list = new ArrayList<OrderableObject>();
- final String[] ids = serializedList.split(",");
- if ((ids.length % 3) != 0)
- {
- return new ArrayList<OrderableObject>();
- }
-
- for (int i = 0; i < ids.length; i += 3)
- {
- final String displayName = ids[i];
- String id = ids[i + 1];
- final String enabled = ids[i + 2];
-
- // fix old id for meta-data resolver
- if ("org.eclipse.jst.jsf.THISISTEMPORARY".equals(id))
- {
- id = DefaultJSPTagResolver.ID;
- }
-
- final StrategyIdentifier strategyIdentifier = new StrategyIdentifier(
- displayName, id);
- list.add(new OrderableObject(strategyIdentifier
- , Boolean.valueOf(enabled).booleanValue()));
- }
- return list;
- }
-
- /**
- * Commits but does not store the preferences
- *
- * @param prefStore
- */
- public void commit(final IPreferenceStore prefStore)
- {
- prefStore.setValue(KEY_STRATEGY_ID_ORDER,
- serialize(getStrategyIdOrdering()));
- }
-
- /**
- * Reverts the model to it's defaults. Does not commit to pref store.
- */
- public void setDefaults()
- {
- setStrategyIdOrdering(new ArrayList<OrderableObject>(
- DEFAULT_STRATEGY_ORDER));
- }
-
- /**
- * @return true if this preference object's properties have
- * changed since load() was last called.
- */
- public boolean isDirty()
- {
- // dirty if the current list is not equal to the original list
- // generated at load time.
- return !(_ids.equals(_originalIds));
- }
-
- /**
- * Used as the model for sorting and enabling strategy identifiers.
- *
- */
- public static class StrategyIdentifier
- {
- private final String _id;
- private final String _displayName;
-
- StrategyIdentifier(final String displayName, final String id)
- {
- _displayName = displayName;
- _id = id;
- }
-
- /**
- * @return the id
- */
- public String getId()
- {
- return _id;
- }
-
- /**
- * @return the display name for the strategy
- */
- public String getDisplayName()
- {
- return _displayName;
- }
-
- @Override
- public boolean equals(Object obj)
- {
- if (obj instanceof StrategyIdentifier)
- {
- return _id.equals(((StrategyIdentifier)obj)._id);
- }
- return false;
- }
-
- @Override
- public int hashCode()
- {
- return _id.hashCode();
- }
- }
-
- private class MyOrderedListProvider extends OrderedListProvider
- {
- @Override
- protected List<OrderableObject> createAndPopulateOrderedObjects()
- {
- return _ids;
- }
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/registry/TLDTagRegistry.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/registry/TLDTagRegistry.java
deleted file mode 100644
index 96598e4..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/registry/TLDTagRegistry.java
+++ /dev/null
@@ -1,456 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.internal.view.model.jsp.registry;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentLinkedQueue;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jst.jsf.common.internal.managedobject.IManagedObject;
-import org.eclipse.jst.jsf.common.internal.policy.IdentifierOrderedIteratorPolicy;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.Namespace;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.core.internal.JSFCoreTraceOptions;
-import org.eclipse.jst.jsf.designtime.internal.view.model.AbstractTagRegistry;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.CompositeTagResolvingStrategy;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.DefaultJSPTagResolver;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.TLDNamespace;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.TagIntrospectingStrategy;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.UnresolvedJSPTagResolvingStrategy;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.persistence.PersistedDataTagStrategy;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.CMDocumentFactoryTLD;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDDocument;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDElementDeclaration;
-import org.eclipse.jst.jsp.core.taglib.ITLDRecord;
-import org.eclipse.jst.jsp.core.taglib.ITaglibRecord;
-import org.eclipse.jst.jsp.core.taglib.TaglibIndex;
-
-/**
- * Registry of all tld-defined tags for a particular project classpath
- *
- * @author cbateman
- *
- */
-public final class TLDTagRegistry extends AbstractTagRegistry implements
- IManagedObject
-{
- // INSTANCE
- private final IProject _project;
- private final Map<String, TLDNamespace> _nsResolved;
- private final CompositeTagResolvingStrategy<TLDElementDeclaration> _resolver;
- private boolean _hasBeenInitialized = false;
- private final ConcurrentLinkedQueue<LibraryOperation> _changeOperations = new ConcurrentLinkedQueue<LibraryOperation>();
- private final Job _changeJob;
- private final PersistedDataTagStrategy _persistedTagStrategy;
- private TagIndexListener _tagIndexListener;
- private TLDRegistryPreferences _prefs;
-
- TLDTagRegistry(final IProject project)
- {
- _project = project;
- _nsResolved = new HashMap<String, TLDNamespace>();
-
- _prefs = new TLDRegistryPreferences(JSFCorePlugin.getDefault().getPreferenceStore());
- _prefs.load();
- final IdentifierOrderedIteratorPolicy<String> policy =
- getTagResolvingPolicy();
- // exclude things that are not explicitly listed in the policy. That
- // way preference-based disablement will cause those strategies to
- // be excluded.
- policy.setExcludeNonExplicitValues(true);
- _resolver = new CompositeTagResolvingStrategy<TLDElementDeclaration>(
- policy);
-
- // add the strategies
- _resolver.addStrategy(new TagIntrospectingStrategy(_project));
- _resolver.addStrategy(new DefaultJSPTagResolver(_project));
- // makes sure that a tag element will always be created for any
- // given tag definition even if other methods fail
- _resolver.addStrategy(new UnresolvedJSPTagResolvingStrategy());
- _persistedTagStrategy = new PersistedDataTagStrategy(_project);
- _persistedTagStrategy.init();
- _resolver.addStrategy(_persistedTagStrategy);
-
- _changeJob = new ChangeJob(project.getName());
- }
-
- private IdentifierOrderedIteratorPolicy<String> getTagResolvingPolicy()
- {
- // strategy ordering
- final List<String> prefOrdering = _prefs.getEnabledIds();
- final List<String> strategyOrdering = new ArrayList<String>(prefOrdering);
-
- // this strategy must always be here, always last
- strategyOrdering.add(UnresolvedJSPTagResolvingStrategy.ID);
-
- final IdentifierOrderedIteratorPolicy<String> policy = new IdentifierOrderedIteratorPolicy<String>(
- strategyOrdering);
- return policy;
- }
-
- protected final void doDispose()
- {
- if (JSFCoreTraceOptions.TRACE_JSPTAGREGISTRY)
- {
- JSFCoreTraceOptions.log("TLDTagRegistry: Disposing for project "
- + _project.toString());
- }
-
- // call checkpoint to flush serializable data
- checkpoint();
- //_persistedTagStrategy.dispose();
-
- _nsResolved.clear();
- _changeOperations.clear();
-
- if (JSFCoreTraceOptions.TRACE_JSPTAGREGISTRY)
- {
- JSFCoreTraceOptions
- .log("TLDTagRegistry: Done disposing registry for "
- + _project.toString());
- }
- }
-
- @Override
- protected void cleanupPersistentState()
- {
- // TODO
- }
-
- public synchronized void checkpoint()
- {
- try
- {
- _persistedTagStrategy.save(_nsResolved);
- }
- catch (IOException e)
- {
- JSFCorePlugin.log(e, "Checkpointing JSP tags failed");
- }
- catch (ClassNotFoundException e)
- {
- JSFCorePlugin.log(e, "Checkpointing JSP tags failed");
- }
- }
-
- @Override
- protected Job getRefreshJob(final boolean flushCaches)
- {
- return new Job("Refreshing JSP tag registry for " + _project.getName())
- {
- @Override
- protected IStatus run(final IProgressMonitor monitor)
- {
- if (JSFCoreTraceOptions.TRACE_JSPTAGREGISTRY)
- {
- JSFCoreTraceOptions.log("TLDTagRegistry.refresh: start");
- }
-
- synchronized (TLDTagRegistry.this)
- {
- if (JSFCoreTraceOptions.TRACE_JSPTAGREGISTRY)
- {
- JSFCoreTraceOptions
- .log("TLDTagRegistry.refresh: start");
- }
-
- final List<Namespace> namespaces = new ArrayList(
- _nsResolved.values());
-
- if (flushCaches)
- {
- _persistedTagStrategy.clear();
- }
- // if we aren't flushing caches, then check point the
- // current namespace data, so it isn't lost when we clear
- // the namespaces
- else
- {
- checkpoint();
- }
-
- _nsResolved.clear();
-
- fireEvent(new TagRegistryChangeEvent(TLDTagRegistry.this,
- TagRegistryChangeEvent.EventType.REMOVED_NAMESPACE,
- namespaces));
- initialize(true);
-
- if (JSFCoreTraceOptions.TRACE_JSPTAGREGISTRY)
- {
- JSFCoreTraceOptions
- .log("TLDTagRegistry.refresh: finished");
- }
- return Status.OK_STATUS;
- }
- }
- };
- }
-
- /**
- */
- private void initialize(boolean fireEvent)
- {
- if (JSFCoreTraceOptions.TRACE_JSPTAGREGISTRY)
- {
- JSFCoreTraceOptions.log("TLDTagRegistry.initialize: start");
- }
-
- final ITaglibRecord[] tldrecs = TaglibIndex
- .getAvailableTaglibRecords(_project.getFullPath());
- final List<Namespace> affectedObjects = new ArrayList<Namespace>();
- for (final ITaglibRecord tldrec : tldrecs)
- {
- // defer the event
- final Namespace ns = initialize(tldrec, fireEvent);
-
- if (ns != null)
- {
- affectedObjects.add(ns);
- }
- }
-
- _hasBeenInitialized = true;
-
- // if tag index listener does exist, add it
- if (_tagIndexListener == null)
- {
- if (JSFCoreTraceOptions.TRACE_TLDREGISTRYMANAGER)
- {
- JSFCoreTraceOptions
- .log("TLDRegistryManager: installing tag index listener due to create instance for "
- + _project.toString());
- }
-
- _tagIndexListener = new TagIndexListener(this);
- TaglibIndex.addTaglibIndexListener(_tagIndexListener);
- }
-
- // if (affectedObjects.size() > 0)
- // {
- // fireEvent(new TagRegistryChangeEvent(this,
- // TagRegistryChangeEvent.EventType.ADDED_NAMESPACE,
- // affectedObjects));
- // }
-
- if (JSFCoreTraceOptions.TRACE_JSPTAGREGISTRY)
- {
- JSFCoreTraceOptions.log("TLDTagRegistry.initialize: finished");
- }
- }
-
- TLDNamespace initialize(final ITaglibRecord tagRecord,
- final boolean fireEvent)
- {
- if (tagRecord.getRecordType() == ITLDRecord.URL)
- {
- if (JSFCoreTraceOptions.TRACE_JSPTAGREGISTRY_CHANGES)
- {
- JSFCoreTraceOptions.log("TLDTagRegistry.initialize_TagRecord: Initializing new tld record: "+tagRecord.toString());
- }
- long startTime = 0;
-
- if (JSFCoreTraceOptions.TRACE_JSPTAGREGISTRY_PERF)
- {
- startTime = System.nanoTime();
- }
-
- final CMDocumentFactoryTLD factory = new CMDocumentFactoryTLD();
- final TLDDocument doc = (TLDDocument) factory
- .createCMDocument(tagRecord);
- if (doc != null)
- {
- final TLDNamespace ns = new TLDNamespace(doc, _resolver);
- _nsResolved.put(doc.getUri(), ns);
-
- if (fireEvent)
- {
- fireEvent(new TagRegistryChangeEvent(this,
- TagRegistryChangeEvent.EventType.ADDED_NAMESPACE,
- Collections.singletonList(ns)));
- }
-
- if (JSFCoreTraceOptions.TRACE_JSPTAGREGISTRY_PERF)
- {
- System.out.printf("Time to update namespace %s was %d\n",
- ns.getNSUri(), Long.valueOf(System.nanoTime()
- - startTime));
- }
- return ns;
- }
- }
- else
- {
- if (JSFCoreTraceOptions.TRACE_JSPTAGREGISTRY_CHANGES)
- {
- JSFCoreTraceOptions.log("TLDTagRegistry.initialize_TagRecord: Skipping tag record for "+tagRecord.toString());
- }
-
- }
- // no new namespace
- return null;
- }
-
- void remove(final ITaglibRecord tagRecord)
- {
- final CMDocumentFactoryTLD factory = new CMDocumentFactoryTLD();
- final TLDDocument doc = (TLDDocument) factory
- .createCMDocument(tagRecord);
-
- final TLDNamespace ns = _nsResolved.remove(doc.getUri());
-
- if (ns != null)
- {
- fireEvent(new TagRegistryChangeEvent(this,
- TagRegistryChangeEvent.EventType.REMOVED_NAMESPACE,
- Collections.singletonList(ns)));
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.jsf.designtime.internal.view.model.jsp.registry.ITagRegistry#getAllTagLibraries()
- */
- public final synchronized Collection<? extends Namespace> getAllTagLibraries()
- {
- if (JSFCoreTraceOptions.TRACE_JSPTAGREGISTRY)
- {
- JSFCoreTraceOptions.log("TLDTagRegistry.getAllTagLibraries: start");
- }
- long startTime = 0;
-
- if (JSFCoreTraceOptions.TRACE_JSPTAGREGISTRY_PERF)
- {
- startTime = System.nanoTime();
- }
-
- if (!_hasBeenInitialized)
- {
- initialize(false);
- }
-
- final Set<TLDNamespace> allTagLibraries = new HashSet<TLDNamespace>();
- allTagLibraries.addAll(_nsResolved.values());
-
- if (JSFCoreTraceOptions.TRACE_JSPTAGREGISTRY_PERF)
- {
- System.out.println("Time to getAllTagLibraries for JSP: "+(System.nanoTime()-startTime));
- }
- if (JSFCoreTraceOptions.TRACE_JSPTAGREGISTRY)
- {
- JSFCoreTraceOptions
- .log("TLDTagRegistry.getAllTagLibraries: finished");
- }
- return allTagLibraries;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.jsf.designtime.internal.view.model.jsp.registry.ITagRegistry#getTagLibrary(java.lang.String)
- */
- public final synchronized Namespace getTagLibrary(final String uri)
- {
- if (JSFCoreTraceOptions.TRACE_JSPTAGREGISTRY)
- {
- JSFCoreTraceOptions.log("TLDTagRegistry.getTagLibrary: start uri="
- + uri);
- }
-
- if (!_hasBeenInitialized)
- {
- initialize(false);
- }
-
- final Namespace ns = _nsResolved.get(uri);
-
- if (JSFCoreTraceOptions.TRACE_JSPTAGREGISTRY)
- {
- JSFCoreTraceOptions
- .log("TLDTagRegistry.getTagLibrary: finished, result="
- + ns.toString());
- }
- return ns;
- }
-
- @Override
- public String toString()
- {
- return String
- .format(
- "TLDRegistry for project %s, isDisposed=%s, hasBeenInitialized=%s, numberOfNamespace=%d",
- _project.toString(), Boolean.valueOf(isDisposed()),
- Boolean.valueOf(_hasBeenInitialized), Integer
- .valueOf(_nsResolved.size()));
- }
-
- void addLibraryOperation(final LibraryOperation operation)
- {
- _changeOperations.add(operation);
- _changeJob.schedule();
- }
-
-
- private class ChangeJob extends Job
- {
- private int _rescheduleTime = -1;
-
- public ChangeJob(final String projectName)
- {
- super("Update job for project " + projectName);
- }
-
- @Override
- protected IStatus run(final IProgressMonitor monitor)
- {
- synchronized (TLDTagRegistry.this)
- {
- _rescheduleTime = -1;
-
- LibraryOperation operation = null;
- final MultiStatus multiStatus = new MultiStatus(
- JSFCorePlugin.PLUGIN_ID, 0, "Result of change job",
- new Throwable());
- while ((operation = _changeOperations.poll()) != null)
- {
- _rescheduleTime = 10000; // ms
-
- operation.run();
- multiStatus.add(operation.getResult());
- }
-
- if (_rescheduleTime >= 0 && !monitor.isCanceled())
- {
- // if any operations were found on this run, reschedule
- // to run again in 10seconds based on the assumption that
- // events may be coming in bursts
- schedule(_rescheduleTime);
- }
-
- return multiStatus;
- }
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/registry/TagIndexListener.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/registry/TagIndexListener.java
deleted file mode 100644
index 0c075af..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/model/jsp/registry/TagIndexListener.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-/**
- *
- */
-package org.eclipse.jst.jsf.designtime.internal.view.model.jsp.registry;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.jsf.core.internal.JSFCoreTraceOptions;
-import org.eclipse.jst.jsp.core.taglib.ITaglibIndexDelta;
-import org.eclipse.jst.jsp.core.taglib.ITaglibIndexListener;
-
-class TagIndexListener implements ITaglibIndexListener
-{
- private final TLDTagRegistry _registry;
- private final LibraryOperationFactory _factory;
-
- TagIndexListener(final TLDTagRegistry registry)
- {
- _registry = registry;
- _factory = new LibraryOperationFactory(_registry);
- }
-
- public void indexChanged(final ITaglibIndexDelta delta)
- {
- if (JSFCoreTraceOptions.TRACE_JSPTAGREGISTRY_CHANGES)
- {
- JSFCoreTraceOptions.log("TagIndexListener.indexChanged: start");
- }
-
- visitDelta(delta);
-
- if (JSFCoreTraceOptions.TRACE_JSPTAGREGISTRY_CHANGES)
- {
- JSFCoreTraceOptions.log("TagIndexListener.indexChanged: finish");
- }
- }
-
- private void visitDelta(final ITaglibIndexDelta delta)
- {
- final IProject project = delta.getProject();
-
- if (_registry != null && !_registry.isDisposed()
- && delta.getTaglibRecord() != null)
- {
- switch (delta.getKind())
- {
- case ITaglibIndexDelta.ADDED:
- {
- if (JSFCoreTraceOptions.TRACE_JSPTAGREGISTRY_CHANGES)
- {
- JSFCoreTraceOptions.log(String.format(
- "Processing add change: project=%s", project
- .getName()));
- }
-
- _registry.addLibraryOperation(_factory
- .createAddOperation(delta.getTaglibRecord()));
- }
- break;
- case ITaglibIndexDelta.REMOVED:
- {
- if (JSFCoreTraceOptions.TRACE_JSPTAGREGISTRY_CHANGES)
- {
- JSFCoreTraceOptions
- .log(String
- .format(
- "Processing remove change: project=%s, tagrecord=%s",
- project.getName()));
- }
- _registry.addLibraryOperation(_factory
- .createRemoveOperation(delta.getTaglibRecord()));
- }
- break;
- case ITaglibIndexDelta.CHANGED:
- {
- if (JSFCoreTraceOptions.TRACE_JSPTAGREGISTRY_CHANGES)
- {
- JSFCoreTraceOptions.log(String.format(
- "Processing change: project=%s, tagrecord=%s",
- project.getName()));
- }
- _registry.addLibraryOperation(_factory
- .createChangeOperation(delta.getTaglibRecord()));
- }
- break;
- }
- }
-
- // visit children
- for (final ITaglibIndexDelta child : delta.getAffectedChildren())
- {
- visitDelta(child);
- }
- }
-}
\ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/messages.properties b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/messages.properties
deleted file mode 100644
index adccd45..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/messages.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2007 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are 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:
-# Oracle Corporation - initial API and implementation
-###############################################################################
-AbstractDataModelVariableFactory.DataModel.Symbol.RowVariable.DetailedDescription=Row variable for dataTable
-JSPDefaultSymbolFactory.Resource.bundle.map.detailedDescription=Resource bundle map for bundle <i>
-JSPDefaultSymbolFactory.Problem.ErrorCreatingVariable=Error creating loadBundle variable
-ResourceBundleSymbolSourceProvider.DetailedDescription=Resource bundle map for bundle <i>
-DefaultBeanSymbolSourceProvider.AdditionalInformation.Name=Name:
-DefaultBeanSymbolSourceProvider.AdditionalInformation.Type=Type:
-DefaultBeanSymbolSourceProvider.AdditionalInformation.Scope=Scope:
-DefaultBeanSymbolSourceProvider.AdditionalInformation.Description=Description:
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/package-info.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/package-info.java
deleted file mode 100644
index 9f687e3..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/package-info.java
+++ /dev/null
@@ -1,16 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-/**
- * JSF Design Time Application Manager Framework.
- */
-package org.eclipse.jst.jsf.designtime;
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/resolver/AbstractStructuredDocumentSymbolResolverFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/resolver/AbstractStructuredDocumentSymbolResolverFactory.java
deleted file mode 100644
index 3fb922c..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/resolver/AbstractStructuredDocumentSymbolResolverFactory.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.resolver;
-
-import org.eclipse.jst.jsf.context.IModelContext;
-
-/**
- * A base class for symbol resolver factories.
- *
- * @author cbateman
- *
- */
-public abstract class AbstractStructuredDocumentSymbolResolverFactory implements
- IStructuredDocumentSymbolResolverFactory
-{
- /**
- * @see org.eclipse.jst.jsf.designtime.resolver.IStructuredDocumentSymbolResolverFactory#getSymbolContextResolver(org.eclipse.jst.jsf.context.IModelContext)
- */
- public abstract ISymbolContextResolver getSymbolContextResolver(IModelContext context);
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/resolver/AbstractSymbolContextResolver.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/resolver/AbstractSymbolContextResolver.java
deleted file mode 100644
index aa766a7..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/resolver/AbstractSymbolContextResolver.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.resolver;
-
-import org.eclipse.jst.jsf.context.IModelContext;
-import org.eclipse.jst.jsf.context.symbol.IMethodSymbol;
-import org.eclipse.jst.jsf.context.symbol.IObjectSymbol;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-
-
-/**
- * An abstract that should sub-classed by clients wishing to implement
- * the ISymbolContextResolver interface
- *
- * @author cbateman
- *
- */
-public abstract class AbstractSymbolContextResolver implements ISymbolContextResolver
-{
- public abstract ISymbol[] getAllVariables();
-
- public abstract IMethodSymbol getMethod(IObjectSymbol base, Object methodName);
-
- public abstract ISymbol[] getMethods(IObjectSymbol base);
-
- public abstract ISymbol[] getProperties(ISymbol symbol);
-
- public abstract ISymbol getProperty(ISymbol symbol, Object propertyName);
-
- public abstract ISymbol getVariable(String name);
-
- public abstract boolean canResolveContext(IModelContext modelContext);
-
- /**
- * Default implementation
- *
- * We should avoid returning true unless we are positive that changing
- * to this context won't change the way symbols are resolved.
- */
- public boolean hasSameResolution(IModelContext modelContext)
- {
- return false;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/resolver/CachingSymbolContextResolver.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/resolver/CachingSymbolContextResolver.java
deleted file mode 100644
index 200b144..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/resolver/CachingSymbolContextResolver.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.resolver;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.jst.jsf.context.IModelContext;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.symbol.IMethodSymbol;
-import org.eclipse.jst.jsf.context.symbol.IObjectSymbol;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.context.symbol.SymbolFactory;
-
-/**
- * A symbol resolver that delegates to the default SymbolContextResolver, but
- * caches the results and returns those on subsequent calls.
- *
- * WARNING: this resolver is suitable *only* in situations where the state
- * of dependent symbol sources won't change between calls. This resolver makes
- * no attempt to ensure that cached data is in sync with changes to symbols
- * such addition, modification or removal of Java class underlying beans.
- *
- * NOTE: this resolver is experimental and should NOT be considered API
- *
- * Clients should not use this resolver directly. Access it through the factory instead
- * @author cbateman
- *
- */
-public final class CachingSymbolContextResolver extends AbstractSymbolContextResolver
-{
- private final static ISymbol SYMBOL_NOT_FOUND = SymbolFactory.eINSTANCE.createIComponentSymbol();
- private final static IMethodSymbol METHOD_SYMBOL_NOT_FOUND =
- SymbolFactory.eINSTANCE.createIMethodSymbol();
-
- private final SymbolContextResolver _delegate;
-
- private final Map<String, ISymbol> _variablesByName = new HashMap<String, ISymbol>();
- private ISymbol[] _allVariables;
-
- private final Map<ISymbol, Map<Object, ISymbol>> _propertiesByOwner =
- new HashMap<ISymbol, Map<Object,ISymbol>>();
- private ISymbol[] _allProperties;
-
- private final Map<IObjectSymbol, Map<Object, IMethodSymbol>> _methodsByOwner =
- new HashMap<IObjectSymbol, Map<Object,IMethodSymbol>>();
- private ISymbol[] _allMethods;
-
- /**
- * @param context
- */
- public CachingSymbolContextResolver(final IStructuredDocumentContext context)
- {
- _delegate = new SymbolContextResolver(context);
- }
-
- @Override
- public boolean canResolveContext(final IModelContext modelContext)
- {
- return _delegate.canResolveContext(modelContext);
- }
-
- @Override
- public ISymbol[] getAllVariables()
- {
- if (_allVariables == null)
- {
- _allVariables = _delegate.getAllVariables();
- }
- return _allVariables;
- }
-
- @Override
- public IMethodSymbol getMethod(final IObjectSymbol base, final Object methodName)
- {
- Map<Object, IMethodSymbol> methods = _methodsByOwner.get(base);
-
- if (methods == null)
- {
- methods = new HashMap<Object, IMethodSymbol>();
- _methodsByOwner.put(base, methods);
- }
-
- IMethodSymbol method = methods.get(methodName);
-
- if (method == SYMBOL_NOT_FOUND)
- {
- method = null;
- }
- else
- {
- if (method == null)
- {
- method = _delegate.getMethod(base, methodName);
-
- if (method == null)
- {
- // if the delegate couldn't find the property,
- // then mark this in case it is requested again
- methods.put(methodName, METHOD_SYMBOL_NOT_FOUND);
- }
- else
- {
- methods.put(methodName, method);
- }
- }
- }
- return method;
- }
-
- @Override
- public ISymbol[] getMethods(final IObjectSymbol base)
- {
- if (_allMethods == null)
- {
- _allMethods = _delegate.getMethods(base);
- }
- return _allMethods;
- }
-
- @Override
- public ISymbol[] getProperties(final ISymbol symbol)
- {
- if (_allProperties == null)
- {
- _allProperties = _delegate.getProperties(symbol);
- }
- return _allProperties;
- }
-
- @Override
- public ISymbol getProperty(final ISymbol symbol, final Object propertyName)
- {
- Map<Object, ISymbol> properties = _propertiesByOwner.get(symbol);
-
- if (properties == null)
- {
- properties = new HashMap<Object, ISymbol>();
- _propertiesByOwner.put(symbol, properties);
- }
-
- ISymbol property = properties.get(propertyName);
-
- if (property == SYMBOL_NOT_FOUND)
- {
- property = null;
- }
- else
- {
- if (property == null)
- {
- property = _delegate.getProperty(symbol, propertyName);
-
- if (property == null)
- {
- // if the delegate couldn't find the property,
- // then mark this in case it is requested again
- properties.put(propertyName, SYMBOL_NOT_FOUND);
- }
- else
- {
- properties.put(propertyName, property);
- }
- }
- }
- return property;
- }
-
- @Override
- public ISymbol getVariable(final String name)
- {
- ISymbol variable = _variablesByName.get(name);
-
- // if the symbol was not found, return null but avoid calling the
- // delegate again
- if (variable == SYMBOL_NOT_FOUND)
- {
- variable = null;
- }
- else
- {
- if (variable == null)
- {
- variable = _delegate.getVariable(name);
-
- if (variable == null)
- {
- // if the delegate couldn't find the variable,
- // then mark this in case it is requested again
- _variablesByName.put(name, SYMBOL_NOT_FOUND);
- }
- else
- {
- _variablesByName.put(name, variable);
- }
- }
- }
- return variable;
- }
-
- @Override
- public boolean hasSameResolution(IModelContext modelContext)
- {
- return _delegate.hasSameResolution(modelContext);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/resolver/IStructuredDocumentSymbolResolverFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/resolver/IStructuredDocumentSymbolResolverFactory.java
deleted file mode 100644
index cdc8b14..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/resolver/IStructuredDocumentSymbolResolverFactory.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.resolver;
-
-import org.eclipse.jst.jsf.context.IModelContext;
-
-/**
- * A factory for symbol context resolvers.
- *
- * Clients may use but implement this interface. To implement, sub-class
- * AbstractStructuredDocumentSymbolResolverFactory
- *
- * @author cbateman
- *
- */
-public interface IStructuredDocumentSymbolResolverFactory
-{
- /**
- * @param context
- * @return a new instance of symbol resolver for context
- */
- public ISymbolContextResolver getSymbolContextResolver(IModelContext context);
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/resolver/ISymbolContextResolver.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/resolver/ISymbolContextResolver.java
deleted file mode 100644
index 6051043..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/resolver/ISymbolContextResolver.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.designtime.resolver;
-
-import org.eclipse.jst.jsf.context.IModelContext;
-import org.eclipse.jst.jsf.context.resolver.IDocumentContextResolver;
-import org.eclipse.jst.jsf.context.symbol.IMethodSymbol;
-import org.eclipse.jst.jsf.context.symbol.IObjectSymbol;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-
-/**
- * Resolves symbols and possible symbols in a given context
- *
- * May NOT be sub-classed or implemented by clients.
- * Sub-class AbstractSymbolContextResolver to implement.
- *
- * @author cbateman
- *
- */
-public interface ISymbolContextResolver extends IDocumentContextResolver
-{
- /**
- * Gets the most appropriate symbol in the current context
- * based on name. Most "appropriate" may take into account
- * scoping and other rules.
- *
- * @param name
- * @return a symbol
- */
- ISymbol getVariable(String name);
-
- /**
- * @return all valid symbols in the current context
- */
- ISymbol[] getAllVariables();
-
- /**
- * @param symbol
- * @param propertyName
- * @return the property symbol called propertyName or null if not found
- */
- ISymbol getProperty(ISymbol symbol, Object propertyName);
-
- /**
- * @param symbol
- * @return all properties of symbol
- */
- ISymbol[] getProperties(ISymbol symbol);
-
- /**
- * @param base
- * @param methodName
- * @return the method of base matching methodName or null if not found
- */
- IMethodSymbol getMethod(IObjectSymbol base, Object methodName);
-
- /**
- * @param base
- * @return all methods belonging to base
- */
- ISymbol[] getMethods(IObjectSymbol base);
-
- /**
- * This is meant to be used things like caching to determine if caches
- * need to be flushed for different contexts. If you are in doubt, always
- * return false.
- *
- * NOTE: this method should not be used to determine if symbols previously
- * returned by this resolver have changed to do changes in the underlying
- * application such as change to a managed bean. This method only needs
- * to check if what variable, properties and methods may have resolved
- * different, because of the context itself.
- *
- * @param modelContext
- * @since 3.0
- * @return true if the instance of this resolver would resolve everything
- * exactly the same with this modelContext. False otherwise.
- */
- boolean hasSameResolution(final IModelContext modelContext);
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/resolver/StructuredDocumentSymbolResolverFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/resolver/StructuredDocumentSymbolResolverFactory.java
deleted file mode 100644
index 69fc6be..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/resolver/StructuredDocumentSymbolResolverFactory.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.designtime.resolver;
-
-import org.eclipse.jst.jsf.context.AbstractDelegatingFactory;
-import org.eclipse.jst.jsf.context.IModelContext;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-/**
- * Factory create resolver capable of resolving symbols in a structured document
- *
- * Clients may not sub-class.
- *
- * @author cbateman
- *
- */
-public final class StructuredDocumentSymbolResolverFactory extends
- AbstractDelegatingFactory implements IStructuredDocumentSymbolResolverFactory
-{
- private static StructuredDocumentSymbolResolverFactory INSTANCE;
-
- /**
- * @return the singleton factory instance
- */
- public final static synchronized StructuredDocumentSymbolResolverFactory getInstance()
- {
- if (INSTANCE == null)
- {
- // no delegates supported
- INSTANCE = new StructuredDocumentSymbolResolverFactory(new Class[0]);
- }
-
- return INSTANCE;
- }
-
- private StructuredDocumentSymbolResolverFactory(Class[] supportedDelegateTypes)
- {
- super(supportedDelegateTypes);
- }
-
- /**
- * @param context
- * @return a new instance of symbol resolver for context
- */
- public ISymbolContextResolver getSymbolContextResolver(IModelContext context) {
- ISymbolContextResolver resolver = internalGetSymbolContextResolver(context);
-
- if (resolver == null)
- {
- resolver = delegateGetSymbolContextResolver(context);
- }
-
- return resolver;
- }
-
- private ISymbolContextResolver internalGetSymbolContextResolver(IModelContext context)
- {
- if (context instanceof IStructuredDocumentContext &&
- ((IStructuredDocumentContext)context).getStructuredDocument() instanceof IStructuredDocument)
- {
- return new SymbolContextResolver((IStructuredDocumentContext) context);
- }
-
- return null;
- }
-
- private ISymbolContextResolver delegateGetSymbolContextResolver(IModelContext context)
- {
- // no delegates currently supported
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/resolver/SymbolContextResolver.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/resolver/SymbolContextResolver.java
deleted file mode 100644
index 3652db1..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/resolver/SymbolContextResolver.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.designtime.resolver;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jst.jsf.context.IModelContext;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IWorkspaceContextResolver;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.symbol.IMethodSymbol;
-import org.eclipse.jst.jsf.context.symbol.IObjectSymbol;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.designtime.DesignTimeApplicationManager;
-import org.eclipse.jst.jsf.designtime.context.DTFacesContext;
-
-/**
- * A symbol context resolver
- * Clients may NOT sub-class.
- *
- * @author cbateman
- *
- */
-/*package*/ final class SymbolContextResolver extends AbstractSymbolContextResolver
-{
- private final IStructuredDocumentContext _context;
- private IWorkspaceContextResolver _wkspResolver; // = null; lazy created through getWorkspaceResolver
-
- /**
- * @param context
- */
- /* package */SymbolContextResolver(IStructuredDocumentContext context)
- {
- _context = context;
- }
-
- public ISymbol getVariable(String name)
- {
- final IFile file = getFile();
-
- if (file != null)
- {
- final DesignTimeApplicationManager manager =
- DesignTimeApplicationManager.getInstance(file.getProject());
-
- if (manager != null)
- {
- final DTFacesContext facesContext = manager.getFacesContext(file);
-
- return manager.getVariableResolver().
- resolveVariable(facesContext, name, file);
- }
- }
-
- return null;
- }
-
- public ISymbol[] getAllVariables()
- {
- final IFile file = getFile();
-
- if (file != null)
- {
- final DesignTimeApplicationManager manager =
- DesignTimeApplicationManager.getInstance(file.getProject());
-
- if (manager != null)
- {
- final DTFacesContext facesContext = manager.getFacesContext(file);
-
- if (facesContext != null)
- {
- return manager.getVariableResolver().
- getAllVariables(facesContext, file);
- }
- }
- }
-
- return ISymbol.EMPTY_SYMBOL_ARRAY;
- }
-
- public ISymbol getProperty(ISymbol symbol, Object propertyName)
- {
- final IFile file = getFile();
-
- if (file != null)
- {
- final DesignTimeApplicationManager manager =
- DesignTimeApplicationManager.getInstance(file.getProject());
-
- if (manager != null)
- {
- return manager.getPropertyResolver().getProperty(symbol, propertyName);
- }
- }
-
- return null;
- }
-
- public ISymbol[] getProperties(ISymbol symbol)
- {
- final IFile file = getFile();
-
- if (file != null)
- {
- final DesignTimeApplicationManager manager =
- DesignTimeApplicationManager.getInstance(file.getProject());
-
- if (manager != null)
- {
- return manager.getPropertyResolver().getAllProperties(symbol);
- }
- }
- return ISymbol.EMPTY_SYMBOL_ARRAY;
- }
-
- public IMethodSymbol getMethod(IObjectSymbol base, Object methodName)
- {
- final IFile file = getFile();
-
- if (file != null)
- {
- final DesignTimeApplicationManager manager =
- DesignTimeApplicationManager.getInstance(file.getProject());
-
- if (manager != null)
- {
- return manager.getMethodResolver().getMethod(base, methodName);
- }
- }
-
- return null;
- }
-
- public ISymbol[] getMethods(IObjectSymbol base)
- {
- final IFile file = getFile();
-
- if (file != null)
- {
- final DesignTimeApplicationManager manager =
- DesignTimeApplicationManager.getInstance(file.getProject());
-
- if (manager != null)
- {
- return manager.getMethodResolver().getMethods(base);
- }
- }
-
- return new IMethodSymbol[0];
- }
-
-
- public boolean canResolveContext(IModelContext modelContext)
- {
- return modelContext.getAdapter(IStructuredDocumentContext.class) != null;
- }
-
- /**
- * @return a lazily loaded workspace resolver for this resolver's context
- */
- protected final IWorkspaceContextResolver getWorkspaceResolver()
- {
- if (_wkspResolver == null)
- {
- _wkspResolver = getWorkspaceResolver(_context);
- }
-
- return _wkspResolver;
- }
-
- private IWorkspaceContextResolver getWorkspaceResolver(final IStructuredDocumentContext context)
- {
- return IStructuredDocumentContextResolverFactory.INSTANCE
- .getWorkspaceContextResolver(context);
- }
-
- /**
- * @return the underlying IFile for my context or null if can't be determined
- */
- protected final IFile getFile()
- {
- return getFile(getWorkspaceResolver());
- }
-
- private IFile getFile(final IWorkspaceContextResolver resolver)
- {
-
- if (resolver != null)
- {
- IResource curRes = resolver.getResource();
-
- if (curRes instanceof IFile)
- {
- return (IFile) curRes;
- }
- }
-
- return null;
-
- }
-
- @Override
- public boolean hasSameResolution(IModelContext modelContext)
- {
- if (canResolveContext(modelContext))
- {
- return getFile().equals(getFile(getWorkspaceResolver((IStructuredDocumentContext) modelContext)));
- }
-
- // if we can't even resolve the context, then we certainly don't have
- // the same resolution
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/resolver/package-info.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/resolver/package-info.java
deleted file mode 100644
index 31457bb..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/resolver/package-info.java
+++ /dev/null
@@ -1,16 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-/**
- * Model Context Resolvers for EL symbols.
- */
-package org.eclipse.jst.jsf.designtime.resolver;
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/symbols/AbstractDataModelVariableFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/symbols/AbstractDataModelVariableFactory.java
deleted file mode 100644
index b2f89c3..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/symbols/AbstractDataModelVariableFactory.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.designtime.symbols;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jst.jsf.common.internal.types.TypeConstants;
-import org.eclipse.jst.jsf.common.internal.types.ValueType;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.symbol.ERuntimeSource;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.core.internal.tld.IJSFConstants;
-import org.eclipse.jst.jsf.validation.internal.appconfig.AppConfigValidationUtil;
-import org.w3c.dom.Element;
-
-/**
- * A framework provided variable factory for EL model objects that are
- * constructed based on DataModel's dervied from an EL expression.
- *
- * @author cbateman
- *
- */
-public abstract class AbstractDataModelVariableFactory
-{
- private final JSFSymbolFactory _symbolFactory = new JSFSymbolFactory();
-
- /**
- * @param elText
- * The EL expression text. Must not be null
- * @param elContext
- * The document context pointing to elText in the source
- * document. Must not be null
- * @param file
- * The workspace resource that contains elText. Must not be null.
- * @return the value expression resolved from elText or null if it cannot be
- * resolved or elText doesn't resolve to value expression (i.e. is a
- * method expression)
- * @deprecated use JSFSymbolFactory.getValueTypeFromEL instead.
- */
- public final ValueType createValueExpression(final String elText,
- final IStructuredDocumentContext elContext, final IFile file)
- {
- return getSymbolFactory().getValueTypeFromEL(elText, elContext, file);
- }
-
- /**
- * @return the symbol factory used by this variable factory
- */
- public final JSFSymbolFactory getSymbolFactory()
- {
- return _symbolFactory;
- }
-
- /**
- * @param symbolName
- * The name of the symbol to be created. Must not be null
- * @param signature
- * The type signature of the array type. Must not be null
- * @param javaProject
- * must not be null
- * @return a symbol based approximating an implicit DataModel wrapper for an
- * array
- * @deprecated use JSFSymbolFactory.createArraySymbol instead
- */
- protected final ISymbol createArraySymbol(final String symbolName,
- final String signature, final IJavaProject javaProject)
- {
- return getSymbolFactory().createArraySymbol(symbolName, signature,
- ERuntimeSource.TAG_INSTANTIATED_SYMBOL_LITERAL, javaProject);
- }
-
- /**
- * Implements default rules for taking an non-array value expression and
- * resolving it to a ISymbol modelling a JSF DataModel
- *
- * @param symbolName
- * @param valueType
- * @param javaProject
- * @return a symbol where valueType is considered to be the base type upon
- * which a data model would be created. This combines the
- * possibility that the value expression is either an explicit
- * DataModel implementation or a non-DataModel type for which JSF be
- * default provides an implicit wrapper model.
- *
- * List is treated as a special case here, since their are two subcases: 1)
- * the list is a raw type, in which case it must be treated as implicit and
- * opaque (as to the type of the variable created) 2) the list has Java 5
- * type argument information that can be used to infer the type of the row
- * variable
- */
- public ISymbol createFromType(String symbolName, ValueType valueType,
- IJavaProject javaProject)
- {
- return internalCreateFromBaseType(symbolName, valueType, javaProject);
- }
-
- private ISymbol internalCreateFromBaseType(String symbolName,
- ValueType valueType, IJavaProject javaProject)
- {
- // based on JSF 1.1 spec section 4.2.1.4 the data model
- // value binding can be one of a number of object that will
- // get an implicit DataModel wrapper at runtime
-
- // could be an array
- if (Signature.getArrayCount(valueType.getSignature()) > 0)
- {
- return getSymbolFactory()
- .createArraySymbol(symbolName, valueType.getSignature(),
- ERuntimeSource.TAG_INSTANTIATED_SYMBOL_LITERAL,
- javaProject);
- }
-
- // if is a list, then we have extra work to do if it
- // is generic and has info about its contents
- if (valueType.isInstanceOf(TypeConstants.TYPE_LIST))
- {
- return getSymbolFactory().createFromList(symbolName, valueType, ERuntimeSource.TAG_INSTANTIATED_SYMBOL_LITERAL, null, javaProject);
- }
- // if is JSTL ResultSet, java ResultSet or DataModel
- // return the default symbol -- in the absence of definite
- // template info, these row containers are opaque to us
- else if (valueType
- .isInstanceOf(TypeConstants.TYPE_JAVAX_SERVLET_JSP_JSTL_SQL_RESULT)
- || valueType.isInstanceOf(TypeConstants.TYPE_RESULT_SET)
- || valueType.isInstanceOf(TypeConstants.TYPE_DATA_MODEL))
- {
- return getSymbolFactory().createDefaultSymbol(symbolName, ERuntimeSource.TAG_INSTANTIATED_SYMBOL_LITERAL, Messages
- .getString("AbstractDataModelVariableFactory.DataModel.Symbol.RowVariable.DetailedDescription"));
- }
-
- // in other cases, we assume that the value is an explicit single row
- // scalar object
- return getSymbolFactory().createScalarSymbol(symbolName, valueType.getSignature(),
- ERuntimeSource.TAG_INSTANTIATED_SYMBOL_LITERAL, javaProject);
- }
-
- /**
- * @param symbolName
- * The name of the symbol to create. Must not be null.
- * @param valueType
- * The value expression representing the implicit list. The
- * signature on the valueType must be a list. Must not be null.
- * @param javaProject
- * The JavaProject whose classpath will be used to resolve types.
- * Must not be null.
- *
- * @return a symbol that approximates as best as possible an implicit
- * DataModel for java.util.List value expressions. If the List has
- * resolvable Java 5 type arguments, then a scalar symbol will be
- * created using this type information. If it is a raw type, then
- * createDefaultSymbol() is called
- * @deprecated use JSFSymbolFactory.createFromList
- */
- protected final ISymbol createFromList(String symbolName,
- ValueType valueType, IJavaProject javaProject)
- {
- return getSymbolFactory().createFromList(symbolName, valueType,
- ERuntimeSource.TAG_INSTANTIATED_SYMBOL_LITERAL, null,
- javaProject);
- }
-
- /**
- * @param symbolName
- * The name of the symbol to create. Must not be null.
- * @param signature
- * The fully resolved type signature of the scalar. Must not be
- * null.
- * @param javaProject
- * The JavaProject whose classpath is to be used to resolve type
- * information for signture. Must not be null.
- * @return a symbol approximating a scalar object DataModel wrapper. The row
- * variable for the data model becomes of type signature
- * @deprecated use JSFSymbolFactory.createScalarSymbol instead.
- */
- protected final ISymbol createScalarSymbol(final String symbolName,
- final String signature, final IJavaProject javaProject)
- {
- return getSymbolFactory().createScalarSymbol(symbolName, signature,
- ERuntimeSource.TAG_INSTANTIATED_SYMBOL_LITERAL, javaProject);
- }
-
- /**
- * @param symbolName
- * The name of the symbol to create. Must not be null
- * @return a default symbol that eliminates bogus warnings for this
- * dataTable's row variable in cases where something better is
- * resolvable. Note that this is not ideal, since will result in any
- * property being accepted on the variable with this name.
- * @deprecated use JSFSymbolFactory.createDefaultSymbol instead.
- */
- public final ISymbol createDefaultSymbol(final String symbolName)
- {
- return getSymbolFactory()
- .createDefaultSymbol(
- symbolName,
- ERuntimeSource.TAG_INSTANTIATED_SYMBOL_LITERAL,
- Messages
- .getString("AbstractDataModelVariableFactory.DataModel.Symbol.RowVariable.DetailedDescription"));
- }
-
- /**
- * @param dataTableElement
- * the DOM element that has a "value" attribute. Must not be
- * null.
- * @return the el text from the 'value attribute of a dataTable element or
- * null if not found
- */
- protected static String getELText(final Element dataTableElement)
- {
- assert dataTableElement != null;
- String attrVal = dataTableElement
- .getAttribute(IJSFConstants.ATTR_VALUE);
-
- if (attrVal != null)
- {
- return AppConfigValidationUtil.extractELExpression(attrVal)
- .getElText();
- }
- return null;
- }
-
- /**
- * @return the variable source name. Protects against null in the abstract
- * method
- */
- protected final String internalGetVariableSourceName()
- {
- String variableSourceName = getVariableSourceName();
-
- if (variableSourceName == null)
- {
- JSFCorePlugin.log("Missing variableSourceName", new Throwable()); //$NON-NLS-1$
- return "**missing variable source name**"; //$NON-NLS-1$
- }
-
- return variableSourceName;
- }
-
- /**
- * @return a user displayable name for the source of variables created by
- * this factory Must not return null.
- */
- protected abstract String getVariableSourceName();
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/symbols/DefaultBeanSymbolSourceProvider.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/symbols/DefaultBeanSymbolSourceProvider.java
deleted file mode 100644
index 2f61816..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/symbols/DefaultBeanSymbolSourceProvider.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.designtime.symbols;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jst.jsf.context.symbol.ERuntimeSource;
-import org.eclipse.jst.jsf.context.symbol.IBeanInstanceSymbol;
-import org.eclipse.jst.jsf.context.symbol.IJavaTypeDescriptor2;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.context.symbol.SymbolFactory;
-import org.eclipse.jst.jsf.context.symbol.source.ISymbolConstants;
-import org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigManager;
-import org.eclipse.jst.jsf.facesconfig.emf.DescriptionType;
-import org.eclipse.jst.jsf.facesconfig.emf.ManagedBeanScopeType;
-import org.eclipse.jst.jsf.facesconfig.emf.ManagedBeanType;
-
-/**
- * Self-factory provider of bean symbol information for a particular project.
- *
- * Context is determined by querying all known managed beans declared in a
- * web project.
- *
- * Client may sub-class
- *
- * @author cbateman
- *
- */
-public class DefaultBeanSymbolSourceProvider
-{
- private static DefaultBeanSymbolSourceProvider INSTANCE;
-
- /**
- * @return the singleton instance of the provider
- */
- public static DefaultBeanSymbolSourceProvider getInstance()
- {
- if (INSTANCE == null)
- {
- INSTANCE = new DefaultBeanSymbolSourceProvider();
- }
-
- return INSTANCE;
- }
-
- /**
- * No external instantiation
- *
- * Left protected to allow sub-classing
- */
- protected DefaultBeanSymbolSourceProvider() {/* empty */}
-
- /**
- * @param context
- * @param symbolScopeMask
- * @return all bean symbols for the context at scopes matching symbolScopeMask
- */
- public ISymbol[] getSymbols(IAdaptable context, int symbolScopeMask)
- {
- final IFile file = FileContextUtil.deriveIFileFromContext(context);
- if (file != null)
- {
- final IProject myProject = file.getProject();
- List managedBeans = getManagedBeanSymbols(myProject, symbolScopeMask);
- return (ISymbol[]) managedBeans.toArray(ISymbol.EMPTY_SYMBOL_ARRAY);
- }
-
- return ISymbol.EMPTY_SYMBOL_ARRAY;
- }
-
- /**
- * @param name
- * @param context
- * @param symbolScopeMask
- * @return the symbol called name, in context/symbolScope
- */
- public ISymbol getSymbol(final String name, final IAdaptable context,
- final int symbolScopeMask)
- {
- return SymbolUtil.
- findSymbolByName(getSymbols(context, symbolScopeMask), name);
- }
-
- /**
- * @param prefix
- * @param context
- * @param symbolScopeMask
- * @return all symbols for context and symbolScopeMask that start with
- * prefix
- */
- public ISymbol[] getSymbols(String prefix, IAdaptable context,
- int symbolScopeMask) {
- return SymbolUtil.
- filterSymbolsByPrefix(getSymbols(context, symbolScopeMask), prefix);
- }
-
- private List getManagedBeanSymbols(IProject iProject, int symbolScopeMask)
- {
- List symbols = new ArrayList();
-
- final JSFAppConfigManager configManager = JSFAppConfigManager.getInstance(iProject);
-
-
- if (configManager != null)
- {
- for (final Iterator aIt = configManager.getManagedBeans().iterator(); aIt.hasNext();)
- {
- ManagedBeanType bean = (ManagedBeanType) aIt.next();
-
- // only bother with all this if we care about the scope of this bean
- if (isBeanScopeInMask(bean.getManagedBeanScope(), symbolScopeMask))
- {
- final String name = bean.getManagedBeanName().getTextContent();
- final String detailedDescription = createAdditionalProposalInfo(bean);
- IBeanInstanceSymbol symbol = SymbolFactory.eINSTANCE.createIBeanInstanceSymbol();
- symbol.setName(name);
- symbol.setDetailedDescription(detailedDescription);
- symbol.setRuntimeSource(ERuntimeSource.MANAGED_BEAN_SYMBOL_LITERAL);
- try
- {
- IJavaProject javaProject = JavaCore.create(iProject);
- IType type = javaProject.findType(bean.getManagedBeanClass().getTextContent());
-
- // don't bother setting a type descriptor if we
- // can't find a type
- if (type != null)
- {
- IJavaTypeDescriptor2 javaTypeDescriptor =
- SymbolFactory.eINSTANCE.createIJavaTypeDescriptor2();
- javaTypeDescriptor.setType(type);
- symbol.setJavaTypeDescriptor(javaTypeDescriptor);
- }
- }
- catch (JavaModelException t)
- {
- // do nothing; skip type info for this bean
- }
- symbols.add(symbol);
- }
- }
- }
-
- return symbols;
- }
-
- private String createAdditionalProposalInfo(ManagedBeanType beanType)
- {
- StringBuffer additionalInfo = new StringBuffer("<p><b>"); //$NON-NLS-1$
- additionalInfo.append(Messages.getString("DefaultBeanSymbolSourceProvider.AdditionalInformation.Name")); //$NON-NLS-1$
- additionalInfo.append(" </b>"); //$NON-NLS-1$
- additionalInfo.append(beanType.getManagedBeanName().getTextContent());
- additionalInfo.append("</p><p><b>"); //$NON-NLS-1$
- additionalInfo.append(Messages.getString("DefaultBeanSymbolSourceProvider.AdditionalInformation.Type")); //$NON-NLS-1$
- additionalInfo.append(" </b>"); //$NON-NLS-1$
- additionalInfo.append(beanType.getManagedBeanClass().getTextContent());
- additionalInfo.append("</p><p><b>"); //$NON-NLS-1$
- additionalInfo.append(Messages.getString("DefaultBeanSymbolSourceProvider.AdditionalInformation.Scope")); //$NON-NLS-1$
- additionalInfo.append(" </b>"); //$NON-NLS-1$
- additionalInfo.append(beanType.getManagedBeanScope().getTextContent());
- additionalInfo.append("</p>"); //$NON-NLS-1$
-
- StringBuffer descBuffer = new StringBuffer();
-
- for (final Iterator it = beanType.getDescription().iterator(); it.hasNext();)
- {
- final DescriptionType descType = (DescriptionType) it.next();
- final String appendString = descType.getTextContent();
- if (appendString != null)
- {
- descBuffer.append(appendString);
- }
- }
-
- if (descBuffer.length() > 0)
- {
- additionalInfo.append("<p><b>"); //$NON-NLS-1$
- additionalInfo.append(Messages.getString("DefaultBeanSymbolSourceProvider.AdditionalInformation.Description")); //$NON-NLS-1$
- additionalInfo.append("</b>"); //$NON-NLS-1$
- additionalInfo.append(descBuffer);
- additionalInfo.append("</p>"); //$NON-NLS-1$
- }
-
- return additionalInfo.toString();
- }
-
-
- private boolean isBeanScopeInMask(final ManagedBeanScopeType scope, final int scopeMask)
- {
- final int testScope = ISymbolConstants.getMaskForString(scope.getTextContent());
-
- if (testScope != -1)
- {
- return (scopeMask & testScope) != 0;
- }
-
- // no other cases supported
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/symbols/DefaultBuiltInSymbolProvider.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/symbols/DefaultBuiltInSymbolProvider.java
deleted file mode 100644
index 7583a7b..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/symbols/DefaultBuiltInSymbolProvider.java
+++ /dev/null
@@ -1,313 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.designtime.symbols;
-
-import java.util.AbstractMap;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jst.jsf.context.symbol.ERuntimeSource;
-import org.eclipse.jst.jsf.context.symbol.IInstanceSymbol;
-import org.eclipse.jst.jsf.context.symbol.IMapTypeDescriptor;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.context.symbol.SymbolFactory;
-import org.eclipse.jst.jsf.context.symbol.source.ISymbolConstants;
-import org.eclipse.jst.jsf.designtime.DesignTimeApplicationManager;
-import org.eclipse.jst.jsf.designtime.context.IDTExternalContext;
-
-/**
- * Provides the default built-in JSF symbols
- *
- * Clients may sub-class
- *
- * @author cbateman
- *
- */
-public class DefaultBuiltInSymbolProvider
-{
- private static DefaultBuiltInSymbolProvider INSTANCE;
- private static final JSFSymbolFactory _symbolFactory;
-
- /**
- * @return the singleton instance
- */
- public synchronized static DefaultBuiltInSymbolProvider getInstance()
- {
- if (INSTANCE == null)
- {
- INSTANCE = new DefaultBuiltInSymbolProvider();
- }
-
- return INSTANCE;
- }
-
- private static final String APPLICATION_SCOPE = "applicationScope"; //$NON-NLS-1$
- private static final String SESSION_SCOPE = "sessionScope"; //$NON-NLS-1$
- private static final String REQUEST_SCOPE = "requestScope"; //$NON-NLS-1$
- private static final String COOKIE_IMPLICIT_OBJ = "cookie"; //$NON-NLS-1$
- private static final String FACES_CONTEXT_IMPLICIT_OBJ = "facesContext"; //$NON-NLS-1$
- private static final String HEADER_IMPLICIT_OBJ = "header"; //$NON-NLS-1$
- private static final String HEADER_VALUES_IMPLICIT_OBJ = "headerValues"; //$NON-NLS-1$
- private static final String INIT_PARAM_IMPLICIT_OBJ = "initParam"; //$NON-NLS-1$
- private static final String PARAM_IMPLICIT_OBJ = "param"; //$NON-NLS-1$
- private static final String PARAM_VALUES_IMPLICIT_OBJ = "paramValues"; //$NON-NLS-1$
- private static final String VIEW_IMPLICIT_OBJ = "view"; //$NON-NLS-1$
-
- private static final String FACES_CONTEXT_FULLY_QUALIFIED_CLASS = "javax.faces.context.FacesContext"; //$NON-NLS-1$
- private static final String VIEW_FULLY_QUALIFIED_CLASS = "javax.faces.component.UIViewRoot"; //$NON-NLS-1$
-
- private static final ISymbol SYMBOL_COOKIE_IMPLICIT_OBJ;
- private static final ISymbol SYMBOL_HEADER_IMPLICIT_OBJ;
- private static final ISymbol SYMBOL_HEADER_VALUES_IMPLICIT_OBJ;
- private static final ISymbol SYMBOL_PARAM_IMPLICIT_OBJ;
- private static final ISymbol SYMBOL_PARAM_VALUES_IMPLICIT_OBJ;
- private static final ISymbol SYMBOL_INIT_PARAM_IMPLICIT_OBJ;
-
- static
- {
- _symbolFactory = new JSFSymbolFactory();
- // invariant request scope variables
- SYMBOL_COOKIE_IMPLICIT_OBJ = _symbolFactory.createUnknownInstanceSymbol(COOKIE_IMPLICIT_OBJ, ERuntimeSource.BUILT_IN_SYMBOL_LITERAL);
- SYMBOL_HEADER_IMPLICIT_OBJ = _symbolFactory.createUnknownInstanceSymbol(HEADER_IMPLICIT_OBJ, ERuntimeSource.BUILT_IN_SYMBOL_LITERAL);
- SYMBOL_HEADER_VALUES_IMPLICIT_OBJ = _symbolFactory.createUnknownInstanceSymbol(HEADER_VALUES_IMPLICIT_OBJ, ERuntimeSource.BUILT_IN_SYMBOL_LITERAL);
- SYMBOL_PARAM_IMPLICIT_OBJ = _symbolFactory.createUnknownInstanceSymbol(PARAM_IMPLICIT_OBJ, ERuntimeSource.BUILT_IN_SYMBOL_LITERAL);
- SYMBOL_PARAM_VALUES_IMPLICIT_OBJ = _symbolFactory.createUnknownInstanceSymbol(PARAM_VALUES_IMPLICIT_OBJ, ERuntimeSource.BUILT_IN_SYMBOL_LITERAL);
-
- // invariant application scope variables
- SYMBOL_INIT_PARAM_IMPLICIT_OBJ = _symbolFactory.createUnknownInstanceSymbol(INIT_PARAM_IMPLICIT_OBJ, ERuntimeSource.BUILT_IN_SYMBOL_LITERAL);
- }
-
-
- /**
- * No direct instantiation -- use getInstance
- *
- * Made protected to allow sub-classing
- */
- protected DefaultBuiltInSymbolProvider()
- {
- // nothing to do.
- }
-
- /**
- * @param context
- * @param symbolScopeMask
- * @return all symbols for context in scopes matching symbolScopeMask
- */
- public ISymbol[] getSymbols(final IAdaptable context,
- final int symbolScopeMask)
- {
- final IFile fileContext = FileContextUtil
- .deriveIFileFromContext(context);
- return (ISymbol[]) getSymbolsForScope(fileContext, symbolScopeMask)
- .toArray(ISymbol.EMPTY_SYMBOL_ARRAY);
- }
-
- /**
- * @param name
- * @param context
- * @param symbolScopeMask
- * @return the symbol in context matching name or null if not found
- */
- public ISymbol getSymbol(final String name, final IAdaptable context,
- final int symbolScopeMask)
- {
- final IFile file = FileContextUtil.deriveIFileFromContext(context);
-
- ISymbol symbol = null;
- if ((symbolScopeMask & ISymbolConstants.SYMBOL_SCOPE_REQUEST) != 0)
- {
- symbol = getRequestScopeSymbols(file).get(name);
- }
- if ((symbolScopeMask & ISymbolConstants.SYMBOL_SCOPE_SESSION) != 0
- && symbol == null)
- {
- symbol = getSessionScopeSymbols(file).get(name);
- }
- if ((symbolScopeMask & ISymbolConstants.SYMBOL_SCOPE_APPLICATION) != 0
- && symbol == null)
- {
- symbol = getApplicationScopeSymbols(file).get(name);
- }
-
- return symbol;
- }
-
- /**
- * @param prefix
- * @param context
- * @param symbolScopeMask
- * @return all implicit symbols for context starting with prefix in scopes
- * matching symbolScopeMask
- */
- public ISymbol[] getSymbols(final String prefix, final IAdaptable context,
- final int symbolScopeMask)
- {
- final IFile file = FileContextUtil.deriveIFileFromContext(context);
-
- final List<ISymbol> symbols = new ArrayList<ISymbol>();
- if ((symbolScopeMask & ISymbolConstants.SYMBOL_SCOPE_REQUEST) != 0)
- {
- symbols.addAll(getRequestScopeSymbols(file).values());
- }
- if ((symbolScopeMask & ISymbolConstants.SYMBOL_SCOPE_SESSION) != 0)
- {
- symbols.addAll(getSessionScopeSymbols(file).values());
- }
- if ((symbolScopeMask & ISymbolConstants.SYMBOL_SCOPE_APPLICATION) != 0)
- {
- symbols.addAll(getApplicationScopeSymbols(file).values());
- }
- return symbols.toArray(ISymbol.EMPTY_SYMBOL_ARRAY);
- }
-
- private List getSymbolsForScope(final IFile file, final int symbolScopeMask)
- {
- final List symbols = new ArrayList();
- if ((symbolScopeMask & ISymbolConstants.SYMBOL_SCOPE_REQUEST) != 0)
- {
- symbols.addAll(getRequestScopeSymbols(file).values());
- }
- if ((symbolScopeMask & ISymbolConstants.SYMBOL_SCOPE_SESSION) != 0)
- {
- symbols.addAll(getSessionScopeSymbols(file).values());
- }
- if ((symbolScopeMask & ISymbolConstants.SYMBOL_SCOPE_APPLICATION) != 0)
- {
- symbols.addAll(getApplicationScopeSymbols(file).values());
- }
-
- return symbols;
- }
-
- private Map<String, ISymbol> getRequestScopeSymbols(final IFile file)
- {
- final Map<String, ISymbol> requestSymbols = new HashMap<String, ISymbol>();
-
- ISymbol symbol = createScopeSymbol(file,
- ISymbolConstants.SYMBOL_SCOPE_REQUEST, REQUEST_SCOPE);
- requestSymbols.put(symbol.getName(), symbol);
-
- requestSymbols.put(SYMBOL_COOKIE_IMPLICIT_OBJ.getName(), SYMBOL_COOKIE_IMPLICIT_OBJ);
- requestSymbols.put(SYMBOL_HEADER_IMPLICIT_OBJ.getName(), SYMBOL_HEADER_IMPLICIT_OBJ);
- requestSymbols.put(SYMBOL_HEADER_VALUES_IMPLICIT_OBJ.getName(), SYMBOL_HEADER_VALUES_IMPLICIT_OBJ);
- requestSymbols.put(SYMBOL_PARAM_IMPLICIT_OBJ.getName(), SYMBOL_PARAM_IMPLICIT_OBJ);
- requestSymbols.put(SYMBOL_PARAM_VALUES_IMPLICIT_OBJ.getName(), SYMBOL_PARAM_VALUES_IMPLICIT_OBJ);
-
- // TODO: these aren't maps; need to find way to handle
- symbol = _symbolFactory.createBeanOrUnknownInstanceSymbol(file
- .getProject(), FACES_CONTEXT_FULLY_QUALIFIED_CLASS,
- FACES_CONTEXT_IMPLICIT_OBJ,
- ERuntimeSource.BUILT_IN_SYMBOL_LITERAL);
- requestSymbols.put(symbol.getName(), symbol);
-
- symbol = _symbolFactory.createBeanOrUnknownInstanceSymbol(file
- .getProject(), VIEW_FULLY_QUALIFIED_CLASS, VIEW_IMPLICIT_OBJ,
- ERuntimeSource.BUILT_IN_SYMBOL_LITERAL);
- requestSymbols.put(symbol.getName(), symbol);
-
- return Collections.unmodifiableMap(requestSymbols);
- }
-
- private Map<String,ISymbol> getSessionScopeSymbols(final IFile file)
- {
- ISymbol symbol = createScopeSymbol(file,
- ISymbolConstants.SYMBOL_SCOPE_SESSION, SESSION_SCOPE);
-
- return Collections.unmodifiableMap
- (Collections.singletonMap(symbol.getName(), symbol));
- }
-
- private Map<String,ISymbol> getApplicationScopeSymbols(final IFile file)
- {
- final Map<String,ISymbol> symbols = new HashMap<String, ISymbol>();
-
- // TODO: may be able to resolve this one based on web.xml
- symbols.put(SYMBOL_INIT_PARAM_IMPLICIT_OBJ.getName(), SYMBOL_INIT_PARAM_IMPLICIT_OBJ);
-
- ISymbol symbol = createScopeSymbol(file,
- ISymbolConstants.SYMBOL_SCOPE_APPLICATION, APPLICATION_SCOPE);
- symbols.put(symbol.getName(), symbol);
-
- return Collections.unmodifiableMap(symbols);
- }
-
- private ISymbol createScopeSymbol(final IFile file, final int scopeMask,
- final String name)
- {
- final Map mapSource = new ScopeMap(file, scopeMask);
- final IMapTypeDescriptor typeDesc = SymbolFactory.eINSTANCE
- .createIBoundedMapTypeDescriptor();
- typeDesc.setMapSource(mapSource);
- typeDesc.setImmutable(false); // scope maps are mutable
- final IInstanceSymbol symbol = SymbolFactory.eINSTANCE
- .createIInstanceSymbol();
- symbol.setName(name);
- symbol.setRuntimeSource(ERuntimeSource.BUILT_IN_SYMBOL_LITERAL);
- symbol.setTypeDescriptor(typeDesc);
- // TODO:symbol.setDetailedDescription("A Map of the application scope
- // attribute values, keyed by attribute name");
-
- return symbol;
- }
-
- private static class ScopeMap extends AbstractMap
- {
- private final IFile _externalContextKey;
- private final int _scopeMask;
-
- ScopeMap(final IFile externalContextKey, final int scopeMask)
- {
- _externalContextKey = externalContextKey;
- _scopeMask = scopeMask;
- }
-
- @Override
- public Set entrySet()
- {
- final Map scopeMap = new HashMap();
- // do beans first so in case of name collision, beans are hidden
- final DefaultBeanSymbolSourceProvider beanProvider = DefaultBeanSymbolSourceProvider
- .getInstance();
-
- final ISymbol beanSymbols[] = beanProvider.getSymbols(
- _externalContextKey, _scopeMask);
-
- for (final ISymbol beanSymbol : beanSymbols)
- {
- scopeMap.put(beanSymbol.getName(), beanSymbol);
- }
-
- final DesignTimeApplicationManager manager = DesignTimeApplicationManager
- .getInstance(_externalContextKey.getProject());
-
- if (manager != null)
- {
-
- final IDTExternalContext externalContext = manager
- .getFacesContext(_externalContextKey)
- .getDTExternalContext(_externalContextKey);
-
- scopeMap.putAll(externalContext.getMapForScope(_scopeMask));
- }
-
- return scopeMap.entrySet();
-
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/symbols/DefaultDataTableSymbolFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/symbols/DefaultDataTableSymbolFactory.java
deleted file mode 100644
index 54111fe..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/symbols/DefaultDataTableSymbolFactory.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.designtime.symbols;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jst.jsf.common.internal.types.ValueType;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContextFactory;
-import org.eclipse.jst.jsf.context.symbol.ERuntimeSource;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.w3c.dom.Element;
-
-/**
- * The default factory for creating DataModel symbols based on an value
- * expression in a dataTable.
- *
- * Clients may sub-class.
- *
- * @author cbateman
- *
- */
-public class DefaultDataTableSymbolFactory
-{
- private final AbstractDataModelVariableFactory _dataModelSymbolFactory;
-
- /**
- * @param dataModelSymbolFactory
- */
- public DefaultDataTableSymbolFactory(
- final AbstractDataModelVariableFactory dataModelSymbolFactory)
- {
- assert dataModelSymbolFactory != null;
- _dataModelSymbolFactory = dataModelSymbolFactory;
- }
-
- /**
- * @param symbolName
- * the name of the symbol to be created. Must not be null.
- * @param dataTableElement
- * the DOM element representing the dataTable tag.
- * @param context
- * the document context pointing to dataTableElement
- * @return a symbol named symbolName based on the variable declared by
- * dataTableElement
- */
- public ISymbol createSymbolForDataTableValue(final String symbolName,
- final Element dataTableElement,
- final IStructuredDocumentContext context)
- {
- final String elText = AbstractDataModelVariableFactory
- .getELText(dataTableElement);
- final IFile file = FileContextUtil.deriveIFileFromContext(context);
-
- if (elText != null && file != null)
- {
- final IStructuredDocumentContext elContext = IStructuredDocumentContextFactory.INSTANCE
- .getContext(context.getStructuredDocument(),
- dataTableElement.getAttributeNode("value")); //$NON-NLS-1$
-
- final IJavaProject javaProject = JavaCore.create(file.getProject());
-
- final ValueType valueExpr = new JSFSymbolFactory()
- .getValueTypeFromEL(elText, elContext, file);
-
- if (valueExpr != null)
- {
- // otherwise, we have to try to resolve the base type and see
- // if it's an instanceof any of the supported implicit or
- // explict types
- return _dataModelSymbolFactory.createFromType(symbolName,
- valueExpr, javaProject);
- }
- }
-
- // by default create a default
- return _dataModelSymbolFactory.getSymbolFactory().createDefaultSymbol(
- symbolName, ERuntimeSource.TAG_INSTANTIATED_SYMBOL_LITERAL,
- null);
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/symbols/FileContextUtil.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/symbols/FileContextUtil.java
deleted file mode 100644
index 30e9e7b..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/symbols/FileContextUtil.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.designtime.symbols;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IWorkspaceContextResolver;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-
-/**
- * Utility for deriving an IFile from an IAdaptable
- *
- * @author cbateman
- *
- */
-public final class FileContextUtil
-{
- /**
- * @param context
- * @return an IFile derived from context or null if not derivable
- */
- public static IFile deriveIFileFromContext(IAdaptable context)
- {
- //
- if (context instanceof IFile)
- {
- return (IFile) context;
- }
- else if (context.getAdapter(IFile.class) != null)
- {
- return (IFile) context.getAdapter(IFile.class);
- }
- else if (context instanceof IStructuredDocumentContext)
- {
- return deriveIFileFromContext((IStructuredDocumentContext)context);
- }
- else
- {
- IStructuredDocumentContext sdContext =
- (IStructuredDocumentContext) context.getAdapter(IStructuredDocumentContext.class);
-
- if (sdContext != null)
- {
- return deriveIFileFromContext(sdContext);
- }
- }
-
- return null;
- }
-
- private static IFile deriveIFileFromContext(IStructuredDocumentContext context)
- {
- IWorkspaceContextResolver resolver =
- IStructuredDocumentContextResolverFactory.
- INSTANCE.
- getWorkspaceContextResolver(context);
-
- if (resolver != null)
- {
- IResource res = resolver.getResource();
-
- if (res instanceof IFile)
- {
- return (IFile) res;
- }
- }
-
- return null;
- }
-
- /**
- * Convenience method for getting the IProject for a document context.
- *
- * @param context
- * @return the project associated with context or null if can't be derived
- */
- public static IProject getProject(final IStructuredDocumentContext context)
- {
- final IWorkspaceContextResolver wkResolver = IStructuredDocumentContextResolverFactory.INSTANCE
- .getWorkspaceContextResolver(context);
-
- if (wkResolver != null)
- {
- return wkResolver.getProject();
- }
- return null;
- }
-
- private FileContextUtil()
- {
- // no instantiation
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/symbols/JSFSymbolFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/symbols/JSFSymbolFactory.java
deleted file mode 100644
index 2ef108d..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/symbols/JSFSymbolFactory.java
+++ /dev/null
@@ -1,420 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Matthias Fuessel -- extracted from https://bugs.eclipse.org/bugs/show_bug.cgi?id=215461
- * Cameron Bateman/Oracle - integrated and moved data table code here.
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.designtime.symbols;
-
-import java.util.Arrays;
-import java.util.HashMap;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.util.ECollections;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jst.jsf.common.internal.types.TypeConstants;
-import org.eclipse.jst.jsf.common.internal.types.ValueType;
-import org.eclipse.jst.jsf.common.util.TypeUtil;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.symbol.ERuntimeSource;
-import org.eclipse.jst.jsf.context.symbol.IBeanInstanceSymbol;
-import org.eclipse.jst.jsf.context.symbol.IComponentSymbol;
-import org.eclipse.jst.jsf.context.symbol.IInstanceSymbol;
-import org.eclipse.jst.jsf.context.symbol.IJavaTypeDescriptor2;
-import org.eclipse.jst.jsf.context.symbol.IMapTypeDescriptor;
-import org.eclipse.jst.jsf.context.symbol.IObjectSymbol;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.context.symbol.InitializedSymbolFactory;
-import org.eclipse.jst.jsf.context.symbol.SymbolFactory;
-import org.eclipse.jst.jsf.context.symbol.internal.util.IObjectSymbolBasedValueType;
-import org.eclipse.jst.jsf.designtime.resolver.IStructuredDocumentSymbolResolverFactory;
-import org.eclipse.jst.jsf.designtime.resolver.StructuredDocumentSymbolResolverFactory;
-import org.eclipse.jst.jsf.validation.internal.IJSFViewValidator.IValidationReporter;
-import org.eclipse.jst.jsf.validation.internal.IJSFViewValidator.ReporterAdapter;
-import org.eclipse.jst.jsf.validation.internal.el.ELExpressionValidator;
-import org.eclipse.jst.jsf.validation.internal.el.IExpressionSemanticValidator;
-
-/**
- * Factory for creating symbols for variables/message bundles that are
- * contributed by components/tags. This Factory can be used by descendants of
- * {@link org.eclipse.jst.jsf.context.symbol.source.AbstractContextSymbolFactory} in order to create the symbols they want
- * to contribute.
- *
- * It provides also methods for getting the resulting {@link ValueType} from an
- * EL expression and the "row" type signature from an DataModel/Array/List
- * {@link ValueType}.
- *
- * NOTE: C.B March 26, 2008 -- commented out portions are left for the future
- * because the rely on enhancements to the symbol model that could not be made
- * in the current release. Other portions of the original ComponentSymbolFactory
- * have been moved to {@link org.eclipse.jst.jsf.context.symbol.InitializedSymbolFactory}
- * This reflects the split between things deemed to be generic EL (put in common
- * plugin) and things deemed to be JSF-specific (put here).
- *
- */
-public final class JSFSymbolFactory extends InitializedSymbolFactory
-{
- /**
- * @param elText The EL expression text. Must not be null
- * @param elContext The document context pointing to elText in the source document. Must not be null
- * @param file The workspace resource that contains elText. Must not be null.
- * @param symbolResolverFactory
- * @return the value expression resolved from elText or null if it cannot
- * be resolved or elText doesn't resolve to value expression (i.e. is a method expression)
- */
- public ValueType getValueTypeFromEL(final String elText,
- final IStructuredDocumentContext elContext, final IFile file, IStructuredDocumentSymbolResolverFactory symbolResolverFactory)
- {
- assert elText != null;
- assert elContext != null;
- assert file != null;
-
- // TODO investigate if infinite recursion; use ASTResolver instead??
- final IValidationReporter reporter = new ReporterAdapter();
- final ELExpressionValidator validator =
- new ELExpressionValidator(
- elContext, elText, symbolResolverFactory, reporter);
- validator.validateXMLNode();
- final IExpressionSemanticValidator semValidator = validator
- .getSemanticValidator();
- if (semValidator != null
- && semValidator.getExpressionType() instanceof ValueType)
- {
- return (ValueType) semValidator.getExpressionType();
- }
- return null;
- }
-
- /**
- * Convenience for {@link JSFSymbolFactory#getValueTypeFromEL(String, IStructuredDocumentContext, IFile, IStructuredDocumentSymbolResolverFactory)}
- * using StructuredDocumentSymbolResolverFactory.getInstance().
- *
- * @param elText
- * @param elContext
- * @param file
- * @return a ValueType or null
- */
- public ValueType getValueTypeFromEL(final String elText,
- final IStructuredDocumentContext elContext, final IFile file)
- {
- return getValueTypeFromEL(elText, elContext, file, StructuredDocumentSymbolResolverFactory.getInstance());
- }
-
- /**
- * @param type
- * @return <code>true</code>, if the given {@link ValueType} represents
- * an instance of <code>javax.faces.model.DataModel</code>
- */
- private boolean isFacesDataModel(ValueType type)
- {
- return type.isInstanceOf(TypeConstants.TYPE_DATA_MODEL);
- }
-
- /**
- * Tries to guess the row type of a <code>javax.faces.DataModel</code>
- * instance. This will only work if <code>type</code> is a descendant that
- * narrows down the return type of "getRowData()".
- *
- * @param type
- * @return the row type of the given DataModel. Will return
- * <code>null</code> if <code>type</code> is no DataModel or if
- * nothing more specific than <code>Object</code> can be
- * determined
- */
- public String getRowSignatureFromDataModel(ValueType type)
- {
- if (type instanceof IObjectSymbolBasedValueType)
- {
- ISymbol resSymbol = ((IObjectSymbolBasedValueType) type)
- .getSymbol().call(
- "getRowData", ECollections.emptyEList(), "res"); //$NON-NLS-1$ //$NON-NLS-2$
- if (resSymbol != null && resSymbol instanceof IObjectSymbol)
- {
- // TODO full signature
- final String signature = ((IObjectSymbol) resSymbol)
- .getTypeDescriptor().getTypeSignature();
- if (!TypeConstants.TYPE_JAVAOBJECT.equals(signature))
- {
- return signature;
- }
- }
- }
- return null;
- }
-
- /**
- * @param type
- * @return <code>true</code>, if <code>type</code> is a collection or
- * array
- */
- public boolean isContainerType(ValueType type)
- {
- return type.isArray()
- || type.isInstanceOf(TypeConstants.TYPE_COLLECTION);
- }
-
- /**
- * @param type -
- * the type of the <code>value</code> property
- * @return the type signature of the row variable for every type that
- * <code>UIData</code> takes as <code>value</code> property.
- * Will return <code>null</code> if no type or nothing more
- * specific than <code>Object</code> can be determined
- */
- public String getRowSignatureFromValueType(ValueType type)
- {
- if (isContainerType(type))
- {
- return getElementSignatureFromContainerType(type);
- }
- if (isFacesDataModel(type))
- {
- return getRowSignatureFromDataModel(type);
- }
- // Otherwise, according to jsf spec, treat value as single row:
- // TODO full signature
- return type.getSignature();
- }
-
- /**
- * @param symbolName The name of the symbol to be created. Must not be null
- * @param signature The type signature of the array type. Must not be null
- * @param source the runtime source
- * @param javaProject must not be null
- * @return a symbol based approximating an implicit DataModel wrapper for an array
- */
- public final ISymbol createArraySymbol(final String symbolName, final String signature, final ERuntimeSource source, final IJavaProject javaProject)
- {
- assert symbolName != null;
- assert signature != null;
- assert javaProject != null;
-
- final String arrayElementType = Signature.getElementType(signature);
- final int arrayCount = Signature.getArrayCount(signature);
- String adjustedSignature = null;
-
- // if it is a single array nesting, then it will just be the element type,
- // but if it is a multi-dim array, then the scalar element will be an array
- // with one less nesting level. It's a strange corner case to have an implicit
- // array of something as a row type, but it is a valid case. I suppose
- // it may be happen if you want to have tables of tables in which the nested tables
- // in turn use nested variables as their type...
- if (arrayCount > 0)
- {
- adjustedSignature = Signature.createArraySignature(arrayElementType, arrayCount-1);
- }
- else
- {
- adjustedSignature = arrayElementType;
- }
-
- return createScalarSymbol(symbolName, adjustedSignature, source, javaProject);
- }
-
- /**
- * @param symbolName The name of the symbol to create. Must not be null.
- * @param signature The fully resolved type signature of the scalar. Must not be null.
- * @param source
- * @param javaProject The JavaProject whose classpath is to be used to resolve type information for signture. Must not be null.
- * @return a symbol approximating a scalar object DataModel wrapper. The row variable for the
- * data model becomes of type signature
- */
- public final ISymbol createScalarSymbol(final String symbolName, final String signature, final ERuntimeSource source, final IJavaProject javaProject)
- {
- assert symbolName != null;
- assert signature != null;
- assert javaProject != null;
-
- final String elementType = Signature.getElementType(signature);
-
- IJavaTypeDescriptor2 desc =
- SymbolFactory.eINSTANCE.createIJavaTypeDescriptor2();
- final int arrayCount = Signature.getArrayCount(signature);
- if (arrayCount > 0)
- {
- desc.setArrayCount(arrayCount);
- }
-
- IType type = TypeUtil.resolveType(javaProject, elementType);
- if (type != null)
- {
- desc.setType(type);
- }
- else
- {
- desc.setTypeSignatureDelegate(Signature.getTypeErasure(signature));
- }
- desc.getTypeParameterSignatures().addAll(Arrays.asList(Signature.getTypeArguments(signature)));
-
- IComponentSymbol symbol = SymbolFactory.eINSTANCE.createIComponentSymbol();
- symbol.setName(symbolName);
- symbol.setTypeDescriptor(desc);
- symbol.setRuntimeSource(ERuntimeSource.TAG_INSTANTIATED_SYMBOL_LITERAL);
- return symbol;
- }
-
- /**
- * @param symbolName The name of the symbol to create. Must not be null.
- * @param valueType The value expression representing the implicit list. The signature
- * on the valueType must be a list. Must not be null.
- * @param source
- * @param description
- * @param javaProject The JavaProject whose classpath will be used to resolve types. Must not be null.
- *
- * @return a symbol that approximates as best as possible an implicit DataModel for java.util.List value expressions. If the List has
- * resolvable Java 5 type arguments, then a scalar symbol will be created
- * using this type information. If it is a raw type, then
- * createDefaultSymbol() is called
- */
- public final ISymbol createFromList(String symbolName, ValueType valueType, ERuntimeSource source, String description, IJavaProject javaProject)
- {
- assert symbolName != null;
- assert valueType != null;
- assert javaProject != null;
- assert TypeConstants.TYPE_LIST.equals(valueType.getSignature());
-
- final String[] typeArguments = valueType.getTypeArguments();
-
- if (typeArguments != null && typeArguments.length > 0)
- {
- // a list has a single type argument
- final String typeArg = typeArguments[0];
-
- if (Signature.getTypeSignatureKind(typeArg) == Signature.CLASS_TYPE_SIGNATURE)
- {
- return createScalarSymbol(symbolName, typeArg, source, javaProject);
- }
- }
-
- // if no resolvable type signatures, do the default thing
- return createDefaultSymbol(symbolName, ERuntimeSource.TAG_INSTANTIATED_SYMBOL_LITERAL, description);
- }
-
- /**
- * @param symbolName The name of the symbol to create. Must not be null
- * @param source
- * @param description
- * @return a default symbol that eliminates bogus warnings for this dataTable's
- * row variable in cases where something better is resolvable. Note that this is
- * not ideal, since will result in any property being accepted on the variable with
- * this name.
- */
- public final ISymbol createDefaultSymbol(final String symbolName, final ERuntimeSource source, final String description)
- {
- assert symbolName != null;
-
- final IMapTypeDescriptor typeDesc =
- SymbolFactory.eINSTANCE.createIBoundedMapTypeDescriptor();
- // empty map source
- typeDesc.setMapSource(new HashMap());
- final IComponentSymbol symbol =
- SymbolFactory.eINSTANCE.createIComponentSymbol();
- symbol.setName(symbolName);
- symbol.setTypeDescriptor(typeDesc);
- symbol.setDetailedDescription(description); //$NON-NLS-1$
- symbol.setRuntimeSource(source);
- return symbol;
- }
-
- /**
- * FUTURE use: added to support future API feature. Should not be used.
- * @param symbolName
- * @param bundleName
- * @param project
- * @return an instance symbol for the message bundle
- */
- public IInstanceSymbol createMessageBundleSymbol(final String symbolName, final String bundleName, IJavaProject project)
- {
- // FUTURE USE
- throw new UnsupportedOperationException("see https://bugs.eclipse.org/bugs/show_bug.cgi?id=215461");
- }
-
- /**
- * FUTURE use: added to support future API feature. Should not be used.
- * @param symbolName
- * @param fullyQualifiedName
- * @param source
- * @param description
- * @param javaProject
- * @return an instance symbol for the message bundle
- */
- public IBeanInstanceSymbol createManagedBeanSymbol(final String symbolName, final String fullyQualifiedName,
- ERuntimeSource source, final String description, final IJavaProject javaProject)
- {
- // FUTURE USE
- throw new UnsupportedOperationException("see https://bugs.eclipse.org/bugs/show_bug.cgi?id=215461");
- }
-
-// / /**
-// * @param symbolName
-// * @param signature
-// * @param javaProject
-// * @return a symbol for a bean
-// */
-// public IComponentBeanSymbol createBeanSymbolFromSignature(
-// final String symbolName, final String signature,
-// final IJavaProject javaProject)
-// {
-// IJavaTypeDescriptor2 desc = createTypeDescriptorFromSignature(
-// signature, javaProject);
-//
-// IComponentBeanSymbol symbol = SymbolFactory.eINSTANCE
-// .createIComponentBeanSymbol();
-// symbol.setName(symbolName);
-// symbol.setTypeDescriptor(desc);
-// symbol.setRuntimeSource(ERuntimeSource.TAG_INSTANTIATED_SYMBOL_LITERAL);
-// return symbol;
-// }
-
-// /**
-// * @param symbolName
-// * @param bundleName
-// * @param project
-// * @return a symbol for a message bundle
-// */
-// public IMessageBundleSymbol createMessageBundleSymbolFromBundleName(final String symbolName, final String bundleName, IJavaProject project) {
-// final IMessageBundleTypeDescriptor typeDesc = SymbolFactory.eINSTANCE.createIMessageBundleTypeDescriptor();
-// try {
-// Map mapSource = ResourceBundleMapSourceFactory.getResourceBundleMapSource(project.getProject(), bundleName);
-// typeDesc.setMapSource(mapSource);
-// } catch (JavaModelException e) {
-// JSFCorePlugin.log(e, "Error creating resource map for bundle '"bundleName "'"); //$NON-NLS-1$ //$NON-NLS-2$
-// } catch (IOException e) {
-// JSFCorePlugin.log(e, "Error creating resource map for bundle '"bundleName "'"); //$NON-NLS-1$ //$NON-NLS-2$
-// } catch (CoreException e) {
-// JSFCorePlugin.log(e, "Error creating resource map for bundle '"bundleName "'"); //$NON-NLS-1$ //$NON-NLS-2$
-// }
-// final IMessageBundleSymbol symbol = SymbolFactory.eINSTANCE.createIMessageBundleSymbol();
-// symbol.setName(symbolName);
-// symbol.setTypeDescriptor(typeDesc);
-// symbol.setDetailedDescription(NLS.bind(Messages.getString("ComponentSymbolFactory.IMessageBundleSymbol.detailedDescription"), bundleName)); //$NON-NLS-1$
-// return symbol;
-// }
-// /**
-// * Sets the symbol to be defined only inside the given element
-// *
-// * @param symbol
-// * @param slement
-// */
-// public void setDefinitionRange(final IComponentVar symbol,
-// final Element slement)
-// {
-// if (slement instanceof IndexedRegion)
-// {
-// final IndexedRegion defRegion = (IndexedRegion) slement;
-// final int defOffset = defRegion.getStartOffset();
-// final int defLength = defRegion.getLength();
-// symbol.setDefinitionRange(defOffset, defLength);
-// }
-// }
-
-}
\ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/symbols/Messages.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/symbols/Messages.java
deleted file mode 100644
index e68910e..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/symbols/Messages.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.symbols;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/*package*/ class Messages {
- private static final String BUNDLE_NAME = "org.eclipse.jst.jsf.designtime.messages"; //$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
- .getBundle(BUNDLE_NAME);
-
- private Messages() {
- // no external instantiation
- }
-
- /**
- * @param key
- * @return the resource or !key! if not found.
- */
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/symbols/SymbolUtil.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/symbols/SymbolUtil.java
deleted file mode 100644
index 18a8594..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/symbols/SymbolUtil.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.designtime.symbols;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-
-/**
- * Utilities for symbol handling
- *
- * @author cbateman
- *
- */
-public final class SymbolUtil
-{
- /**
- * @param symbols
- * @param name
- * @return the symbol in symbols matching name or null if not there
- */
- public static ISymbol findSymbolByName(final ISymbol[] symbols, final String name)
- {
- for (int i = 0; i < symbols.length; i++)
- {
- if (name.equals(symbols[i].getName()))
- {
- return symbols[i];
- }
- }
-
- // if not found, return null
- return null;
- }
-
- /**
- * @param allSymbols
- * @param prefix
- * @return an array of symbols filtered based on name.startsWith(prefix)
- */
- public static ISymbol[] filterSymbolsByPrefix(final ISymbol[] allSymbols, final String prefix)
- {
- List filteredSymbols = new ArrayList(allSymbols.length);
- for (int i = 0; i < allSymbols.length; i++)
- {
- if (allSymbols[i].getName().startsWith(prefix))
- {
- filteredSymbols.add(allSymbols[i]);
- }
- }
-
- return (ISymbol[]) filteredSymbols.toArray(ISymbol.EMPTY_SYMBOL_ARRAY);
- }
-
- private SymbolUtil()
- {
- // no external instantiation
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/symbols/package-info.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/symbols/package-info.java
deleted file mode 100644
index 6ccfac9..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/symbols/package-info.java
+++ /dev/null
@@ -1,16 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-/**
- * Design Time EL Symbol Contribution framework.
- */
-package org.eclipse.jst.jsf.designtime.symbols;
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/AbstractMetaDataEnabledFeature.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/AbstractMetaDataEnabledFeature.java
deleted file mode 100644
index c022bd9..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/AbstractMetaDataEnabledFeature.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.metadataprocessors;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.internal.IImageDescriptorProvider;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataSourceModelProvider;
-import org.eclipse.jst.jsf.common.metadata.internal.TraitValueHelper;
-import org.eclipse.jst.jsf.common.metadata.query.TaglibDomainMetaDataQueryHelper;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-
-/**
- * Simple abstract class that implementers of {@link IMetaDataEnabledFeature} can subclass in the <b>TagLibDomain</b> of metadata
- * <p><b>Provisional API - subject to change</b></p>*
- */
-public abstract class AbstractMetaDataEnabledFeature implements IMetaDataEnabledFeature{
-
- private MetaDataContext mdContext;
- private IStructuredDocumentContext sdContext;
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.metadataprocessors.IMetaDataEnabledFeature#setMetaDataContext(org.eclipse.jst.jsf.metadataprocessors.MetaDataContext)
- */
- public void setMetaDataContext(final MetaDataContext context) {
- this.mdContext = context;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.metadataprocessors.IMetaDataEnabledFeature#getMetaDataContext()
- */
- public MetaDataContext getMetaDataContext() {
- return mdContext;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.metadataprocessors.IMetaDataEnabledFeature#setStructuredDocumentContext(org.eclipse.wtp.jsf.context.structureddocument.IStructuredDocumentContext)
- */
- public void setStructuredDocumentContext(final IStructuredDocumentContext context) {
- this.sdContext = context;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.metadataprocessors.IMetaDataEnabledFeature#getStructuredDocumentContext()
- */
- public IStructuredDocumentContext getStructuredDocumentContext() {
- return sdContext;
- }
-
-// private IProject getProject(){
-// if (_project == null){
-// _project = IStructuredDocumentContextResolverFactory.INSTANCE.getWorkspaceContextResolver(sdContext).getProject();
-// }
-// return _project;
-// }
-
-
- //common metadata accessors
- /**
- * Return the single expected String value for a given property.
- *
- * @param traitName property name
- * @return String value
- */
- protected String getTraitValueAsString(final String traitName){
- Trait t = getTraitForEntityUsingContext(traitName);
- if (t != null){
- return TraitValueHelper.getValueAsString(t);
- }
-
- return null;
-
- }
-
- /**
- * Return the List of values for a given property.
- *
- * @param traitName trait name
- * @return List of String values
- */
- protected List getTraitValueAsListOfStrings(final String traitName){
- Trait t = getTraitForEntityUsingContext(traitName);
- if (t != null){
- return TraitValueHelper.getValueAsListOfStrings(t);
- }
-
- return Collections.EMPTY_LIST;
- }
-
- /**
- * Return a boolean value for the given named trait .
- *
- * @param traitName property name
- * @return boolean value. Returns false if trait was not located.
- */
- protected boolean getTraitValueAsBoolean(final String traitName){
- Trait t = getTraitForEntityUsingContext(traitName);
- if (t != null){
- return TraitValueHelper.getValueAsBoolean(t);
- }
-
- return false;
-
- }
- private Trait getTraitForEntityUsingContext(final String traitName) {
- //look for trait on given entity
- final Entity entity = getMetaDataContext().getEntity();
- return TaglibDomainMetaDataQueryHelper.getTrait(entity, traitName);
- }
-
- /**
- * @return small-icon name
- */
- protected String getSmallIcon() {
- return getTraitValueAsString(IPossibleValues.POSSIBLE_VALUES_SMALL_ICON_PROP_NAME);
- }
-
- /**
- * @return ImageDescriptor from the small-icon property for annotation from the same
- * source model provider as the trait
- */
- protected ImageDescriptor getImage() {
- final String smallIcon = getSmallIcon();
- if (smallIcon == null)
- return null;
-
- try {
- Trait t = getMetaDataContext().getTrait();
- IMetaDataSourceModelProvider provider = t.getSourceModelProvider();
- IImageDescriptorProvider ip = (IImageDescriptorProvider)provider.getAdapter(IImageDescriptorProvider.class);
- if (ip != null){
- return ip.getImageDescriptor(smallIcon);
- }
- } catch (RuntimeException e) {
- //TODO: log error?
-
- }
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/AbstractRootTypeDescriptor.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/AbstractRootTypeDescriptor.java
deleted file mode 100644
index 00b1ed8..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/AbstractRootTypeDescriptor.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.metadataprocessors;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jst.jsf.metadataprocessors.internal.IMetaDataEnabledFeatureExtension;
-import org.eclipse.jst.jsf.metadataprocessors.internal.MetaDataEnabledFeatureAdapterFactory;
-import org.eclipse.jst.jsf.metadataprocessors.internal.MetaDataEnabledFeatureRegistry;
-
-
-/**
- * Default implementation that a metadata type should strongly consider for using as it's root.
- * This implementation allows for a class implementing {@link ITypeDescriptor} to also contain features so
- * that it is not necessary to declare the features using the MetaDataEnabledFeatures ext-pt
- * <p><b>Provisional API - subject to change</b></p>
- * @author Gerry Kessler - Oracle
- */
-public abstract class AbstractRootTypeDescriptor extends AbstractMetaDataEnabledFeature
- implements ITypeDescriptor {
-
- private IType type;
-
- /**
- * Default implementation that will return <code>this</code> if it supports the processing feature,
- * and all {@link IMetaDataEnabledFeature}s that also support this feature on this type. The caller can determine
- * which one or more of the returned processors to use.
- *
- * @param processingFeature class
- * @return List of <code>IMetaDataEnabledFeature</code>s that support the
- * specified featureType interface.
- *
- * @see org.eclipse.jst.jsf.metadataprocessors.ITypeDescriptor#getFeatureAdapters(java.lang.Class)
- */
- public List getFeatureAdapters(Class processingFeature) {
- Assert.isTrue(processingFeature.isInterface());
- List ret = new ArrayList(3);
- if (processingFeature.isInstance(this)) {
-// ((IMetaDataEnabledFeature)this).setBundleID(type.getBundleID());
- ret.add(this);
- }
-
- //add extensions here
- ret.addAll(findMetaDataEnabledFeaturesForThisType(processingFeature));
- return ret;
-
- }
-
- /**
- * This implementation relies on the the feature implementor using a subclass of AbstractRootTypeDescriptor
- * which implements {@link IMetaDataEnabledFeature}.
- *
- * @param processingFeature
- * @return list of <code>IMetaDataEnabledFeature</code>s
- */
- protected final List<IMetaDataEnabledFeature> findMetaDataEnabledFeaturesForThisType(Class processingFeature) {
- Map <String, IMetaDataEnabledFeature> mapOfFeatures = new HashMap<String, IMetaDataEnabledFeature>();
- List extensions = MetaDataEnabledFeatureRegistry.getInstance()
- .getFeatures(getTypeExtension().getTypeID());
-
- if (!extensions.isEmpty()){
- for (int i=0;i<extensions.size();i++){
- IMetaDataEnabledFeatureExtension aFeature = (IMetaDataEnabledFeatureExtension)extensions.get(i);
- IMetaDataEnabledFeature feature = MetaDataEnabledFeatureAdapterFactory.getInstance().getFeatureAdapter(aFeature, processingFeature);
- if (feature != null && processingFeature.isInstance(feature)
- && ! mapOfFeatures.containsKey(aFeature.getClassName())){
- mapOfFeatures.put(aFeature.getClassName(),feature);
- }
- }
- }
- List<IMetaDataEnabledFeature> ret = new ArrayList<IMetaDataEnabledFeature>(mapOfFeatures.size());
- for (IMetaDataEnabledFeature feature: mapOfFeatures.values()){
- ret.add(feature);
- }
- return ret;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.metadataprocessors.ITypeDescriptor#getRuntimeType()
- */
- public IType getTypeExtension() {
- return type;
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.metadataprocessors.ITypeDescriptor#setRuntimeType(org.eclipse.jst.jsf.metadataprocessors.internal.AbstractMetaDataEnabledType)
- */
- public void setTypeExtension(IType type) {
- this.type = type;
- }
-
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/DefaultTypeDescriptor.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/DefaultTypeDescriptor.java
deleted file mode 100644
index 49b5ad9..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/DefaultTypeDescriptor.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.metadataprocessors;
-
-
-/**
- * Type descriptor that is created if no class if provided for the implementation
- * in the AttributeValueRuntimeTypes extension point.
- * <p><b>Provisional API - subject to change</b></p>
- * @author Gerry Kessler - Oracle
- *
- */
-public class DefaultTypeDescriptor extends AbstractRootTypeDescriptor {
- // abstract super contains no abstract methods, so do nothing: automatic default
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/IMetaDataEnabledFeature.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/IMetaDataEnabledFeature.java
deleted file mode 100644
index f25054d..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/IMetaDataEnabledFeature.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.metadataprocessors;
-
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-
-/**
- * Required interface used by the MetaData feature processing framework.
- * All features must extend this interface.
- * <p><b>Provisional API - subject to change</b></p>
- * @author Gerry Kessler - Oracle
- *
- */
-public abstract interface IMetaDataEnabledFeature {
-
- /**
- * Sets structured document context that this feature will operating on
- * @param context
- */
- public void setStructuredDocumentContext(IStructuredDocumentContext context);
-
- /**
- * Gets structured document context that this feature will operating on
- * @return IStructuredDocumentContext
- */
- public IStructuredDocumentContext getStructuredDocumentContext();
-
- /**
- * Sets metadata model context that this feature will operating on
- * @param context
- */
- public void setMetaDataContext(MetaDataContext context);
-
- /**
- * Gets metadata model context that this feature will be operating on.
- * @return MetaDataContext
- */
- public MetaDataContext getMetaDataContext();
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/IType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/IType.java
deleted file mode 100644
index 7466b57..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/IType.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.metadataprocessors;
-
-
-/**
- * Interface representing the information contained by the type registries.
- * Encapsulates the IConfigurationElement information.
- * <p><b>Provisional API - subject to change</b></p>
- * @author Gerry Kessler - Oracle
- *
- */
-public interface IType {
- /**
- * @return type id
- */
- public String getTypeID();
- /**
- * @return bundle id where it is defined
- */
- public String getBundleID();
- /**
- * @return classname for the type that must be located within the bundle
- */
- public String getClassName();
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/ITypeDescriptor.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/ITypeDescriptor.java
deleted file mode 100644
index 0031ebb..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/ITypeDescriptor.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.metadataprocessors;
-
-import java.util.List;
-
-/**
- * Interface describing the runtime type of a metadata enabled annotation.
- * The type descriptor will load the feature adapters for a certain kind of
- * feature that it supports. The type descriptor is registered by an extension point.
- * <p><b>Provisional API - subject to change</b></p>
- * @see IMetaDataEnabledFeature
- * @see AbstractRootTypeDescriptor
- * @see org.eclipse.jst.jsf.metadataprocessors.internal.AbstractMetaDataEnabledTypeFactory
- * @see IType
- *
- * @author Gerry Kessler - Oracle
- *
- */
-public interface ITypeDescriptor {
- /**
- * @param type
- * The IType must be set after the ITypeDescriptor is constructed
- */
- public void setTypeExtension(IType type);
- /**
- * @return IType
- * Must not be null
- */
- public IType getTypeExtension();
-
- /**
- * @param processingFeature interface class
- * @return List of <code>IMetaDataEnabledFeature</code>s that support the
- * specified processingFeature interface.
- */
- public List<IMetaDataEnabledFeature> getFeatureAdapters(Class processingFeature);
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/MetaDataContext.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/MetaDataContext.java
deleted file mode 100644
index 5876340..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/MetaDataContext.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.metadataprocessors;
-
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-
-
-/**
- * The current meta data model context being used for processing.
- * <p><b>Provisional API - subject to change</b></p>
- *
- */
-public class MetaDataContext {
- private Trait trait;
- private Entity entity;
-
- /**
- * Constructor
- * @param entity
- * @param trait
- */
- public MetaDataContext(Entity entity, Trait trait) {
- this.entity = entity;
- this.trait = trait;
- }
-
- /**
- * @return Entity
- */
- public Entity getEntity(){
- return entity;
- }
- /**
- * @return Trait
- */
- public Trait getTrait(){
- return trait;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/MetaDataEnabledProcessingFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/MetaDataEnabledProcessingFactory.java
deleted file mode 100644
index 0b3f157..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/MetaDataEnabledProcessingFactory.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.metadataprocessors;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.jsf.common.dom.AttributeIdentifier;
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.internal.TraitValueHelper;
-import org.eclipse.jst.jsf.common.metadata.query.ITaglibDomainMetaDataModelContext;
-import org.eclipse.jst.jsf.common.metadata.query.TaglibDomainMetaDataQueryHelper;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IWorkspaceContextResolver;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.metadataprocessors.internal.AttributeValueRuntimeTypeFactory;
-
-/**
- * Singleton class that will produce <code>IMetaDataEnabledFeature</code>s
- * that the caller can use for processing.
- * <p>
- * <b>Provisional API - subject to change</b>
- * </p>
- *
- * @author Gerry Kessler - Oracle
- *
- */
-public final class MetaDataEnabledProcessingFactory {
- private static MetaDataEnabledProcessingFactory INSTANCE;
-
- /**
- * Name of property in annotation file to use when applying a runtime type
- * to an attribute value
- */
- public static final String ATTRIBUTE_VALUE_RUNTIME_TYPE_PROP_NAME = "attribute-value-runtime-type";
-
- /**
- * @return singleton instance
- */
- public static MetaDataEnabledProcessingFactory getInstance() {
- if (INSTANCE == null) {
- INSTANCE = new MetaDataEnabledProcessingFactory();
- }
- return INSTANCE;
- }
-
- private MetaDataEnabledProcessingFactory() {
- super();
- }
-
- /**
- * Returns list of <code>IMetaDataEnabledFeature</code> adapters for the
- * given Taglibrary attribute.
- *
- * Adapters will be scanned for first by uri, element, attribute and if not
- * found, uri, "*", attribute and if still not found by "*", "*", attribute.
- *
- * @param featureType
- * feature type. eg. <code>IPossibleValues</code>,
- * <code>IValidValues</code>, etc. Must be subclass of
- * IMetaDataEnabledFeature.
- * @param sdContext
- * @param uri
- * annotation file uri
- * @param elementName
- * @param attributeName
- * @return returns null - if the metadata was not found <br>
- * returns empty list - if not a
- * <code>IMetaDataEnabledFeature</code> processor or is not valid
- * or does not support the specified feature
- *
- * @see MetaDataEnabledProcessingFactory#ATTRIBUTE_VALUE_RUNTIME_TYPE_PROP_NAME
- */
- public List<IMetaDataEnabledFeature> getAttributeValueRuntimeTypeFeatureProcessors(
- Class featureType, IStructuredDocumentContext sdContext,
- String uri, String elementName, String attributeName) {
-
- // look up the attribute's runtime type from MD
- IProject _project = null;
- if (sdContext != null) {
- IWorkspaceContextResolver resolver = IStructuredDocumentContextResolverFactory.INSTANCE
- .getWorkspaceContextResolver(sdContext);
- _project = resolver != null ? resolver.getProject() : null;
- }
- String _elem = elementName + "/" + attributeName;
- String _uri = uri;
- ITaglibDomainMetaDataModelContext modelContext = TaglibDomainMetaDataQueryHelper
- .createMetaDataModelContext(_project, _uri);
- Entity attrEntity = TaglibDomainMetaDataQueryHelper.getEntity(modelContext,
- _elem);
-
- if (attrEntity != null)
- return getAttributeValueRuntimeTypeFeatureProcessors(featureType, sdContext, attrEntity);
-
- return Collections.EMPTY_LIST;
-
- }
-
- /**
- * A convenience method fully equivalent to:
- *
- * getAttributeValueRuntimeTypeFeatureProcessors
- * (featureType, sdContext, attributeId.getTagIdentifier().getUri()
- * , attributeId.getTagIdentifier().getTagName(),
- * attributeId.getName())
- * @param featureType
- * @param sdContext
- * @param attributeId
- * @return the meta-data enabled feature
- */
- public List<IMetaDataEnabledFeature> getAttributeValueRuntimeTypeFeatureProcessors(
- Class featureType, IStructuredDocumentContext sdContext,
- AttributeIdentifier attributeId)
- {
- return getAttributeValueRuntimeTypeFeatureProcessors
- (featureType, sdContext, attributeId.getTagIdentifier().getUri()
- , attributeId.getTagIdentifier().getTagName(),
- attributeId.getName());
- }
-
- /**
- * @param featureType
- * @param sdContext
- * @param attrEntity
- * @return returns null - if the meta data was not found <br>
- * returns empty list - if not a
- * <code>IMetaDataEnabledFeature</code> processor or is not valid
- * or does not support the specified feature
- */
- public List<IMetaDataEnabledFeature> getAttributeValueRuntimeTypeFeatureProcessors(
- Class featureType, IStructuredDocumentContext sdContext,
- Entity attrEntity) {
-
- Trait trait = TaglibDomainMetaDataQueryHelper.getTrait(attrEntity,
- ATTRIBUTE_VALUE_RUNTIME_TYPE_PROP_NAME);
-
- if (trait == null) {
- return Collections.EMPTY_LIST;
- }
-
- List<IMetaDataEnabledFeature> retList = new ArrayList<IMetaDataEnabledFeature>(2);
- String typeId = TraitValueHelper.getValueAsString(trait);
-
- // get the implementing class for the type
- ITypeDescriptor type = AttributeValueRuntimeTypeFactory.getInstance()
- .getType(typeId);
- if (type != null) {
- MetaDataContext context = new MetaDataContext(attrEntity, trait);
- // get all the feature adapters (IMetaDataEnabledFeature) for this
- // type
- List<IMetaDataEnabledFeature> featureAdapters = type.getFeatureAdapters(featureType);
- for (int j = 0; j < featureAdapters.size(); j++) {
- // set the context in the feature
- featureAdapters.get(j).setMetaDataContext(context);
- featureAdapters.get(j).setStructuredDocumentContext(sdContext);
- retList.add(featureAdapters.get(j));
- }
-
- }
- // return list of IMetaDataEnabledFeatures for this type
- return Collections.unmodifiableList(retList);
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/TaglibMetadataContext.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/TaglibMetadataContext.java
deleted file mode 100644
index 71809e8..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/TaglibMetadataContext.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.metadataprocessors;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-
-/**
- * Binds tag library context to the metadata context
- * <p><b>Provisional API - subject to change</b></p>
- * @deprecated - should not have been public, and no reason anyone should be using this class
- */
-public class TaglibMetadataContext extends MetaDataContext {
-
- private String uri;
- private String tagName;
- private String attributeName;
-
- /**
- * Constructor
- *
- * @param uri - must not be null
- * @param tagName - must not be null
- * @param attributeName - may be null
- * @param entity - the metadata entity represented by the tag or attribute
- * @param trait - the metadata trait of interest
- */
- public TaglibMetadataContext(String uri, String tagName, String attributeName, Entity entity, Trait trait){
- super(entity, trait);
- this.uri = uri;
- this.tagName = tagName;
- this.attributeName = attributeName;
- }
-
- /**
- * Package-private Constructor
- *
- * @param tagAttrEntity - must be tag attribute entity and not null
- * @param trait
- */
- /*package*/ TaglibMetadataContext(Entity tagAttrEntity, Trait trait){
- super(tagAttrEntity, trait);
- Assert.isNotNull(tagAttrEntity);
- this.uri = tagAttrEntity.getModel().getCurrentModelContext().getUri();
- if (!(tagAttrEntity.eContainer() instanceof Entity))
- {
- throw new IllegalArgumentException("tagAttrEntity must be contained in a tag Entity to use this constructor");
- }
- this.tagName = ((Entity)tagAttrEntity.eContainer()).getId();
- this.attributeName = tagAttrEntity.getId();
- }
-
- /**
- * @return URI
- */
- public String getUri() {
- return uri;
- }
-
- /**
- * @return Tag name - should not be null
- */
- public String getTagName() {
- return tagName;
- }
-
- /**
- * @return Attribute name - may be null
- */
- public String getAttributeName() {
- return attributeName;
- }
-
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/features/ELIsNotValidException.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/features/ELIsNotValidException.java
deleted file mode 100644
index f1b5b16..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/features/ELIsNotValidException.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.metadataprocessors.features;
-
-/**
- * Exception
- *
- * <p><b>Provisional API - subject to change</b></p>
- */
-public class ELIsNotValidException extends Exception {
- private static final long serialVersionUID = 1L;
-
- /**
- * Constructor
- * @param msg
- */
- public ELIsNotValidException(String msg){
- super(msg);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/features/ICreateValues.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/features/ICreateValues.java
deleted file mode 100644
index 6c25a65..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/features/ICreateValues.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.metadataprocessors.features;
-
-import org.eclipse.jst.jsf.metadataprocessors.IMetaDataEnabledFeature;
-
-/**
- * @author Gerry Kessler - Oracle
- *
- * Experimental - not currently used
- * <p><b>Provisional API - subject to change</b></p>
- *
- */
-public interface ICreateValues extends IMetaDataEnabledFeature{
- /**
- * @return object created
- */
- public Object createValue();
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/features/IDefaultValue.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/features/IDefaultValue.java
deleted file mode 100644
index 93d93b8..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/features/IDefaultValue.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.metadataprocessors.features;
-
-import org.eclipse.jst.jsf.metadataprocessors.IMetaDataEnabledFeature;
-
-/**
- * Interface providing a default value.
- *
- * @author Gerry Kessler - Oracle
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- */
-public interface IDefaultValue extends IMetaDataEnabledFeature {
- /**
- * Default name of property in annotation file to use when supplying default values from meta-data
- */
- String DEFAULT_VALUE_PROP_NAME = "default-value";
-
- /**
- * @return default value or null if one not defined
- */
- public String getDefaultValue();
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/features/IPossibleValue.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/features/IPossibleValue.java
deleted file mode 100644
index d4cdbf9..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/features/IPossibleValue.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.metadataprocessors.features;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-
-/**
- * Interface for providing lists of possible values
- * Values can be different than displayed values.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- */
-public interface IPossibleValue {
- /**
- * @return value to set. should not return null.
- */
- public String getValue();
- /**
- * @return value to display in a proposal which can be different than what is set. Must not return null.
- */
- public String getDisplayValue();
- /**
- * @return ImageDescriptor for image to be displayed in a proposal. May be null.
- */
- public ImageDescriptor getIcon();
- /**
- * @return true if is known to be the default value.
- */
- public boolean isDefaultValue();
-
- /**
- * @return additional information that could be used for descriptive help
- * May be null
- */
- public String getAdditionalInformation();
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/features/IPossibleValues.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/features/IPossibleValues.java
deleted file mode 100644
index 4d43d87..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/features/IPossibleValues.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.metadataprocessors.features;
-
-import java.util.List;
-
-import org.eclipse.jst.jsf.metadataprocessors.IMetaDataEnabledFeature;
-
-/**
- * Interface for providing possible values.
- *
- * <p><b>Provisional API - subject to change</b></p>
- * @author Gerry Kessler - Oracle
- *
- */
-public interface IPossibleValues extends IMetaDataEnabledFeature{
-
- /**
- * Default name of property in annotation file to use when supplying possible values from meta-data
- */
- public static final String POSSIBLE_VALUES_PROP_NAME = "valid-values";
- /**
- * Default name of property in annotation file to use when supplying possible displayed values from meta-data
- */
- public static final String POSSIBLE_VALUES_FOR_DISPLAY_PROP_NAME = "displayed-values";
- /**
- * Default name of property in annotation file to use when supplying icon displayed values from meta-data
- */
- public static final String POSSIBLE_VALUES_SMALL_ICON_PROP_NAME = "small-icon";
- /**
- * @return List of IPossibleValue instances representing possible values
- * Implementer must ensure that an empty rather than null list is returned if no values are posssible.
- */
- public List getPossibleValues();
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/features/IValidELValues.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/features/IValidELValues.java
deleted file mode 100644
index ca0b8f6..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/features/IValidELValues.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.metadataprocessors.features;
-
-import org.eclipse.jst.jsf.common.internal.types.CompositeType;
-import org.eclipse.jst.jsf.metadataprocessors.IMetaDataEnabledFeature;
-
-/**
- * An {@link IMetaDataEnabledFeature} for semantic validation of EL Values
- *
- * <p><b>Provisional API - subject to change</b></p>
- */
-public interface IValidELValues extends IMetaDataEnabledFeature {
- /**
- * Expected runtime type for EL value
- * @return CompositeType
- * @throws ELIsNotValidException
- */
- public CompositeType getExpectedRuntimeType() throws ELIsNotValidException;
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/features/IValidValues.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/features/IValidValues.java
deleted file mode 100644
index 25baa40..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/features/IValidValues.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.metadataprocessors.features;
-
-import java.util.List;
-
-import org.eclipse.jst.jsf.metadataprocessors.IMetaDataEnabledFeature;
-
-/**
- * An {@link IMetaDataEnabledFeature} for validating values using metadata
- *
- * <p><b>Provisional API - subject to change</b></p>
- */
-public interface IValidValues extends IMetaDataEnabledFeature{
- /**
- * Trait name for valid-values
- */
- public static final String VALID_VALUES_PROP_NAME = "valid-values";
-
- /**
- * Trait name for valid-values-code
- */
- public static final String VALID_VALUES_CODE_PROP_NAME = VALID_VALUES_PROP_NAME + "-code";
- /**
- * Trait name for valid-values-severity
- */
- public static final String VALID_VALUES_SEVERITY_PROP_NAME = VALID_VALUES_PROP_NAME + "-severity";
- /**
- * Trait name for valid-values-message
- */
- public static final String VALID_VALUES_MESSAGE_PROP_NAME = VALID_VALUES_PROP_NAME + "-message";
- /**
- * Trait name for valid-maximum
- */
- public static final String VALID_VALUES_MAX_PROP_NAME = "valid-maximum";
- /**
- * Trait name for valid-minimum
- */
- public static final String VALID_VALUES_MIN_PROP_NAME = "valid-minimum";
- /**
- * @param value fully resolved value as String
- * @return true if is valid
- */
- public boolean isValidValue(String value);
- /**
- * @return List of IValidationMessage objects if invalid
- * Must return empty list rather than null
- * Call to isValidValue(String value) required before this should be called.
- */
- public List getValidationMessages();
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/features/IValidationMessage.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/features/IValidationMessage.java
deleted file mode 100644
index 4f29c78..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/features/IValidationMessage.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.metadataprocessors.features;
-
-/**
- * Interface for validation messages for metadata features
- *
- * <p><b>Provisional API - subject to change</b></p>
- */
-public interface IValidationMessage {
- /**
- * @return localized string desribing validation issue
- * Should not be null;
- */
- public String getMessage();
-
- /**
- * @return String representing a validation code associated with validation issue
- * Can return null
- */
- public String getCode();
-
- /**
- * @return integer value representing severity.
- * Valid values are 0 (IStatus.INFO), 1 (IStatus.WARNING) and 4 (IStatus.ERROR)
- */
- public int getSeverity();
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/features/PossibleValue.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/features/PossibleValue.java
deleted file mode 100644
index dbbde06..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/features/PossibleValue.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.metadataprocessors.features;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-
-
-/**
- * Implements {@link IPossibleValues}
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- */
-public class PossibleValue implements IPossibleValue {
- private String value;
- private String displayValue;
- private ImageDescriptor smallIcon;
- private boolean isDefault = false;
- private String additionalInfo;
-
- /**
- * Constructor when display value is same as stored value
- * @param value
- */
- public PossibleValue(String value){
- this.value = value;
- }
-
- /**
- * Constructor when display-value may be different than stored value
- * @param value
- * @param displayValue
- */
- public PossibleValue(String value, String displayValue){
- this.value = value;
- this.displayValue = displayValue;
- }
-
- /**
- * Constructor when display-value may be different than stored value
- * and a default value is known
- * @param value
- * @param displayValue
- * @param isDefaultValue
- */
- public PossibleValue(String value, String displayValue, boolean isDefaultValue) {
- this.value = value;
- this.displayValue = displayValue;
- this.isDefault = isDefaultValue;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValue#getValue()
- */
- public String getValue() {
- return value;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValue#getDisplayValue()
- */
- public String getDisplayValue() {
- if (displayValue == null)
- return value;
- return displayValue;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValue#getIcon()
- */
- public ImageDescriptor getIcon() {
- return smallIcon;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValue#isDefaultValue()
- */
- public boolean isDefaultValue() {
- return isDefault;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValue#getAdditionalInformation()
- */
- public String getAdditionalInformation() {
- return additionalInfo;
- }
-
- /**
- * @param value
- */
- public void setValue(String value) {
- this.value = value;
- }
-
- /**
- * @param displayValue
- */
- public void setDisplayValue(String displayValue) {
- this.displayValue = displayValue;
- }
-
- /**
- * @param smallIcon
- */
- public void setIcon(ImageDescriptor smallIcon) {
- this.smallIcon = smallIcon;
- }
-
- /**
- * @param isDefault
- */
- public void setIsDefault(boolean isDefault) {
- this.isDefault = isDefault;
- }
-
- /**
- * @param additionalInfo
- */
- public void setAdditionalInformation(String additionalInfo){
- this.additionalInfo = additionalInfo;
- }
-
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/features/ValidationMessage.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/features/ValidationMessage.java
deleted file mode 100644
index 5aaf29e..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/features/ValidationMessage.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.metadataprocessors.features;
-
-import org.eclipse.core.runtime.IStatus;
-
-/**
- * Metadata Validation Message implementation
- *
- * <p><b>Provisional API - subject to change</b></p>
- */
-public class ValidationMessage implements IValidationMessage {
-
- private String code;
- private String msg;
- private int severity = IStatus.WARNING;
-
- /**
- * Constructor
- * @param msg
- */
- public ValidationMessage(String msg){
- this.msg = msg;
- }
-
- /**
- * Constructor
- * @param msg
- * @param code
- * @param severity
- */
- public ValidationMessage(String msg, String code, int severity){
- this.msg = msg;
- this.code = code;
- this.severity = severity;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidationMessage#getMessage()
- */
- public String getMessage() {
- return msg;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidationMessage#getCode()
- */
- public String getCode() {
- return code;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidationMessage#getSeverity()
- */
- public int getSeverity() {
- return severity;
- }
-
- /**
- * @param msg
- */
- public void setMessage(String msg) {
- this.msg = msg;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/features/package-info.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/features/package-info.java
deleted file mode 100644
index 552ffe6..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/features/package-info.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-/**
- * Provides tooling services for tag attribute values
- * based on the org.eclipse.jst.jsf.core.AttributeValueRuntimeTypes.
- * <p>
- * New features can added to the system using the org.eclipse.jst.jsf.core.MetaDataEnabledFeatures
- * extension-point. This extension point provides the binding of a AttributeValueRuntimeTypes to a feature
- * so that new behaviors can be added to existing types.
- *
- * <p><b>Provisional API - subject to change</b></p>
- */
-package org.eclipse.jst.jsf.metadataprocessors.features;
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/internal/AbstractMetaDataEnabledType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/internal/AbstractMetaDataEnabledType.java
deleted file mode 100644
index 0ae2de2..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/internal/AbstractMetaDataEnabledType.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.metadataprocessors.internal;
-
-import org.eclipse.jst.jsf.metadataprocessors.IType;
-
-
-/**
- * Class that encapuslates the information from the
- * <code>AttributeValueRuntimeTypes</code> and
- * <code>MetaDataEnabledFeatures</code>
- * extension points.
- *
- * @author Gerry Kessler - Oracle
- *
- */
-public class AbstractMetaDataEnabledType implements IType{
- String typeId;
- String bundleId;
- String klass;
-
- AbstractMetaDataEnabledType(String bundleID, String id, String klass){
- this.bundleId = bundleID;
- this.typeId = bundleId + "." + id;
- this.klass = klass;
- }
-
- public String getTypeID(){
- return typeId;
- }
-
- public String getBundleID(){
- return bundleId;
- }
-
- public String getClassName(){
- return klass;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/internal/AbstractMetaDataEnabledTypeFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/internal/AbstractMetaDataEnabledTypeFactory.java
deleted file mode 100644
index 6e2d1f4..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/internal/AbstractMetaDataEnabledTypeFactory.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.metadataprocessors.internal;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.metadataprocessors.IType;
-import org.eclipse.jst.jsf.metadataprocessors.ITypeDescriptor;
-import org.osgi.framework.Bundle;
-
-/**
- * Abstract factory producing <code>ITypeDescriptor</code>s
- * from instances of <code>AbstractMetaDataEnabledType</code>s
- *
- * @author Gerry Kessler - Oracle
- *
- */
-public abstract class AbstractMetaDataEnabledTypeFactory {
- /**
- * The factory instance
- * TODO: why is this defined here it is only used in sub-classes??
- */
- protected static AbstractMetaDataEnabledTypeFactory INSTANCE;
-
- /**
- * No arg constructor
- */
- protected AbstractMetaDataEnabledTypeFactory(){
- super();
- }
-
- /**
- * Concrete factory must pass instances of the it's types.
- *
- * @param typeId
- * @return list of instances identified by the type id
- */
- public abstract ITypeDescriptor getType(String typeId);
-
- /**
- * @param type
- * @return instance of ITypeDescriptor identified by the type id
- */
- public ITypeDescriptor getType(AbstractMetaDataEnabledType type){
-
- return createType(type);
-
- }
-
- /**
- * @param type
- * @return class identified by the type id
- */
- public Class getClassForType(IType type){
- return createTypeClass(type);
-
- }
-
- /**
- * Creates instances of <code>ITypeDescriptor</code>s from
- * <code>AbstractMetaDataEnabledType</code>s
- *
- * @param atype
- * @return the meta-data type descriptor
- */
- protected ITypeDescriptor createType(IType atype){
- if (atype != null){
- ITypeDescriptor desc = createDescriptorInstance(atype);
- if (desc != null){
- desc.setTypeExtension(atype);
- return desc;
- }
- }
- return null;
- }
-
-
- private Class createTypeClass(IType type){
- String className = type.getClassName();
- try {
- Bundle bundle =Platform.getBundle(type.getBundleID());
- if (bundle == null){
- JSFCorePlugin.log(IStatus.ERROR, type.getBundleID() + " could not be created to load " + className);
- return null;
- }
- Class klass = bundle.loadClass(className);
- if (klass != null){
- //make sure the class can support the feature/extended interface
- if (ITypeDescriptor.class.isAssignableFrom(klass))
- {
- return klass;
- }
- JSFCorePlugin.log(IStatus.INFO, className + " was not found in " + type.getBundleID() +" for " + type.getTypeID());
- }
- } catch (ClassNotFoundException e) {
- JSFCorePlugin.log(IStatus.ERROR, className + " was not found in " + type.getBundleID() +" for " + type.getTypeID());
- }
- return null;
- }
-
- private ITypeDescriptor createDescriptorInstance(IType type){
- String className = type.getClassName();
- try {
- Class klass = createTypeClass(type);
- if (klass != null){
- return (ITypeDescriptor)klass.newInstance();
- }
- } catch (InstantiationException e) {
- JSFCorePlugin.log(IStatus.ERROR, "InstantiationException: " + className + " in " + type.getBundleID() +" for " + type.getTypeID());
- } catch (IllegalAccessException e) {
- JSFCorePlugin.log(IStatus.ERROR, "IllegalAccessException: " + className + " in " + type.getBundleID() +" for " + type.getTypeID());
- }
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/internal/AbstractMetaDataEnabledTypeRegistry.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/internal/AbstractMetaDataEnabledTypeRegistry.java
deleted file mode 100644
index 5c4b0b2..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/internal/AbstractMetaDataEnabledTypeRegistry.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.metadataprocessors.internal;
-
-import java.util.HashMap;
-
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.InvalidRegistryObjectException;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-
-/**
- * Abstract registry of <code>AbstractMetaDataEnabledType<code>
- * mapped by type id.
- *
- * @author Gerry Kessler - Oracle
- *
- */
-public abstract class AbstractMetaDataEnabledTypeRegistry {
- private final HashMap typeMap; //map of types keyed by id
- private final String ext_pt_id; //type ext-pt id
-
- /**
- * @param extPtId
- */
- public AbstractMetaDataEnabledTypeRegistry(String extPtId){
- typeMap = new HashMap();
- ext_pt_id = extPtId;
-
- readRegistry();
- }
-
- /**
- * @param bundleID
- * @param id
- * @param klass
- * @param runtimeType
- */
- protected void registerType(String bundleID, String id, String klass, String runtimeType){
- AbstractMetaDataEnabledType atype = new AbstractMetaDataEnabledType(bundleID, id, klass);
- if (!typeMap.containsKey(atype.getTypeID())){
- typeMap.put(atype.getTypeID(), atype);
- }
- else {
- //is there any point in putting this more in the user's face? this is really an internal error.
- JSFCorePlugin.log(IStatus.ERROR, "Duplicate RuntimeTypeId being registered from " + ext_pt_id + ": " + atype.getTypeID());
- }
- }
-
- /**
- * Return the metadata enabled type for the given id
- * @param id
- * @return type
- */
- public AbstractMetaDataEnabledType getType(String id){
- if (typeMap.containsKey(id))
- {
- return (AbstractMetaDataEnabledType)typeMap.get(id);
- }
- return null;
- }
-
- /**
- * Reads the extensions for a particular type id
- */
- protected void readRegistry() {
- try {
- IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(JSFCorePlugin.PLUGIN_ID, ext_pt_id);
- IExtension[] extensions = point.getExtensions();
- for (int i=0;i < extensions.length;i++){
- IExtension ext = extensions[i];
- for (int j=0;j < ext.getConfigurationElements().length;j++){
- final String bundleId = ext.getConfigurationElements()[j].getContributor().getName();
- final String id = ext.getConfigurationElements()[j].getAttribute("id");
- String klass = ext.getConfigurationElements()[j].getAttribute("class");
- final String runtimeType = ext.getConfigurationElements()[j].getAttribute("runtime-type");
- if (klass == null || klass.trim().equals("")){
- klass = getDefaultClassName();
- }
- registerType(bundleId, id, klass, runtimeType);
- }
- }
- } catch (InvalidRegistryObjectException e) {
- JSFCorePlugin.log(e, "Unable to read " + JSFCorePlugin.PLUGIN_ID + ext_pt_id + " registry");
- }
- }
-
- /**
- * @return default classname to use for the type
- */
- protected abstract String getDefaultClassName();
-
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/internal/AttributeValueRuntimeTypeFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/internal/AttributeValueRuntimeTypeFactory.java
deleted file mode 100644
index 78638e2..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/internal/AttributeValueRuntimeTypeFactory.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.metadataprocessors.internal;
-
-import org.eclipse.jst.jsf.metadataprocessors.ITypeDescriptor;
-
-
-/**
- * Factory producing <code>IMetaDataEnabledFeature</code>s from
- * <code>AttributeValueRuntimeType</code> objects
- *
- * @author Gerry Kessler - Oracle
- *
- */
-public class AttributeValueRuntimeTypeFactory extends AbstractMetaDataEnabledTypeFactory{
-
- /**
- * @return the single instance... TODO: why is this allocated here if it is
- * declared in super?
- */
- public static AttributeValueRuntimeTypeFactory getInstance(){
- if (INSTANCE == null){
- INSTANCE = new AttributeValueRuntimeTypeFactory();
- }
- return (AttributeValueRuntimeTypeFactory)INSTANCE;
- }
-
- private AttributeValueRuntimeTypeFactory(){
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.metadataprocessors.internal.AbstractMetaDataEnabledTypeFactory#getType(java.lang.String)
- */
- public ITypeDescriptor getType(String typeId){
-
- return createType(AttributeValueRuntimeTypeRegistry.getInstance().getType(typeId));
-
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/internal/AttributeValueRuntimeTypeRegistry.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/internal/AttributeValueRuntimeTypeRegistry.java
deleted file mode 100644
index 9deab17..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/internal/AttributeValueRuntimeTypeRegistry.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.metadataprocessors.internal;
-
-/**
- * Registry of <code>AbstractMetaDataEnabledType</code>s that are loaded from
- * the <code>AttributeValueRuntimeValueType</code> extension point
- *
- * @author Gerry Kessler - Oracle
- *
- */
-public class AttributeValueRuntimeTypeRegistry extends AbstractMetaDataEnabledTypeRegistry {
-
- private static final String EXTPTID = "AttributeValueRuntimeTypes";
- private static final String DEFAULT_CLASS = "org.eclipse.jst.jsf.metadataprocessors.DefaultTypeDescriptor";
- private static AttributeValueRuntimeTypeRegistry INSTANCE;
-
- /**
- * @return singleton instance
- */
- public static AttributeValueRuntimeTypeRegistry getInstance(){
- if (INSTANCE == null){
- INSTANCE = new AttributeValueRuntimeTypeRegistry();
- }
- return INSTANCE;
- }
-
- private AttributeValueRuntimeTypeRegistry(){
- super(EXTPTID);
- }
-
- protected String getDefaultClassName() {
- return DEFAULT_CLASS;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/internal/IMetaDataEnabledFeatureExtension.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/internal/IMetaDataEnabledFeatureExtension.java
deleted file mode 100644
index bde9ca6..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/internal/IMetaDataEnabledFeatureExtension.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.metadataprocessors.internal;
-
-/**
- * Interface used to bind feature extensions to metadata enabled types
- *
- */
-public interface IMetaDataEnabledFeatureExtension {
- /**
- * @return bundle id
- */
- public String getBundleID();
- /**
- * @return type id
- */
- public String getTypeID();
- /**
- * @return class name to use for type. Must be located within the bundle.
- */
- public String getClassName();
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/internal/MetaDataEnabledFeatureAdapterFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/internal/MetaDataEnabledFeatureAdapterFactory.java
deleted file mode 100644
index 9cb0303..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/internal/MetaDataEnabledFeatureAdapterFactory.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.metadataprocessors.internal;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.metadataprocessors.IMetaDataEnabledFeature;
-import org.eclipse.jst.jsf.metadataprocessors.IType;
-import org.eclipse.jst.jsf.metadataprocessors.ITypeDescriptor;
-import org.osgi.framework.Bundle;
-
-/**
- * Factory producing <code>IMetaDataEnabledFeature</code>s from
- * <code>IType</code> objects that implement a specified feature
- *
- * @author Gerry Kessler - Oracle
- *
- */
-public final class MetaDataEnabledFeatureAdapterFactory {
- private static MetaDataEnabledFeatureAdapterFactory INSTANCE;
- private Map<String, Class> typesCache;
- /**
- * @return singleton instance
- */
- public static MetaDataEnabledFeatureAdapterFactory getInstance(){
- if (INSTANCE == null){
- INSTANCE = new MetaDataEnabledFeatureAdapterFactory();
- }
- return INSTANCE;
- }
-
- private MetaDataEnabledFeatureAdapterFactory(){
- super();
- typesCache = new HashMap<String, Class>();
- }
-
-
- /**
- * Given the feature extension, create and return the {@link IMetaDataEnabledFeature} for a given processing feature
- * @param feature
- * @param processingFeature class
- * @return IMetaDataEnabledFeature
- */
- public IMetaDataEnabledFeature getFeatureAdapter(IMetaDataEnabledFeatureExtension feature, Class processingFeature){
- if (feature != null){
- return createFeature(feature, processingFeature);
- }
- return null;
- }
-
- /**
- * Given the feature extension, create and return the {@link IMetaDataEnabledFeature} for a given processing feature if
- * that the type that the feature is bound to is a subclass of the the type
- * @param feature
- * @param processingFeature class
- * @param type
- * @return IMetaDataEnabledFeature. <br>Will return null if the type that the feature extension is bound to,
- * is not a subclass of the supplied type
- */
- public IMetaDataEnabledFeature getFeatureAdapterForSubclass(IMetaDataEnabledFeatureExtension feature, Class processingFeature, IType type){
- if (feature != null ){
- ITypeDescriptor aType = AttributeValueRuntimeTypeFactory.getInstance().getType(feature.getTypeID());
- Class klass = aType.getTypeExtension().getClass();
- if (klass.asSubclass(type.getClass()) != null)
- return createFeature(feature, processingFeature);
- }
- return null;
- }
-
-// private Class getOrCreateTypeClassFor(IMetaDataEnabledFeatureExtension featureExt){
-// Class klass = null;
-// String className;
-// ITypeDescriptor type = AttributeValueRuntimeTypeFactory.getInstance().getType(featureExt.getTypeID());
-// try {
-// if (! typesCache.containsKey(featureExt.getTypeID())){
-// Bundle bundle =Platform.getBundle(featureExt.getBundleID());
-// if (bundle == null){
-// JSFCorePlugin.log(IStatus.ERROR, featureExt.getBundleID() + " could not be created to load " + className);
-// return null;
-// }
-// klass = bundle.loadClass(className);
-// if (klass != null){
-// typesCache.put(featureExt.getTypeID(), klass);
-// }
-// }
-// else
-// klass = typesCache.get(featureExt.getTypeID());
-//
-// return klass;
-// if (!IMetaDataEnabledFeature.class.isAssignableFrom(klass)){
-// JSFCorePlugin.log(IStatus.INFO, className + " is not a IMetaDataEnabledFeature. " + featureExt.getBundleID() +" : " + featureExt.getTypeID());
-// }
-// else if (klass != null && processingFeature.isAssignableFrom(klass)){
-// IMetaDataEnabledFeature obj = (IMetaDataEnabledFeature)klass.newInstance();
-// return obj;
-// }
-//
-// } catch (ClassNotFoundException e) {
-// JSFCorePlugin.log(IStatus.ERROR, className + " was not found in " + featureExt.getBundleID() +" for " + featureExt.getTypeID());
-// } catch (InstantiationException e) {
-// JSFCorePlugin.log(IStatus.ERROR, "InstantiationException: " + className + " in " + featureExt.getBundleID() +" for " + featureExt.getTypeID());
-// } catch (IllegalAccessException e) {
-// JSFCorePlugin.log(IStatus.ERROR, "IllegalAccessException: " + className + " in " + featureExt.getBundleID() +" for " + featureExt.getTypeID());
-// }
-// return null;
-// }
-
- private IMetaDataEnabledFeature createFeature(IMetaDataEnabledFeatureExtension featureExt, Class processingFeature){
- String className = featureExt.getClassName();
- Class klass = null;
- try {
- if (! typesCache.containsKey(featureExt.getTypeID())){
- Bundle bundle =Platform.getBundle(featureExt.getBundleID());
- if (bundle == null){
- JSFCorePlugin.log(IStatus.ERROR, featureExt.getBundleID() + " could not be created to load " + className);
- return null;
- }
- klass = bundle.loadClass(className);
- if (klass != null){
- typesCache.put(featureExt.getTypeID(), klass);
- }
- }
- else
- klass = typesCache.get(featureExt.getTypeID());
-
- if (!IMetaDataEnabledFeature.class.isAssignableFrom(klass)){
- JSFCorePlugin.log(IStatus.INFO, className + " is not a IMetaDataEnabledFeature. " + featureExt.getBundleID() +" : " + featureExt.getTypeID());
- }
- else if (klass != null && processingFeature.isAssignableFrom(klass)){
- IMetaDataEnabledFeature obj = (IMetaDataEnabledFeature)klass.newInstance();
- return obj;
- }
-
- } catch (ClassNotFoundException e) {
- JSFCorePlugin.log(IStatus.ERROR, className + " was not found in " + featureExt.getBundleID() +" for " + featureExt.getTypeID());
- } catch (InstantiationException e) {
- JSFCorePlugin.log(IStatus.ERROR, "InstantiationException: " + className + " in " + featureExt.getBundleID() +" for " + featureExt.getTypeID());
- } catch (IllegalAccessException e) {
- JSFCorePlugin.log(IStatus.ERROR, "IllegalAccessException: " + className + " in " + featureExt.getBundleID() +" for " + featureExt.getTypeID());
- }
- return null;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/internal/MetaDataEnabledFeatureExtension.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/internal/MetaDataEnabledFeatureExtension.java
deleted file mode 100644
index ae90a9a..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/internal/MetaDataEnabledFeatureExtension.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.metadataprocessors.internal;
-
-
-/**
- *
- * @author Gerry Kessler - Oracle
- *
- */
-public class MetaDataEnabledFeatureExtension implements IMetaDataEnabledFeatureExtension{
-
- private String klass;
- private String typeId;
- private String bundleId;
-
- MetaDataEnabledFeatureExtension(String bundleID, String typeId, String klass) {
- this.bundleId = bundleID;
- this.typeId = typeId;
- this.klass = klass;
- }
-
- public String getBundleID() {
- return bundleId;
- }
-
- public String getClassName() {
- return klass;
- }
-
- public String getTypeID() {
- return typeId;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/internal/MetaDataEnabledFeatureRegistry.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/internal/MetaDataEnabledFeatureRegistry.java
deleted file mode 100644
index 17b5a41..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/internal/MetaDataEnabledFeatureRegistry.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.metadataprocessors.internal;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.InvalidRegistryObjectException;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.metadataprocessors.IType;
-
-/**
- * Registry of <code>AbstractMetaDataEnabledType</code>s loaded from
- * the <code>MetaDataEnabledFeatures</code> extension point
- *
- * A map of features keyed by type id
- *
- */
-public class MetaDataEnabledFeatureRegistry{
- private static final String EXTPTID = "MetaDataEnabledFeatures";
- private Map<String, List<IMetaDataEnabledFeatureExtension>> featuresMap;
- private Map<String, Class> typeCacheMap;
- private static MetaDataEnabledFeatureRegistry INSTANCE;
-
- /**
- * @return the singleton instance of the MetaDataEnabledFeatureRegistry
- */
- public static synchronized MetaDataEnabledFeatureRegistry getInstance(){
- if (INSTANCE == null){
- INSTANCE = new MetaDataEnabledFeatureRegistry();
- }
- return INSTANCE;
- }
-
- private MetaDataEnabledFeatureRegistry(){
- featuresMap = new HashMap<String, List<IMetaDataEnabledFeatureExtension>>();
- typeCacheMap = new HashMap<String, Class>();
- readRegistry();
- }
-
- /**
- * Reads the MetaDataEnabledFeatures extensions into a registry
- */
- protected void readRegistry() {
- try {
- IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(JSFCorePlugin.PLUGIN_ID, EXTPTID);
- IExtension[] extensions = point.getExtensions();
- for (int i=0;i < extensions.length;i++){
- IExtension ext = extensions[i];
- for (int j=0;j < ext.getConfigurationElements().length;j++){
- final String bundleId = ext.getConfigurationElements()[j].getContributor().getName();
- final String id = ext.getConfigurationElements()[j].getAttribute("typeid");
- final String klass = ext.getConfigurationElements()[j].getAttribute("class");
- registerFeature(bundleId, id, klass);
- }
- }
- } catch (InvalidRegistryObjectException e) {
- JSFCorePlugin.log(e, "Unable to read " + JSFCorePlugin.PLUGIN_ID + EXTPTID + " registry");
- }
- }
-
- /**
- * Create {@link IMetaDataEnabledFeatureExtension}s and add to registry
- * @param bundleID
- * @param typeId
- * @param klass
- */
- protected void registerFeature(String bundleID, String typeId, String klass){
- IMetaDataEnabledFeatureExtension aFeature = new MetaDataEnabledFeatureExtension(bundleID, typeId, klass);
- if (canCreateTypeForFeatureExtension(aFeature)){
- if (!featuresMap.containsKey(typeId)){
- List list = new ArrayList();
- list.add(aFeature);
- featuresMap.put(typeId, list);
- }
- else {
- List list = featuresMap.get(typeId);
- list.add(aFeature);
- }
- }
- }
-
-
- private boolean canCreateTypeForFeatureExtension(IMetaDataEnabledFeatureExtension feature) {
- if (! typeCacheMap.containsKey(feature.getTypeID())){
- IType type = AttributeValueRuntimeTypeRegistry.getInstance().getType(feature.getTypeID());
- if (type != null){
- Class typeClass = AttributeValueRuntimeTypeFactory.getInstance().getClassForType(type);
- typeCacheMap.put(feature.getTypeID(), typeClass);
- }
- else
- return false;
- }
- return typeCacheMap.get(feature.getTypeID()) != null;
- }
-
- /**
- * @param typeId
- * @return List of <code>AbstractMetaDataEnabledRuntimeTypeExtensions</code>
- * for a given by type id
- *
- * TODO: make more efficient... no need to keep calculating features for subtypes.
- */
- public List<IMetaDataEnabledFeatureExtension> getFeatures(String typeId) {
-
- if (!featuresMap.containsKey(typeId))
- featuresMap.put(typeId,new ArrayList());
-
- //copy current featuresMapped to typeId into return list
- List<IMetaDataEnabledFeatureExtension> srcList = featuresMap.get(typeId);
- List<IMetaDataEnabledFeatureExtension> ret = new ArrayList<IMetaDataEnabledFeatureExtension>(srcList.size());
- copy(ret, srcList);
-
- List subs = getFeatureExtensionsForMatchingSubclass(typeId);
- for (Iterator<IMetaDataEnabledFeatureExtension> it=subs.iterator();it.hasNext();){
- IMetaDataEnabledFeatureExtension featureExt = it.next();
- if (!ret.contains(featureExt))
- ret.add(featureExt);
- }
- return ret;
-
- }
-
- private void copy(List<IMetaDataEnabledFeatureExtension> destList,
- List<IMetaDataEnabledFeatureExtension> srcList) {
- for (Iterator<IMetaDataEnabledFeatureExtension> it=srcList.iterator();it.hasNext();){
- destList.add(it.next());
- }
- }
-
- /**
- * If the feature adapter is mapped to a type which is a superclass of the type of interest, then the feature adapter is an extension of that type
- * @param typeId
- * @return list of IMetaDataEnabledFeatureExtension
- */
- private List<IMetaDataEnabledFeatureExtension> getFeatureExtensionsForMatchingSubclass(String typeId) {
- IType type = AttributeValueRuntimeTypeRegistry.getInstance().getType(typeId);
- Class typeClass = AttributeValueRuntimeTypeFactory.getInstance().getClassForType(type);
-
- List<IMetaDataEnabledFeatureExtension> ret = new ArrayList<IMetaDataEnabledFeatureExtension>();
- // loop thru all of the type classes mapped to feature adapters that are subclasses of the type
- for (Iterator it=typeCacheMap.keySet().iterator();it.hasNext();){
- String featureTypeId = (String)it.next();
- Class featureTypeClass = typeCacheMap.get(featureTypeId);
- try {
-// if (featureTypeClass.equals(typeClass)){
-// ret.add(featureTypeClass);
-// }
-// else
- if (typeClass.asSubclass(featureTypeClass) != null) {
- ret.addAll(featuresMap.get(featureTypeId));
- }
- } catch (ClassCastException e) {//
- }
-
- }
- return ret;
- }
-
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/package-info.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/package-info.java
deleted file mode 100644
index 44cf369..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/metadataprocessors/package-info.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-/**
- * Provides tooling support for taglibraries using the Design-time Metadata
- * feature (org.eclipse.jst.jsf.common.metadata).
- * <p>
- * The MetaDataEnabledProcessingFactory singleton instance is the entry point. The tool requests
- * the IMetaDataEnabled feature for a particular tag attribute, and through metadata, will locate the
- * "metadata processing" feature using the attribute value runtime type system.
- * <p><b>Provisional API - subject to change</b></p>
- */
-package org.eclipse.jst.jsf.metadataprocessors;
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/PaletteInfo.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/PaletteInfo.java
deleted file mode 100644
index 1c25080..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/PaletteInfo.java
+++ /dev/null
@@ -1,323 +0,0 @@
-/**
- * Copyright (c) 2007 Oracle Corporation
- *
- * $Id: PaletteInfo.java,v 1.2 2008/03/30 21:22:24 cbateman Exp $
- */
-package org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Palette Info</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo#getId <em>Id</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo#getTag <em>Tag</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo#getDisplayLabel <em>Display Label</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo#getDescription <em>Description</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo#getExpert <em>Expert</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo#getHidden <em>Hidden</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo#getSmallIcon <em>Small Icon</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo#getLargeIcon <em>Large Icon</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo#getTagCreation <em>Tag Creation</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfosPackage#getPaletteInfo()
- * @model
- * @generated
- */
-public interface PaletteInfo extends EObject {
- /**
- * the trait id name
- */
- public static final String TRAIT_ID = "paletteInfo";
- /**
- * the display label name
- */
- public static final String TRAIT_DISPLAY_LABEL = "display-label";
- /**
- * the trait description name
- */
- public static final String TRAIT_DESCRIPTION = "description";
- /**
- * the expert trait
- */
- public static final String TRAIT_IS_EXPERT = "expert";
- /**
- * the hiddent trait
- */
- public static final String TRAIT_IS_HIDDEN = "hidden";
- /**
- * the small icon trait
- */
- public static final String TRAIT_SMALL_ICON = "small-icon";
- /**
- * the large icon trait
- */
- public static final String TRAIT_LARGE_ICON = "large-icon";
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * Returns the value of the '<em><b>Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Id</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Id</em>' attribute.
- * @see #setId(String)
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfosPackage#getPaletteInfo_Id()
- * @model required="true"
- * @generated
- */
- String getId();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo#getId <em>Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Id</em>' attribute.
- * @see #getId()
- * @generated
- */
- void setId(String value);
-
- /**
- * Returns the value of the '<em><b>Tag</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Tag</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Tag</em>' attribute.
- * @see #setTag(String)
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfosPackage#getPaletteInfo_Tag()
- * @model
- * @generated
- */
- String getTag();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo#getTag <em>Tag</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Tag</em>' attribute.
- * @see #getTag()
- * @generated
- */
- void setTag(String value);
-
- /**
- * Returns the value of the '<em><b>Display Label</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Display Label</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Display Label</em>' attribute.
- * @see #setDisplayLabel(String)
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfosPackage#getPaletteInfo_DisplayLabel()
- * @model extendedMetaData="kind='element' name='display-label'"
- * @generated
- */
- String getDisplayLabel();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo#getDisplayLabel <em>Display Label</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Display Label</em>' attribute.
- * @see #getDisplayLabel()
- * @generated
- */
- void setDisplayLabel(String value);
-
- /**
- * Returns the value of the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Description</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Description</em>' attribute.
- * @see #setDescription(String)
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfosPackage#getPaletteInfo_Description()
- * @model extendedMetaData="kind='element'"
- * @generated
- */
- String getDescription();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo#getDescription <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Description</em>' attribute.
- * @see #getDescription()
- * @generated
- */
- void setDescription(String value);
-
- /**
- * Returns the value of the '<em><b>Expert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Expert</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Expert</em>' attribute.
- * @see #setExpert(Boolean)
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfosPackage#getPaletteInfo_Expert()
- * @model extendedMetaData="kind='element'"
- * @generated
- */
- Boolean getExpert();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo#getExpert <em>Expert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Expert</em>' attribute.
- * @see #getExpert()
- * @generated
- */
- void setExpert(Boolean value);
-
- /**
- * Returns the value of the '<em><b>Hidden</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Hidden</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Hidden</em>' attribute.
- * @see #setHidden(Boolean)
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfosPackage#getPaletteInfo_Hidden()
- * @model extendedMetaData="kind='element'"
- * @generated
- */
- Boolean getHidden();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo#getHidden <em>Hidden</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Hidden</em>' attribute.
- * @see #getHidden()
- * @generated
- */
- void setHidden(Boolean value);
-
- /**
- * Returns the value of the '<em><b>Small Icon</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Small Icon</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Small Icon</em>' attribute.
- * @see #setSmallIcon(String)
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfosPackage#getPaletteInfo_SmallIcon()
- * @model extendedMetaData="kind='element' name='small-icon'"
- * @generated
- */
- String getSmallIcon();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo#getSmallIcon <em>Small Icon</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Small Icon</em>' attribute.
- * @see #getSmallIcon()
- * @generated
- */
- void setSmallIcon(String value);
-
- /**
- * Returns the value of the '<em><b>Large Icon</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Large Icon</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Large Icon</em>' attribute.
- * @see #setLargeIcon(String)
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfosPackage#getPaletteInfo_LargeIcon()
- * @model extendedMetaData="kind='element' name='large-icon'"
- * @generated
- */
- String getLargeIcon();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo#getLargeIcon <em>Large Icon</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Large Icon</em>' attribute.
- * @see #getLargeIcon()
- * @generated
- */
- void setLargeIcon(String value);
-
- /**
- * Returns the value of the '<em><b>Tag Creation</b></em>' reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Tag Creation</em>' reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Tag Creation</em>' reference.
- * @see #setTagCreation(TagCreationInfo)
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfosPackage#getPaletteInfo_TagCreation()
- * @model extendedMetaData="kind='element' name='tag-create'"
- * @generated
- */
- TagCreationInfo getTagCreation();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo#getTagCreation <em>Tag Creation</em>}' reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Tag Creation</em>' reference.
- * @see #getTagCreation()
- * @generated
- */
- void setTagCreation(TagCreationInfo value);
-
- /**
- * <!-- begin-user-doc -->
- * @return true if is expert
- * <!-- end-user-doc -->
- * @model kind="operation"
- * @generated
- */
- boolean isExpert();
-
- /**
- * <!-- begin-user-doc -->
- * @return true if is hidden
- * <!-- end-user-doc -->
- * @model kind="operation"
- * @generated
- */
- boolean isHidden();
-
-} // PaletteInfo
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/PaletteInfos.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/PaletteInfos.java
deleted file mode 100644
index a6f2ba4..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/PaletteInfos.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/**
- * Copyright (c) 2007 Oracle Corporation
- *
- * $Id: PaletteInfos.java,v 1.2 2008/03/30 21:22:24 cbateman Exp $
- */
-package org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos;
-
-import org.eclipse.emf.common.util.EList;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Palette Infos</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfos#getInfos <em>Infos</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfosPackage#getPaletteInfos()
- * @model
- * @generated
- */
-public interface PaletteInfos extends EObject {
- /**
- * the palette infos trait id
- */
- public static final String TRAIT_ID = "paletteInfos";
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * Returns the value of the '<em><b>Infos</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Infos</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Infos</em>' containment reference list.
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfosPackage#getPaletteInfos_Infos()
- * @model type="org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo" containment="true"
- * extendedMetaData="kind='element' name='item'"
- * @generated
- */
- EList getInfos();
-
- /**
- * <!-- begin-user-doc -->
- * @param id
- * @return the pallette info corresponding to id.
- * <!-- end-user-doc -->
- * @model idRequired="true"
- * @generated
- */
- PaletteInfo findPaletteInfoById(String id);
-
-} // PaletteInfos
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/PaletteInfosFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/PaletteInfosFactory.java
deleted file mode 100644
index 2929af3..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/PaletteInfosFactory.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/**
- * Copyright (c) 2007 Oracle Corporation
- *
- * $Id: PaletteInfosFactory.java,v 1.1 2008/03/25 19:31:30 gkessler Exp $
- */
-package org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos;
-
-import org.eclipse.emf.ecore.EFactory;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Factory</b> for the model.
- * It provides a create method for each non-abstract class of the model.
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfosPackage
- * @generated
- */
-public interface PaletteInfosFactory extends EFactory {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * The singleton instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- PaletteInfosFactory eINSTANCE = org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.PaletteInfosFactoryImpl.init();
-
- /**
- * Returns a new object of class '<em>Palette Infos</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Palette Infos</em>'.
- * @generated
- */
- PaletteInfos createPaletteInfos();
-
- /**
- * Returns a new object of class '<em>Palette Info</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Palette Info</em>'.
- * @generated
- */
- PaletteInfo createPaletteInfo();
-
- /**
- * Returns a new object of class '<em>Tag Creation Info</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Tag Creation Info</em>'.
- * @generated
- */
- TagCreationInfo createTagCreationInfo();
-
- /**
- * Returns a new object of class '<em>Tag Creation Template</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Tag Creation Template</em>'.
- * @generated
- */
- TagCreationTemplate createTagCreationTemplate();
-
- /**
- * Returns a new object of class '<em>Tag Creation Attribute</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Tag Creation Attribute</em>'.
- * @generated
- */
- TagCreationAttribute createTagCreationAttribute();
-
- /**
- * Returns the package supported by this factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the package supported by this factory.
- * @generated
- */
- PaletteInfosPackage getPaletteInfosPackage();
-
-} //PaletteInfosFactory
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/PaletteInfosPackage.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/PaletteInfosPackage.java
deleted file mode 100644
index 377ff43..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/PaletteInfosPackage.java
+++ /dev/null
@@ -1,709 +0,0 @@
-/**
- * Copyright (c) 2007 Oracle Corporation
- *
- * $Id: PaletteInfosPackage.java,v 1.1 2008/03/25 19:31:30 gkessler Exp $
- */
-package org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Package</b> for the model.
- * It contains accessors for the meta objects to represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfosFactory
- * @model kind="package"
- * @generated
- */
-@SuppressWarnings("hiding")
-public interface PaletteInfosPackage extends EPackage {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * The package name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String eNAME = "paletteinfos";
-
- /**
- * The package namespace URI.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String eNS_URI = "http://org.eclipse.jsf.pagedesigner/paletteInfos.ecore";
-
- /**
- * The package namespace name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String eNS_PREFIX = "pi";
-
- /**
- * The singleton instance of the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- PaletteInfosPackage eINSTANCE = org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.PaletteInfosPackageImpl.init();
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.PaletteInfosImpl <em>Palette Infos</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.PaletteInfosImpl
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.PaletteInfosPackageImpl#getPaletteInfos()
- * @generated
- */
- int PALETTE_INFOS = 0;
-
- /**
- * The feature id for the '<em><b>Infos</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int PALETTE_INFOS__INFOS = 0;
-
- /**
- * The number of structural features of the '<em>Palette Infos</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int PALETTE_INFOS_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.PaletteInfoImpl <em>Palette Info</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.PaletteInfoImpl
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.PaletteInfosPackageImpl#getPaletteInfo()
- * @generated
- */
- int PALETTE_INFO = 1;
-
- /**
- * The feature id for the '<em><b>Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int PALETTE_INFO__ID = 0;
-
- /**
- * The feature id for the '<em><b>Tag</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int PALETTE_INFO__TAG = 1;
-
- /**
- * The feature id for the '<em><b>Display Label</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int PALETTE_INFO__DISPLAY_LABEL = 2;
-
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int PALETTE_INFO__DESCRIPTION = 3;
-
- /**
- * The feature id for the '<em><b>Expert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int PALETTE_INFO__EXPERT = 4;
-
- /**
- * The feature id for the '<em><b>Hidden</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int PALETTE_INFO__HIDDEN = 5;
-
- /**
- * The feature id for the '<em><b>Small Icon</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int PALETTE_INFO__SMALL_ICON = 6;
-
- /**
- * The feature id for the '<em><b>Large Icon</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int PALETTE_INFO__LARGE_ICON = 7;
-
- /**
- * The feature id for the '<em><b>Tag Creation</b></em>' reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int PALETTE_INFO__TAG_CREATION = 8;
-
- /**
- * The number of structural features of the '<em>Palette Info</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int PALETTE_INFO_FEATURE_COUNT = 9;
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.TagCreationInfoImpl <em>Tag Creation Info</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.TagCreationInfoImpl
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.PaletteInfosPackageImpl#getTagCreationInfo()
- * @generated
- */
- int TAG_CREATION_INFO = 2;
-
- /**
- * The feature id for the '<em><b>Attributes</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TAG_CREATION_INFO__ATTRIBUTES = 0;
-
- /**
- * The feature id for the '<em><b>Template</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TAG_CREATION_INFO__TEMPLATE = 1;
-
- /**
- * The number of structural features of the '<em>Tag Creation Info</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TAG_CREATION_INFO_FEATURE_COUNT = 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.TagCreationTemplateImpl <em>Tag Creation Template</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.TagCreationTemplateImpl
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.PaletteInfosPackageImpl#getTagCreationTemplate()
- * @generated
- */
- int TAG_CREATION_TEMPLATE = 3;
-
- /**
- * The feature id for the '<em><b>Template</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TAG_CREATION_TEMPLATE__TEMPLATE = 0;
-
- /**
- * The number of structural features of the '<em>Tag Creation Template</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TAG_CREATION_TEMPLATE_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.TagCreationAttributeImpl <em>Tag Creation Attribute</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.TagCreationAttributeImpl
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.PaletteInfosPackageImpl#getTagCreationAttribute()
- * @generated
- */
- int TAG_CREATION_ATTRIBUTE = 4;
-
- /**
- * The feature id for the '<em><b>Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TAG_CREATION_ATTRIBUTE__ID = 0;
-
- /**
- * The feature id for the '<em><b>Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TAG_CREATION_ATTRIBUTE__VALUE = 1;
-
- /**
- * The number of structural features of the '<em>Tag Creation Attribute</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TAG_CREATION_ATTRIBUTE_FEATURE_COUNT = 2;
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfos <em>Palette Infos</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Palette Infos</em>'.
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfos
- * @generated
- */
- EClass getPaletteInfos();
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfos#getInfos <em>Infos</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Infos</em>'.
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfos#getInfos()
- * @see #getPaletteInfos()
- * @generated
- */
- EReference getPaletteInfos_Infos();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo <em>Palette Info</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Palette Info</em>'.
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo
- * @generated
- */
- EClass getPaletteInfo();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo#getId <em>Id</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Id</em>'.
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo#getId()
- * @see #getPaletteInfo()
- * @generated
- */
- EAttribute getPaletteInfo_Id();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo#getTag <em>Tag</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Tag</em>'.
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo#getTag()
- * @see #getPaletteInfo()
- * @generated
- */
- EAttribute getPaletteInfo_Tag();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo#getDisplayLabel <em>Display Label</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Display Label</em>'.
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo#getDisplayLabel()
- * @see #getPaletteInfo()
- * @generated
- */
- EAttribute getPaletteInfo_DisplayLabel();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo#getDescription <em>Description</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Description</em>'.
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo#getDescription()
- * @see #getPaletteInfo()
- * @generated
- */
- EAttribute getPaletteInfo_Description();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo#getExpert <em>Expert</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Expert</em>'.
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo#getExpert()
- * @see #getPaletteInfo()
- * @generated
- */
- EAttribute getPaletteInfo_Expert();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo#getHidden <em>Hidden</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Hidden</em>'.
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo#getHidden()
- * @see #getPaletteInfo()
- * @generated
- */
- EAttribute getPaletteInfo_Hidden();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo#getSmallIcon <em>Small Icon</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Small Icon</em>'.
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo#getSmallIcon()
- * @see #getPaletteInfo()
- * @generated
- */
- EAttribute getPaletteInfo_SmallIcon();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo#getLargeIcon <em>Large Icon</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Large Icon</em>'.
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo#getLargeIcon()
- * @see #getPaletteInfo()
- * @generated
- */
- EAttribute getPaletteInfo_LargeIcon();
-
- /**
- * Returns the meta object for the reference '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo#getTagCreation <em>Tag Creation</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the reference '<em>Tag Creation</em>'.
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo#getTagCreation()
- * @see #getPaletteInfo()
- * @generated
- */
- EReference getPaletteInfo_TagCreation();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationInfo <em>Tag Creation Info</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Tag Creation Info</em>'.
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationInfo
- * @generated
- */
- EClass getTagCreationInfo();
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationInfo#getAttributes <em>Attributes</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Attributes</em>'.
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationInfo#getAttributes()
- * @see #getTagCreationInfo()
- * @generated
- */
- EReference getTagCreationInfo_Attributes();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationInfo#getTemplate <em>Template</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Template</em>'.
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationInfo#getTemplate()
- * @see #getTagCreationInfo()
- * @generated
- */
- EAttribute getTagCreationInfo_Template();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationTemplate <em>Tag Creation Template</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Tag Creation Template</em>'.
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationTemplate
- * @generated
- */
- EClass getTagCreationTemplate();
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationTemplate#getTemplate <em>Template</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Template</em>'.
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationTemplate#getTemplate()
- * @see #getTagCreationTemplate()
- * @generated
- */
- EReference getTagCreationTemplate_Template();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationAttribute <em>Tag Creation Attribute</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Tag Creation Attribute</em>'.
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationAttribute
- * @generated
- */
- EClass getTagCreationAttribute();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationAttribute#getId <em>Id</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Id</em>'.
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationAttribute#getId()
- * @see #getTagCreationAttribute()
- * @generated
- */
- EAttribute getTagCreationAttribute_Id();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationAttribute#getValue <em>Value</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Value</em>'.
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationAttribute#getValue()
- * @see #getTagCreationAttribute()
- * @generated
- */
- EAttribute getTagCreationAttribute_Value();
-
- /**
- * Returns the factory that creates the instances of the model.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the factory that creates the instances of the model.
- * @generated
- */
- PaletteInfosFactory getPaletteInfosFactory();
-
- /**
- * <!-- begin-user-doc -->
- * Defines literals for the meta objects that represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @generated
- */
- interface Literals {
- /**
- * The meta object literal for the '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.PaletteInfosImpl <em>Palette Infos</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.PaletteInfosImpl
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.PaletteInfosPackageImpl#getPaletteInfos()
- * @generated
- */
- EClass PALETTE_INFOS = eINSTANCE.getPaletteInfos();
-
- /**
- * The meta object literal for the '<em><b>Infos</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EReference PALETTE_INFOS__INFOS = eINSTANCE.getPaletteInfos_Infos();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.PaletteInfoImpl <em>Palette Info</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.PaletteInfoImpl
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.PaletteInfosPackageImpl#getPaletteInfo()
- * @generated
- */
- EClass PALETTE_INFO = eINSTANCE.getPaletteInfo();
-
- /**
- * The meta object literal for the '<em><b>Id</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute PALETTE_INFO__ID = eINSTANCE.getPaletteInfo_Id();
-
- /**
- * The meta object literal for the '<em><b>Tag</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute PALETTE_INFO__TAG = eINSTANCE.getPaletteInfo_Tag();
-
- /**
- * The meta object literal for the '<em><b>Display Label</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute PALETTE_INFO__DISPLAY_LABEL = eINSTANCE.getPaletteInfo_DisplayLabel();
-
- /**
- * The meta object literal for the '<em><b>Description</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute PALETTE_INFO__DESCRIPTION = eINSTANCE.getPaletteInfo_Description();
-
- /**
- * The meta object literal for the '<em><b>Expert</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute PALETTE_INFO__EXPERT = eINSTANCE.getPaletteInfo_Expert();
-
- /**
- * The meta object literal for the '<em><b>Hidden</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute PALETTE_INFO__HIDDEN = eINSTANCE.getPaletteInfo_Hidden();
-
- /**
- * The meta object literal for the '<em><b>Small Icon</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute PALETTE_INFO__SMALL_ICON = eINSTANCE.getPaletteInfo_SmallIcon();
-
- /**
- * The meta object literal for the '<em><b>Large Icon</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute PALETTE_INFO__LARGE_ICON = eINSTANCE.getPaletteInfo_LargeIcon();
-
- /**
- * The meta object literal for the '<em><b>Tag Creation</b></em>' reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EReference PALETTE_INFO__TAG_CREATION = eINSTANCE.getPaletteInfo_TagCreation();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.TagCreationInfoImpl <em>Tag Creation Info</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.TagCreationInfoImpl
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.PaletteInfosPackageImpl#getTagCreationInfo()
- * @generated
- */
- EClass TAG_CREATION_INFO = eINSTANCE.getTagCreationInfo();
-
- /**
- * The meta object literal for the '<em><b>Attributes</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EReference TAG_CREATION_INFO__ATTRIBUTES = eINSTANCE.getTagCreationInfo_Attributes();
-
- /**
- * The meta object literal for the '<em><b>Template</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute TAG_CREATION_INFO__TEMPLATE = eINSTANCE.getTagCreationInfo_Template();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.TagCreationTemplateImpl <em>Tag Creation Template</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.TagCreationTemplateImpl
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.PaletteInfosPackageImpl#getTagCreationTemplate()
- * @generated
- */
- EClass TAG_CREATION_TEMPLATE = eINSTANCE.getTagCreationTemplate();
-
- /**
- * The meta object literal for the '<em><b>Template</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EReference TAG_CREATION_TEMPLATE__TEMPLATE = eINSTANCE.getTagCreationTemplate_Template();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.TagCreationAttributeImpl <em>Tag Creation Attribute</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.TagCreationAttributeImpl
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.PaletteInfosPackageImpl#getTagCreationAttribute()
- * @generated
- */
- EClass TAG_CREATION_ATTRIBUTE = eINSTANCE.getTagCreationAttribute();
-
- /**
- * The meta object literal for the '<em><b>Id</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute TAG_CREATION_ATTRIBUTE__ID = eINSTANCE.getTagCreationAttribute_Id();
-
- /**
- * The meta object literal for the '<em><b>Value</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute TAG_CREATION_ATTRIBUTE__VALUE = eINSTANCE.getTagCreationAttribute_Value();
-
- }
-
-} //PaletteInfosPackage
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/TagCreationAttribute.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/TagCreationAttribute.java
deleted file mode 100644
index d84b1ad..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/TagCreationAttribute.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/**
- * Copyright (c) 2007 Oracle Corporation
- *
- * $Id: TagCreationAttribute.java,v 1.1 2008/03/25 19:31:30 gkessler Exp $
- */
-package org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Tag Creation Attribute</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationAttribute#getId <em>Id</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationAttribute#getValue <em>Value</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfosPackage#getTagCreationAttribute()
- * @model
- * @generated
- */
-public interface TagCreationAttribute extends EObject {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * Returns the value of the '<em><b>Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Id</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Id</em>' attribute.
- * @see #setId(String)
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfosPackage#getTagCreationAttribute_Id()
- * @model required="true"
- * @generated
- */
- String getId();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationAttribute#getId <em>Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Id</em>' attribute.
- * @see #getId()
- * @generated
- */
- void setId(String value);
-
- /**
- * Returns the value of the '<em><b>Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Value</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Value</em>' attribute.
- * @see #setValue(String)
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfosPackage#getTagCreationAttribute_Value()
- * @model
- * @generated
- */
- String getValue();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationAttribute#getValue <em>Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Value</em>' attribute.
- * @see #getValue()
- * @generated
- */
- void setValue(String value);
-
-} // TagCreationAttribute
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/TagCreationInfo.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/TagCreationInfo.java
deleted file mode 100644
index fb3b937..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/TagCreationInfo.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/**
- * Copyright (c) 2007 Oracle Corporation
- *
- * $Id: TagCreationInfo.java,v 1.1 2008/03/25 19:31:30 gkessler Exp $
- */
-package org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos;
-
-import org.eclipse.emf.common.util.EList;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Tag Creation Info</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationInfo#getAttributes <em>Attributes</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationInfo#getTemplate <em>Template</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfosPackage#getTagCreationInfo()
- * @model
- * @generated
- */
-public interface TagCreationInfo extends EObject {
- /**
- * the name of the trait id
- */
- public static final String TRAIT_ID = "tag-create";
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * Returns the value of the '<em><b>Attributes</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationAttribute}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attributes</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attributes</em>' containment reference list.
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfosPackage#getTagCreationInfo_Attributes()
- * @model type="org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationAttribute" containment="true"
- * extendedMetaData="kind='element' name='attribute'"
- * @generated
- */
- EList getAttributes();
-
- /**
- * Returns the value of the '<em><b>Template</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Template</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Template</em>' attribute.
- * @see #setTemplate(Object)
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfosPackage#getTagCreationInfo_Template()
- * @model dataType="org.eclipse.emf.ecore.xml.type.AnySimpleType"
- * @generated
- */
- Object getTemplate();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationInfo#getTemplate <em>Template</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Template</em>' attribute.
- * @see #getTemplate()
- * @generated
- */
- void setTemplate(Object value);
-
-} // TagCreationInfo
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/TagCreationTemplate.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/TagCreationTemplate.java
deleted file mode 100644
index c06f5d8..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/TagCreationTemplate.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/**
- * Copyright (c) 2007 Oracle Corporation
- *
- * $Id: TagCreationTemplate.java,v 1.1 2008/03/25 19:31:30 gkessler Exp $
- */
-package org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Tag Creation Template</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationTemplate#getTemplate <em>Template</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfosPackage#getTagCreationTemplate()
- * @model
- * @generated
- */
-public interface TagCreationTemplate extends EObject {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * Returns the value of the '<em><b>Template</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Template</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Template</em>' containment reference.
- * @see #setTemplate(EObject)
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfosPackage#getTagCreationTemplate_Template()
- * @model containment="true"
- * @generated
- */
- EObject getTemplate();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationTemplate#getTemplate <em>Template</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Template</em>' containment reference.
- * @see #getTemplate()
- * @generated
- */
- void setTemplate(EObject value);
-
-} // TagCreationTemplate
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/impl/PaletteInfoImpl.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/impl/PaletteInfoImpl.java
deleted file mode 100644
index 1d0717b..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/impl/PaletteInfoImpl.java
+++ /dev/null
@@ -1,727 +0,0 @@
-/**
- * Copyright (c) 2007 Oracle Corporation
- *
- * $Id: PaletteInfoImpl.java,v 1.1 2008/03/25 19:31:28 gkessler Exp $
- */
-package org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl;
-
-import java.util.Iterator;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.internal.TraitValueHelper;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo;
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfosPackage;
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationInfo;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Palette Info</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.PaletteInfoImpl#getId <em>Id</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.PaletteInfoImpl#getTag() <em>Tag</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.PaletteInfoImpl#getDisplayLabel <em>Display Label</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.PaletteInfoImpl#getDescription <em>Description</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.PaletteInfoImpl#getExpert <em>Expert</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.PaletteInfoImpl#getHidden <em>Hidden</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.PaletteInfoImpl#getSmallIcon <em>Small Icon</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.PaletteInfoImpl#getLargeIcon <em>Large Icon</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.PaletteInfoImpl#getTagCreation <em>Tag Creation</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class PaletteInfoImpl extends EObjectImpl implements PaletteInfo {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * The default value of the '{@link #getId() <em>Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getId()
- * @generated
- * @ordered
- */
- protected static final String ID_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getId() <em>Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getId()
- * @generated
- * @ordered
- */
- protected String id = ID_EDEFAULT;
-
- /**
- * The default value of the '{@link #getTag() <em>Tag</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTag()
- * @generated
- * @ordered
- */
- protected static final String TAG_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getTag() <em>Tag</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTag()
- * @generated
- * @ordered
- */
- protected String tag = TAG_EDEFAULT;
-
- /**
- * The default value of the '{@link #getDisplayLabel() <em>Display Label</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDisplayLabel()
- * @generated
- * @ordered
- */
- protected static final String DISPLAY_LABEL_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDisplayLabel() <em>Display Label</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDisplayLabel()
- * @generated
- * @ordered
- */
- protected String displayLabel = DISPLAY_LABEL_EDEFAULT;
-
- /**
- * The default value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected static final String DESCRIPTION_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected String description = DESCRIPTION_EDEFAULT;
-
- /**
- * The default value of the '{@link #getExpert() <em>Expert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getExpert()
- * @generated
- * @ordered
- */
- protected static final Boolean EXPERT_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getExpert() <em>Expert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getExpert()
- * @generated
- * @ordered
- */
- protected Boolean expert = EXPERT_EDEFAULT;
-
- /**
- * The default value of the '{@link #getHidden() <em>Hidden</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getHidden()
- * @generated
- * @ordered
- */
- protected static final Boolean HIDDEN_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getHidden() <em>Hidden</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getHidden()
- * @generated
- * @ordered
- */
- protected Boolean hidden = HIDDEN_EDEFAULT;
-
- /**
- * The default value of the '{@link #getSmallIcon() <em>Small Icon</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSmallIcon()
- * @generated
- * @ordered
- */
- protected static final String SMALL_ICON_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getSmallIcon() <em>Small Icon</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSmallIcon()
- * @generated
- * @ordered
- */
- protected String smallIcon = SMALL_ICON_EDEFAULT;
-
- /**
- * The default value of the '{@link #getLargeIcon() <em>Large Icon</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getLargeIcon()
- * @generated
- * @ordered
- */
- protected static final String LARGE_ICON_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getLargeIcon() <em>Large Icon</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getLargeIcon()
- * @generated
- * @ordered
- */
- protected String largeIcon = LARGE_ICON_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getTagCreation() <em>Tag Creation</em>}' reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTagCreation()
- * @generated
- * @ordered
- */
- protected TagCreationInfo tagCreation = null;
-
- private Entity _tag;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected PaletteInfoImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EClass eStaticClass() {
- return PaletteInfosPackage.Literals.PALETTE_INFO;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getId() {
- return id;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setId(String newId) {
- String oldId = id;
- id = newId;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PaletteInfosPackage.PALETTE_INFO__ID, oldId, id));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public String getTag() {
- return tag != null ? tag : getId();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setTag(String newTag) {
- String oldTag = tag;
- tag = newTag;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PaletteInfosPackage.PALETTE_INFO__TAG, oldTag, tag));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public String getDisplayLabel() {
- if (displayLabel == null){
- return getTagTraitValueAsString(getTag(), TRAIT_DISPLAY_LABEL);
- }
- return getNLSedValue(displayLabel);
- }
-
- private String getNLSedValue(final String rawValue) {
- String value = TraitValueHelper.getNLSValue((Trait)this.eContainer.eContainer(), rawValue);
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated NOT
- */
- private String getTagTraitValueAsString(final String _id, final String traitKey) {
- EObject obj = getTagTraitValue(getTag(), traitKey);
- if (obj != null){
- return TraitValueHelper.getValueAsString((Trait)obj.eContainer());
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated NOT
- */
- private EObject getTagTraitValue(final String tagName, final String traitKey) {
- Entity tag_ = getTag(tagName);
- if (tag_ != null){
- for (Iterator it=tag_.getTraits().iterator();it.hasNext();){
- Trait trait = (Trait)it.next();
- if (traitKey.equals(trait.getId()))
- return trait.getValue();
- }
- }
- return null;
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated NOT
- */
- private Entity getTag(String tagName) {
- if (_tag == null){
- //rely on PaletteInfos objects being inside a Model trait only
- try {
- Model model = (Model)this.eContainer().eContainer().eContainer();
- //we could probably do better than this... oh well
- //FIXME: C.B: this is really bad! We could probably do better than
- // write code that expects to throw ClassCastExceptions and then hides them? I hope so!
- _tag = findTag(model, tagName);
- } catch (ClassCastException e) {
-// PDPlugin.getLogger(getClass()).error(e);
- JSFCorePlugin.log(e, "ClassCastException in getTag() for " + tagName);
- return null;
- }
- }
- return _tag;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated NOT
- */
- private Entity findTag(Model model, String tagid) {
- for (Iterator it=model.getChildEntities().iterator();it.hasNext();){
- Entity tag_ = (Entity)it.next();
- if (tagid.equals(tag_.getId()))
- return tag_;
- }
- return null;
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setDisplayLabel(String newDisplayLabel) {
- String oldDisplayLabel = displayLabel;
- displayLabel = newDisplayLabel;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PaletteInfosPackage.PALETTE_INFO__DISPLAY_LABEL, oldDisplayLabel, displayLabel));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public String getDescription() {
- if (description == null){
- return getTagTraitValueAsString(getId(), TRAIT_DESCRIPTION);
- }
- return getNLSedValue(description);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setDescription(String newDescription) {
- String oldDescription = description;
- description = newDescription;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PaletteInfosPackage.PALETTE_INFO__DESCRIPTION, oldDescription, description));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Boolean getExpert() {
- return expert;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setExpert(Boolean newExpert) {
- Boolean oldExpert = expert;
- expert = newExpert;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PaletteInfosPackage.PALETTE_INFO__EXPERT, oldExpert, expert));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Boolean getHidden() {
- return hidden;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setHidden(Boolean newHidden) {
- Boolean oldHidden = hidden;
- hidden = newHidden;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PaletteInfosPackage.PALETTE_INFO__HIDDEN, oldHidden, hidden));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public String getSmallIcon() {
- if (smallIcon == null){
- return getTagTraitValueAsString(getId(), TRAIT_SMALL_ICON);
- }
- return smallIcon;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setSmallIcon(String newSmallIcon) {
- String oldSmallIcon = smallIcon;
- smallIcon = newSmallIcon;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PaletteInfosPackage.PALETTE_INFO__SMALL_ICON, oldSmallIcon, smallIcon));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public String getLargeIcon() {
- if (largeIcon == null){
- return getTagTraitValueAsString(getId(), TRAIT_LARGE_ICON);
- }
- return largeIcon;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setLargeIcon(String newLargeIcon) {
- String oldLargeIcon = largeIcon;
- largeIcon = newLargeIcon;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PaletteInfosPackage.PALETTE_INFO__LARGE_ICON, oldLargeIcon, largeIcon));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public TagCreationInfo getTagCreation() {
- if (tagCreation != null && tagCreation.eIsProxy()) {
- InternalEObject oldTagCreation = (InternalEObject)tagCreation;
- tagCreation = (TagCreationInfo)eResolveProxy(oldTagCreation);
- if (tagCreation != oldTagCreation) {
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.RESOLVE, PaletteInfosPackage.PALETTE_INFO__TAG_CREATION, oldTagCreation, tagCreation));
- }
- }
- else if (tagCreation == null){
- //delegate to entity if it exists
- return (TagCreationInfo)getTagTraitValue(getTag(), "tag-create");
- }
- return tagCreation;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the tag creation info
- * <!-- end-user-doc -->
- * @generated
- */
- public TagCreationInfo basicGetTagCreation() {
- return tagCreation;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setTagCreation(TagCreationInfo newTagCreation) {
- TagCreationInfo oldTagCreation = tagCreation;
- tagCreation = newTagCreation;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PaletteInfosPackage.PALETTE_INFO__TAG_CREATION, oldTagCreation, tagCreation));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public boolean isExpert() {
- if (expert == null){
- String val = getTagTraitValueAsString(getId(), "expert");
- return Boolean.valueOf(val).booleanValue();
- }
- return expert.booleanValue();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public boolean isHidden() {
- if (hidden == null){
- String val = getTagTraitValueAsString(getId(), "hidden");
- return Boolean.valueOf(val).booleanValue();
- }
- return hidden.booleanValue();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case PaletteInfosPackage.PALETTE_INFO__ID:
- return getId();
- case PaletteInfosPackage.PALETTE_INFO__TAG:
- return getTag();
- case PaletteInfosPackage.PALETTE_INFO__DISPLAY_LABEL:
- return getDisplayLabel();
- case PaletteInfosPackage.PALETTE_INFO__DESCRIPTION:
- return getDescription();
- case PaletteInfosPackage.PALETTE_INFO__EXPERT:
- return getExpert();
- case PaletteInfosPackage.PALETTE_INFO__HIDDEN:
- return getHidden();
- case PaletteInfosPackage.PALETTE_INFO__SMALL_ICON:
- return getSmallIcon();
- case PaletteInfosPackage.PALETTE_INFO__LARGE_ICON:
- return getLargeIcon();
- case PaletteInfosPackage.PALETTE_INFO__TAG_CREATION:
- if (resolve) return getTagCreation();
- return basicGetTagCreation();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case PaletteInfosPackage.PALETTE_INFO__ID:
- setId((String)newValue);
- return;
- case PaletteInfosPackage.PALETTE_INFO__TAG:
- setTag((String)newValue);
- return;
- case PaletteInfosPackage.PALETTE_INFO__DISPLAY_LABEL:
- setDisplayLabel((String)newValue);
- return;
- case PaletteInfosPackage.PALETTE_INFO__DESCRIPTION:
- setDescription((String)newValue);
- return;
- case PaletteInfosPackage.PALETTE_INFO__EXPERT:
- setExpert((Boolean)newValue);
- return;
- case PaletteInfosPackage.PALETTE_INFO__HIDDEN:
- setHidden((Boolean)newValue);
- return;
- case PaletteInfosPackage.PALETTE_INFO__SMALL_ICON:
- setSmallIcon((String)newValue);
- return;
- case PaletteInfosPackage.PALETTE_INFO__LARGE_ICON:
- setLargeIcon((String)newValue);
- return;
- case PaletteInfosPackage.PALETTE_INFO__TAG_CREATION:
- setTagCreation((TagCreationInfo)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eUnset(int featureID) {
- switch (featureID) {
- case PaletteInfosPackage.PALETTE_INFO__ID:
- setId(ID_EDEFAULT);
- return;
- case PaletteInfosPackage.PALETTE_INFO__TAG:
- setTag(TAG_EDEFAULT);
- return;
- case PaletteInfosPackage.PALETTE_INFO__DISPLAY_LABEL:
- setDisplayLabel(DISPLAY_LABEL_EDEFAULT);
- return;
- case PaletteInfosPackage.PALETTE_INFO__DESCRIPTION:
- setDescription(DESCRIPTION_EDEFAULT);
- return;
- case PaletteInfosPackage.PALETTE_INFO__EXPERT:
- setExpert(EXPERT_EDEFAULT);
- return;
- case PaletteInfosPackage.PALETTE_INFO__HIDDEN:
- setHidden(HIDDEN_EDEFAULT);
- return;
- case PaletteInfosPackage.PALETTE_INFO__SMALL_ICON:
- setSmallIcon(SMALL_ICON_EDEFAULT);
- return;
- case PaletteInfosPackage.PALETTE_INFO__LARGE_ICON:
- setLargeIcon(LARGE_ICON_EDEFAULT);
- return;
- case PaletteInfosPackage.PALETTE_INFO__TAG_CREATION:
- setTagCreation((TagCreationInfo)null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case PaletteInfosPackage.PALETTE_INFO__ID:
- return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
- case PaletteInfosPackage.PALETTE_INFO__TAG:
- return TAG_EDEFAULT == null ? tag != null : !TAG_EDEFAULT.equals(tag);
- case PaletteInfosPackage.PALETTE_INFO__DISPLAY_LABEL:
- return DISPLAY_LABEL_EDEFAULT == null ? displayLabel != null : !DISPLAY_LABEL_EDEFAULT.equals(displayLabel);
- case PaletteInfosPackage.PALETTE_INFO__DESCRIPTION:
- return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description);
- case PaletteInfosPackage.PALETTE_INFO__EXPERT:
- return EXPERT_EDEFAULT == null ? expert != null : !EXPERT_EDEFAULT.equals(expert);
- case PaletteInfosPackage.PALETTE_INFO__HIDDEN:
- return HIDDEN_EDEFAULT == null ? hidden != null : !HIDDEN_EDEFAULT.equals(hidden);
- case PaletteInfosPackage.PALETTE_INFO__SMALL_ICON:
- return SMALL_ICON_EDEFAULT == null ? smallIcon != null : !SMALL_ICON_EDEFAULT.equals(smallIcon);
- case PaletteInfosPackage.PALETTE_INFO__LARGE_ICON:
- return LARGE_ICON_EDEFAULT == null ? largeIcon != null : !LARGE_ICON_EDEFAULT.equals(largeIcon);
- case PaletteInfosPackage.PALETTE_INFO__TAG_CREATION:
- return tagCreation != null;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String toString() {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (id: ");
- result.append(id);
- result.append(", tag: ");
- result.append(tag);
- result.append(", displayLabel: ");
- result.append(displayLabel);
- result.append(", description: ");
- result.append(description);
- result.append(", expert: ");
- result.append(expert);
- result.append(", hidden: ");
- result.append(hidden);
- result.append(", smallIcon: ");
- result.append(smallIcon);
- result.append(", largeIcon: ");
- result.append(largeIcon);
- result.append(')');
- return result.toString();
- }
-
-} //PaletteInfoImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/impl/PaletteInfosFactoryImpl.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/impl/PaletteInfosFactoryImpl.java
deleted file mode 100644
index 9d68ced..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/impl/PaletteInfosFactoryImpl.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/**
- * Copyright (c) 2007 Oracle Corporation
- *
- * $Id: PaletteInfosFactoryImpl.java,v 1.1 2008/03/25 19:31:28 gkessler Exp $
- */
-package org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.impl.EFactoryImpl;
-import org.eclipse.emf.ecore.plugin.EcorePlugin;
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo;
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfos;
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfosFactory;
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfosPackage;
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationAttribute;
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationInfo;
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationTemplate;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model <b>Factory</b>.
- * <!-- end-user-doc -->
- * @generated
- */
-public class PaletteInfosFactoryImpl extends EFactoryImpl implements PaletteInfosFactory {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * Creates the default factory implementation.
- * <!-- begin-user-doc -->
- * @return the palette info factory
- * <!-- end-user-doc -->
- * @generated
- */
- public static PaletteInfosFactory init() {
- try {
- PaletteInfosFactory thePaletteInfosFactory = (PaletteInfosFactory)EPackage.Registry.INSTANCE.getEFactory("http://org.eclipse.jsf.pagedesigner/paletteInfos.ecore");
- if (thePaletteInfosFactory != null) {
- return thePaletteInfosFactory;
- }
- }
- catch (Exception exception) {
- EcorePlugin.INSTANCE.log(exception);
- }
- return new PaletteInfosFactoryImpl();
- }
-
- /**
- * Creates an instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public PaletteInfosFactoryImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EObject create(EClass eClass) {
- switch (eClass.getClassifierID()) {
- case PaletteInfosPackage.PALETTE_INFOS: return createPaletteInfos();
- case PaletteInfosPackage.PALETTE_INFO: return createPaletteInfo();
- case PaletteInfosPackage.TAG_CREATION_INFO: return createTagCreationInfo();
- case PaletteInfosPackage.TAG_CREATION_TEMPLATE: return createTagCreationTemplate();
- case PaletteInfosPackage.TAG_CREATION_ATTRIBUTE: return createTagCreationAttribute();
- default:
- throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public PaletteInfo createPaletteInfo() {
- PaletteInfoImpl paletteInfo = new PaletteInfoImpl();
- return paletteInfo;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public TagCreationInfo createTagCreationInfo() {
- TagCreationInfoImpl tagCreationInfo = new TagCreationInfoImpl();
- return tagCreationInfo;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public TagCreationTemplate createTagCreationTemplate() {
- TagCreationTemplateImpl tagCreationTemplate = new TagCreationTemplateImpl();
- return tagCreationTemplate;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public TagCreationAttribute createTagCreationAttribute() {
- TagCreationAttributeImpl tagCreationAttribute = new TagCreationAttributeImpl();
- return tagCreationAttribute;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public PaletteInfos createPaletteInfos() {
- PaletteInfosImpl paletteInfos = new PaletteInfosImpl();
- return paletteInfos;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public PaletteInfosPackage getPaletteInfosPackage() {
- return (PaletteInfosPackage)getEPackage();
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the palette info package
- * <!-- end-user-doc -->
- * @deprecated
- * @generated
- */
- public static PaletteInfosPackage getPackage() {
- return PaletteInfosPackage.eINSTANCE;
- }
-
-} //PaletteInfosFactoryImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/impl/PaletteInfosImpl.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/impl/PaletteInfosImpl.java
deleted file mode 100644
index 0b1e219..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/impl/PaletteInfosImpl.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/**
- * Copyright (c) 2007 Oracle Corporation
- *
- * $Id: PaletteInfosImpl.java,v 1.1 2008/03/25 19:31:28 gkessler Exp $
- */
-package org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo;
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfos;
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfosPackage;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Palette Infos</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.PaletteInfosImpl#getInfos <em>Infos</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class PaletteInfosImpl extends EObjectImpl implements PaletteInfos {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * The cached value of the '{@link #getInfos() <em>Infos</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getInfos()
- * @generated
- * @ordered
- */
- protected EList infos;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected PaletteInfosImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EClass eStaticClass() {
- return PaletteInfosPackage.Literals.PALETTE_INFOS;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EList getInfos() {
- if (infos == null) {
- infos = new EObjectContainmentEList(PaletteInfo.class, this, PaletteInfosPackage.PALETTE_INFOS__INFOS);
- }
- return infos;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public PaletteInfo findPaletteInfoById(String id) {
- for (Iterator it=getInfos().iterator();it.hasNext();){
- PaletteInfo info = (PaletteInfo)it.next();
- if (id.equals(info.getId()))
- return info;
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case PaletteInfosPackage.PALETTE_INFOS__INFOS:
- return ((InternalEList)getInfos()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case PaletteInfosPackage.PALETTE_INFOS__INFOS:
- return getInfos();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case PaletteInfosPackage.PALETTE_INFOS__INFOS:
- getInfos().clear();
- getInfos().addAll((Collection)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eUnset(int featureID) {
- switch (featureID) {
- case PaletteInfosPackage.PALETTE_INFOS__INFOS:
- getInfos().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case PaletteInfosPackage.PALETTE_INFOS__INFOS:
- return infos != null && !infos.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
-} //PaletteInfosImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/impl/PaletteInfosPackageImpl.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/impl/PaletteInfosPackageImpl.java
deleted file mode 100644
index 7abbfbb..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/impl/PaletteInfosPackageImpl.java
+++ /dev/null
@@ -1,520 +0,0 @@
-/**
- * Copyright (c) 2007 Oracle Corporation
- *
- * $Id: PaletteInfosPackageImpl.java,v 1.1 2008/03/25 19:31:28 gkessler Exp $
- */
-package org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EOperation;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-
-import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
-
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo;
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfos;
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfosFactory;
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfosPackage;
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationAttribute;
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationInfo;
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationTemplate;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model <b>Package</b>.
- * <!-- end-user-doc -->
- * @generated
- */
-public class PaletteInfosPackageImpl extends EPackageImpl implements PaletteInfosPackage {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass paletteInfosEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass paletteInfoEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass tagCreationInfoEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass tagCreationTemplateEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass tagCreationAttributeEClass = null;
-
- /**
- * Creates an instance of the model <b>Package</b>, registered with
- * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
- * package URI value.
- * <p>Note: the correct way to create the package is via the static
- * factory method {@link #init init()}, which also performs
- * initialization of the package, or returns the registered package,
- * if one already exists.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.emf.ecore.EPackage.Registry
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfosPackage#eNS_URI
- * @see #init()
- * @generated
- */
- private PaletteInfosPackageImpl() {
- super(eNS_URI, PaletteInfosFactory.eINSTANCE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static boolean isInited = false;
-
- /**
- * Creates, registers, and initializes the <b>Package</b> for this
- * model, and for any others upon which it depends. Simple
- * dependencies are satisfied by calling this method on all
- * dependent packages before doing anything else. This method drives
- * initialization for interdependent packages directly, in parallel
- * with this package, itself.
- * <p>Of this package and its interdependencies, all packages which
- * have not yet been registered by their URI values are first created
- * and registered. The packages are then initialized in two steps:
- * meta-model objects for all of the packages are created before any
- * are initialized, since one package's meta-model objects may refer to
- * those of another.
- * <p>Invocation of this method will not affect any packages that have
- * already been initialized.
- * <!-- begin-user-doc -->
- * @return the palette info package
- * <!-- end-user-doc -->
- * @see #eNS_URI
- * @see #createPackageContents()
- * @see #initializePackageContents()
- * @generated
- */
- public static PaletteInfosPackage init() {
- if (isInited) return (PaletteInfosPackage)EPackage.Registry.INSTANCE.getEPackage(PaletteInfosPackage.eNS_URI);
-
- // Obtain or create and register package
- PaletteInfosPackageImpl thePaletteInfosPackage = (PaletteInfosPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof PaletteInfosPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new PaletteInfosPackageImpl());
-
- isInited = true;
-
- // Initialize simple dependencies
- XMLTypePackage.eINSTANCE.eClass();
-
- // Create package meta-data objects
- thePaletteInfosPackage.createPackageContents();
-
- // Initialize created meta-data
- thePaletteInfosPackage.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- thePaletteInfosPackage.freeze();
-
- return thePaletteInfosPackage;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getPaletteInfos() {
- return paletteInfosEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EReference getPaletteInfos_Infos() {
- return (EReference)paletteInfosEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getPaletteInfo() {
- return paletteInfoEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getPaletteInfo_Id() {
- return (EAttribute)paletteInfoEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getPaletteInfo_Tag() {
- return (EAttribute)paletteInfoEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getPaletteInfo_DisplayLabel() {
- return (EAttribute)paletteInfoEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getPaletteInfo_Description() {
- return (EAttribute)paletteInfoEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getPaletteInfo_Expert() {
- return (EAttribute)paletteInfoEClass.getEStructuralFeatures().get(4);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getPaletteInfo_Hidden() {
- return (EAttribute)paletteInfoEClass.getEStructuralFeatures().get(5);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getPaletteInfo_SmallIcon() {
- return (EAttribute)paletteInfoEClass.getEStructuralFeatures().get(6);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getPaletteInfo_LargeIcon() {
- return (EAttribute)paletteInfoEClass.getEStructuralFeatures().get(7);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EReference getPaletteInfo_TagCreation() {
- return (EReference)paletteInfoEClass.getEStructuralFeatures().get(8);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getTagCreationInfo() {
- return tagCreationInfoEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EReference getTagCreationInfo_Attributes() {
- return (EReference)tagCreationInfoEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getTagCreationInfo_Template() {
- return (EAttribute)tagCreationInfoEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getTagCreationTemplate() {
- return tagCreationTemplateEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EReference getTagCreationTemplate_Template() {
- return (EReference)tagCreationTemplateEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getTagCreationAttribute() {
- return tagCreationAttributeEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getTagCreationAttribute_Id() {
- return (EAttribute)tagCreationAttributeEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getTagCreationAttribute_Value() {
- return (EAttribute)tagCreationAttributeEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public PaletteInfosFactory getPaletteInfosFactory() {
- return (PaletteInfosFactory)getEFactoryInstance();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isCreated = false;
-
- /**
- * Creates the meta-model objects for the package. This method is
- * guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void createPackageContents() {
- if (isCreated) return;
- isCreated = true;
-
- // Create classes and their features
- paletteInfosEClass = createEClass(PALETTE_INFOS);
- createEReference(paletteInfosEClass, PALETTE_INFOS__INFOS);
-
- paletteInfoEClass = createEClass(PALETTE_INFO);
- createEAttribute(paletteInfoEClass, PALETTE_INFO__ID);
- createEAttribute(paletteInfoEClass, PALETTE_INFO__TAG);
- createEAttribute(paletteInfoEClass, PALETTE_INFO__DISPLAY_LABEL);
- createEAttribute(paletteInfoEClass, PALETTE_INFO__DESCRIPTION);
- createEAttribute(paletteInfoEClass, PALETTE_INFO__EXPERT);
- createEAttribute(paletteInfoEClass, PALETTE_INFO__HIDDEN);
- createEAttribute(paletteInfoEClass, PALETTE_INFO__SMALL_ICON);
- createEAttribute(paletteInfoEClass, PALETTE_INFO__LARGE_ICON);
- createEReference(paletteInfoEClass, PALETTE_INFO__TAG_CREATION);
-
- tagCreationInfoEClass = createEClass(TAG_CREATION_INFO);
- createEReference(tagCreationInfoEClass, TAG_CREATION_INFO__ATTRIBUTES);
- createEAttribute(tagCreationInfoEClass, TAG_CREATION_INFO__TEMPLATE);
-
- tagCreationTemplateEClass = createEClass(TAG_CREATION_TEMPLATE);
- createEReference(tagCreationTemplateEClass, TAG_CREATION_TEMPLATE__TEMPLATE);
-
- tagCreationAttributeEClass = createEClass(TAG_CREATION_ATTRIBUTE);
- createEAttribute(tagCreationAttributeEClass, TAG_CREATION_ATTRIBUTE__ID);
- createEAttribute(tagCreationAttributeEClass, TAG_CREATION_ATTRIBUTE__VALUE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isInitialized = false;
-
- /**
- * Complete the initialization of the package and its meta-model. This
- * method is guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void initializePackageContents() {
- if (isInitialized) return;
- isInitialized = true;
-
- // Initialize package
- setName(eNAME);
- setNsPrefix(eNS_PREFIX);
- setNsURI(eNS_URI);
-
- // Obtain other dependent packages
- XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI);
-
- // Add supertypes to classes
-
- // Initialize classes and features; add operations and parameters
- initEClass(paletteInfosEClass, PaletteInfos.class, "PaletteInfos", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getPaletteInfos_Infos(), this.getPaletteInfo(), null, "infos", null, 0, -1, PaletteInfos.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- EOperation op = addEOperation(paletteInfosEClass, this.getPaletteInfo(), "findPaletteInfoById", 0, 1);
- addEParameter(op, ecorePackage.getEString(), "id", 1, 1);
-
- initEClass(paletteInfoEClass, PaletteInfo.class, "PaletteInfo", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getPaletteInfo_Id(), ecorePackage.getEString(), "id", null, 1, 1, PaletteInfo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getPaletteInfo_Tag(), ecorePackage.getEString(), "tag", null, 0, 1, PaletteInfo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getPaletteInfo_DisplayLabel(), ecorePackage.getEString(), "displayLabel", null, 0, 1, PaletteInfo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getPaletteInfo_Description(), ecorePackage.getEString(), "description", null, 0, 1, PaletteInfo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getPaletteInfo_Expert(), ecorePackage.getEBooleanObject(), "expert", null, 0, 1, PaletteInfo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getPaletteInfo_Hidden(), ecorePackage.getEBooleanObject(), "hidden", null, 0, 1, PaletteInfo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getPaletteInfo_SmallIcon(), ecorePackage.getEString(), "smallIcon", null, 0, 1, PaletteInfo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getPaletteInfo_LargeIcon(), ecorePackage.getEString(), "largeIcon", null, 0, 1, PaletteInfo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getPaletteInfo_TagCreation(), this.getTagCreationInfo(), null, "tagCreation", null, 0, 1, PaletteInfo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- addEOperation(paletteInfoEClass, ecorePackage.getEBoolean(), "isExpert", 0, 1);
-
- addEOperation(paletteInfoEClass, ecorePackage.getEBoolean(), "isHidden", 0, 1);
-
- initEClass(tagCreationInfoEClass, TagCreationInfo.class, "TagCreationInfo", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getTagCreationInfo_Attributes(), this.getTagCreationAttribute(), null, "attributes", null, 0, -1, TagCreationInfo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getTagCreationInfo_Template(), theXMLTypePackage.getAnySimpleType(), "template", null, 0, 1, TagCreationInfo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(tagCreationTemplateEClass, TagCreationTemplate.class, "TagCreationTemplate", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getTagCreationTemplate_Template(), ecorePackage.getEObject(), null, "template", null, 0, 1, TagCreationTemplate.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(tagCreationAttributeEClass, TagCreationAttribute.class, "TagCreationAttribute", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getTagCreationAttribute_Id(), ecorePackage.getEString(), "id", null, 1, 1, TagCreationAttribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getTagCreationAttribute_Value(), ecorePackage.getEString(), "value", null, 0, 1, TagCreationAttribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- // Create resource
- createResource(eNS_URI);
-
- // Create annotations
- // http:///org/eclipse/emf/ecore/util/ExtendedMetaData
- createExtendedMetaDataAnnotations();
- }
-
- /**
- * Initializes the annotations for <b>http:///org/eclipse/emf/ecore/util/ExtendedMetaData</b>.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected void createExtendedMetaDataAnnotations() {
- String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData";
- addAnnotation
- (getPaletteInfos_Infos(),
- source,
- new String[] {
- "kind", "element",
- "name", "item"
- });
- addAnnotation
- (getPaletteInfo_DisplayLabel(),
- source,
- new String[] {
- "kind", "element",
- "name", "display-label"
- });
- addAnnotation
- (getPaletteInfo_Description(),
- source,
- new String[] {
- "kind", "element"
- });
- addAnnotation
- (getPaletteInfo_Expert(),
- source,
- new String[] {
- "kind", "element"
- });
- addAnnotation
- (getPaletteInfo_Hidden(),
- source,
- new String[] {
- "kind", "element"
- });
- addAnnotation
- (getPaletteInfo_SmallIcon(),
- source,
- new String[] {
- "kind", "element",
- "name", "small-icon"
- });
- addAnnotation
- (getPaletteInfo_LargeIcon(),
- source,
- new String[] {
- "kind", "element",
- "name", "large-icon"
- });
- addAnnotation
- (getPaletteInfo_TagCreation(),
- source,
- new String[] {
- "kind", "element",
- "name", "tag-create"
- });
- addAnnotation
- (getTagCreationInfo_Attributes(),
- source,
- new String[] {
- "kind", "element",
- "name", "attribute"
- });
- }
-
-} //PaletteInfosPackageImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/impl/TagCreationAttributeImpl.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/impl/TagCreationAttributeImpl.java
deleted file mode 100644
index 4109b42..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/impl/TagCreationAttributeImpl.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/**
- * Copyright (c) 2007 Oracle Corporation
- *
- * $Id: TagCreationAttributeImpl.java,v 1.1 2008/03/25 19:31:28 gkessler Exp $
- */
-package org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfosPackage;
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationAttribute;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Tag Creation Attribute</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.TagCreationAttributeImpl#getId <em>Id</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.TagCreationAttributeImpl#getValue <em>Value</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class TagCreationAttributeImpl extends EObjectImpl implements TagCreationAttribute {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * The default value of the '{@link #getId() <em>Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getId()
- * @generated
- * @ordered
- */
- protected static final String ID_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getId() <em>Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getId()
- * @generated
- * @ordered
- */
- protected String id = ID_EDEFAULT;
-
- /**
- * The default value of the '{@link #getValue() <em>Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValue()
- * @generated
- * @ordered
- */
- protected static final String VALUE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getValue() <em>Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValue()
- * @generated
- * @ordered
- */
- protected String value = VALUE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected TagCreationAttributeImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EClass eStaticClass() {
- return PaletteInfosPackage.Literals.TAG_CREATION_ATTRIBUTE;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getId() {
- return id;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setId(String newId) {
- String oldId = id;
- id = newId;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PaletteInfosPackage.TAG_CREATION_ATTRIBUTE__ID, oldId, id));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getValue() {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setValue(String newValue) {
- String oldValue = value;
- value = newValue;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PaletteInfosPackage.TAG_CREATION_ATTRIBUTE__VALUE, oldValue, value));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case PaletteInfosPackage.TAG_CREATION_ATTRIBUTE__ID:
- return getId();
- case PaletteInfosPackage.TAG_CREATION_ATTRIBUTE__VALUE:
- return getValue();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case PaletteInfosPackage.TAG_CREATION_ATTRIBUTE__ID:
- setId((String)newValue);
- return;
- case PaletteInfosPackage.TAG_CREATION_ATTRIBUTE__VALUE:
- setValue((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eUnset(int featureID) {
- switch (featureID) {
- case PaletteInfosPackage.TAG_CREATION_ATTRIBUTE__ID:
- setId(ID_EDEFAULT);
- return;
- case PaletteInfosPackage.TAG_CREATION_ATTRIBUTE__VALUE:
- setValue(VALUE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case PaletteInfosPackage.TAG_CREATION_ATTRIBUTE__ID:
- return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
- case PaletteInfosPackage.TAG_CREATION_ATTRIBUTE__VALUE:
- return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String toString() {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (id: ");
- result.append(id);
- result.append(", value: ");
- result.append(value);
- result.append(')');
- return result.toString();
- }
-
-} //TagCreationAttributeImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/impl/TagCreationInfoImpl.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/impl/TagCreationInfoImpl.java
deleted file mode 100644
index 327f928..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/impl/TagCreationInfoImpl.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/**
- * Copyright (c) 2007 Oracle Corporation
- *
- * $Id: TagCreationInfoImpl.java,v 1.1 2008/03/25 19:31:28 gkessler Exp $
- */
-package org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl;
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-
-import org.eclipse.emf.common.util.EList;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfosPackage;
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationAttribute;
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationInfo;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Tag Creation Info</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.TagCreationInfoImpl#getAttributes <em>Attributes</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.TagCreationInfoImpl#getTemplate <em>Template</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class TagCreationInfoImpl extends EObjectImpl implements TagCreationInfo {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * The cached value of the '{@link #getAttributes() <em>Attributes</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributes()
- * @generated
- * @ordered
- */
- protected EList attributes;
-
- /**
- * The default value of the '{@link #getTemplate() <em>Template</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTemplate()
- * @generated
- * @ordered
- */
- protected static final Object TEMPLATE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getTemplate() <em>Template</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTemplate()
- * @generated
- * @ordered
- */
- protected Object template = TEMPLATE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected TagCreationInfoImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EClass eStaticClass() {
- return PaletteInfosPackage.Literals.TAG_CREATION_INFO;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EList getAttributes() {
- if (attributes == null) {
- attributes = new EObjectContainmentEList(TagCreationAttribute.class, this, PaletteInfosPackage.TAG_CREATION_INFO__ATTRIBUTES);
- }
- return attributes;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Object getTemplate() {
- return template;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setTemplate(Object newTemplate) {
- Object oldTemplate = template;
- template = newTemplate;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PaletteInfosPackage.TAG_CREATION_INFO__TEMPLATE, oldTemplate, template));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case PaletteInfosPackage.TAG_CREATION_INFO__ATTRIBUTES:
- return ((InternalEList)getAttributes()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case PaletteInfosPackage.TAG_CREATION_INFO__ATTRIBUTES:
- return getAttributes();
- case PaletteInfosPackage.TAG_CREATION_INFO__TEMPLATE:
- return getTemplate();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case PaletteInfosPackage.TAG_CREATION_INFO__ATTRIBUTES:
- getAttributes().clear();
- getAttributes().addAll((Collection)newValue);
- return;
- case PaletteInfosPackage.TAG_CREATION_INFO__TEMPLATE:
- setTemplate(newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eUnset(int featureID) {
- switch (featureID) {
- case PaletteInfosPackage.TAG_CREATION_INFO__ATTRIBUTES:
- getAttributes().clear();
- return;
- case PaletteInfosPackage.TAG_CREATION_INFO__TEMPLATE:
- setTemplate(TEMPLATE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case PaletteInfosPackage.TAG_CREATION_INFO__ATTRIBUTES:
- return attributes != null && !attributes.isEmpty();
- case PaletteInfosPackage.TAG_CREATION_INFO__TEMPLATE:
- return TEMPLATE_EDEFAULT == null ? template != null : !TEMPLATE_EDEFAULT.equals(template);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String toString() {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (template: ");
- result.append(template);
- result.append(')');
- return result.toString();
- }
-
-} //TagCreationInfoImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/impl/TagCreationTemplateImpl.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/impl/TagCreationTemplateImpl.java
deleted file mode 100644
index edad1eb..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/impl/TagCreationTemplateImpl.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/**
- * Copyright (c) 2007 Oracle Corporation
- *
- * $Id: TagCreationTemplateImpl.java,v 1.1 2008/03/25 19:31:28 gkessler Exp $
- */
-package org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.InternalEObject;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfosPackage;
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationTemplate;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Tag Creation Template</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.TagCreationTemplateImpl#getTemplate <em>Template</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class TagCreationTemplateImpl extends EObjectImpl implements TagCreationTemplate {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * The cached value of the '{@link #getTemplate() <em>Template</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTemplate()
- * @generated
- * @ordered
- */
- protected EObject template;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected TagCreationTemplateImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EClass eStaticClass() {
- return PaletteInfosPackage.Literals.TAG_CREATION_TEMPLATE;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EObject getTemplate() {
- return template;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @param newTemplate
- * @param msgs
- * @return the notification chain
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetTemplate(EObject newTemplate, NotificationChain msgs) {
- EObject oldTemplate = template;
- template = newTemplate;
- if (eNotificationRequired()) {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, PaletteInfosPackage.TAG_CREATION_TEMPLATE__TEMPLATE, oldTemplate, newTemplate);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setTemplate(EObject newTemplate) {
- if (newTemplate != template) {
- NotificationChain msgs = null;
- if (template != null)
- msgs = ((InternalEObject)template).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - PaletteInfosPackage.TAG_CREATION_TEMPLATE__TEMPLATE, null, msgs);
- if (newTemplate != null)
- msgs = ((InternalEObject)newTemplate).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - PaletteInfosPackage.TAG_CREATION_TEMPLATE__TEMPLATE, null, msgs);
- msgs = basicSetTemplate(newTemplate, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PaletteInfosPackage.TAG_CREATION_TEMPLATE__TEMPLATE, newTemplate, newTemplate));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case PaletteInfosPackage.TAG_CREATION_TEMPLATE__TEMPLATE:
- return basicSetTemplate(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case PaletteInfosPackage.TAG_CREATION_TEMPLATE__TEMPLATE:
- return getTemplate();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case PaletteInfosPackage.TAG_CREATION_TEMPLATE__TEMPLATE:
- setTemplate((EObject)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eUnset(int featureID) {
- switch (featureID) {
- case PaletteInfosPackage.TAG_CREATION_TEMPLATE__TEMPLATE:
- setTemplate((EObject)null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case PaletteInfosPackage.TAG_CREATION_TEMPLATE__TEMPLATE:
- return template != null;
- }
- return super.eIsSet(featureID);
- }
-
-} //TagCreationTemplateImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/util/PaletteInfosAdapterFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/util/PaletteInfosAdapterFactory.java
deleted file mode 100644
index 020473a..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/util/PaletteInfosAdapterFactory.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/**
- * Copyright (c) 2007 Oracle Corporation
- *
- * $Id: PaletteInfosAdapterFactory.java,v 1.1 2008/03/25 19:31:30 gkessler Exp $
- */
-package org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.util;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-
-import org.eclipse.emf.ecore.EObject;
-
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.*;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Adapter Factory</b> for the model.
- * It provides an adapter <code>createXXX</code> method for each class of the model.
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfosPackage
- * @generated
- */
-public class PaletteInfosAdapterFactory extends AdapterFactoryImpl {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * The cached model package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected static PaletteInfosPackage modelPackage;
-
- /**
- * Creates an instance of the adapter factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public PaletteInfosAdapterFactory() {
- if (modelPackage == null) {
- modelPackage = PaletteInfosPackage.eINSTANCE;
- }
- }
-
- /**
- * Returns whether this factory is applicable for the type of the object.
- * <!-- begin-user-doc -->
- * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
- * <!-- end-user-doc -->
- * @return whether this factory is applicable for the type of the object.
- * @generated
- */
- public boolean isFactoryForType(Object object) {
- if (object == modelPackage) {
- return true;
- }
- if (object instanceof EObject) {
- return ((EObject)object).eClass().getEPackage() == modelPackage;
- }
- return false;
- }
-
- /**
- * The switch that delegates to the <code>createXXX</code> methods.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected PaletteInfosSwitch modelSwitch =
- new PaletteInfosSwitch() {
- public Object casePaletteInfos(PaletteInfos object) {
- return createPaletteInfosAdapter();
- }
- public Object casePaletteInfo(PaletteInfo object) {
- return createPaletteInfoAdapter();
- }
- public Object caseTagCreationInfo(TagCreationInfo object) {
- return createTagCreationInfoAdapter();
- }
- public Object caseTagCreationTemplate(TagCreationTemplate object) {
- return createTagCreationTemplateAdapter();
- }
- public Object caseTagCreationAttribute(TagCreationAttribute object) {
- return createTagCreationAttributeAdapter();
- }
- public Object defaultCase(EObject object) {
- return createEObjectAdapter();
- }
- };
-
- /**
- * Creates an adapter for the <code>target</code>.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param target the object to adapt.
- * @return the adapter for the <code>target</code>.
- * @generated
- */
- public Adapter createAdapter(Notifier target) {
- return (Adapter)modelSwitch.doSwitch((EObject)target);
- }
-
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfos <em>Palette Infos</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfos
- * @generated
- */
- public Adapter createPaletteInfosAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo <em>Palette Info</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo
- * @generated
- */
- public Adapter createPaletteInfoAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationInfo <em>Tag Creation Info</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationInfo
- * @generated
- */
- public Adapter createTagCreationInfoAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationTemplate <em>Tag Creation Template</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationTemplate
- * @generated
- */
- public Adapter createTagCreationTemplateAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationAttribute <em>Tag Creation Attribute</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationAttribute
- * @generated
- */
- public Adapter createTagCreationAttributeAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for the default case.
- * <!-- begin-user-doc -->
- * This default implementation returns null.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @generated
- */
- public Adapter createEObjectAdapter() {
- return null;
- }
-
-} //PaletteInfosAdapterFactory
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/util/PaletteInfosSwitch.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/util/PaletteInfosSwitch.java
deleted file mode 100644
index 1059181..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/tagdisplay/internal/paletteinfos/util/PaletteInfosSwitch.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/**
- * Copyright (c) 2007 Oracle Corporation
- *
- * $Id: PaletteInfosSwitch.java,v 1.1 2008/03/25 19:31:30 gkessler Exp $
- */
-package org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.util;
-
-import java.util.List;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.*;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Switch</b> for the model's inheritance hierarchy.
- * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
- * to invoke the <code>caseXXX</code> method for each class of the model,
- * starting with the actual class of the object
- * and proceeding up the inheritance hierarchy
- * until a non-null result is returned,
- * which is the result of the switch.
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfosPackage
- * @generated
- */
-public class PaletteInfosSwitch {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * The cached model package
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected static PaletteInfosPackage modelPackage;
-
- /**
- * Creates an instance of the switch.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public PaletteInfosSwitch() {
- if (modelPackage == null) {
- modelPackage = PaletteInfosPackage.eINSTANCE;
- }
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc -->
- * @param theEObject
- * <!-- end-user-doc -->
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * @generated
- */
- public Object doSwitch(EObject theEObject) {
- return doSwitch(theEObject.eClass(), theEObject);
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc -->
- * @param theEClass
- * @param theEObject
- * <!-- end-user-doc -->
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * @generated
- */
- protected Object doSwitch(EClass theEClass, EObject theEObject) {
- if (theEClass.eContainer() == modelPackage) {
- return doSwitch(theEClass.getClassifierID(), theEObject);
- }
- List eSuperTypes = theEClass.getESuperTypes();
- return
- eSuperTypes.isEmpty() ?
- defaultCase(theEObject) :
- doSwitch((EClass)eSuperTypes.get(0), theEObject);
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc -->
- * @param classifierID
- * @param theEObject
- * <!-- end-user-doc -->
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * @generated
- */
- protected Object doSwitch(int classifierID, EObject theEObject) {
- switch (classifierID) {
- case PaletteInfosPackage.PALETTE_INFOS: {
- PaletteInfos paletteInfos = (PaletteInfos)theEObject;
- Object result = casePaletteInfos(paletteInfos);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case PaletteInfosPackage.PALETTE_INFO: {
- PaletteInfo paletteInfo = (PaletteInfo)theEObject;
- Object result = casePaletteInfo(paletteInfo);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case PaletteInfosPackage.TAG_CREATION_INFO: {
- TagCreationInfo tagCreationInfo = (TagCreationInfo)theEObject;
- Object result = caseTagCreationInfo(tagCreationInfo);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case PaletteInfosPackage.TAG_CREATION_TEMPLATE: {
- TagCreationTemplate tagCreationTemplate = (TagCreationTemplate)theEObject;
- Object result = caseTagCreationTemplate(tagCreationTemplate);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case PaletteInfosPackage.TAG_CREATION_ATTRIBUTE: {
- TagCreationAttribute tagCreationAttribute = (TagCreationAttribute)theEObject;
- Object result = caseTagCreationAttribute(tagCreationAttribute);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- default: return defaultCase(theEObject);
- }
- }
-
- /**
- * Returns the result of interpreting the object as an instance of '<em>Palette Infos</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpreting the object as an instance of '<em>Palette Infos</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public Object casePaletteInfos(PaletteInfos object) {
- return null;
- }
-
- /**
- * Returns the result of interpreting the object as an instance of '<em>Palette Info</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpreting the object as an instance of '<em>Palette Info</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public Object casePaletteInfo(PaletteInfo object) {
- return null;
- }
-
- /**
- * Returns the result of interpreting the object as an instance of '<em>Tag Creation Info</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpreting the object as an instance of '<em>Tag Creation Info</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public Object caseTagCreationInfo(TagCreationInfo object) {
- return null;
- }
-
- /**
- * Returns the result of interpreting the object as an instance of '<em>Tag Creation Template</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpreting the object as an instance of '<em>Tag Creation Template</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public Object caseTagCreationTemplate(TagCreationTemplate object) {
- return null;
- }
-
- /**
- * Returns the result of interpreting the object as an instance of '<em>Tag Creation Attribute</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpreting the object as an instance of '<em>Tag Creation Attribute</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public Object caseTagCreationAttribute(TagCreationAttribute object) {
- return null;
- }
-
- /**
- * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch, but this is the last case anyway.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject)
- * @generated
- */
- public Object defaultCase(EObject object) {
- return null;
- }
-
-} //PaletteInfosSwitch
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/AbstractEnumerationType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/AbstractEnumerationType.java
deleted file mode 100644
index fda6dd5..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/AbstractEnumerationType.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- * Vadim Dmitriev
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jst.jsf.common.internal.types.CompositeType;
-import org.eclipse.jst.jsf.metadataprocessors.AbstractRootTypeDescriptor;
-import org.eclipse.jst.jsf.metadataprocessors.features.ELIsNotValidException;
-import org.eclipse.jst.jsf.metadataprocessors.features.IDefaultValue;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.ValidationMessage;
-
-/**
- * Abstract meta-data processing type representing an enumeration attribute value runtime type
- * <p><b>Provisional API - subject to change</b></p>
- */
-public abstract class AbstractEnumerationType extends AbstractRootTypeDescriptor implements IValidValues, IDefaultValue, IValidELValues{
- private List validationMessages;
-
- /**
- * An empty list
- */
- protected static List EMPTY_LIST = new ArrayList(0);
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidValues#getValidationMessages()
- */
- public List getValidationMessages() {
- if (validationMessages == null){
- validationMessages = new ArrayList();
- }
- return validationMessages;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.metadataprocessors.features.IDefaultValue#getDefaultValue()
- */
- public String getDefaultValue() {
- return getTraitValueAsString(IDefaultValue.DEFAULT_VALUE_PROP_NAME);
- }
-
- /**
- * @return possible values of type as list of Strings using
- * {@link IPossibleValues}.POSSIBLE_VALUES_PROP_NAME trait name
- */
- protected List getMDPossibleValues() {
- return getTraitValueAsListOfStrings(IPossibleValues.POSSIBLE_VALUES_PROP_NAME);
- }
-
- /**
- * @return possible values of type to dislay as list of Strings using
- * {@link IPossibleValues}.POSSIBLE_VALUES_FOR_DISPLAY_PROP_NAME trait name
- */
- protected List getMDPossibleValuesForDisplay() {
- return getTraitValueAsListOfStrings(IPossibleValues.POSSIBLE_VALUES_FOR_DISPLAY_PROP_NAME);
- }
-
- /**
- * @return list of valid values as list of Strings using
- * {@link IValidValues}.VALID_VALUES_PROP_NAME trait name
- */
- protected List getMDValidValues() {
- return getTraitValueAsListOfStrings(IValidValues.VALID_VALUES_PROP_NAME);
- }
-
- /**
- * @return Validation message for type using
- * {@link IValidValues}.VALID_VALUES_MESSAGE_PROP_NAME trait name
- */
- protected String getMDValidationMessage() {
- return getTraitValueAsString(IValidValues.VALID_VALUES_MESSAGE_PROP_NAME);
- }
-
- /**
- * @return Validation severity int value for type using
- * {@link IValidValues}.VALID_VALUES_SEVERITY_PROP_NAME trait name
- */
- protected int getMDValidationSeverity() {
- String val = getTraitValueAsString(IValidValues.VALID_VALUES_SEVERITY_PROP_NAME);
- if (val == null)
- return IStatus.WARNING;
-
- int severity = Integer.valueOf(val).intValue();
- return severity;
- }
-
- /**
- * @return Validation code as String value for type using
- * {@link IValidValues}.VALID_VALUES_CODE_PROP_NAME trait name
- */
- protected String getMDValidationCode() {
- return getTraitValueAsString(IValidValues.VALID_VALUES_CODE_PROP_NAME);
- }
-
- /**
- * Create a {@link ValidationMessage} from metadata or use default message
- * and add it to the collection of validation messages
- * @param defaultMsg
- */
- protected void addNewValidationMessage(String defaultMsg) {
- String msg = getMDValidationMessage();
- if (msg == null || msg.equals("")) //$NON-NLS-1$
- msg = defaultMsg;
-
- String code = getMDValidationCode();
- int severity = getMDValidationSeverity();
- ValidationMessage val = new ValidationMessage(msg, code, severity);
- getValidationMessages().add(val);
- }
-
- /**
- * @return the value of {@link org.eclipse.jst.jsf.common.internal.types.IAssignable}.ASSIGNMENT_TYPE_NONE. Subclasses to override.
- */
- protected int getAssignmentType(){
- return 0;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues#getExpectedRuntimeType()
- */
- public abstract CompositeType getExpectedRuntimeType() throws ELIsNotValidException;
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ActionType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ActionType.java
deleted file mode 100644
index d072810..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ActionType.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IWorkspaceContextResolver;
-import org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigManager;
-import org.eclipse.jst.jsf.facesconfig.FacesConfigPlugin;
-import org.eclipse.jst.jsf.facesconfig.emf.DisplayNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.NavigationCaseType;
-import org.eclipse.jst.jsf.facesconfig.emf.NavigationRuleType;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidationMessage;
-import org.eclipse.jst.jsf.metadataprocessors.features.PossibleValue;
-import org.eclipse.jst.jsf.metadataprocessors.features.ValidationMessage;
-import org.eclipse.osgi.util.NLS;
-import org.osgi.framework.Bundle;
-
-/**
- * Meta-data processing type representing an "action" attribute
- *
- * <p><b>Provisional API - subject to change</b></p>
- * @author Gerry Kessler - Oracle
- */
-public class ActionType extends MethodBindingType implements IPossibleValues{
- /**
- * Image to use if metadata defined image cannot be created
- */
- protected static final ImageDescriptor MISSING_IMAGE = ImageDescriptor.getMissingImageDescriptor();
-
- private static final String IMAGE_NAME = "/icons/full/obj16/NavigationCaseType.gif"; //$NON-NLS-1$
- private ImageDescriptor imageDescriptor;
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.MethodBindingType#isValidValue(java.lang.String)
- */
- public boolean isValidValue(String value){
- if (value == null || (value != null && value.length() == 0)) {
- IValidationMessage msg = new ValidationMessage(Messages.ActionType_invalid_empty_value);
- getValidationMessages().add(msg);
- return false;
- }
- //any other value should be one of the possible values
- //optimize
- IWorkspaceContextResolver wr = IStructuredDocumentContextResolverFactory.INSTANCE.getWorkspaceContextResolver(getStructuredDocumentContext());
- if (wr == null)
- return true;//shouldn't get here
-
- //in case that this is not JSF faceted or missing configs, need to pass
- if (JSFAppConfigManager.getInstance(wr.getProject()) == null)
- return true;
-
- IFile jsp = (IFile)wr.getResource();
- List rules = JSFAppConfigManager.getInstance(wr.getProject()).getNavigationRulesForPage(jsp);
- for(Iterator it=rules.iterator();it.hasNext();){
- NavigationRuleType rule = (NavigationRuleType)it.next();
- for (Iterator cases=rule.getNavigationCase().iterator();cases.hasNext();){
- NavigationCaseType navCase = (NavigationCaseType)cases.next();
- if (navCase.getFromOutcome() != null &&
- value.equals(navCase.getFromOutcome().getTextContent().trim()))
- return true;
- }
- }
- IValidationMessage msg = new ValidationMessage(Messages.ActionType_invalid_value);
- getValidationMessages().add(msg);
- return false;
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues#getPossibleValues()
- */
- public List getPossibleValues() {
- List ret = new ArrayList();
- if (getStructuredDocumentContext() == null)
- return ret;
-
- IWorkspaceContextResolver wr = IStructuredDocumentContextResolverFactory.INSTANCE.getWorkspaceContextResolver(getStructuredDocumentContext());
- if (wr != null && JSFAppConfigManager.getInstance(wr.getProject()) != null) {//may not be JSF faceted project or know faces-config){
- IFile jsp = (IFile)wr.getResource();
- List rules = JSFAppConfigManager.getInstance(wr.getProject()).getNavigationRulesForPage(jsp);
- for(Iterator it=rules.iterator();it.hasNext();){
- NavigationRuleType rule = (NavigationRuleType)it.next();
- if (rule != null)
- ret.addAll(createProposals(rule));
- }
- }
- return ret;
- }
-
- private List createProposals(NavigationRuleType rule) {
- List ret = new ArrayList();
- List cases = rule.getNavigationCase();
- for(Iterator it=cases.iterator();it.hasNext();){
- NavigationCaseType navCase = (NavigationCaseType)it.next();
- PossibleValue pv = createProposal(rule, navCase);
- if (pv != null)
- ret.add(pv);
- }
- return ret;
- }
-
- private PossibleValue createProposal(NavigationRuleType rule, NavigationCaseType navCase) {
- PossibleValue pv = null;
- String value = null;
- String ruleDisp = null;
- String navDisplay = null;
- String navAction = null;
- String toViewId = null;
-
- if (navCase.getFromOutcome() != null)
- value = navCase.getFromOutcome().getTextContent();
- if (navCase.getToViewId()!= null)
- toViewId = navCase.getToViewId().getTextContent();
- if (rule.getFromViewId() != null)
- ruleDisp = rule.getFromViewId().getTextContent();
- if (navCase.getDisplayName() != null
- && navCase.getDisplayName().size() > 0) {
- navDisplay = ((DisplayNameType) navCase
- .getDisplayName().get(0)).getTextContent();
- }
- if (navCase.getFromAction() != null) {
- navAction= navCase.getFromAction().getTextContent();
- }
- if (navDisplay == null || navDisplay.trim().equals("")) //$NON-NLS-1$
- navDisplay = NLS.bind(Messages.ActionType_navcase_display, new String[]{value, toViewId});
-
- if (value != null){
- pv = new PossibleValue(value, navDisplay);
- pv.setIcon(getNavCaseImageDescriptor());
- pv.setAdditionalInformation("from-outcome: "+value //$NON-NLS-1$
- + "<br>to-view-id: " + toViewId //$NON-NLS-1$
- + "<br>from-view-id: " + ruleDisp //$NON-NLS-1$
- + "<br>from-action: " + (navAction == null ? "null" : navAction)); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- return pv;
- }
-
-
- private ImageDescriptor getNavCaseImageDescriptor() {
- ImageDescriptor ret = super.getImage();
- if (ret != null && ret != MISSING_IMAGE)
- return ret;
-
- if (imageDescriptor == null){
- imageDescriptor = getImageDesc(IMAGE_NAME);
- }
- return imageDescriptor;
-
- }
-
- private ImageDescriptor getImageDesc(String img)
- {
- Bundle bundle = FacesConfigPlugin.getPlugin().getBundle();
- URL url = FileLocator.find(bundle, new Path(img), null);
- ImageDescriptor desc = ImageDescriptor.createFromURL(url);
- if (desc == MISSING_IMAGE){
- return null;
- }
- return desc;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/BindingType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/BindingType.java
deleted file mode 100644
index 6932796..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/BindingType.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-import org.eclipse.jst.jsf.metadataprocessors.AbstractRootTypeDescriptor;
-
-/**
- * Abstract meta-data processing type representing a binding
- *
- * <p><b>Provisional API - subject to change</b></p>
- * @author Gerry Kessler - Oracle
- */
-public abstract class BindingType extends AbstractRootTypeDescriptor{
- // TODO: what's the point of this?
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/BooleanType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/BooleanType.java
deleted file mode 100644
index cd90e74..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/BooleanType.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jst.jsf.metadataprocessors.features.IDefaultValue;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.PossibleValue;
-
-/**
- * Meta-data processing type representing a boolean attribute value runtime type
- * that implements IPossibleValues, IValidValues, IDefaultValue, IValidELValues
- *
- * <p><b>Provisional API - subject to change</b></p>
- * @author Gerry Kessler - Oracle
- */
-public class BooleanType extends EnumerationType implements IValidValues, IPossibleValues, IDefaultValue{
- private static final String TRUE_VAL = "true"; //$NON-NLS-1$
- private static final String FALSE_VAL = "false"; //$NON-NLS-1$
-
- private static final String BOOLTYPE_VALIDATION_MSG = Messages.BooleanType_invalid_values;
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.EnumerationType#getReturnType()
- */
- protected String getReturnType(){ return "boolean";} //$NON-NLS-1$
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues#getPossibleValues()
- */
- public List getPossibleValues() {
- String def = getDefaultValue();
- List vals = new ArrayList();
- vals.add(new PossibleValue(TRUE_VAL, TRUE_VAL, def != null && def.equals(TRUE_VAL) ));
- vals.add(new PossibleValue(FALSE_VAL, FALSE_VAL, def != null && def.equals(FALSE_VAL) ));
- return vals;
- }
-
- /**
- * Type coercion according to JSP 2.0 spec: JSP.1.14.2.1 Conversions from String values
- * Although not completely faithful to spec, we will validate values as either 'true' or 'false'
- * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidValues#isValidValue(java.lang.String)
- **/
- public boolean isValidValue(String value) {
- if(TRUE_VAL.equalsIgnoreCase(value) || FALSE_VAL.equalsIgnoreCase(value)) {
- return true;
- }
- addNewValidationMessage(BOOLTYPE_VALIDATION_MSG);
- return false;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/CSSClassType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/CSSClassType.java
deleted file mode 100644
index 57a0625..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/CSSClassType.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IDOMContextResolver;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.internal.impl.StructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.metadataprocessors.AbstractRootTypeDescriptor;
-import org.eclipse.jst.jsf.metadataprocessors.IMetaDataEnabledFeature;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValue;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.PossibleValue;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetListAdapter;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.util.CSSClassTraverser;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.w3c.dom.Document;
-import org.w3c.dom.stylesheets.StyleSheetList;
-
-/**
- * Represents a style class attribute type
- * <p><b>Provisional API - subject to change</b></p>
- */
-public class CSSClassType extends AbstractRootTypeDescriptor implements
- IMetaDataEnabledFeature, IPossibleValues {
-
- private List<IPossibleValue> _pvs;
-
- public List<IPossibleValue> getPossibleValues() {
- if (_pvs == null){
- IDOMContextResolver resolver = StructuredDocumentContextResolverFactory.getInstance().getDOMContextResolver(getStructuredDocumentContext());
- _pvs = getCSSClasses(resolver.getDOMDocument());
- }
- return _pvs;
- }
-
- private List<IPossibleValue> getCSSClasses(Document doc) {
- List result = new ArrayList();
- String [] names = internalGetCSSClasses(doc);
- for (int i=0;i<names.length;i++){
- IPossibleValue pv = new PossibleValue(names[i]);
- result.add(pv);
- }
- return result;
- }
-
- //code duplicated from pagedesigner CSSUtils. Uses internal CSSClassTraverser
- private static String[] internalGetCSSClasses(Document doc) {
- Collection c = Collections.EMPTY_SET;
- if (doc instanceof INodeNotifier) {
- IStyleSheetListAdapter adapter = (IStyleSheetListAdapter) ((INodeNotifier) doc)
- .getAdapterFor(IStyleSheetListAdapter.class);
- StyleSheetList ssl = (adapter == null ? null : adapter
- .getStyleSheets());
-
- CSSClassTraverser traverser = new CSSClassTraverser();
- if (ssl != null) {
- for (int i = 0, numStyles = ssl.getLength(); i < numStyles; i++) {
- // loop for styles (<style> and <link>)
- org.w3c.dom.stylesheets.StyleSheet ss = ssl.item(i);
-
- try {
- traverser.apply((ICSSNode) ss);
- } catch (ClassCastException ex) {
- JSFCorePlugin.log(ex, "Unable to cast to CSS style");
- }
- }
- c = traverser.getClassNames();
- }
- }
- String[] result = new String[c.size()];
- c.toArray(result);
- return result;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/CSSIdType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/CSSIdType.java
deleted file mode 100644
index 4fa8ee1..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/CSSIdType.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-import org.eclipse.jst.jsf.metadataprocessors.AbstractRootTypeDescriptor;
-import org.eclipse.jst.jsf.metadataprocessors.IMetaDataEnabledFeature;
-
-/**
- * Represents CSS id attribute type
- * EXPERIMENTAL - may change or disappear
- *
- */
-public class CSSIdType extends AbstractRootTypeDescriptor implements
- IMetaDataEnabledFeature {
-
- /**
- * Constructor
- */
- public CSSIdType() {
- // TODO Auto-generated constructor stub
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/CSSStyleType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/CSSStyleType.java
deleted file mode 100644
index 1c7f35b..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/CSSStyleType.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-import org.eclipse.jst.jsf.metadataprocessors.AbstractRootTypeDescriptor;
-import org.eclipse.jst.jsf.metadataprocessors.IMetaDataEnabledFeature;
-
-/**
- * Represents CSS style attribute.
- * No features currently supported.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- */
-public class CSSStyleType extends AbstractRootTypeDescriptor implements
- IMetaDataEnabledFeature {
-
- /**
- * Constructor
- */
- public CSSStyleType() {
- //
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/CharacterType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/CharacterType.java
deleted file mode 100644
index 5ec13d8..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/CharacterType.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jst.jsf.metadataprocessors.AbstractRootTypeDescriptor;
-import org.eclipse.jst.jsf.metadataprocessors.IMetaDataEnabledFeature;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidationMessage;
-import org.eclipse.jst.jsf.metadataprocessors.features.ValidationMessage;
-
-/**
- * Represents a single unicode character
- */
-public class CharacterType extends AbstractRootTypeDescriptor implements
- IMetaDataEnabledFeature, IValidValues{
-
- private List _msgs;
-
- /**
- * Constructor
- */
- public CharacterType() {
- super();
- }
-
- public List<IValidationMessage> getValidationMessages() {
- if (_msgs == null){
- _msgs = new ArrayList<IValidationMessage>(1);
- }
- return _msgs;
- }
-
- public boolean isValidValue(String value) {
- if (value.length() != 1)
- getValidationMessages().add(new ValidationMessage(Messages.CharacterType_0));
-
- return getValidationMessages().size() == 0;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ColorType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ColorType.java
deleted file mode 100644
index 897a399..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ColorType.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation., and others
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Yury Kats/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.PossibleValue;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.graphics.PaletteData;
-import org.eclipse.swt.graphics.RGB;
-
-/**
- * Meta-data processing type representing a color.
- * A color is defined as in html spec http://www.w3.org/TR/html4/types.html#type-color
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author ykats
- */
-
-public class ColorType extends EnumerationType implements IPossibleValues {
-
- /**
- * List of standard colors
- * See http://www.w3.org/TR/html4/types.html#type-color
- */
- private final static String[] COLORS = {"Black", "Silver", "Gray", "White", "Maroon", "Red", "Purple", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
- "Fuchsia", "Green", "Lime", "Olive", "Yellow", "Navy", "Blue", "Teal","Aqua"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$
- //if ordering changes, must change RGB[] ordering
-
- private RGB[] _rgb;
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.EnumerationType#getReturnType()
- */
- protected String getReturnType(){ return "java.lang.String";} //$NON-NLS-1$
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidValues#isValidValue(java.lang.String)
- */
- public boolean isValidValue(String value) {
- boolean bValid = true;
- String trimmedVal = value.trim();
- if (trimmedVal.length() == 0)
- bValid = false;
- else if (trimmedVal.charAt(0) == '#' && trimmedVal.length() == 7) {
- for (int i=1; i<7; i++) {
- if (trimmedVal.charAt(i) < '0' ||
- (trimmedVal.charAt(i) > '9' && trimmedVal.charAt(i) < 'A') ||
- (trimmedVal.charAt(i) > 'F' && trimmedVal.charAt(i) < 'a') ||
- trimmedVal.charAt(i) > 'f') {
- bValid = false;
- break;
- }
- }
- }
- else {
- bValid = false;
- for (int i = 0; i < COLORS.length; i++) {
- if(trimmedVal.equalsIgnoreCase(COLORS[i])) {
- bValid = true;
- break;
- }
- }
- }
-
- if(!bValid) {
- addNewValidationMessage(Messages.ColorType_invalid_color);
- }
-
- return getValidationMessages().isEmpty();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues#getPossibleValues()
- */
- public List getPossibleValues() {
- List ret = new ArrayList(COLORS.length);
- for (int i=0;i < COLORS.length;i++){
- PossibleValue pv = new PossibleValue(COLORS[i]);
- pv.setIcon(createImage(i));
- ret.add(pv);
- }
- return ret;
- }
-
- private ImageDescriptor createImage(int color) {
- PaletteData pd = getPaletteData(color);
- return ImageDescriptor.createFromImageData(new ImageData(16, 16, 1, pd));
- }
-
- private PaletteData getPaletteData(int color){
- if (_rgb == null){
- _rgb = new RGB[16];
- _rgb[0] = new RGB(0,0,0);//black
- _rgb[1] = new RGB(192,192,192);//silver
- _rgb[2] = new RGB(128,128,128);//gray
- _rgb[3] = new RGB(255,255,255);//white
- _rgb[4] = new RGB(128,0,0);//Maroon
- _rgb[5] = new RGB(255,0,0);//Red
- _rgb[6] = new RGB(128,0,128);//Purple
- _rgb[7] = new RGB(255,0,255);//Fuchsia
- _rgb[8] = new RGB(0,128,0);//Green
- _rgb[9] = new RGB(0,255,0);//Lime
- _rgb[10] = new RGB(128,128,0);//Olive
- _rgb[11] = new RGB(255,255,0);//Yellow
- _rgb[12] = new RGB(0,0,128);//Navy
- _rgb[13] = new RGB(0,0,255);//Blue
- _rgb[14] = new RGB(0,128,128);//Teal
- _rgb[15] = new RGB(0,255,255);//Aqua
- }
- RGB[] rgbColor = new RGB[1];
- System.arraycopy(_rgb, color, rgbColor, 0, 1);
- return new PaletteData(rgbColor);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ComponentBindingType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ComponentBindingType.java
deleted file mode 100644
index 4e394ed..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ComponentBindingType.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidationMessage;
-import org.eclipse.jst.jsf.metadataprocessors.features.ValidationMessage;
-
-/**
- * Meta-data processing type representing a "binding" attribute
- *
- * <p><b>Provisional API - subject to change</b></p>
- * @author Gerry Kessler - Oracle
- */
-public class ComponentBindingType extends ValueBindingType implements
- IValidValues, IValidELValues {
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidValues#isValidValue(java.lang.String)
- */
- public boolean isValidValue(String value) {
- //Strings are invalid. Requires a EL value binding.
- IValidationMessage msg = new ValidationMessage(Messages.ComponentBindingType_invalid_value);
- getValidationMessages().add(msg);
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ComponentIDType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ComponentIDType.java
deleted file mode 100644
index 82c9957..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ComponentIDType.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-
-import org.eclipse.jst.jsf.common.internal.types.CompositeType;
-import org.eclipse.jst.jsf.metadataprocessors.features.ELIsNotValidException;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidationMessage;
-import org.eclipse.jst.jsf.metadataprocessors.features.ValidationMessage;
-
-/**
- * Meta-data processing type representing an "id" attribute
- * Represents an ID or NAME HTML attribute type.
- * <br>
- * Attribute values of type ID and NAME must begin with a letter in the range A-Z or a-z or underscore ("_") and
- * may be followed by letters (A-Z, a-z), digits (0-9), hyphens ("-"), underscores ("_"), colons (":"),
- * and periods (".").
- *
- * <p><b>Provisional API - subject to change</b></p>
- * @author Gerry Kessler - Oracle
- * TODO: finish regex validation
- */
-public class ComponentIDType extends ValueBindingType implements
- IValidValues, IValidELValues {
-
-// private static Pattern idPattern1 = Pattern.compile("[A-Za-z_]");;
-// private static Pattern idPattern2 = Pattern.compile("^[:\\w\\.\\-]*");
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.ValueBindingType#getExpectedRuntimeType()
- */
- public CompositeType getExpectedRuntimeType() throws ELIsNotValidException {
- throw new ELIsNotValidException(Messages.ComponentIDType_invalid_as_el);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidValues#isValidValue(java.lang.String)
- */
- public boolean isValidValue(String value) {
- IValidationMessage msg = null;
- if (value != null && value.trim().length() == 0)
- msg = new ValidationMessage(Messages.ComponentIDType_invalid_value);
- else {
- //we could validate uniqueness, but will not for the time being. This would require a DT FacesContext.
- //any other coercion rules apply here?
- return true;
- }
- getValidationMessages().add(msg);
- return false;
-
-// if (value != null && value.trim().length() == 0)
-// msg = new ValidationMessage(Messages.ComponentIDType_invalid_value);
-//
-//// else if (!idPattern.matcher(value.trim()).find())
-//// fail = true;
-// else if (!idPattern1.matcher(value.trim().substring(0, 1)).find())
-// msg = new ValidationMessage("id must begin with alpha character");
-// else if ((value.trim().length() > 1) && (!( idPattern2.matcher(value.trim().substring(1)).find())))
-// msg = new ValidationMessage("illegal characters in id: must be alphanum, period, colon, and hyphen only");
-// else {
-// //we could validate uniqueness, but will not for the time being. This would require a DT FacesContext.
-// //any other coercion rules apply here?
-// }
-// if (msg != null)
-// getValidationMessages().add(msg);
-//
-// return getValidationMessages().size() == 0;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ContentType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ContentType.java
deleted file mode 100644
index 4fb9ec4..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ContentType.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation., and others
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Yury Kats/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.PossibleValue;
-
-/**
- * Meta-data processing type representing a content (MIME) type.
- * A ContentType is defined as in 4.0 html spec http://www.w3.org/TR/html401/types.html#h-6.7
- *
- * <p><b>Provisional API - subject to change</b></p>
- */
-
-public class ContentType extends EnumerationType implements IPossibleValues {
-
- /**
- * List of some of the more common content (MIME) types
- * See http://www.w3.org/TR/html4/types.html#type-color
- */
- private final static String[] commontypes = {
- "text/html", //$NON-NLS-1$
- "text/css", //$NON-NLS-1$
- "image/jpeg", //$NON-NLS-1$
- "image/gif", //$NON-NLS-1$
- "audio/mpeg", //$NON-NLS-1$
- "video/mpeg", //$NON-NLS-1$
- "video/quicktime", //$NON-NLS-1$
- "text/javascript" //$NON-NLS-1$
- };
-
- protected String getReturnType(){ return "java.lang.String";} //$NON-NLS-1$
-
- public boolean isValidValue(String value) {
- boolean bValid = true;
- if (value == null || value.trim().length() == 0)
- bValid = false;
-
- if(!bValid) {
- addNewValidationMessage(Messages.ContentType_MIME_not_empty);
- }
-
- return getValidationMessages().isEmpty();
- }
-
- public List getPossibleValues() {
- List ret = new ArrayList(commontypes.length);
- for (int i=0;i < commontypes.length;i++){
- PossibleValue pv = new PossibleValue(commontypes[i]);
- ret.add(pv);
- }
- return ret;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/CurrencyCodeType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/CurrencyCodeType.java
deleted file mode 100644
index 4dc6db8..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/CurrencyCodeType.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation., and others
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.PossibleValue;
-
-/**
- * ISO-4217 Currency codes
- */
-public class CurrencyCodeType extends EnumerationType implements IPossibleValues {
- private static final CurrencyCodeMap _map = new CurrencyCodeMap();
-
- @Override
- protected String getReturnType() {
- return "java.lang.String"; //$NON-NLS-1$
- }
-
- public List getPossibleValues() {
- List ret = new ArrayList();
- for(Iterator it = _map.keySet().iterator();it.hasNext();){
- String key = (String)it.next();
- String value = _map.get(key);
- PossibleValue pv = new PossibleValue(key, value);
- ret.add(pv);
- }
- return ret;
- }
-
- public boolean isValidValue(String value) {
- if(!_map.containsKey(value.toUpperCase())) {
- addNewValidationMessage(Messages.CurrencyCodeType_invalid);
- }
-
- return getValidationMessages().isEmpty();
- }
-
- private static class CurrencyCodeMap extends HashMap<String, String> {
-
- private static final long serialVersionUID = 1L;
-
- CurrencyCodeMap(){
- put("AED",Messages.CurrencyCodeType_2); //$NON-NLS-1$
- put("AFA",Messages.CurrencyCodeType_3); //$NON-NLS-1$
- put("ALL",Messages.CurrencyCodeType_4); //$NON-NLS-1$
- put("AMD",Messages.CurrencyCodeType_5); //$NON-NLS-1$
- put("ANG",Messages.CurrencyCodeType_6); //$NON-NLS-1$
- put("AOA",Messages.CurrencyCodeType_7); //$NON-NLS-1$
- put("ARS",Messages.CurrencyCodeType_8); //$NON-NLS-1$
- put("AUD",Messages.CurrencyCodeType_9); //$NON-NLS-1$
- put("AWG",Messages.CurrencyCodeType_10); //$NON-NLS-1$
- put("AZM",Messages.CurrencyCodeType_11); //$NON-NLS-1$
- put("BAM",Messages.CurrencyCodeType_12); //$NON-NLS-1$
- put("BBD",Messages.CurrencyCodeType_13); //$NON-NLS-1$
- put("BDT",Messages.CurrencyCodeType_14); //$NON-NLS-1$
- put("BGN",Messages.CurrencyCodeType_15); //$NON-NLS-1$
- put("BHD",Messages.CurrencyCodeType_16); //$NON-NLS-1$
- put("BIF",Messages.CurrencyCodeType_17); //$NON-NLS-1$
- put("BMD",Messages.CurrencyCodeType_18); //$NON-NLS-1$
- put("BND",Messages.CurrencyCodeType_19); //$NON-NLS-1$
- put("BOB",Messages.CurrencyCodeType_20); //$NON-NLS-1$
- put("BRL",Messages.CurrencyCodeType_21); //$NON-NLS-1$
- put("BSD",Messages.CurrencyCodeType_22); //$NON-NLS-1$
- put("BTN",Messages.CurrencyCodeType_23); //$NON-NLS-1$
- put("BWP",Messages.CurrencyCodeType_24); //$NON-NLS-1$
- put("BYR",Messages.CurrencyCodeType_25); //$NON-NLS-1$
- put("BZD",Messages.CurrencyCodeType_26); //$NON-NLS-1$
- put("CAD",Messages.CurrencyCodeType_27); //$NON-NLS-1$
- put("CDF",Messages.CurrencyCodeType_28); //$NON-NLS-1$
- put("CHF",Messages.CurrencyCodeType_29); //$NON-NLS-1$
- put("CLP",Messages.CurrencyCodeType_30); //$NON-NLS-1$
- put("CNY",Messages.CurrencyCodeType_31); //$NON-NLS-1$
- put("COP",Messages.CurrencyCodeType_32); //$NON-NLS-1$
- put("CRC",Messages.CurrencyCodeType_33); //$NON-NLS-1$
- put("CSD",Messages.CurrencyCodeType_34); //$NON-NLS-1$
- put("CUP",Messages.CurrencyCodeType_35); //$NON-NLS-1$
- put("CVE",Messages.CurrencyCodeType_36); //$NON-NLS-1$
- put("CYP",Messages.CurrencyCodeType_37); //$NON-NLS-1$
- put("CZK",Messages.CurrencyCodeType_38); //$NON-NLS-1$
- put("DJF",Messages.CurrencyCodeType_39); //$NON-NLS-1$
- put("DKK",Messages.CurrencyCodeType_40); //$NON-NLS-1$
- put("DOP",Messages.CurrencyCodeType_41); //$NON-NLS-1$
- put("DZD",Messages.CurrencyCodeType_42); //$NON-NLS-1$
- put("EEK",Messages.CurrencyCodeType_43); //$NON-NLS-1$
- put("EGP",Messages.CurrencyCodeType_44); //$NON-NLS-1$
- put("ERN",Messages.CurrencyCodeType_45); //$NON-NLS-1$
- put("ETB",Messages.CurrencyCodeType_46); //$NON-NLS-1$
- put("EUR",Messages.CurrencyCodeType_47); //$NON-NLS-1$
- put("FJD",Messages.CurrencyCodeType_48); //$NON-NLS-1$
- put("FKP",Messages.CurrencyCodeType_49); //$NON-NLS-1$
- put("GBP",Messages.CurrencyCodeType_50); //$NON-NLS-1$
- put("GEL",Messages.CurrencyCodeType_51); //$NON-NLS-1$
- put("GGP",Messages.CurrencyCodeType_52); //$NON-NLS-1$
- put("GHC",Messages.CurrencyCodeType_53); //$NON-NLS-1$
- put("GIP",Messages.CurrencyCodeType_54); //$NON-NLS-1$
- put("GMD",Messages.CurrencyCodeType_55); //$NON-NLS-1$
- put("GNF",Messages.CurrencyCodeType_56); //$NON-NLS-1$
- put("GTQ",Messages.CurrencyCodeType_57); //$NON-NLS-1$
- put("GYD",Messages.CurrencyCodeType_58); //$NON-NLS-1$
- put("HKD",Messages.CurrencyCodeType_59); //$NON-NLS-1$
- put("HNL",Messages.CurrencyCodeType_60); //$NON-NLS-1$
- put("HRK",Messages.CurrencyCodeType_61); //$NON-NLS-1$
- put("HTG",Messages.CurrencyCodeType_62); //$NON-NLS-1$
- put("HUF",Messages.CurrencyCodeType_63); //$NON-NLS-1$
- put("IDR",Messages.CurrencyCodeType_64); //$NON-NLS-1$
- put("ILS",Messages.CurrencyCodeType_65); //$NON-NLS-1$
- put("IMP",Messages.CurrencyCodeType_66); //$NON-NLS-1$
- put("INR",Messages.CurrencyCodeType_67); //$NON-NLS-1$
- put("IQD",Messages.CurrencyCodeType_68); //$NON-NLS-1$
- put("IRR",Messages.CurrencyCodeType_69); //$NON-NLS-1$
- put("ISK",Messages.CurrencyCodeType_70); //$NON-NLS-1$
- put("JEP",Messages.CurrencyCodeType_71); //$NON-NLS-1$
- put("JMD",Messages.CurrencyCodeType_72); //$NON-NLS-1$
- put("JOD",Messages.CurrencyCodeType_73); //$NON-NLS-1$
- put("JPY",Messages.CurrencyCodeType_74); //$NON-NLS-1$
- put("KES",Messages.CurrencyCodeType_75); //$NON-NLS-1$
- put("KGS",Messages.CurrencyCodeType_76); //$NON-NLS-1$
- put("KHR",Messages.CurrencyCodeType_77); //$NON-NLS-1$
- put("KMF",Messages.CurrencyCodeType_78); //$NON-NLS-1$
- put("KPW",Messages.CurrencyCodeType_79); //$NON-NLS-1$
- put("KRW",Messages.CurrencyCodeType_80); //$NON-NLS-1$
- put("KWD",Messages.CurrencyCodeType_81); //$NON-NLS-1$
- put("KYD",Messages.CurrencyCodeType_82); //$NON-NLS-1$
- put("KZT",Messages.CurrencyCodeType_83); //$NON-NLS-1$
- put("LAK",Messages.CurrencyCodeType_84); //$NON-NLS-1$
- put("LBP",Messages.CurrencyCodeType_85); //$NON-NLS-1$
- put("LKR",Messages.CurrencyCodeType_86); //$NON-NLS-1$
- put("LRD",Messages.CurrencyCodeType_87); //$NON-NLS-1$
- put("LSL",Messages.CurrencyCodeType_88); //$NON-NLS-1$
- put("LTL",Messages.CurrencyCodeType_89); //$NON-NLS-1$
- put("LVL",Messages.CurrencyCodeType_90); //$NON-NLS-1$
- put("LYD",Messages.CurrencyCodeType_91); //$NON-NLS-1$
- put("MAD",Messages.CurrencyCodeType_92); //$NON-NLS-1$
- put("MDL",Messages.CurrencyCodeType_93); //$NON-NLS-1$
- put("MGA",Messages.CurrencyCodeType_94); //$NON-NLS-1$
- put("MKD",Messages.CurrencyCodeType_95); //$NON-NLS-1$
- put("MMK",Messages.CurrencyCodeType_96); //$NON-NLS-1$
- put("MNT",Messages.CurrencyCodeType_97); //$NON-NLS-1$
- put("MOP",Messages.CurrencyCodeType_98); //$NON-NLS-1$
- put("MRO",Messages.CurrencyCodeType_99); //$NON-NLS-1$
- put("MTL",Messages.CurrencyCodeType_100); //$NON-NLS-1$
- put("MUR",Messages.CurrencyCodeType_101); //$NON-NLS-1$
- put("MVR",Messages.CurrencyCodeType_102); //$NON-NLS-1$
- put("MWK",Messages.CurrencyCodeType_103); //$NON-NLS-1$
- put("MXN",Messages.CurrencyCodeType_104); //$NON-NLS-1$
- put("MYR",Messages.CurrencyCodeType_105); //$NON-NLS-1$
- put("MZM",Messages.CurrencyCodeType_106); //$NON-NLS-1$
- put("NAD",Messages.CurrencyCodeType_107); //$NON-NLS-1$
- put("NGN",Messages.CurrencyCodeType_108); //$NON-NLS-1$
- put("NIO",Messages.CurrencyCodeType_109); //$NON-NLS-1$
- put("NOK",Messages.CurrencyCodeType_110); //$NON-NLS-1$
- put("NPR",Messages.CurrencyCodeType_111); //$NON-NLS-1$
- put("NZD",Messages.CurrencyCodeType_112); //$NON-NLS-1$
- put("OMR",Messages.CurrencyCodeType_113); //$NON-NLS-1$
- put("PAB",Messages.CurrencyCodeType_114); //$NON-NLS-1$
- put("PEN",Messages.CurrencyCodeType_115); //$NON-NLS-1$
- put("PGK",Messages.CurrencyCodeType_116); //$NON-NLS-1$
- put("PHP",Messages.CurrencyCodeType_117); //$NON-NLS-1$
- put("PKR",Messages.CurrencyCodeType_118); //$NON-NLS-1$
- put("PLN",Messages.CurrencyCodeType_119); //$NON-NLS-1$
- put("PYG",Messages.CurrencyCodeType_120); //$NON-NLS-1$
- put("QAR",Messages.CurrencyCodeType_121); //$NON-NLS-1$
- put("ROL",Messages.CurrencyCodeType_122); //$NON-NLS-1$
- put("RUB",Messages.CurrencyCodeType_123); //$NON-NLS-1$
- put("RWF",Messages.CurrencyCodeType_124); //$NON-NLS-1$
- put("SAR",Messages.CurrencyCodeType_125); //$NON-NLS-1$
- put("SBD",Messages.CurrencyCodeType_126); //$NON-NLS-1$
- put("SCR",Messages.CurrencyCodeType_127); //$NON-NLS-1$
- put("SDD",Messages.CurrencyCodeType_128); //$NON-NLS-1$
- put("SEK",Messages.CurrencyCodeType_129); //$NON-NLS-1$
- put("SGD",Messages.CurrencyCodeType_130); //$NON-NLS-1$
- put("SHP",Messages.CurrencyCodeType_131); //$NON-NLS-1$
- put("SIT",Messages.CurrencyCodeType_132); //$NON-NLS-1$
- put("SKK",Messages.CurrencyCodeType_133); //$NON-NLS-1$
- put("SLL",Messages.CurrencyCodeType_134); //$NON-NLS-1$
- put("SOS",Messages.CurrencyCodeType_135); //$NON-NLS-1$
- put("SPL",Messages.CurrencyCodeType_136); //$NON-NLS-1$
- put("SRD",Messages.CurrencyCodeType_137); //$NON-NLS-1$
- put("STD",Messages.CurrencyCodeType_138); //$NON-NLS-1$
- put("SVC",Messages.CurrencyCodeType_139); //$NON-NLS-1$
- put("SYP",Messages.CurrencyCodeType_140); //$NON-NLS-1$
- put("SZL",Messages.CurrencyCodeType_141); //$NON-NLS-1$
- put("THB",Messages.CurrencyCodeType_142); //$NON-NLS-1$
- put("TJS",Messages.CurrencyCodeType_143); //$NON-NLS-1$
- put("TMM",Messages.CurrencyCodeType_144); //$NON-NLS-1$
- put("TND",Messages.CurrencyCodeType_145); //$NON-NLS-1$
- put("TOP",Messages.CurrencyCodeType_146); //$NON-NLS-1$
- put("TRL",Messages.CurrencyCodeType_147); //$NON-NLS-1$
- put("TRY",Messages.CurrencyCodeType_148); //$NON-NLS-1$
- put("TTD",Messages.CurrencyCodeType_149); //$NON-NLS-1$
- put("TVD",Messages.CurrencyCodeType_150); //$NON-NLS-1$
- put("TWD",Messages.CurrencyCodeType_151); //$NON-NLS-1$
- put("TZS",Messages.CurrencyCodeType_152); //$NON-NLS-1$
- put("UAH",Messages.CurrencyCodeType_153); //$NON-NLS-1$
- put("UGX",Messages.CurrencyCodeType_154); //$NON-NLS-1$
- put("USD",Messages.CurrencyCodeType_155); //$NON-NLS-1$
- put("UYU",Messages.CurrencyCodeType_156); //$NON-NLS-1$
- put("UZS",Messages.CurrencyCodeType_157); //$NON-NLS-1$
- put("VEB",Messages.CurrencyCodeType_158); //$NON-NLS-1$
- put("VND",Messages.CurrencyCodeType_159); //$NON-NLS-1$
- put("VUV",Messages.CurrencyCodeType_160); //$NON-NLS-1$
- put("WST",Messages.CurrencyCodeType_161); //$NON-NLS-1$
- put("XAF",Messages.CurrencyCodeType_162); //$NON-NLS-1$
- put("XAG",Messages.CurrencyCodeType_163); //$NON-NLS-1$
- put("XAU",Messages.CurrencyCodeType_164); //$NON-NLS-1$
- put("XCD",Messages.CurrencyCodeType_165); //$NON-NLS-1$
- put("XDR",Messages.CurrencyCodeType_166); //$NON-NLS-1$
- put("XOF",Messages.CurrencyCodeType_167); //$NON-NLS-1$
- put("XPD",Messages.CurrencyCodeType_168); //$NON-NLS-1$
- put("XPF",Messages.CurrencyCodeType_169); //$NON-NLS-1$
- put("XPT",Messages.CurrencyCodeType_170); //$NON-NLS-1$
- put("YER",Messages.CurrencyCodeType_171); //$NON-NLS-1$
- put("ZAR",Messages.CurrencyCodeType_172); //$NON-NLS-1$
- put("ZMK",Messages.CurrencyCodeType_173); //$NON-NLS-1$
- put("ZWD",Messages.CurrencyCodeType_174); //$NON-NLS-1$
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/DateTimePatternType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/DateTimePatternType.java
deleted file mode 100644
index 5d06105..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/DateTimePatternType.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation., and others
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IDOMContextResolver;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.metadataprocessors.AbstractRootTypeDescriptor;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.PossibleValue;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.w3c.dom.Node;
-
-/**
- * Meta-data processing type representing a Date, Time and DateTime Pattern types.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- */
-
-public class DateTimePatternType extends AbstractRootTypeDescriptor implements IPossibleValues{
- //should we ever validate the patterns, extend EnumerationType
- final private static String[] DATEPATTERNS = {"M/d/yy", "EEE, M/d/yy", "MM/dd/yyyy", "EEE, MM/dd/yyyy", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- "MMM d, yyyy", "EEE, MMM d, yyyy", "MMMM d, yyyy", "EEEE, MMMM d, yyyy", "MMMM yyyy" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ };
- };
-
- final private static String[] TIMEPATTERNS = {"hh:mm", "hh:mm z", "HH:mm z", "HH:mm:ss z" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- };
-
- final private static String[] DATETIMEPATTERNS = {"M/d/yy hh:mm", "EEE, M/d/yy hh:mm", "MM/dd/yyyy HH:mm:ss z", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- "EEE, MM/dd/yyyy HH:mm:ss z", "MMM d, yyyy HH:mm z", "EEE, MMM d, yyyy HH:mm z", "MMMM d, yyyy HH:mm z", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- "EEEE, MMMM d, yyyy HH:mm z" //$NON-NLS-1$
- };
-
- public List getPossibleValues() {
- List ret = new ArrayList();
- String typeVal = getTypeValue();
- if ("date".equalsIgnoreCase(typeVal)){ //$NON-NLS-1$
- for (int i=0;i<DATEPATTERNS.length;i++){
- ret.add(new PossibleValue(DATEPATTERNS[i]));
- }
- }
- else if ("time".equalsIgnoreCase(typeVal)){ //$NON-NLS-1$
- for (int i=0;i<TIMEPATTERNS.length;i++){
- ret.add(new PossibleValue(TIMEPATTERNS[i]));
- }
- }
- else {
- for (int i=0;i<DATETIMEPATTERNS.length;i++){
- ret.add(new PossibleValue(DATETIMEPATTERNS[i]));
- }
- }
- return ret;
- }
-
- private String getTypeValue() {
- if (getStructuredDocumentContext() != null){
- IDOMContextResolver resolver = IStructuredDocumentContextResolverFactory.INSTANCE.getDOMContextResolver(getStructuredDocumentContext());
- if (resolver != null){
- Node aNode = resolver.getNode();
- if (aNode instanceof IDOMAttr) {
- Node tagNode = ((IDOMAttr)aNode).getOwnerElement();
- IDOMAttr typeNode = (IDOMAttr) tagNode.getAttributes().getNamedItem("type"); //$NON-NLS-1$
- if (typeNode != null)
- return typeNode.getValue();
- }
- }
- }
- return ""; //$NON-NLS-1$
- }
-
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/DirectBindingType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/DirectBindingType.java
deleted file mode 100644
index 2c5f7c0..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/DirectBindingType.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-/**
- * Abstract meta-data processing type
- *
- * <p><b>Provisional API - subject to change</b></p>
- * @author Gerry Kessler - Oracle
- */
-public abstract class DirectBindingType extends BindingType {
- // TODO: what is the point of this?
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/DoubleType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/DoubleType.java
deleted file mode 100644
index 0e73d4a..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/DoubleType.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-import java.util.List;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Meta-data processing type representing a "double" attribute value runtime type
- *
- * <p><b>Provisional API - subject to change</b></p>
- * @author Gerry Kessler - Oracle
- */
-public class DoubleType extends NumberType {
- private static final String INVALID_DOUBLE = Messages.DoubleType_invalid_double;
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.EnumerationType#getReturnType()
- */
- protected String getReturnType(){ return "double";} //$NON-NLS-1$
-
- /**
- * Type coercion according to JSP 2.0 spec: JSP.1.14.2.1 Conversions from String values
- * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidValues#isValidValue(java.lang.String)
- **/
- public boolean isValidValue(String value) {
- try {
- Double dbl = Double.valueOf(value);
- exceedsMaxValue(dbl.doubleValue());
- lessThanMinValue(dbl.doubleValue());
- if (!(minFound || maxFound)){
- List validVals = getMDValidValues();
- if (!validVals.isEmpty()){
- if (!validVals.contains(value)){
- addNewValidationMessage(Messages.DoubleType_invalid_member);//fix me
- }
- }
- }
- return getValidationMessages().isEmpty();
- } catch (NumberFormatException e) {
- addNewValidationMessage(INVALID_DOUBLE);
- return false;
- }
-
- }
-
- private void exceedsMaxValue(double dbl) {
- String strMax = getValidMaximumValue();
- if (strMax != null){
- try {
- double max = Double.valueOf(strMax).doubleValue();
- maxFound = true;
- if (dbl > max){
- addNewValidationMessage(NLS.bind(EXCEEDS_MAX, strMax));
- }
- } catch (NumberFormatException e) {
- //TODO: ignore error???? or log it????
- }
- }
-
- }
-
- private void lessThanMinValue(double dbl) {
- String strMin = getValidMinimumValue();
- if (strMin != null){
- try {
- double max = Double.valueOf(strMin).doubleValue();
- minFound = true;
- if (dbl < max){
- addNewValidationMessage(NLS.bind(LESS_THAN_MIN, strMin));
- }
- } catch (NumberFormatException e) {
- //TODO: ignore error???? or log it????
- }
- }
-
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/EnumerationType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/EnumerationType.java
deleted file mode 100644
index f92684f..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/EnumerationType.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- * Vadim Dmitriev
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jst.jsf.common.internal.types.CompositeType;
-import org.eclipse.jst.jsf.metadataprocessors.features.ELIsNotValidException;
-
-/**
- * Abstract meta-data processing type representing an enumeration attribute value runtime type
- * with a single signature
- *
- * @author Gerry Kessler - Oracle
- */
-public abstract class EnumerationType extends AbstractEnumerationType
-{
-
- /**
- * @return return Java type as string (i.e. boolean, java.lang.String, etc.)
- * Must not be null.
- */
- protected abstract String getReturnType();
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues#getExpectedRuntimeType()
- */
- public CompositeType getExpectedRuntimeType() throws ELIsNotValidException
- {
- String type = Signature.createTypeSignature(getReturnType(), true);
- return new CompositeType(type, getAssignmentType());
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ExpressionBindingType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ExpressionBindingType.java
deleted file mode 100644
index 1ae1d98..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ExpressionBindingType.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Abstract meta-data processing type representing an expression binding attribute value runtime type
- *
- * <p><b>Provisional API - subject to change</b></p>
- * @author Gerry Kessler - Oracle
- */
-public abstract class ExpressionBindingType extends BindingType {
- /**
- * Valid values is any fully qualified Java type or primitive.
- * Assign a value for each parameter in order
- */
- public static final String RUNTIME_PARAMS_TYPES = "runtime-param-types"; //$NON-NLS-1$
- /**
- * Valid values is any fully qualified Java type or primitive.
- */
- public static final String RUNTIME_RETURN_TYPE = "runtime-return-type"; //$NON-NLS-1$
- /**
- * Value should be set true or false. If not specified, the default inmplementation assumes false.
- */
- public static final String RUNTIME_SETTER_REQUIRED = "runtime-type-setter-required"; //$NON-NLS-1$
- private List validationMessages;
-
-
- /**
- * @return String value of the "runtime-return-type" trait
- */
- protected String getReturnType() {
- return getTraitValueAsString(RUNTIME_RETURN_TYPE);
- }
-
- /**
- * @return String[] value of the "runtime-param-types" trait
- */
- protected String[] getParams() {
- List params = getTraitValueAsListOfStrings(RUNTIME_PARAMS_TYPES);
-
- return (String[])params.toArray(new String[0]);
- }
-
- /**
- * @return lits of validation messages
- */
- public List getValidationMessages() {
- if (validationMessages == null){
- validationMessages = new ArrayList();
- }
- return validationMessages;
- }
-
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/FacesConfigConverterIDFeatures.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/FacesConfigConverterIDFeatures.java
deleted file mode 100644
index 79b1c5b..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/FacesConfigConverterIDFeatures.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigManager;
-import org.eclipse.jst.jsf.facesconfig.emf.ConverterType;
-import org.eclipse.jst.jsf.metadataprocessors.features.PossibleValue;
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Meta-data processing feature representing an attribute value requiring a "converterid"
- *
- * <p><b>Provisional API - subject to change</b></p>
- * @author Gerry Kessler - Oracle
- */
-public class FacesConfigConverterIDFeatures extends FacesConfigIdentifierFeatures {
-
- /**
- * Faces converter classname
- */
- protected static final String CONVERTER = "javax.faces.convert.Converter"; //$NON-NLS-1$
- /**
- * Imagename to use when displaying converter
- */
- protected static final String IMAGE_NAME = "/icons/full/obj16/FacesConfig_Converter.gif"; //$NON-NLS-1$
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.FacesConfigIdentifierFeatures#getElements(org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigManager)
- */
- protected List getElements(JSFAppConfigManager mgr) {
- if (mgr != null)
- return mgr.getConverters();
- return new ArrayList(0);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.FacesConfigIdentifierFeatures#getReturnType()
- */
- protected String getReturnType(){ return CONVERTER;}
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.FacesConfigIdentifierFeatures#getPossibleValueProposals(java.util.List)
- */
- protected List getPossibleValueProposals(List elements) {
- List ret = new ArrayList();
- Collections.sort(elements, new ConverterSorter());
- for (Iterator it = elements.iterator();it.hasNext();){
- ConverterType obj = (ConverterType)it.next();
- if (obj.getConverterId() != null && obj.getConverterId().getTextContent() != null){
- PossibleValue pv = createProposal(obj.getConverterId().getTextContent(), obj.getDisplayName(), obj.getDescription());
- if (pv != null){
- pv.setIcon(getImage());
- ret.add(pv);
- }
- }
- }
- return ret;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.FacesConfigIdentifierFeatures#getImageName()
- */
- protected String getImageName() {
- return IMAGE_NAME;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.FacesConfigIdentifierFeatures#getMyValidationMessage(java.lang.String)
- */
- protected String getMyValidationMessage(String value) {
- if (value == null || value.trim().equals("")) //$NON-NLS-1$
- return Messages.FacesConfigConverterIDFeatures_converterid_empty;
-
- return NLS.bind(Messages.FacesConfigIdentifierType_invalid_converter_id, new String[]{singleQuote(value)});
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.FacesConfigIdentifierFeatures#getElementIDs(org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigManager)
- */
- protected List getElementIDs(JSFAppConfigManager mgr) {
- List elements = getElements(mgr);
- List ret = new ArrayList(elements.size());
- for (Iterator it = elements.iterator();it.hasNext();){
- ConverterType aType = (ConverterType)it.next();
- if (aType.getConverterId() != null && aType.getConverterId().getTextContent() != null){
- String id = aType.getConverterId().getTextContent();
- if (id != null)
- ret.add(id.trim());
- }
- }
- return ret;
- }
-
- /**
- *
- * Converter ID Sorter - incomplete
- */
- private static class ConverterSorter implements Comparator, Serializable {
- /**
- *
- */
- private static final long serialVersionUID = 5255291244511783735L;
-
- public int compare(Object o1, Object o2) {
- //TODO
- return 0;
-
- }
-
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/FacesConfigConverterIDType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/FacesConfigConverterIDType.java
deleted file mode 100644
index 3e81d04..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/FacesConfigConverterIDType.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-/**
- * Type representing a FacesConfig Converter attribute
- *
- * <p><b>Provisional API - subject to change</b></p>
- */
-public class FacesConfigConverterIDType extends FacesConfigIdentifierType {
- // FIXME: why do we have an empty class?
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/FacesConfigIdentifierFeatures.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/FacesConfigIdentifierFeatures.java
deleted file mode 100644
index b22f4d1..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/FacesConfigIdentifierFeatures.java
+++ /dev/null
@@ -1,305 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jst.jsf.common.internal.types.CompositeType;
-import org.eclipse.jst.jsf.common.internal.types.IAssignable;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IWorkspaceContextResolver;
-import org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigManager;
-import org.eclipse.jst.jsf.facesconfig.FacesConfigPlugin;
-import org.eclipse.jst.jsf.facesconfig.emf.DescriptionType;
-import org.eclipse.jst.jsf.facesconfig.emf.DisplayNameType;
-import org.eclipse.jst.jsf.metadataprocessors.AbstractMetaDataEnabledFeature;
-import org.eclipse.jst.jsf.metadataprocessors.features.ELIsNotValidException;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidationMessage;
-import org.eclipse.jst.jsf.metadataprocessors.features.PossibleValue;
-import org.eclipse.jst.jsf.metadataprocessors.features.ValidationMessage;
-import org.osgi.framework.Bundle;
-
-/**
- * Abstract meta-data processing feature representing a faces-config type
- *
- * <p><b>Provisional API - subject to change</b></p>
- * @author Gerry Kessler - Oracle
- */
-public abstract class FacesConfigIdentifierFeatures extends AbstractMetaDataEnabledFeature
- implements IPossibleValues, IValidValues, IValidELValues{
-
- /**
- * Meta-data property name to use for identifying the faces-config type
- *
- * see jsf_core.xml converterID and validatorID attributes
- */
- public static final String ID_TYPE_PROP_NAME = "config-type"; //$NON-NLS-1$
-
- /**
- * Missing image descriptor
- */
- protected static final ImageDescriptor MISSING_IMAGE = ImageDescriptor.getMissingImageDescriptor();
-
- /**
- * Name of image file to use with content assist proposals
- */
- protected String imageName;
- private ImageDescriptor imageDescriptor;
- /**
- * Validation messages to return
- */
- protected List validationMessages;
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues#getPossibleValues()
- */
- public List getPossibleValues() {
- List ret = new ArrayList();
- List idTypes = getConfigTypes();
-
- if (idTypes != null){
- for (int i=0;i<idTypes.size();i++){
- //verify this feature can deal with this type
- if (getReturnType().equals(idTypes.get(i))){
- ret.addAll(createPossibleValues());
- }
- }
- }
-
- return ret;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidValues#isValidValue(java.lang.String)
- */
- public boolean isValidValue(String value) {
- List idTypes = getConfigTypes();
- if (idTypes != null){
- for (int i=0;i<idTypes.size();i++){
- if (getReturnType().equals(idTypes.get(i))){
- if (hasValue(getElementIDs(getJSFAppConfigMgr()), value)){
- getValidationMessages().clear();
- return true;
- }
- getValidationMessages().add(getValidationMessage(value));
- }
- }
- }
- return false;
- }
-
- private boolean hasValue(List elements, String value) {
- for (Iterator it=elements.iterator();it.hasNext();){
- if (value.equals(it.next()))
- return true;
- }
- return false;
- }
-
- /**
- * @param value of the attribute
- * @return the validation message String
- */
- protected abstract String getMyValidationMessage(String value);
-
- /**
- * Creates an IValidationMessage
- * @param value
- * @return IValidationMessage
- */
- protected IValidationMessage getValidationMessage(String value) {
- String msg;
- msg = getCMValidationMessage();
- if (msg == null){
- msg = getMyValidationMessage(value);
- }
- String code = getCMValidationCode();
- int severity = getCMValidationSeverity();
-
- IValidationMessage valMsg = new ValidationMessage(msg, code, severity);
- return valMsg;
- }
-
- /**
- *
- * @param value
- * @return single-quoted value
- */
- protected String singleQuote(String value){
- return "'" + value+"'"; //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidValues#getValidationMessages()
- */
- public List getValidationMessages(){
- if (validationMessages == null){
- validationMessages = new ArrayList();
- }
- return validationMessages;
- }
-
- /**
- * @param jsfAppConfigManager
- * @return list of faces-config element for the specified config-type
- */
- protected abstract List getElements(JSFAppConfigManager jsfAppConfigManager);
- /**
- * @param elements
- * @return list of IPossibleValue objects for the specified list of config elements
- */
- protected abstract List getPossibleValueProposals(List elements);
- /**
- * @return image name relative to the FacesConfigEditPlugin where the images are stored
- */
- protected abstract String getImageName();
-
- private List createPossibleValues() {
- return getPossibleValueProposals(getElements(getJSFAppConfigMgr()));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.metadataprocessors.AbstractMetaDataEnabledFeature#getImage()
- */
- protected ImageDescriptor getImage() {
- ImageDescriptor ret = super.getImage();
- if (ret != null && ret != MISSING_IMAGE)
- return ret;
-
- if (imageDescriptor == null){
- imageDescriptor = getImageDesc(getImageName());
- }
- return imageDescriptor;
-
- }
-
- //return FacesConfigPlugin relative image descriptor
- private ImageDescriptor getImageDesc(String img) {
- Bundle bundle = FacesConfigPlugin.getPlugin().getBundle();
- URL url = FileLocator.find(bundle, new Path(img), null);
- ImageDescriptor desc = ImageDescriptor.createFromURL(url);
- if (desc == MISSING_IMAGE){
- return null;
- }
- return desc;
- }
-
- /**
- * @param value
- * @param displayName
- * @param description
- * @return PossibleValue object
- */
- protected PossibleValue createProposal(String value, EList displayName, EList description) {
- String display = value;
- if (displayName.size() > 0) {
- DisplayNameType displayNameType= (DisplayNameType) displayName.get(0);
- display = displayNameType.getTextContent();
- }
- String desc = null;
- if (description.size() > 0) {
- DescriptionType descType= (DescriptionType) description.get(0);
- desc = descType.getTextContent();
- }
- PossibleValue pv = new PossibleValue(value, display);
- if (desc != null)
- pv.setAdditionalInformation(desc);
-
- return pv;
-
- }
-
- private List getConfigTypes() {
- return getTraitValueAsListOfStrings(ID_TYPE_PROP_NAME);
-
-// return CMAnnotationHelper.getCMAttributePropertyValues(getMetaDataContext().getBundleId(),
-// getMetaDataContext().getUri(), getMetaDataContext().getElementName(),
-// getMetaDataContext().getAttributeName(), ID_TYPE_PROP_NAME);
- }
-
- private JSFAppConfigManager getJSFAppConfigMgr(){
- return JSFAppConfigManager.getInstance(getProject());
- }
-
- private IProject getProject() {
- IWorkspaceContextResolver resolver = IStructuredDocumentContextResolverFactory.INSTANCE.getWorkspaceContextResolver(getStructuredDocumentContext());
- if (resolver != null)
- return resolver.getProject();
-
- return null;
- }
-
- /**
- * @param jsfAppConfigManager
- * @return list of identifier Strings for config-type
- */
- protected abstract List getElementIDs(JSFAppConfigManager jsfAppConfigManager);
-
- /**
- * @return the config-type
- */
- protected abstract String getReturnType();
- /**
- * @return int value of {@link IAssignable}.ASSIGNMENT_TYPE_RHS & {@link IAssignable}.ASSIGNMENT_TYPE_LHS
- */
- protected int getAssignmentType(){
- //TODO: fix me to get from meta-data(?)
- return IAssignable.ASSIGNMENT_TYPE_RHS & IAssignable.ASSIGNMENT_TYPE_LHS;
- }
- public CompositeType getExpectedRuntimeType() throws ELIsNotValidException {
- String type = Signature.createTypeSignature(getReturnType(), true);
- return new CompositeType(type, getAssignmentType());
- }
-
- /**
- * @return String value of {@link IValidValues}.VALID_VALUES_MESSAGE_PROP_NAME trait
- */
- protected String getCMValidationMessage() {
- //TODO: Standard Validation stuff - should be moved somewhere else
- return getTraitValueAsString(IValidValues.VALID_VALUES_MESSAGE_PROP_NAME);
- }
-
- /**
- * @return int value of {@link IValidValues}.VALID_VALUES_SEVERITY_PROP_NAME trait
- */
- protected int getCMValidationSeverity() {
- String val = getTraitValueAsString(IValidValues.VALID_VALUES_SEVERITY_PROP_NAME);
- if (val == null)
- return IStatus.WARNING;
-
- int severity = Integer.valueOf(val).intValue();
- return severity;
- }
-
- /**
- * @return String value of {@link IValidValues}.VALID_VALUES_CODE_PROP_NAME trait
- */
- protected String getCMValidationCode() {
- return getTraitValueAsString(IValidValues.VALID_VALUES_CODE_PROP_NAME);
- }
-
-}
-
-
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/FacesConfigIdentifierType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/FacesConfigIdentifierType.java
deleted file mode 100644
index 5ac934d..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/FacesConfigIdentifierType.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-/**
- * Meta-data processing type representing a faces-config type
- *
- * <p><b>Provisional API - subject to change</b></p>
- * @author Gerry Kessler - Oracle
- */
-public abstract class FacesConfigIdentifierType extends IdentifierType {
- // FIXME: why do we have an empty class?
-}
-
-
-
-
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/FacesConfigValidatorIDFeatures.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/FacesConfigValidatorIDFeatures.java
deleted file mode 100644
index 2a2711a..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/FacesConfigValidatorIDFeatures.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigManager;
-import org.eclipse.jst.jsf.facesconfig.emf.ValidatorType;
-import org.eclipse.jst.jsf.metadataprocessors.features.PossibleValue;
-import org.eclipse.osgi.util.NLS;
-
-/**
- * ValidatorID attribute feature
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- */
-public class FacesConfigValidatorIDFeatures extends FacesConfigIdentifierFeatures {
-
- /**
- * Faces validator classname
- */
- protected static final String VALIDATOR = "javax.faces.validator.Validator"; //$NON-NLS-1$
- /**
- * Imagename to use when displaying validator
- */
- protected static final String IMAGE_NAME = "/icons/full/obj16/FacesConfig_Validator.gif"; //$NON-NLS-1$
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.FacesConfigIdentifierFeatures#getReturnType()
- */
- protected String getReturnType(){ return VALIDATOR;}
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.FacesConfigIdentifierFeatures#getElements(org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigManager)
- */
- protected List getElements(JSFAppConfigManager mgr) {
- if (mgr != null)
- return mgr.getValidators();
- return new ArrayList(0);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.FacesConfigIdentifierFeatures#getPossibleValueProposals(java.util.List)
- */
- protected List getPossibleValueProposals(List elements) {
- List ret = new ArrayList();
- Collections.sort(elements, new ValidatorSorter());
- for (Iterator it = elements.iterator();it.hasNext();){
- ValidatorType obj = (ValidatorType)it.next();
- if (obj.getValidatorId() != null && obj.getValidatorId().getTextContent() != null){
- PossibleValue pv = createProposal(obj.getValidatorId().getTextContent(), obj.getDisplayName(), obj.getDescription());
- if (pv != null){
- pv.setIcon(getImage());
- ret.add(pv);
- }
- }
- }
- return ret;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.FacesConfigIdentifierFeatures#getImageName()
- */
- protected String getImageName() {
- return IMAGE_NAME;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.FacesConfigIdentifierFeatures#getMyValidationMessage(java.lang.String)
- */
- protected String getMyValidationMessage(String value) {
- if (value == null || value.trim().equals("")) //$NON-NLS-1$
- return Messages.FacesConfigValidatorIDFeatures_validatorid_empty;
-
- return NLS.bind(Messages.FacesConfigIdentifierType_invalid_validator_id, new String[]{singleQuote(value)});
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.FacesConfigIdentifierFeatures#getElementIDs(org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigManager)
- */
- protected List getElementIDs(JSFAppConfigManager mgr) {
- List elements = getElements(mgr);
- List ret = new ArrayList(elements.size());
- for (Iterator it = elements.iterator();it.hasNext();){
- ValidatorType aType = (ValidatorType)it.next();
- if (aType.getValidatorId() != null && aType.getValidatorId().getTextContent() != null){
- String id = aType.getValidatorId().getTextContent();
- if (id != null)
- ret.add(id.trim());
- }
- }
- return ret;
- }
-
- /**
- * Validator id sorter - incomplete
- */
- private static class ValidatorSorter implements Comparator, Serializable {
- /**
- *
- */
- private static final long serialVersionUID = -398026037193914126L;
-
- public int compare(Object o1, Object o2) {
- //TODO
- return 0;
-
- }
-
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/FacesConfigValidatorIDType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/FacesConfigValidatorIDType.java
deleted file mode 100644
index 65f0504..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/FacesConfigValidatorIDType.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-/**
- * Type representing a FacesConfig Validator attribute
- *
- * <p><b>Provisional API - subject to change</b></p>
- */
-public class FacesConfigValidatorIDType extends FacesConfigIdentifierType {
- // FIXME: why do we have an empty class?
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/IdentifierType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/IdentifierType.java
deleted file mode 100644
index 134e23d..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/IdentifierType.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-/**
- * Abstract meta-data processing type representing an identifier binding type
- *
- * <p><b>Provisional API - subject to change</b></p>
- * @author Gerry Kessler - Oracle
- */
-public abstract class IdentifierType extends DirectBindingType {
- // TODO: parent is already abstract; what's the point?
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/IntegerType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/IntegerType.java
deleted file mode 100644
index 6fcbdb7..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/IntegerType.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-import java.util.List;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Meta-data processing type representing an integer attribute value runtime type
- * that implements IValidValues, IDefaultValue, IValidELValues
- *
- * <p><b>Provisional API - subject to change</b></p>
- * @author Gerry Kessler - Oracle
- */
-public class IntegerType extends NumberType {
- private static final String INVALID_INTEGER = Messages.IntegerType_invalid_integer;
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.EnumerationType#getReturnType()
- */
- protected String getReturnType(){ return "int";} //$NON-NLS-1$
-
- /**
- * Type coercion according to JSP 2.0 spec: JSP.1.14.2.1 Conversions from String values
- * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidValues#isValidValue(java.lang.String)
- **/
- public boolean isValidValue(String value) {
- try {
- Integer anInt = Integer.valueOf(value);
- exceedsMaxValue(anInt.intValue());
- lessThanMinValue(anInt.intValue());
- if (!(minFound || maxFound)){
- List validVals = getMDValidValues();
- if (!validVals.isEmpty()){
- if (!validVals.contains(value)){
- addNewValidationMessage(Messages.IntegerType_invalid_member);//fix me
- }
- }
- }
- return getValidationMessages().isEmpty();
- } catch (NumberFormatException e) {
- addNewValidationMessage(INVALID_INTEGER);
- return false;
- }
-
- }
-
- private void exceedsMaxValue(int anInt) {
- String strMax = getValidMaximumValue();
- if (strMax != null){
- try {
- int max = Integer.valueOf(strMax).intValue();
- maxFound = true;
- if (anInt > max){
- addNewValidationMessage(NLS.bind(EXCEEDS_MAX, strMax));
- }
- } catch (NumberFormatException e) {
- //TODO: ignore error???? or log it????
- }
- }
-
- }
-
- private void lessThanMinValue(int anInt) {
- String strMin = getValidMinimumValue();
- if (strMin != null){
- try {
- int max = Integer.valueOf(strMin).intValue();
- minFound = true;
- if (anInt < max){
- addNewValidationMessage(NLS.bind(LESS_THAN_MIN, strMin));
- }
- } catch (NumberFormatException e) {
- //TODO: ignore error???? or log it????
- }
- }
-
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/JavaClassType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/JavaClassType.java
deleted file mode 100644
index 912c818..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/JavaClassType.java
+++ /dev/null
@@ -1,498 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jdt.core.Flags;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.ITypeHierarchy;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.search.IJavaSearchConstants;
-import org.eclipse.jdt.core.search.IJavaSearchScope;
-import org.eclipse.jdt.core.search.SearchEngine;
-import org.eclipse.jdt.core.search.SearchMatch;
-import org.eclipse.jdt.core.search.SearchParticipant;
-import org.eclipse.jdt.core.search.SearchPattern;
-import org.eclipse.jdt.core.search.SearchRequestor;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IWorkspaceContextResolver;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.PossibleValue;
-import org.eclipse.jst.jsf.metadataprocessors.features.ValidationMessage;
-
-/**
- * Provides possible values and validates attribute values that should be fully qualified Java types.
- * A type can be verified against multiple "valid-interfaces" and/or a "valid-superclass" from meta-data.
- * Code checks to ensure the class can be instantiated (i.e. not abstract, anonymous or inner class)
- * Search is scoped to within the current project only.
- *
- * (Until https://bugs.eclipse.org/bugs/show_bug.cgi?id=142044 is fixed, only the first found will be used)
- *
- * <p><b>Provisional API - subject to change</b></p>
- * @author Gerry Kessler - Oracle
- *
- */
-public class JavaClassType extends ObjectType implements IPossibleValues, IValidValues{
- /**
- * Trait name for valid interfaces
- */
- public static final String POSSIBLE_VALUES_INTERFACES_PROP_NAME = "valid-interfaces"; //$NON-NLS-1$
- /**
- * Trait name for valid superclass
- */
- public static final String POSSIBLE_VALUES_SUPERCLASS_PROP_NAME = "valid-superclass"; //$NON-NLS-1$
-
- private List validationMsgs;
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues#getPossibleValues()
- */
- public List getPossibleValues() {
- List results = getTypes();
- if (results != null && !results.isEmpty()){
-
- Set vals = new HashSet(results.size());
- Set checkedTypes = new HashSet();
- for (Iterator it = results.iterator();it.hasNext();){
- SearchMatch match = (SearchMatch)it.next();
- IType res = (IType)match.getElement();
- addValidSubClasses(res, vals, checkedTypes);
- }
- return createPossibleValues(vals);
- }
- return new ArrayList(0);
- }
-
- private List createPossibleValues(Set vals) {
- List list = new ArrayList(vals.size());
- Iterator it = vals.iterator();
- while(it.hasNext()){
- IJavaElement elem = (IJavaElement)it.next();
- list.add(createPossibleValue(elem));
- }
- return list;
- }
-
- private void addValidSubClasses(IType res, Set vals, Set checkedTypes) {
-
- try {
- //check to see if we have already checked the hiearchy
- if (checkedTypes.contains(res))
- return;
-
- //should we add itself?
- if (isInnerOrAnonymousClass(res))
- return;
- if (!isAbstractClass(res))
- vals.add(res); //since it is a set, dupes will not be added
-
-
- ITypeHierarchy hierarchy = res.newTypeHierarchy(getJavaProject(), null);
- IType[] subclasses = hierarchy.getSubclasses(res);
- checkedTypes.add(res);
- for (int i=0;i<subclasses.length;i++){
- addValidSubClasses(subclasses[i], vals, checkedTypes);
- }
- } catch (JavaModelException e) {
- //ignore
- }
- }
-
- private IWorkspaceContextResolver getWorkspaceContextResolver(){
- if (getStructuredDocumentContext() == null)
- return null;
-
- return IStructuredDocumentContextResolverFactory.INSTANCE.getWorkspaceContextResolver(getStructuredDocumentContext());
- }
-
- private List getTypes(){
- IJavaProject jp = getJavaProject();
- if (jp == null)
- return null;
-
- List elems = new ArrayList();
- elems.addAll(getInterfaces(jp));
- IType sc = getSuperClass(jp);
- if (sc != null)
- elems.add(sc);
-
- if (elems.size() > 0){
- SearchRequestor requestor = new Searcher();
- SearchEngine engine = new SearchEngine();
-
- IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[]{jp});//, IJavaSearchScope.SOURCES | IJavaSearchScope.APPLICATION_LIBRARIES | IJavaSearchScope.);
- SearchPattern combined = SearchPattern.createPattern((IJavaElement)elems.get(0), IJavaSearchConstants.IMPLEMENTORS, 0);
-
-// Until this bug is fixed, stub it out... only the first interface/superclass will be used.
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=142044
-// for(int i=1;i<elems.size();i++){
-// final SearchPattern other = SearchPattern.createPattern((IJavaElement)elems.get(i), IJavaSearchConstants.IMPLEMENTORS, 0);
-// combined = SearchPattern.createAndPattern(combined, other);
-// }
-
- try {
- engine.search(combined, new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()}, scope, requestor, null);
-
- } catch (CoreException e) {
- //ignore
- }
-
- return ((Searcher)requestor).getResults();
- }
-
- return Collections.EMPTY_LIST;
- }
-
- private IJavaProject getJavaProject() {
- IWorkspaceContextResolver resolver = getWorkspaceContextResolver();
- if (resolver != null){
- IProject proj = resolver.getProject();
- if (proj != null)
- return JavaCore.create(proj);
- }
- return null;
- }
-
- private List getInterfaces(IJavaProject jp) {
- List ret = new ArrayList();
- List propVals = getInterfaceNames();
-
- for (Iterator it = propVals.iterator();it.hasNext();){
- String propVal = (String)it.next();
- IType interfase = null;
- try {
- interfase = findType(jp, propVal);
- if (interfase != null){
- ret.add(interfase);
- }
- } catch (JavaModelException e) {
- // suppress and fall-through to return empty list
- }
-
- }
- return ret;
- }
-
- private IType getSuperClass(IJavaProject jp){
- IType superclass = null;
- try {
- String sc = getSuperClassName();
- if (sc != null && !sc.trim().equals("")){ //$NON-NLS-1$
- superclass = findType(jp, sc );
- if (superclass != null){
- return superclass;
- }
- }
- } catch (JavaModelException e) {
- //ignore
- }
- return null;
- }
-
- private PossibleValue createPossibleValue(IJavaElement val) {
- return new PossibleValue(((IType)val).getFullyQualifiedName());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidValues#getValidationMessages()
- */
- public List getValidationMessages() {
- if (validationMsgs == null){
- validationMsgs = new ArrayList();
- }
- return validationMsgs;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidValues#isValidValue(java.lang.String)
- */
- public boolean isValidValue(String value) {
- if (value == null || value.trim().equals("")){ //$NON-NLS-1$
- getValidationMessages().add(new ValidationMessage(Messages.JavaClassType_invalid_type));
- return false;
- }
- IJavaProject jp = getJavaProject();
- if (jp == null)
- return false;
-
- //first verify that the value specified is a resolvable type
- IType type = getTypeForValue(jp, value);
- if (type != null){
- //ensure that it is not abstract or anonymous
- if (!isInnerOrAnonymousClass(type) && !isAbstractClass(type)){
- //now verify that it meets the criteria
- ITypeHierarchy hierarchy;
- try {
- hierarchy = type.newTypeHierarchy(jp, null);
- } catch (JavaModelException e) {
- return false;
- }
-
- //check that all interfaces
- List<String> interfaceNames = getInterfaceNames();
- for (Iterator<String> it=interfaceNames.iterator();it.hasNext();){
- //check that all interfaces are satisfied by type
- IType interfase = getTypeForValue(jp, it.next());
- if (interfase == null){
- addNewValidationMessage(Messages.JavaClassType_not_found);
- return false;
- }
- else if (! containsType(hierarchy.getAllSupertypes(type), interfase)){
- addNewValidationMessage(Messages.JavaClassType_not_found);
- return false;
- }
- }
- //interfaces have been satisfied now check the superclass if specified
- IType superClass = getSuperClass(jp);
- if (superClass != null && superClass.equals(type))
- return true;
- else if (superClass != null && !containsType(hierarchy.getAllSuperclasses(type), superClass )){
- addNewValidationMessage(Messages.JavaClassType_not_found);
- return false;
- }
- return true;
-// List results = getTypes();
-// if (!results.isEmpty()){
-// for (Iterator it = results.iterator();it.hasNext();){
-// SearchMatch match = (SearchMatch)it.next();
-// IType res = (IType)match.getElement();
-// if (!isInnerOrAnonymousClass(res) ){
-// //if this is the class, then optimize to reduce expense of creating hierarchy
-// if (!isAbstractClass(type) && (res.getFullyQualifiedName().equals(value)) )
-// return true;
-// //check to see if value is a subtype in the hierarchy
-// try {
-// ITypeHierarchy hierarchy = res.newTypeHierarchy(jp, null);
-// if (containsType(hierarchy.getAllSubtypes(res), type))
-// return true;
-//
-// } catch (JavaModelException e) {
-// //ignore
-// }
-// }
-// }
-// }
- }
- }
- addNewValidationMessage(Messages.JavaClassType_not_found);
- return false;
- }
-
- private boolean containsType(IType[] types, IType type) {
- for (int i=0;i < types.length;i++) {
- if (type.equals(types[i]))
- return true;
- }
- return false;
- }
-
- private IType getTypeForValue(IJavaProject jp, String value) {
- try {
- return findType(jp, value);
- } catch (JavaModelException e) {
- // suppress and fall through to return null
- }
- return null;
- }
-
- /**
- * @return String value of {@link #POSSIBLE_VALUES_SUPERCLASS_PROP_NAME}
- */
- protected String getSuperClassName(){
- return getTraitValueAsString(POSSIBLE_VALUES_SUPERCLASS_PROP_NAME);
-// return CMAnnotationHelper.getCMAttributePropertyValue(getMetaDataContext().getBundleId(), getMetaDataContext().getUri(),
-// getMetaDataContext().getElementName(), getMetaDataContext().getAttributeName(),
-// POSSIBLE_VALUES_SUPERCLASS_PROP_NAME);
-
- }
-
- /**
- * @return List of values from {@link #POSSIBLE_VALUES_INTERFACES_PROP_NAME}
- */
- protected List getInterfaceNames(){
- return getTraitValueAsListOfStrings(POSSIBLE_VALUES_INTERFACES_PROP_NAME);
-
-// return CMAnnotationHelper.getCMAttributePropertyValues(getMetaDataContext().getBundleId(), getMetaDataContext().getUri(),
-// getMetaDataContext().getElementName(), getMetaDataContext().getAttributeName(),
-// POSSIBLE_VALUES_INTERFACES_PROP_NAME);
-
- }
-
- /**
- * Create a {@link ValidationMessage} from metadata or use default message
- * and add it to the collection of validation messages
- * @param defaultMsg
- */
- protected void addNewValidationMessage(String defaultMsg) {
- //TODO: need to refactor below as this as also in Enumeration
- String msg = getCMValidationMessage();
- if (msg == null || msg.equals("")) //$NON-NLS-1$
- msg = defaultMsg;
-
- String code = getValidationCode();
- int severity = getValidationSeverity();
- ValidationMessage val = new ValidationMessage(msg, code, severity);
- getValidationMessages().add(val);
- }
-
-
- /**
- * @return validation message from meta-data using {@link IValidValues}.VALID_VALUES_MESSAGE_PROP_NAME trait. Can be null.
- */
- protected String getCMValidationMessage() {
- return getTraitValueAsString(IValidValues.VALID_VALUES_MESSAGE_PROP_NAME);
- }
-
- /**
- * @return validation severity as int from meta-data using {@link IValidValues}.VALID_VALUES_SEVERITY_PROP_NAME trait. IStatus.WARNING is default.
- */
- protected int getValidationSeverity() {
- String val = getTraitValueAsString(IValidValues.VALID_VALUES_SEVERITY_PROP_NAME);
- if (val == null)
- return IStatus.WARNING;
-
- int severity = Integer.valueOf(val).intValue();
- return severity;
- }
-
- /**
- * @return validation code as String from meta-data. Can be null.
- */
- protected String getValidationCode() {
- return getTraitValueAsString(IValidValues.VALID_VALUES_CODE_PROP_NAME);
- }
-
- private boolean isInnerOrAnonymousClass(IType res) {
- try {
- if (res.isClass() && (res.isAnonymous() ||
- (Flags.isPrivate(res.getFlags())) ||
- res.getFullyQualifiedName().indexOf("$") > 0)) //must be better way to discover if it is an inner class //$NON-NLS-1$
- return true;
- } catch (JavaModelException e) {
- //ignore
- }
- return false;
- }
-
-
- private boolean isAbstractClass(IType res) {
- try {
- if (res.isClass() && Flags.isAbstract(res.getFlags()))
- return true;
- } catch (JavaModelException e) {
- //ignore
- }
- return false;
- }
-
- private static class Searcher extends SearchRequestor{
- private List results = new ArrayList();
- public void acceptSearchMatch(SearchMatch match) throws CoreException {
- results.add(match);
- }
-
- /**
- * @return list of serach results
- */
- public List getResults(){
- return results;
- }
- }
-
-///////////////// ///////////////////////////////////////////////////////////////////////
-//remainder of this class copied from org.eclipse.jdt.internal.corext.util.JavaCoreUtil //
-//TODO: find public version of this functionality //
-//////////////////////////////////////////////////////////////////////////////////////////
- private IType findType(IJavaProject jproject, String fullyQualifiedName) throws JavaModelException {
- //workaround for bug 22883
- IType type= jproject.findType(fullyQualifiedName);
- if (type != null)
- return type;
-
- IPackageFragmentRoot[] roots= jproject.getPackageFragmentRoots();
- for (int i= 0; i < roots.length; i++) {
- IPackageFragmentRoot root= roots[i];
- type= findType(root, fullyQualifiedName);
- if (type != null && type.exists())
- return type;
- }
- return null;
- }
-
- private IType findType(IPackageFragmentRoot root, String fullyQualifiedName) throws JavaModelException{
- IJavaElement[] children= root.getChildren();
- for (int i= 0; i < children.length; i++) {
- IJavaElement element= children[i];
- if (element.getElementType() == IJavaElement.PACKAGE_FRAGMENT){
- IPackageFragment pack= (IPackageFragment)element;
- if (! fullyQualifiedName.startsWith(pack.getElementName()))
- continue;
- IType type= findType(pack, fullyQualifiedName);
- if (type != null && type.exists())
- return type;
- }
- }
- return null;
- }
-
- private IType findType(IPackageFragment pack, String fullyQualifiedName) throws JavaModelException{
- ICompilationUnit[] cus= pack.getCompilationUnits();
- for (int i= 0; i < cus.length; i++) {
- ICompilationUnit unit= cus[i];
- IType type= findType(unit, fullyQualifiedName);
- if (type != null && type.exists())
- return type;
- }
- return null;
- }
-
- private IType findType(ICompilationUnit cu, String fullyQualifiedName) throws JavaModelException{
- IType[] types= cu.getAllTypes();
- for (int i= 0; i < types.length; i++) {
- IType type= types[i];
- if (getFullyQualifiedName(type).equals(fullyQualifiedName))
- return type;
- }
- return null;
- }
-
- private String getFullyQualifiedName(IType type) {
- try {
- if (type.isBinary() && !type.isAnonymous()) {
- IType declaringType= type.getDeclaringType();
- if (declaringType != null) {
- return getFullyQualifiedName(declaringType) + '.' + type.getElementName();
- }
- }
- } catch (JavaModelException e) {
- // ignore
- }
- return type.getFullyQualifiedName('.');
- }
-////////////////////////////////////////////////////////////////////////
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/LanguageCodeType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/LanguageCodeType.java
deleted file mode 100644
index 102df5a..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/LanguageCodeType.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation., and others
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.PossibleValue;
-
-/**
- * Meta-data processing type representing a Language Code type.
- * A Language code is defined as in html spec http://www.w3.org/TR/html4/types.html#h-6.8
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- */
-
-public class LanguageCodeType extends EnumerationType implements IPossibleValues {
- private static final LanguageCodeMap _map = new LanguageCodeMap();
-
- @Override
- protected String getReturnType() {
- return "java.lang.String"; //$NON-NLS-1$
- }
-
- public List getPossibleValues() {
- List ret = new ArrayList();
- for(Iterator it = _map.keySet().iterator();it.hasNext();){
- String key = (String)it.next();
- String value = _map.get(key);
- PossibleValue pv = new PossibleValue(key, value);
- ret.add(pv);
- }
- return ret;
- }
-
- public boolean isValidValue(String value) {
- if(!_map.containsKey(value)) {
- addNewValidationMessage(Messages.LanguageCodeType_1);
- }
-
- return getValidationMessages().isEmpty();
- }
-
- /**
- * Defines language code map
- *
- */
- private static class LanguageCodeMap extends HashMap<String, String> {
- private static final long serialVersionUID = 1L;
-
- LanguageCodeMap() {
- put("af", Messages.LanguageCodeType_118); //$NON-NLS-1$
- put("ar", Messages.LanguageCodeType_0); //$NON-NLS-1$
- put("be", Messages.LanguageCodeType_7); //$NON-NLS-1$
- put("bg", Messages.LanguageCodeType_9); //$NON-NLS-1$
- put("br", Messages.LanguageCodeType_11); //$NON-NLS-1$
- put("ca", Messages.LanguageCodeType_13); //$NON-NLS-1$
- put("cs", Messages.LanguageCodeType_15); //$NON-NLS-1$
- put("da", Messages.LanguageCodeType_17); //$NON-NLS-1$
- put("de", Messages.LanguageCodeType_19); //$NON-NLS-1$
- put("el", Messages.LanguageCodeType_21); //$NON-NLS-1$
- put("en", Messages.LanguageCodeType_23); //$NON-NLS-1$
- put("es", Messages.LanguageCodeType_25); //$NON-NLS-1$
- put("et", Messages.LanguageCodeType_27); //$NON-NLS-1$
- put("eu", Messages.LanguageCodeType_29); //$NON-NLS-1$
- put("fa", Messages.LanguageCodeType_31); //$NON-NLS-1$
- put("fi", Messages.LanguageCodeType_33); //$NON-NLS-1$
- put("fo", Messages.LanguageCodeType_35); //$NON-NLS-1$
- put("fr", Messages.LanguageCodeType_37); //$NON-NLS-1$
- put("gd", Messages.LanguageCodeType_39); //$NON-NLS-1$
- put("he", Messages.LanguageCodeType_41); //$NON-NLS-1$
- put("hi", Messages.LanguageCodeType_43); //$NON-NLS-1$
- put("hr", Messages.LanguageCodeType_45); //$NON-NLS-1$
- put("hu", Messages.LanguageCodeType_47); //$NON-NLS-1$
- put("id", Messages.LanguageCodeType_49); //$NON-NLS-1$
- put("is", Messages.LanguageCodeType_51); //$NON-NLS-1$
- put("it", Messages.LanguageCodeType_53); //$NON-NLS-1$
- put("ja", Messages.LanguageCodeType_55); //$NON-NLS-1$
- put("ko", Messages.LanguageCodeType_57); //$NON-NLS-1$
- put("lt", Messages.LanguageCodeType_59); //$NON-NLS-1$
- put("lv", Messages.LanguageCodeType_61); //$NON-NLS-1$
- put("mk", Messages.LanguageCodeType_63); //$NON-NLS-1$
- put("ms", Messages.LanguageCodeType_65); //$NON-NLS-1$
- put("mt", Messages.LanguageCodeType_67); //$NON-NLS-1$
- put("nl", Messages.LanguageCodeType_69); //$NON-NLS-1$
- put("no", Messages.LanguageCodeType_71); //$NON-NLS-1$
- put("pl", Messages.LanguageCodeType_73); //$NON-NLS-1$
- put("pt", Messages.LanguageCodeType_75); //$NON-NLS-1$
- put("rm", Messages.LanguageCodeType_77); //$NON-NLS-1$
- put("ro", Messages.LanguageCodeType_79); //$NON-NLS-1$
- put("ru", Messages.LanguageCodeType_81); //$NON-NLS-1$
- put("sk", Messages.LanguageCodeType_83); //$NON-NLS-1$
- put("sl", Messages.LanguageCodeType_85); //$NON-NLS-1$
- put("sq", Messages.LanguageCodeType_87); //$NON-NLS-1$
- put("sr", Messages.LanguageCodeType_89); //$NON-NLS-1$
- put("sv", Messages.LanguageCodeType_91); //$NON-NLS-1$
- put("sx", Messages.LanguageCodeType_93); //$NON-NLS-1$
- put("sz", Messages.LanguageCodeType_95); //$NON-NLS-1$
- put("th", Messages.LanguageCodeType_97); //$NON-NLS-1$
- put("tn", Messages.LanguageCodeType_99); //$NON-NLS-1$
- put("tr", Messages.LanguageCodeType_101); //$NON-NLS-1$
- put("ts", Messages.LanguageCodeType_103); //$NON-NLS-1$
- put("uk", Messages.LanguageCodeType_105); //$NON-NLS-1$
- put("ur", Messages.LanguageCodeType_107); //$NON-NLS-1$
- put("vi", Messages.LanguageCodeType_109); //$NON-NLS-1$
- put("xh", Messages.LanguageCodeType_111); //$NON-NLS-1$
- put("yi", Messages.LanguageCodeType_113); //$NON-NLS-1$
- put("zh", Messages.LanguageCodeType_115); //$NON-NLS-1$
- put("zu", Messages.LanguageCodeType_117); //$NON-NLS-1$
- }
-
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/LengthType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/LengthType.java
deleted file mode 100644
index 70c5069..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/LengthType.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-/**
- * Meta-data processing type representing an length attribute value runtime type.
- * Does not support min and max values from MD. Length must be positive.
- * that implements IValidValues, IDefaultValue, IValidELValues.
- */
-public class LengthType extends IntegerType {
- private static final String INVALID_LENGTH = Messages.LengthType_invalid_integer;
- /**
- * Type coercion according to JSP 2.0 spec: JSP.1.14.2.1 Conversions from String values
- * Allows a percentage.
- * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidValues#isValidValue(java.lang.String)
- **/
- public boolean isValidValue(String value) {
- //FIXME: this is not right... px, em, etc. are also valid... and spaces between # and units are not
- //see http://www.w3.org/TR/html401/types.html#h-6.6
- if (value == null) return true;
- String aValue = stripPercentIfPresent(value);
- try {
- int anInt = Integer.valueOf(aValue).intValue();
- if (anInt < 0)
- addNewValidationMessage(INVALID_LENGTH);
-
- return getValidationMessages().isEmpty();
- } catch (NumberFormatException e) {
- addNewValidationMessage(INVALID_LENGTH);
- return false;
- }
-
- }
- //will strip '%' if at end of string. If string is only '%', then will return empty which will be invalid.
- private String stripPercentIfPresent(String value) {
- //"%" is allowed at end
- if (value.length() > 0
- && value.lastIndexOf('%') == value.length() - 1)
- return value.replaceFirst("%",""); //$NON-NLS-1$ //$NON-NLS-2$
-
- return value;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/LinkType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/LinkType.java
deleted file mode 100644
index ead9b79..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/LinkType.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation., and others
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.PossibleValue;
-
-/**
- * Meta-data processing type representing a Link type.
- *
- * Possible values are only common types; not all
- * Valid values just checks for a non-empty value, and not against known link types
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- */
-
-public class LinkType extends EnumerationType implements IPossibleValues{
- //common link types
- private String[] _linkTypes = new String[]{
- "Alternate", //$NON-NLS-1$
- "Stylesheet", //$NON-NLS-1$
- "Start", //$NON-NLS-1$
- "Next", //$NON-NLS-1$
- "Prev", //$NON-NLS-1$
- "Contents", //$NON-NLS-1$
- "Index", //$NON-NLS-1$
- "Glossary", //$NON-NLS-1$
- "Copyright", //$NON-NLS-1$
- "Chapter", //$NON-NLS-1$
- "Section", //$NON-NLS-1$
- "Subsection", //$NON-NLS-1$
- "Appendix", //$NON-NLS-1$
- "Help", //$NON-NLS-1$
- "Bookmark" //$NON-NLS-1$
- };
-
-
- @Override
- protected String getReturnType() {
- return "java.lang.String"; //$NON-NLS-1$
- }
-
- public List getPossibleValues() {
- List ret = new ArrayList();
- for(int i=0;i<_linkTypes.length;i++){
- PossibleValue pv = new PossibleValue(_linkTypes[i].toString(), _linkTypes[i].toString());
- ret.add(pv);
- }
- return ret;
- }
-
- public boolean isValidValue(String value) {
- if (value == null || value.trim().length() == 0){
- addNewValidationMessage(Messages.LinkType_16);
- return false;
- }
- return true;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/LocaleType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/LocaleType.java
deleted file mode 100644
index cb04fde..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/LocaleType.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation., and others
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- * Vadim Dmitriev
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Locale;
-
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValue;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.PossibleValue;
-import org.eclipse.jst.jsf.metadataprocessors.features.ValidationMessage;
-
-/**
- * Meta-data processing type representing a Locale Code type.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- */
-
-public class LocaleType extends MultiSignatureEnumerationType implements IPossibleValues, IValidValues, IValidELValues{
- private List<IPossibleValue> _pvs;
- @Override
- protected String[] getReturnTypes() {
- return new String[]{"java.util.Locale", "java.lang.String"}; //$NON-NLS-1$
- }
-
- public List getPossibleValues() {
- if (_pvs == null){
- _pvs = new ArrayList();
- Locale[]_locales = getLocales();
- for(int i=0;i<_locales.length;i++){
- PossibleValue pv = new PossibleValue(_locales[i].toString(), _locales[i].getDisplayName());
- _pvs.add(pv);
- }
- Collections.sort(_pvs, new Comparator(){
- public int compare(Object o1, Object o2) {
- PossibleValue pv1 = (PossibleValue)o1;
- PossibleValue pv2 = (PossibleValue)o2;
- return (pv1.getDisplayValue().compareTo(pv2.getDisplayValue()));
- }
-
- });
- }
- return _pvs;
- }
-
- private Locale[] getLocales() {
- return Locale.getAvailableLocales();
- }
-
- public boolean isValidValue(String value) {
- Locale[]_locales = getLocales();
- for(int i=0;i<_locales.length;i++){
- Locale local = getLocales()[i];
- if (local.toString().equals(value))
- return true;
- }
- getValidationMessages().add(new ValidationMessage(Messages.LocaleType_1));
- return false;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/LongType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/LongType.java
deleted file mode 100644
index a7791e9..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/LongType.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-import java.util.List;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Meta-data processing type representing a long attribute value runtime type
- * that implements IValidValues, IDefaultValue, IValidELValues
- *
- * <p><b>Provisional API - subject to change</b></p>
- * @author Gerry Kessler - Oracle
- */
-public class LongType extends NumberType {
- private static final String INVALID_LONG = Messages.LongType_invalid_long;
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.EnumerationType#getReturnType()
- */
- protected String getReturnType(){ return "long";} //$NON-NLS-1$
-
- /**
- * Type coercion according to JSP 2.0 spec: JSP.1.14.2.1 Conversions from String values
- * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidValues#isValidValue(java.lang.String)
- **/
- public boolean isValidValue(String value) {
- try {
- Long aLong = Long.valueOf(value);
- exceedsMaxValue(aLong.longValue());
- lessThanMinValue(aLong.longValue());
- if (!(minFound || maxFound)){
- List validVals = getMDValidValues();
- if (!validVals.isEmpty()){
- if (!validVals.contains(value)){
- addNewValidationMessage(Messages.LongType_invalid_member);
- }
- }
- }
- return getValidationMessages().isEmpty();
- } catch (NumberFormatException e) {
- addNewValidationMessage(INVALID_LONG);
- return false;
- }
-
- }
-
- private void exceedsMaxValue(long aLong) {
- String strMax = getValidMaximumValue();
- if (strMax != null){
- try {
- long max = Long.valueOf(strMax).longValue();
- maxFound = true;
- if (aLong > max){
- addNewValidationMessage(NLS.bind(EXCEEDS_MAX, strMax));
- }
- } catch (NumberFormatException e) {
- //TODO: ignore error???? or log it????
- }
- }
-
- }
-
- private void lessThanMinValue(long aLong) {
- String strMin = getValidMinimumValue();
- if (strMin != null){
- try {
- long min = Long.valueOf(strMin).longValue();
- minFound = true;
- if (aLong < min){
- addNewValidationMessage(NLS.bind(LESS_THAN_MIN, strMin));
- }
- } catch (NumberFormatException e) {
- //TODO: ignore error???? or log it????
- }
- }
-
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/Messages.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/Messages.java
deleted file mode 100644
index 447ef78..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/Messages.java
+++ /dev/null
@@ -1,1101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Message bundle for attributevalue types/features
- *
- * <p>
- * <b>Provisional API - subject to change</b>
- * </p>
- */
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.jst.jsf.taglibprocessing.attributevalues.messages"; //$NON-NLS-1$
- static {
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
- /**
- * see messages.properties
- */
- public static String ActionType_navcase_display;
- /**
- * see messages.properties
- */
- public static String ActionType_invalid_value;
- /**
- * see messages.properties
- */
- public static String ActionType_invalid_empty_value;
- /**
- * see messages.properties
- */
- public static String BooleanType_invalid_values;
- /**
- * see messages.properties
- */
- public static String ContentType_MIME_not_empty;
- /**
- * see messages.properties
- */
- public static String ComponentBindingType_invalid_value;
- /**
- * see messages.properties
- */
- public static String ComponentIDType_invalid_as_el;
- /**
- * see messages.properties
- */
- public static String ComponentIDType_invalid_value;
- /**
- * see messages.properties
- */
- public static String DoubleType_invalid_double;
- /**
- * see messages.properties
- */
- public static String DoubleType_invalid_member;
- /**
- * see messages.properties
- */
- public static String FacesConfigConverterIDFeatures_converterid_empty;
- /**
- * see messages.properties
- */
- public static String FacesConfigIdentifierType_invalid_converter_id;
- /**
- * see messages.properties
- */
- public static String FacesConfigIdentifierType_invalid_validator_id;
- /**
- * see messages.properties
- */
- public static String FacesConfigValidatorIDFeatures_validatorid_empty;
- /**
- * see messages.properties
- */
- public static String IntegerType_invalid_integer;
- /**
- * see messages.properties
- */
- public static String IntegerType_invalid_member;
- /**
- * see messages.properties
- */
- public static String JavaClassType_invalid_type;
- /**
- * see messages.properties
- */
- public static String JavaClassType_not_found;
- /**
- * see messages.properties
- */
- public static String LongType_invalid_long;
- /**
- * see messages.properties
- */
- public static String LongType_invalid_member;
- /**
- * see messages.properties
- */
- public static String MethodBindingType_invalid_value;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_invalid;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_10;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_100;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_101;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_102;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_103;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_104;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_105;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_106;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_107;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_108;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_109;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_11;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_110;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_111;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_112;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_113;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_114;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_115;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_116;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_117;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_118;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_119;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_12;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_120;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_121;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_122;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_123;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_124;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_125;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_126;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_127;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_128;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_129;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_13;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_130;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_131;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_132;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_133;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_134;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_135;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_136;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_137;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_138;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_139;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_14;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_140;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_141;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_142;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_143;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_144;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_145;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_146;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_147;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_148;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_149;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_15;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_150;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_151;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_152;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_153;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_154;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_155;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_156;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_157;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_158;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_159;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_16;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_160;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_161;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_162;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_163;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_164;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_165;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_166;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_167;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_168;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_169;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_17;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_170;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_171;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_172;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_173;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_174;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_18;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_19;
- /**
- * see messages.properties
- */
- public static String CharacterType_0;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_2;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_20;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_21;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_22;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_23;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_24;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_25;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_26;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_27;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_28;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_29;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_3;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_30;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_31;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_32;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_33;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_34;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_35;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_36;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_37;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_38;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_39;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_4;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_40;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_41;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_42;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_43;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_44;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_45;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_46;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_47;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_48;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_49;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_5;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_50;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_51;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_52;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_53;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_54;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_55;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_56;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_57;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_58;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_59;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_6;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_60;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_61;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_62;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_63;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_64;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_65;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_66;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_67;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_68;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_69;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_7;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_70;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_71;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_72;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_73;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_74;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_75;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_76;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_77;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_78;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_79;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_8;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_80;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_81;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_82;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_83;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_84;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_85;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_86;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_87;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_88;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_89;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_9;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_0;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_1;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_7;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_9;
- /**
- * see messages.properties
- */
- public static String LinkType_16;
- /**
- * see messages.properties
- */
- public static String LocaleType_1;
- /**
- * see messages.properties
- */
- public static String WebPathType_1;
- /**
- * see messages.properties
- */
- public static String WebPathType_2;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_11;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_13;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_15;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_17;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_19;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_21;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_23;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_25;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_27;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_29;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_31;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_33;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_35;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_37;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_39;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_41;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_43;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_45;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_47;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_49;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_51;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_53;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_55;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_57;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_59;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_61;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_63;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_65;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_67;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_69;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_71;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_73;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_75;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_77;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_79;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_81;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_83;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_85;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_87;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_89;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_91;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_93;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_95;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_97;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_99;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_101;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_103;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_105;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_107;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_109;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_111;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_113;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_115;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_117;
- /**
- * see messages.properties
- */
- public static String LanguageCodeType_118;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_90;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_91;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_92;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_93;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_94;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_95;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_96;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_97;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_98;
- /**
- * see messages.properties
- */
- public static String CurrencyCodeType_99;
- /**
- * see messages.properties
- */
- public static String NumberType_max_val;
- /**
- * see messages.properties
- */
- public static String NumberType_min_val;
- /**
- * see messages.properties
- */
- public static String RelativePathType_0;
- /**
- * see messages.properties
- */
- public static String StringType_invalid_value;
- /**
- * see messages.properties
- */
- public static String ValueType_invalid_value;
- /**
- * see messages.properties
- */
- public static String ValueType_invalid_value_without_setter;
- /**
- * see messages.properties
- */
- public static String LengthType_invalid_integer;
- /**
- * see messages.properties
- */
- public static String ColorType_invalid_color;
-
- /**
- * see messages.properties
- */
- public static String Bundle_not_found_rb;
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/MethodBindingType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/MethodBindingType.java
deleted file mode 100644
index 4c07e0e..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/MethodBindingType.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jst.jsf.common.internal.types.CompositeType;
-import org.eclipse.jst.jsf.common.internal.types.IAssignable;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.metadataprocessors.features.ELIsNotValidException;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidationMessage;
-import org.eclipse.jst.jsf.metadataprocessors.features.ValidationMessage;
-
-/**
- * Meta-data processing type representing an method-binding attribute value runtime type
- *
- * <p><b>Provisional API - subject to change</b></p>
- * @author Gerry Kessler - Oracle
- */
-public class MethodBindingType extends ExpressionBindingType implements IValidELValues, IValidValues{
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues#getExpectedRuntimeType()
- */
- public CompositeType getExpectedRuntimeType() throws ELIsNotValidException {
- String[] params = getParams();
-
- // need to "signaturize" each parameter
- for (int param = 0; param < params.length; param++)
- {
- params[param] = Signature.createTypeSignature(params[param],true);
- }
- final String runtimeType = getReturnType();
-
- String returnTypeSignature = null;
-
- if (runtimeType != null)
- {
- returnTypeSignature = Signature.createTypeSignature(runtimeType, true);
- }
- else
- {
- JSFCorePlugin.log(IStatus.INFO, "Missing metadata for trait "+RUNTIME_RETURN_TYPE+" for entity "+getMetaDataContext().getEntity());
- }
-
- if (returnTypeSignature == null)
- {
- return null;
- }
-
- String methodSig = Signature.createMethodSignature(params, returnTypeSignature);
- return new CompositeType(methodSig, IAssignable.ASSIGNMENT_TYPE_NONE);
- }
-
- /**
- * Non-EL values are invalid for method bound attribute values
- * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidValues#isValidValue(java.lang.String)
- */
- public boolean isValidValue(String value) {
- //if this is being called, we are being called in an non-EL context which is invalid.
- IValidationMessage msg = new ValidationMessage(Messages.MethodBindingType_invalid_value);
- getValidationMessages().add(msg);
- return false;
- }
-
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/MultiSignatureEnumerationType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/MultiSignatureEnumerationType.java
deleted file mode 100644
index 5b84c4b..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/MultiSignatureEnumerationType.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Vadim Dmitriev and others
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Vadim Dmitriev - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jst.jsf.common.internal.types.CompositeType;
-import org.eclipse.jst.jsf.metadataprocessors.features.ELIsNotValidException;
-
-/**
- * Abstract meta-data processing type representing an enumeration attribute value
- * of multiple runtime types
- *
- * @author Vadim Dmitriev
- */
-public abstract class MultiSignatureEnumerationType extends AbstractEnumerationType {
-
- /**
- * @return return Java types as array of strings (i.e.
- * new String[]{"boolean", "java.lang.String"}, etc.)
- * Must not be null.
- */
- protected abstract String[] getReturnTypes();
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues#getExpectedRuntimeType()
- */
- public CompositeType getExpectedRuntimeType() throws ELIsNotValidException {
- String[] types = getReturnTypes();
- int len = types.length;
-
- String[] signaturedTypes = new String[ len ];
- for( int i = 0; i < len; i++ )
- {
- signaturedTypes[ i ] = Signature.createTypeSignature(types[ i ], true);
- }
- return new CompositeType( signaturedTypes, getAssignmentType());
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/NumberPatternType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/NumberPatternType.java
deleted file mode 100644
index b5add42..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/NumberPatternType.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation., and others
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jst.jsf.metadataprocessors.AbstractRootTypeDescriptor;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.PossibleValue;
-
-/**
- * Meta-data processing type representing a numeric pattern type.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- */
-
-public class NumberPatternType extends AbstractRootTypeDescriptor implements IPossibleValues{
- //should we ever decide to validate the patterns, extend EnumerationType
- final private static String[] PATTERNS = {
- "0.00", //$NON-NLS-1$
- "#,##0", //$NON-NLS-1$
- "#,##0.00", //$NON-NLS-1$
- "#,##0;(#,##0)", //$NON-NLS-1$
- "#,##0.00;(#,##0.00)", //$NON-NLS-1$
- "0.##E0", //$NON-NLS-1$
- "0%", //$NON-NLS-1$
- "0.00%" //$NON-NLS-1$
- };
-
- public List getPossibleValues() {
- List ret = new ArrayList();
- for (int i=0;i<PATTERNS.length;i++){
- ret.add(new PossibleValue(PATTERNS[i]));
- }
- return ret;
- }
-
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/NumberType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/NumberType.java
deleted file mode 100644
index 4ee78b9..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/NumberType.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-
-/**
- * Abstract meta-data processing type representing a numeric attribute value runtime type
- *
- * <p><b>Provisional API - subject to change</b></p>
- * @author Gerry Kessler - Oracle
- */
-public abstract class NumberType extends EnumerationType{
- /**
- * flag indicating max value metadata was found
- */
- protected boolean maxFound = false;
- /**
- * flag indicating min value metadata was found
- */
- protected boolean minFound = false;
-
- /**
- * Validation message when value has exceeded maximum
- */
- protected String EXCEEDS_MAX = Messages.NumberType_max_val;
- /**
- * Validation message when value is less than minimum
- */
- protected String LESS_THAN_MIN = Messages.NumberType_min_val;
-
- /**
- * @return maximum value from property named IValidValues.VALID_VALUES_MAX_PROP_NAME
- */
- protected String getValidMaximumValue(){
- return getTraitValueAsString(IValidValues.VALID_VALUES_MAX_PROP_NAME);
- }
-
- /**
- * @return minimum value from property named IValidValues.VALID_VALUES_MIN_PROP_NAME
- */
- protected String getValidMinimumValue(){
- return getTraitValueAsString(IValidValues.VALID_VALUES_MIN_PROP_NAME);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ObjectType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ObjectType.java
deleted file mode 100644
index 07120d4..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ObjectType.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-/**
- * Abstract meta-data processing type representing an Object attribute value runtime type
- *
- * <p><b>Provisional API - subject to change</b></p>
- * @author Gerry Kessler - Oracle
- */
-public abstract class ObjectType extends DirectBindingType {
- // TODO: ????
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/PathType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/PathType.java
deleted file mode 100644
index 5f4f311..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/PathType.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IWorkspaceContextResolver;
-import org.eclipse.jst.jsf.metadataprocessors.AbstractRootTypeDescriptor;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidationMessage;
-
-/**
- * EXPERIMENTAL - may change or dissappear
- *
- */
-public abstract class PathType extends AbstractRootTypeDescriptor {
-
- private IProject _project = null;
- private final List<IValidationMessage> _validationMsgs = new ArrayList<IValidationMessage>(1);
-
- /**
- * Constructor
- */
- public PathType() {
- super();
- }
-
- /**
- * @return IProject
- */
- protected IProject getProject() {
- if( _project == null )
- {
- final IWorkspaceContextResolver wkspaceResolver =
- IStructuredDocumentContextResolverFactory.INSTANCE.getWorkspaceContextResolver( getStructuredDocumentContext() );
- _project = wkspaceResolver.getProject();
- }
-
- return _project;
- }
-
- /**
- * @return list of {@link IValidationMessage}
- */
- public List<IValidationMessage> getValidationMessages() {
- return _validationMsgs;
- }
-
-}
\ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/RelativePathType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/RelativePathType.java
deleted file mode 100644
index 82dd380..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/RelativePathType.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jst.jsf.metadataprocessors.IMetaDataEnabledFeature;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.ValidationMessage;
-
-/**
- * Path is relative to project
- * <b>EXPERIMENTAL</b> - may change or dissappear
- *
- */
-public class RelativePathType extends PathType implements
- IMetaDataEnabledFeature, IValidValues{
-
- public boolean isValidValue(String value) {
- //is this a relative path, or absolute url?
- try {
- new URL(value);
- //not much else we what to do for now
- return true;
- } catch (MalformedURLException e) {
- //is this a valid path relative to the
- IProject project = getProject();
- IFile file= project.getFile(new Path(value));
- if (! file.exists())
- getValidationMessages().add(new ValidationMessage( value+Messages.RelativePathType_0));
-
- return getValidationMessages().size() == 0;
- }
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ResourceBundleType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ResourceBundleType.java
deleted file mode 100644
index 65f2fc9..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ResourceBundleType.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Vadim Dmitriev - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-import java.text.MessageFormat;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IStorage;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jst.jsf.core.internal.tld.LoadBundleUtil;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.ValidationMessage;
-
-/**
- * Meta-data processing type representing a path to resource bundle on classpath
- * Patch by Vadim Dmitriev. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=203307.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author Vadim Dmitriev
- *
- *
- */
-public class ResourceBundleType extends PathType implements IValidValues
-{
- public boolean isValidValue( String value )
- {
- try
- {
- IProject project = getProject();
- IStorage bundle = LoadBundleUtil.getLoadBundleResource( project , value );
- if( bundle != null )
- {
- return true;
- }
- }
- catch (CoreException e)
- {
- //error message is generated later
- }
-
- final String message =
- MessageFormat.format(Messages.Bundle_not_found_rb, value);
- getValidationMessages().add(new ValidationMessage(message, "", IStatus.ERROR)); //$NON-NLS-1$
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ScriptType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ScriptType.java
deleted file mode 100644
index 9df83d4..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ScriptType.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-import org.eclipse.jst.jsf.metadataprocessors.AbstractRootTypeDescriptor;
-
-/**
- * Represents script type
- * <p><b>Provisional API - subject to change</b></p>
- */
-public class ScriptType extends AbstractRootTypeDescriptor {
-//
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/StringType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/StringType.java
deleted file mode 100644
index fa8f3af..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/StringType.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jst.jsf.metadataprocessors.features.IDefaultValue;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.PossibleValue;
-
-/**
- * Meta-data processing type representing a String attribute value runtime type
- * that implements IPossibleValues, IValidValues and IDefaultValues
- *
- * <p><b>Provisional API - subject to change</b></p>
- * @author Gerry Kessler - Oracle
- */
-public class StringType extends EnumerationType implements IValidValues,
- IPossibleValues, IDefaultValue {
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.EnumerationType#getReturnType()
- */
- protected String getReturnType(){ return "java.lang.String";} //$NON-NLS-1$
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidValues#isValidValue(java.lang.String)
- */
- public boolean isValidValue(String value) {
- List vals = getMDValidValues();
- if (vals.isEmpty())
- return true;
-
- //if the value is empty but there is a default value, consider it valid
- if (getDefaultValue() != null && (value == null || value.trim().equals(""))) //$NON-NLS-1$
- return true;
-
- if(! vals.contains(value)){
- addNewValidationMessage(Messages.StringType_invalid_value);
- }
- return getValidationMessages().isEmpty();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues#getPossibleValues()
- */
- public List getPossibleValues() {
- List pvs = getMDPossibleValues();
- if (pvs.isEmpty())
- return EMPTY_LIST;
-
- List pdvs = getMDPossibleValuesForDisplay();
-
- //if there are no display vals or the meta-data list sizes are different, use the values list for display also
- if (pdvs.isEmpty() || pvs.size() != pdvs.size())
- pdvs = pvs;
-
- ImageDescriptor icon = getImage();
-
- String defaultValue = getDefaultValue();
- List ret = new ArrayList(pvs.size());
- for(int i=0;i<pvs.size();i++){
- PossibleValue pv = new PossibleValue((String)pvs.get(i), (String)pdvs.get(i));
- pv.setIcon(icon);
- pv.setIsDefault(((String)pvs.get(i)).equals(defaultValue));
- ret.add(pv);
- }
- return ret;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/TimeZoneType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/TimeZoneType.java
deleted file mode 100644
index 56af13d..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/TimeZoneType.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation., and others
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.TimeZone;
-
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.PossibleValue;
-
-/**
- * Meta-data processing type representing a TimeZone Code type.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- */
-
-public class TimeZoneType extends EnumerationType implements IPossibleValues, IValidValues{
- private String[] _timezones;
-
- @Override
- protected String getReturnType() {
- return "java.lang.String"; //$NON-NLS-1$
- }
-
- public List getPossibleValues() {
- List ret = new ArrayList();
- for(int i=0;i<getTimeZones().length;i++){
- PossibleValue pv = new PossibleValue(_timezones[i], _timezones[i]);
- ret.add(pv);
- }
- return ret;
- }
-
- private String[] getTimeZones() {
- if (_timezones == null)
- _timezones = TimeZone.getAvailableIDs();
- return _timezones;
- }
-
- public boolean isValidValue(String value) {
- for(int i=0;i<getTimeZones().length;i++){
- if (getTimeZones()[i].equals(value))
- return true;
- }
- return false;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/URIType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/URIType.java
deleted file mode 100644
index 889959b..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/URIType.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-import org.eclipse.jst.jsf.metadataprocessors.IMetaDataEnabledFeature;
-
-/**
- * URI Type: attribute values are Uniform Resource Identifiers (URIs), as defined in RFC 2396.
- * URI attribute values may include full URIs such as http://www.foobar.com/ as well as relative URIs such as foo.html and ../foo/.
- * EXPERIMENTAL - will change or dissappear
- */
-public class URIType extends PathType implements IMetaDataEnabledFeature{
- //TODO: add validation... refactor or WebPath, RelativePath, etc.
-
- /**
- * Constructor
- */
- public URIType() {
- //
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ValueBindingType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ValueBindingType.java
deleted file mode 100644
index ef9c455..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ValueBindingType.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jst.jsf.common.internal.types.CompositeType;
-import org.eclipse.jst.jsf.common.internal.types.IAssignable;
-import org.eclipse.jst.jsf.metadataprocessors.features.ELIsNotValidException;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues;
-
-/**
- * Meta-data processing type representing a Value Bound attribute value runtime type
- * that implements IValidValues
- *
- * <p><b>Provisional API - subject to change</b></p>
- * @author Gerry Kessler - Oracle
- */
-public class ValueBindingType extends ExpressionBindingType implements IValidELValues{
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues#getExpectedRuntimeType()
- */
- public CompositeType getExpectedRuntimeType() throws ELIsNotValidException {
- String returnType = getReturnType();
- if (returnType == null)
- return null;
-
- String methodSig = Signature.createTypeSignature(returnType, true);
- return new CompositeType(methodSig, getAssignmentValue());
- }
-
- /**
- * @return {@link IAssignable}.LHS or {@link IAssignable}.RHS
- */
- protected int getAssignmentValue(){
- return (getIsSetValueRequired() ? IAssignable.ASSIGNMENT_TYPE_LHS : 0) | IAssignable.ASSIGNMENT_TYPE_RHS;
-
- }
-
- /**
- * @return is runtime setter required?
- */
- protected boolean getIsSetValueRequired(){
- String value = getTraitValueAsString(RUNTIME_SETTER_REQUIRED);
- if (value == null || value.trim().length() == 0)
- return false;
- else if (value.trim().equals("true")) //$NON-NLS-1$
- return true;
- else
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ValueType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ValueType.java
deleted file mode 100644
index 7c03fae..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ValueType.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-
-/**
- * Meta-data processing type representing a "value" attribute
- * that implements IValidValues and IValidELValues
- *
- * <p><b>Provisional API - subject to change</b></p>
- * @author Gerry Kessler - Oracle
- */
-public class ValueType extends ValueBindingType implements IValidValues, IValidELValues {
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidValues#isValidValue(java.lang.String)
- */
- public boolean isValidValue(String value){
- //value can be a string or a value binding expression
- return true;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/WebPathType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/WebPathType.java
deleted file mode 100644
index c1c8c0d..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/WebPathType.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jst.jsf.metadataprocessors.IMetaDataEnabledFeature;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.ValidationMessage;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IVirtualContainer;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
-
-/**
- * Path relative to web root
- * <b>EXPERIMENTAL</b> - may change or dissappear
- *
- */
-public class WebPathType extends PathType implements
- IMetaDataEnabledFeature, IValidValues{
-
- public boolean isValidValue(String value) {
- //is this a relative path, or absolute url?
- try {
- URL url = new URL(value);
- //if file protocol, see if it is valid? Otherwise assume ok.
- if (url.getProtocol().equals("file")){ //$NON-NLS-1$
- validateFileRelativeToWebRoot(url.getPath());
- }
- } catch (MalformedURLException e) {
- //is this a valid path relative to the
- validateFileRelativeToWebRoot(value);
- }
- return getValidationMessages().size() == 0;
-
- }
-
- private void validateFileRelativeToWebRoot(String value) {
- IVirtualContainer webRoot = getWebRoot();
- if (! webRoot.exists()){
- getValidationMessages().add(new ValidationMessage( Messages.WebPathType_1));
- }
- else {
- IVirtualFile file = webRoot.getFile(new Path(value));
- if (!file.exists()) {
- //was this a valid file path string, or bogus url?
- getValidationMessages().add(new ValidationMessage(Messages.WebPathType_2));
- }
- //we could also validate the expected file-extensions from meta data
- }
-
- }
-
- private IVirtualContainer getWebRoot()
- {
- IVirtualContainer webRoot =
- ComponentCore.createComponent(getProject()).getRootFolder();
-
- return webRoot;
- }
-}
\ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/messages.properties b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/messages.properties
deleted file mode 100644
index 22ddc87..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/messages.properties
+++ /dev/null
@@ -1,278 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2007 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are 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:
-# Oracle Corporation - initial API and implementation
-###############################################################################
-IntegerType_invalid_integer=Value is not a valid integer.
-IntegerType_invalid_member=Value is not a member of the provided valid values
-LengthType_invalid_integer=Value is not a valid positive integer or positive integer percentage.
-LongType_invalid_long=Value is not a valid Long.
-LongType_invalid_member=Value is not a member of the provided valid values
-BooleanType_invalid_values=Valid values are "true" or "false"
-CurrencyCodeType_invalid=Invalid currency code
-CurrencyCodeType_10=Aruba, Guilders (also called Florins)
-CurrencyCodeType_100=Malta, Liri
-CurrencyCodeType_101=Mauritius, Rupees
-CurrencyCodeType_102=Maldives (Maldive Islands), Rufiyaa
-CurrencyCodeType_103=Malawi, Kwachas
-CurrencyCodeType_104=Mexico, Pesos
-CurrencyCodeType_105=Malaysia, Ringgits
-CurrencyCodeType_106=Mozambique, Meticais
-CurrencyCodeType_107=Namibia, Dollars
-CurrencyCodeType_108=Nigeria, Nairas
-CurrencyCodeType_109=Nicaragua, Cordobas
-CurrencyCodeType_11=Azerbaijan, Manats
-CurrencyCodeType_110=Norway, Krone
-CurrencyCodeType_111=Nepal, Nepal Rupees
-CurrencyCodeType_112=New Zealand, Dollars
-CurrencyCodeType_113=Oman, Rials
-CurrencyCodeType_114=Panama, Balboa
-CurrencyCodeType_115=Peru, Nuevos Soles
-CurrencyCodeType_116=Papua New Guinea, Kina
-CurrencyCodeType_117=Philippines, Pesos
-CurrencyCodeType_118=Pakistan, Rupees
-CurrencyCodeType_119=Poland, Zlotych
-CurrencyCodeType_12=Bosnia and Herzegovina, Convertible Marka
-CurrencyCodeType_120=Paraguay, Guarani
-CurrencyCodeType_121=Qatar, Rials
-CurrencyCodeType_122=Romania, Lei
-CurrencyCodeType_123=Russia, Rubles
-CurrencyCodeType_124=Rwanda, Rwanda Francs
-CurrencyCodeType_125=Saudi Arabia, Riyals
-CurrencyCodeType_126=Solomon Islands, Dollars
-CurrencyCodeType_127=Seychelles, Rupees
-CurrencyCodeType_128=Sudan, Dinars
-CurrencyCodeType_129=Sweden, Kronor
-CurrencyCodeType_13=Barbados, Dollars
-CurrencyCodeType_130=Singapore, Dollars
-CurrencyCodeType_131=Saint Helena, Pounds
-CurrencyCodeType_132=Slovenia, Tolars
-CurrencyCodeType_133=Slovakia, Koruny
-CurrencyCodeType_134=Sierra Leone, Leones
-CurrencyCodeType_135=Somalia, Shillings
-CurrencyCodeType_136=Seborga, Luigini
-CurrencyCodeType_137=Suriname, Dollars
-CurrencyCodeType_138=Principe and S\u00E3o Tome, Dobras
-CurrencyCodeType_139=El Salvador, Colones
-CurrencyCodeType_14=Bangladesh, Taka
-CurrencyCodeType_140=Syria, Pounds
-CurrencyCodeType_141=Swaziland, Emalangeni
-CurrencyCodeType_142=Thailand, Baht
-CurrencyCodeType_143=Tajikistan, Somoni
-CurrencyCodeType_144=Turkmenistan, Manats
-CurrencyCodeType_145=Tunisia, Dinars
-CurrencyCodeType_146=Tonga, Pa'anga
-CurrencyCodeType_147=Turkey, Liras [being phased out]
-CurrencyCodeType_148=Turkey, New Lira
-CurrencyCodeType_149=Trinidad and Tobago, Dollars
-CurrencyCodeType_15=Bulgaria, Leva
-CurrencyCodeType_150=Tuvalu, Tuvalu Dollars
-CurrencyCodeType_151=Taiwan, New Dollars
-CurrencyCodeType_152=Tanzania, Shillings
-CurrencyCodeType_153=Ukraine, Hryvnia
-CurrencyCodeType_154=Uganda, Shillings
-CurrencyCodeType_155=United States of America, Dollars
-CurrencyCodeType_156=Uruguay, Pesos
-CurrencyCodeType_157=Uzbekistan, Sums
-CurrencyCodeType_158=Venezuela, Bolivares
-CurrencyCodeType_159=Viet Nam, Dong
-CurrencyCodeType_16=Bahrain, Dinars
-CurrencyCodeType_160=Vanuatu, Vatu
-CurrencyCodeType_161=Samoa, Tala
-CurrencyCodeType_162=Communaut\u00E9 Financi\u00E8re Africaine BEAC Franc , Francs
-CurrencyCodeType_163=Silver, Ounces
-CurrencyCodeType_164=Gold, Ounces
-CurrencyCodeType_165=East Caribbean Dollars
-CurrencyCodeType_166=International Monetary Fund (IMF) Special Drawing Rights
-CurrencyCodeType_167=Communaut\u00E9 Financi\u00E8re Africaine BCEAO, Francs
-CurrencyCodeType_168=Palladium Ounces
-CurrencyCodeType_169=Comptoirs Francais du Pacifique, Francs
-CurrencyCodeType_17=Burundi, Francs
-CurrencyCodeType_170=Platinum, Ounces
-CurrencyCodeType_171=Yemen, Rials
-CurrencyCodeType_172=South Africa, Rand
-CurrencyCodeType_173=Zambia, Kwacha
-CurrencyCodeType_174=Zimbabwe, Zimbabwe Dollars
-CurrencyCodeType_18=Bermuda, Dollars
-CurrencyCodeType_19=Brunei Darussalam, Dollars
-CharacterType_0=Single unicode character is required
-CurrencyCodeType_2=United Arab Emirates, Dirhams
-CurrencyCodeType_20=Bolivia, Bolivianos
-CurrencyCodeType_21=Brazil, Brazil Real
-CurrencyCodeType_22=Bahamas, Dollars
-CurrencyCodeType_23=Bhutan, Ngultrum
-CurrencyCodeType_24=Botswana, Pulas
-CurrencyCodeType_25=Belarus, Rubles
-CurrencyCodeType_26=Belize, Dollars
-CurrencyCodeType_27=Canada, Dollars
-CurrencyCodeType_28=Congo/Kinshasa, Congolese Francs
-CurrencyCodeType_29=Switzerland, Francs
-CurrencyCodeType_3=Afghanistan, Afghanis
-CurrencyCodeType_30=Chile, Pesos
-CurrencyCodeType_31=China, Yuan Renminbi
-CurrencyCodeType_32=Colombia, Pesos
-CurrencyCodeType_33=Costa Rica, Colones
-CurrencyCodeType_34=Serbia, Dinars
-CurrencyCodeType_35=Cuba, Pesos
-CurrencyCodeType_36=Cape Verde, Escudos
-CurrencyCodeType_37=Cyprus, Pounds
-CurrencyCodeType_38=Czech Republic, Koruny
-CurrencyCodeType_39=Djibouti, Francs
-CurrencyCodeType_4=Albania, Leke
-CurrencyCodeType_40=Denmark, Kroner
-CurrencyCodeType_41=Dominican Republic, Pesos
-CurrencyCodeType_42=Algeria, Algeria Dinars
-CurrencyCodeType_43=Estonia, Krooni
-CurrencyCodeType_44=Egypt, Pounds
-CurrencyCodeType_45=Eritrea, Nakfa
-CurrencyCodeType_46=Ethiopia, Birr
-CurrencyCodeType_47=Euro Member Countries, Euro
-CurrencyCodeType_48=Fiji, Dollars
-CurrencyCodeType_49=Falkland Islands (Malvinas), Pounds
-CurrencyCodeType_5=Armenia, Drams
-CurrencyCodeType_50=United Kingdom, Pounds
-CurrencyCodeType_51=Georgia, Lari
-CurrencyCodeType_52=Guernsey, Pounds
-CurrencyCodeType_53=Ghana, Cedis
-CurrencyCodeType_54=Gibraltar, Pounds
-CurrencyCodeType_55=Gambia, Dalasi
-CurrencyCodeType_56=Guinea, Francs
-CurrencyCodeType_57=Guatemala, Quetzales
-CurrencyCodeType_58=Guyana, Dollars
-CurrencyCodeType_59=Hong Kong, Dollars
-CurrencyCodeType_6=Netherlands Antilles, Guilders (also called Florins)
-CurrencyCodeType_60=Honduras, Lempiras
-CurrencyCodeType_61=Croatia, Kuna
-CurrencyCodeType_62=Haiti, Gourdes
-CurrencyCodeType_63=Hungary, Forint
-CurrencyCodeType_64=Indonesia, Rupiahs
-CurrencyCodeType_65=Israel, New Shekels
-CurrencyCodeType_66=Isle of Man, Pounds
-CurrencyCodeType_67=India, Rupees
-CurrencyCodeType_68=Iraq, Dinars
-CurrencyCodeType_69=Iran, Rials
-CurrencyCodeType_7=Angola, Kwanza
-CurrencyCodeType_70=Iceland, Kronur
-CurrencyCodeType_71=Jersey, Pounds
-CurrencyCodeType_72=Jamaica, Dollars
-CurrencyCodeType_73=Jordan, Dinars
-CurrencyCodeType_74=Japan, Yen
-CurrencyCodeType_75=Kenya, Shillings
-CurrencyCodeType_76=Kyrgyzstan, Soms
-CurrencyCodeType_77=Cambodia, Riels
-CurrencyCodeType_78=Comoros, Francs
-CurrencyCodeType_79=Korea (North), Won
-CurrencyCodeType_8=Argentina, Pesos
-CurrencyCodeType_80=Korea (South), Won
-CurrencyCodeType_81=Kuwait, Dinars
-CurrencyCodeType_82=Cayman Islands, Dollars
-CurrencyCodeType_83=Kazakhstan, Tenge
-CurrencyCodeType_84=Laos, Kips
-CurrencyCodeType_85=Lebanon, Pounds
-CurrencyCodeType_86=Sri Lanka, Rupees
-CurrencyCodeType_87=Liberia, Dollars
-CurrencyCodeType_88=Lesotho, Maloti
-CurrencyCodeType_89=Lithuania, Litai
-CurrencyCodeType_9=Australia, Dollars
-LanguageCodeType_0=ar Arabic (needs subtype)
-LanguageCodeType_1=Invalid language code
-LanguageCodeType_101=tr Turkish
-LanguageCodeType_103=ts Tsonga
-LanguageCodeType_105=uk Ukrainian
-LanguageCodeType_107=ur Urdu
-LanguageCodeType_109=vi Vietnamese
-LanguageCodeType_11=br Breton
-LanguageCodeType_111=xh Xhosa
-LanguageCodeType_113=yi Yiddish
-LanguageCodeType_115=zh Chinese (needs subtype)
-LanguageCodeType_117=zu Zulu
-LanguageCodeType_118=af Afrikaans
-LanguageCodeType_13=ca Catalan
-LanguageCodeType_15=cs Czech
-LanguageCodeType_17=da Danish
-LanguageCodeType_19=de German (Standard)
-LanguageCodeType_21=el Greek
-LanguageCodeType_23=en English
-LanguageCodeType_25=es Spanish (Spain)
-LanguageCodeType_27=et Estonian
-LanguageCodeType_29=eu Basque
-LanguageCodeType_31=fa Farsi
-LanguageCodeType_33=fi Finnish
-LanguageCodeType_35=fo Faeroese
-LanguageCodeType_37=fr French (Standard)
-LanguageCodeType_39=gd Gaelic (Scotland)
-LanguageCodeType_41=he Hebrew
-LanguageCodeType_43=hi Hindi
-LanguageCodeType_45=hr Croatian
-LanguageCodeType_47=hu Hungarian
-LanguageCodeType_49=id Indonesian
-LanguageCodeType_51=is Icelandic
-LanguageCodeType_53=it Italian (Standard)
-LanguageCodeType_55=ja Japanese
-LanguageCodeType_57=ko Korean
-LanguageCodeType_59=lt Lithuanian
-LanguageCodeType_61=lv Latvian
-LanguageCodeType_63=mk Macedonian
-LanguageCodeType_65=ms Malaysian
-LanguageCodeType_67=mt Maltese
-LanguageCodeType_69=nl Dutch (Standard)
-LanguageCodeType_7=be Belarusian
-LanguageCodeType_71=no Norwegian (Bokmal/Nynorsk)
-LanguageCodeType_73=pl Polish
-LanguageCodeType_75=pt Portuguese (Standard)
-LanguageCodeType_77=rm Rhaeto-Romanic
-LanguageCodeType_79=ro Romanian
-LanguageCodeType_81=ru Russian
-LanguageCodeType_83=sk Slovak
-LanguageCodeType_85=sl Slovenian
-LanguageCodeType_87=sq Albanian
-LanguageCodeType_89=sr Serbian (Cyrillic/Latin)
-LanguageCodeType_9=bg Bulgarian
-LinkType_16=Link type value must not be empty
-LocaleType_1=Invalid locale value
-WebPathType_1=Web root path not found
-WebPathType_2=Invalid value
-LanguageCodeType_91=sv Swedish
-LanguageCodeType_93=sx Sutu
-LanguageCodeType_95=sz Sami (Lappish)
-LanguageCodeType_97=th Thai
-LanguageCodeType_99=tn Setswana
-CurrencyCodeType_90=Latvia, Lati
-CurrencyCodeType_91=Libya, Dinars
-CurrencyCodeType_92=Morocco, Dirhams
-CurrencyCodeType_93=Moldova, Lei
-CurrencyCodeType_94=Madagascar, Ariary
-CurrencyCodeType_95=Macedonia, Denars
-CurrencyCodeType_96=Myanmar (Burma), Kyats
-CurrencyCodeType_97=Mongolia, Tugriks
-CurrencyCodeType_98=Macau, Patacas
-CurrencyCodeType_99=Mauritania, Ouguiyas
-NumberType_max_val=Value exceeds maximum of {0}
-NumberType_min_val=Value is less than minimum of {0}
-RelativePathType_0=: path not found
-DoubleType_invalid_double=Value is not a valid double.
-DoubleType_invalid_member=Value is not a member of the provided valid values
-StringType_invalid_value=Value is not valid.
-FacesConfigIdentifierType_invalid_validator_id= {0} validator id is is not registered.
-FacesConfigIdentifierType_invalid_converter_id= {0} converter id is not registered.
-FacesConfigConverterIDFeatures_converterid_empty=Converter ids must not be null or empty.
-FacesConfigValidatorIDFeatures_validatorid_empty=Validator ids must not be null or empty.
-ValueType_invalid_value_without_setter=This 'value' attribute value must be a value binding expression that can take a value assignment.
-ValueType_invalid_value=The 'value' attribute must be a non-zero length String or be a value binding expression.
-ComponentBindingType_invalid_value=The 'binding' attribute requires an EL value binding reference to a UIComponent.
-ComponentIDType_invalid_as_el='id' attributes must be Strings. Consider using 'binding' attribute instead.
-ComponentIDType_invalid_value=The 'id' attribute must be a non-zero length String and be uniquely defined on the page.
-ActionType_invalid_value=The action value does not match a navigation case outcome.
-ActionType_invalid_empty_value=The action attribute must be a non-zero length String or a method binding matching a navigation case outcome.
-ActionType_navcase_display={0}: goto {1}
-ContentType_MIME_not_empty=Content (MIME) type must not be empty
-MethodBindingType_invalid_value=MethodBinding attribute values must be EL expressions.
-JavaClassType_invalid_type=Value for type attribute must be valid Java class and not empty.
-JavaClassType_not_found=Java type not found, not instantiable, or does implement correct interfaces or extend correct superclass.
-ColorType_invalid_color=Value is not a valid color.
-Bundle_not_found_rb=Resource bundle {0} cannot be found on classpath
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/package-info.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/package-info.java
deleted file mode 100644
index 468104b..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/package-info.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-/**
- * Provides type system for tag attribute values so that the
- * org.eclipse.jst.jsf.core.metadataprocessors.features can be applied.
- *
- * A type is added using the org.eclipse.jst.jsf.core.AttributeValueRuntimeTypes extension point.
- * These types are referenced using the design-time metadata framework in org.eclipse.jst.jsf.common
- * The org.eclipse.jst.jsf.metadataprocessors.features provides the interesting tooling services based upon the type.
- *
- * <p><b>Provisional API - subject to change</b></p>
- */
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/AbstractXMLViewValidationStrategy.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/AbstractXMLViewValidationStrategy.java
deleted file mode 100644
index 5be7a8a..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/AbstractXMLViewValidationStrategy.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.validation.internal;
-
-import org.eclipse.jst.jsf.common.dom.DOMAdapter;
-import org.eclipse.jst.jsf.common.internal.policy.IIdentifiable;
-
-/**
- * A strategy that validates JSF views that are defined in XML format.
- *
- * @author cbateman
- *
- */
-public abstract class AbstractXMLViewValidationStrategy implements IIdentifiable<String>
-{
- private final String _id;
- private final String _displayName;
-
- /**
- * @param id
- * @param displayName
- */
- public AbstractXMLViewValidationStrategy(final String id, final String displayName)
- {
- _id = id;
- _displayName = displayName;
- }
-
- /**
- * @param domAdapter
- */
- public abstract void validate(final DOMAdapter domAdapter);
-
- /**
- * @param domAdapter
- * @return true if this validator is interested in validating this node
- */
- public abstract boolean isInteresting(final DOMAdapter domAdapter);
-
- public final String getId()
- {
- return _id;
- }
-
- public String getDisplayName()
- {
- return _displayName;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/ELValidationPreferences.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/ELValidationPreferences.java
deleted file mode 100644
index b96918d..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/ELValidationPreferences.java
+++ /dev/null
@@ -1,767 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.validation.internal;
-
-import org.eclipse.core.runtime.preferences.IScopeContext;
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jst.jsf.core.internal.IJSFPreferenceModel;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.validation.internal.el.diagnostics.DiagnosticFactory;
-
-/**
- * Model object for EL validation preferences
- *
- * @author cbateman
- */
-public class ELValidationPreferences implements IJSFPreferenceModel
-{
- private final static String KEY_ENABLE_BUILD_VALIDATION =
- "org.eclipse.jst.jsf.ui.ValidateJSFELBuild";
- private final static boolean DEFAULT_ENABLE_BUILD_VALIDATION = true;
-
- private final static String KEY_ENABLE_INCREMENTAL_VALIDATION =
- "org.eclipse.jst.jsf.ui.ValidateJSFELIncremental";
- private final static boolean DEFAULT_ENABLE_INCREMENTAL_VALIDATION = false;
-
-
- private boolean _enableBuildValidation;
- private boolean _enableIncrementalValidation;
- private int[] _severities;
-
- /**
- * Loads the object from the preference store provided
- *
- * @param prefStore
- */
- public void load(IPreferenceStore prefStore)
- {
- if (!prefStore.contains(KEY_ENABLE_BUILD_VALIDATION))
- {
- prefStore.setDefault(KEY_ENABLE_BUILD_VALIDATION, DEFAULT_ENABLE_BUILD_VALIDATION);
- }
- _enableBuildValidation =
- prefStore.getBoolean(KEY_ENABLE_BUILD_VALIDATION);
-
- if (!prefStore.contains(KEY_ENABLE_INCREMENTAL_VALIDATION))
- {
- prefStore.setDefault(KEY_ENABLE_INCREMENTAL_VALIDATION, DEFAULT_ENABLE_INCREMENTAL_VALIDATION);
- }
- _enableIncrementalValidation =
- prefStore.getBoolean(KEY_ENABLE_INCREMENTAL_VALIDATION);
-
- loadSeverities(prefStore);
- }
-
- private void loadSeverities(final IPreferenceStore prefStore)
- {
- final int severities[] = getSeverities();
-
- for (int i = 0; i < DiagnosticFactory.NUM_IDS; i++)
- {
- final String key = getKeyById(i);
-
- if (!prefStore.contains(key))
- {
- final int diagSeverity = getDefaultSeverity(i);
- final Severity severity = mapDiagToSeverity(diagSeverity);
-
- prefStore.setDefault(key, severity.toString());
- }
- final String storedSeverity = prefStore.getString(key);
- severities[i] = mapSeverityToDiag(storedSeverity);
- }
- }
- /**
- * Copies the object into the preference store but DOES NOT SAVE IT
- *
- * @param prefStore
- */
- public void commit(IPreferenceStore prefStore)
- {
- prefStore.setValue(KEY_ENABLE_BUILD_VALIDATION, _enableBuildValidation);
- prefStore.setValue(KEY_ENABLE_INCREMENTAL_VALIDATION,
- _enableIncrementalValidation);
- commitSeverities(prefStore);
- }
-
- private void commitSeverities(final IPreferenceStore prefStore)
- {
- final int severities[] = getSeverities();
-
- for (int i = 0; i < severities.length; i++)
- {
- final String key = getKeyById(i);
- prefStore.setValue(key
- , mapDiagToSeverity(severities[i]).toString());
- }
- }
-
- /**
- * Reverts the model to it's defaults. Does not commit to pref store.
- */
- public void setDefaults()
- {
- setEnableBuildValidation(DEFAULT_ENABLE_BUILD_VALIDATION);
- setEnableIncrementalValidation(DEFAULT_ENABLE_INCREMENTAL_VALIDATION);
- setProblemSeverityDefaults();
- }
-
- private void setProblemSeverityDefaults()
- {
- final int[] severities = getSeverities();
-
- for (int i = 0; i < DiagnosticFactory.NUM_IDS; i++)
- {
- severities[i] = getDefaultSeverity(i);
- }
- }
-
- public Object getValueByKey(IScopeContext context, String key) {
- // ignore context for now; will be used when we have project overrides
- if (KEY_ENABLE_BUILD_VALIDATION.equals(key))
- {
- return Boolean.valueOf(isEnableBuildValidation());
- }
- else if (KEY_ENABLE_INCREMENTAL_VALIDATION.equals(key))
- {
- return Boolean.valueOf(isEnableIncrementalValidation());
- }
- else
- {
- try
- {
- final Severity severity = getSeverity(key);
- return severity.toString();
- }
- catch (IllegalArgumentException e)
- {
- // getIdByKey will throw this exception if key is not a valid
- // severity key. Ignore the exception here and fall-through
- }
- }
-
- return null; // not found
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.core.internal.IJSFPreferenceModel#getStoredValueByKey(org.eclipse.core.runtime.preferences.IScopeContext, java.lang.String)
- */
- public Object getStoredValueByKey(IScopeContext context, String key) {
- // ignore context for now; will be used when we have project overrides
- if (KEY_ENABLE_BUILD_VALIDATION.equals(key))
- {
- return Boolean.valueOf(context.getNode("org.eclipse.jst.jsf.ui").getBoolean(key, true));
- }
- else if (KEY_ENABLE_INCREMENTAL_VALIDATION.equals(key))
- {
- return Boolean.valueOf(context.getNode("org.eclipse.jst.jsf.ui").getBoolean(key, false));
- }
- else
- {
- try
- {
- return context.getNode("org.eclipse.jst.jsf.core").get(key, mapDiagToSeverity(getDefaultSeverity(getIdByKey(key))).toString());
- }
- catch (IllegalArgumentException e)
- {
- // getIdByKey will throw this exception if key is not a valid
- // severity key. Ignore the exception here and fall-through
- }
- }
-
- return null; // not found
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.core.internal.IJSFPreferenceModel#setValueByKey(org.eclipse.core.runtime.preferences.IScopeContext, java.lang.String, java.lang.Object)
- */
- public Object setValueByKey(IScopeContext context, String key, Object value)
- {
- // ignore context for now; will be used when we have project overrides
- if (KEY_ENABLE_BUILD_VALIDATION.equals(key))
- {
- boolean oldValue = isEnableBuildValidation();
- boolean newValue = ((Boolean)value).booleanValue();
- setEnableBuildValidation(newValue);
- return Boolean.valueOf(oldValue);
- }
- else if (KEY_ENABLE_INCREMENTAL_VALIDATION.equals(key))
- {
- boolean oldValue = isEnableIncrementalValidation();
- boolean newValue = ((Boolean)value).booleanValue();
- setEnableIncrementalValidation(newValue);
- return Boolean.valueOf(oldValue);
- }
- else
- {
- final Severity oldValue = getSeverity(key);
- setSeverity(key, (Severity)value);
- return oldValue;
- }
- }
-
- /**
- * @return the build validation enablement
- */
- public boolean isEnableBuildValidation()
- {
- return _enableBuildValidation;
- }
-
- /**
- * @return the incremental validation enablement
- */
- public boolean isEnableIncrementalValidation()
- {
- return _enableIncrementalValidation;
- }
-
- /**
- * @param enableBuildValidation
- */
- public void setEnableBuildValidation(boolean enableBuildValidation) {
- _enableBuildValidation = enableBuildValidation;
- }
-
- /**
- * @param enableIncrementalValidation
- */
- public void setEnableIncrementalValidation(boolean enableIncrementalValidation) {
- _enableIncrementalValidation = enableIncrementalValidation;
- }
-
- /**
- * @param key
- * @return the severity
- */
- public Severity getSeverity(final String key)
- {
- final int severityDiag = _severities[getIdByKey(key)];
- final Severity severity = mapDiagToSeverity(severityDiag);
- return severity;
- }
-
- /**
- * @param key
- * @param severity
- */
- public void setSeverity(final String key, final Severity severity)
- {
- final int newSeverityDiag = mapSeverityToDiag(severity.toString());
- final int diagId = getIdByKey(key);
- _severities[diagId] = newSeverityDiag;
- }
-
- /**
- * @param diagnosticId
- * @return the severity as configured for diagnosticId. The value
- * is relative to the Diagnostic class severity scheme
- */
- public final int getDiagnosticSeverity(final int diagnosticId)
- {
- return getSeverities()[diagnosticId];
- }
-
- private int[] getSeverities()
- {
- if (_severities == null)
- {
- _severities = new int[DiagnosticFactory.NUM_IDS];
- }
-
- return _severities;
- }
-
- /**
- * @param diagSeverity
- * @return a Severity preference value for a diagnostic severity
- */
- public static Severity mapDiagToSeverity(int diagSeverity)
- {
- switch(diagSeverity)
- {
- case Diagnostic.ERROR:
- return Severity.ERROR;
- case Diagnostic.WARNING:
- return Severity.WARNING;
- default:
- return Severity.IGNORE;
- }
- }
-
- /**
- * @param severity
- * @return a Diagnostic severity level for a severity pref string
- */
- public static int mapSeverityToDiag(String severity)
- {
- if ("error".equals(severity))
- {
- return Diagnostic.ERROR;
- }
- else if ("warning".equals(severity))
- {
- return Diagnostic.WARNING;
- }
- else if ("ignore".equals(severity))
- {
- return Diagnostic.OK;
- }
- else
- {
- throw new IllegalArgumentException("Invalid enum name: "+severity);
- }
- }
-
- /**
- * @param diagnosticId
- * @return the default severity of a diagnostic
- */
- public static int getDefaultSeverity(final int diagnosticId)
- {
- switch(diagnosticId)
- {
- case DiagnosticFactory.BINARY_OP_BOTH_OPERANDS_NULL_ID:
- return Diagnostic.WARNING;
- case DiagnosticFactory.BINARY_OP_POSSIBLE_DIVISION_BY_ZERO_ID:
- return Diagnostic.ERROR;
- case DiagnosticFactory.BINARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION_ID:
- return Diagnostic.ERROR;
- case DiagnosticFactory.BINARY_OP_CONSTANT_EXPRESSION_ALWAYS_EVAL_SAME_ID:
- return Diagnostic.WARNING;
- case DiagnosticFactory.BINARY_OP_EQUALITY_COMP_WITH_NULL_ALWAYS_EVAL_SAME_ID:
- return Diagnostic.WARNING;
- case DiagnosticFactory.BINARY_OP_CANNOT_COERCE_ARGUMENT_TO_BOOLEAN_ID:
- return Diagnostic.ERROR;
- case DiagnosticFactory.BINARY_OP_FIRST_ARGUMENT_SHORT_CIRCUITS_ID:
- return Diagnostic.WARNING;
- case DiagnosticFactory.BINARY_OP_SECOND_ARGUMENT_ALWAYS_EVAL_SAME_ID:
- return Diagnostic.WARNING;
- case DiagnosticFactory.BINARY_OP_NO_AVAILABLE_TYPE_COERCION_ID:
- return Diagnostic.ERROR;
- case DiagnosticFactory.BINARY_OP_COULD_NOT_COERCE_LITERALS_TO_NUMBERS_ID:
- return Diagnostic.ERROR;
- case DiagnosticFactory.UNARY_OP_CONSTANT_EXPRESSION_EVAL_SAME_ID:
- return Diagnostic.WARNING;
- case DiagnosticFactory.UNARY_OP_EMPTY_ALWAYS_FALSE_ON_TYPE_ID:
- return Diagnostic.WARNING;
- case DiagnosticFactory.UNARY_OP_MINUS_ON_NULL_ALWAYS_ZERO_ID:
- return Diagnostic.WARNING;
- case DiagnosticFactory.UNARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION_ID:
- return Diagnostic.ERROR;
- case DiagnosticFactory.UNARY_OP_CANNOT_COERCE_ARGUMENT_TO_BOOLEAN_ID:
- return Diagnostic.ERROR;
- case DiagnosticFactory.TERNARY_OP_CHOICE_IS_ALWAYS_SAME_ID:
- return Diagnostic.WARNING;
- case DiagnosticFactory.TERNARY_OP_CANNOT_COERCE_CHOICE_TO_BOOLEAN_ID:
- return Diagnostic.ERROR;
- case DiagnosticFactory.UNARY_OP_STRING_CONVERSION_NOT_GUARANTEED_ID:
- return Diagnostic.WARNING;
- case DiagnosticFactory.CANNOT_APPLY_OPERATOR_TO_METHOD_BINDING_ID:
- return Diagnostic.ERROR;
- case DiagnosticFactory.MEMBER_NOT_FOUND_ID:
- return Diagnostic.WARNING;
- case DiagnosticFactory.VARIABLE_NOT_FOUND_ID:
- return Diagnostic.WARNING;
- case DiagnosticFactory.MISSING_CLOSING_EXPR_BRACKET_ID:
- return Diagnostic.ERROR;
- case DiagnosticFactory.GENERAL_SYNTAX_ERROR_ID:
- return Diagnostic.WARNING;
- case DiagnosticFactory.EMPTY_EL_EXPRESSION_ID:
- return Diagnostic.WARNING;
- case DiagnosticFactory.BINARY_OP_DOT_WITH_VALUEB_NULL_ID:
- return Diagnostic.WARNING;
- case DiagnosticFactory.BINARY_OP_DOT_WITH_DOTTED_KEY_SHOULD_USE_ARRAY_ID:
- return Diagnostic.WARNING;
- case DiagnosticFactory.POSSIBLE_ARRAY_INDEX_OUT_OF_BOUNDS_ID:
- return Diagnostic.WARNING;
- case DiagnosticFactory.BINARY_COMPARISON_WITH_ENUM_ALWAYS_SAME_ID:
- return Diagnostic.WARNING;
- case DiagnosticFactory.BINARY_OP_COMPARISON_OF_ENUMS_INCOMPATIBLE_ID:
- return Diagnostic.ERROR;
- case DiagnosticFactory.MEMBER_IS_INTERMEDIATE_ID:
- return Diagnostic.WARNING;
- default:
- throw new IllegalArgumentException("Diagnostic Id: "+ diagnosticId +" is out of range");
- }
- }
-
- /**
- * @param diagnosticId
- * @return the preference key for the corresponding diagnosticId in the el DiagnosticFactory
- */
- public static String getKeyById(final int diagnosticId)
- {
- switch(diagnosticId)
- {
- case DiagnosticFactory.BINARY_OP_BOTH_OPERANDS_NULL_ID:
- return BINARY_OP_BOTH_OPERANDS_NULL;
- case DiagnosticFactory.BINARY_OP_POSSIBLE_DIVISION_BY_ZERO_ID:
- return BINARY_OP_POSSIBLE_DIVISION_BY_ZERO;
- case DiagnosticFactory.BINARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION_ID:
- return BINARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION;
- case DiagnosticFactory.BINARY_OP_CONSTANT_EXPRESSION_ALWAYS_EVAL_SAME_ID:
- return BINARY_OP_CONSTANT_EXPRESSION_ALWAYS_EVAL_SAME;
- case DiagnosticFactory.BINARY_OP_EQUALITY_COMP_WITH_NULL_ALWAYS_EVAL_SAME_ID:
- return BINARY_OP_EQUALITY_COMP_WITH_NULL_ALWAYS_EVAL_SAME;
- case DiagnosticFactory.BINARY_OP_CANNOT_COERCE_ARGUMENT_TO_BOOLEAN_ID:
- return BINARY_OP_CANNOT_COERCE_ARGUMENT_TO_BOOLEAN;
- case DiagnosticFactory.BINARY_OP_FIRST_ARGUMENT_SHORT_CIRCUITS_ID:
- return BINARY_OP_FIRST_ARGUMENT_SHORT_CIRCUITS;
- case DiagnosticFactory.BINARY_OP_SECOND_ARGUMENT_ALWAYS_EVAL_SAME_ID:
- return BINARY_OP_SECOND_ARGUMENT_ALWAYS_EVAL_SAME;
- case DiagnosticFactory.BINARY_OP_NO_AVAILABLE_TYPE_COERCION_ID:
- return BINARY_OP_NO_AVAILABLE_TYPE_COERCION;
- case DiagnosticFactory.BINARY_OP_COULD_NOT_COERCE_LITERALS_TO_NUMBERS_ID:
- return BINARY_OP_COULD_NOT_COERCE_LITERALS_TO_NUMBERS;
- case DiagnosticFactory.UNARY_OP_CONSTANT_EXPRESSION_EVAL_SAME_ID:
- return UNARY_OP_CONSTANT_EXPRESSION_EVAL_SAME;
- case DiagnosticFactory.UNARY_OP_EMPTY_ALWAYS_FALSE_ON_TYPE_ID:
- return UNARY_OP_EMPTY_ALWAYS_FALSE_ON_TYPE;
- case DiagnosticFactory.UNARY_OP_MINUS_ON_NULL_ALWAYS_ZERO_ID:
- return UNARY_OP_MINUS_ON_NULL_ALWAYS_ZERO;
- case DiagnosticFactory.UNARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION_ID:
- return UNARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION;
- case DiagnosticFactory.UNARY_OP_CANNOT_COERCE_ARGUMENT_TO_BOOLEAN_ID:
- return UNARY_OP_CANNOT_COERCE_ARGUMENT_TO_BOOLEAN;
- case DiagnosticFactory.TERNARY_OP_CHOICE_IS_ALWAYS_SAME_ID:
- return TERNARY_OP_CHOICE_IS_ALWAYS_SAME;
- case DiagnosticFactory.TERNARY_OP_CANNOT_COERCE_CHOICE_TO_BOOLEAN_ID:
- return TERNARY_OP_CANNOT_COERCE_CHOICE_TO_BOOLEAN;
- case DiagnosticFactory.UNARY_OP_STRING_CONVERSION_NOT_GUARANTEED_ID:
- return UNARY_OP_STRING_CONVERSION_NOT_GUARANTEED;
- case DiagnosticFactory.CANNOT_APPLY_OPERATOR_TO_METHOD_BINDING_ID:
- return CANNOT_APPLY_OPERATOR_TO_METHOD_BINDING;
- case DiagnosticFactory.MEMBER_NOT_FOUND_ID:
- return MEMBER_NOT_FOUND;
- case DiagnosticFactory.VARIABLE_NOT_FOUND_ID:
- return VARIABLE_NOT_FOUND;
- case DiagnosticFactory.MISSING_CLOSING_EXPR_BRACKET_ID:
- return MISSING_CLOSING_EXPR_BRACKET;
- case DiagnosticFactory.GENERAL_SYNTAX_ERROR_ID:
- return GENERAL_SYNTAX_ERROR;
- case DiagnosticFactory.EMPTY_EL_EXPRESSION_ID:
- return EMPTY_EL_EXPRESSION;
- case DiagnosticFactory.BINARY_OP_DOT_WITH_VALUEB_NULL_ID:
- return BINARY_OP_DOT_WITH_VALUEB_NULL;
- case DiagnosticFactory.BINARY_OP_DOT_WITH_DOTTED_KEY_SHOULD_USE_ARRAY_ID:
- return BINARY_OP_DOT_WITH_DOTTED_KEY_SHOULD_USE_ARRAY;
- case DiagnosticFactory.POSSIBLE_ARRAY_INDEX_OUT_OF_BOUNDS_ID:
- return POSSIBLE_ARRAY_INDEX_OUT_OF_BOUNDS;
- case DiagnosticFactory.BINARY_COMPARISON_WITH_ENUM_ALWAYS_SAME_ID:
- return BINARY_COMPARISON_WITH_ENUM_ALWAYS_SAME;
- case DiagnosticFactory.BINARY_OP_COMPARISON_OF_ENUMS_INCOMPATIBLE_ID:
- return BINARY_OP_COMPARISON_OF_ENUMS_INCOMPATIBLE;
- case DiagnosticFactory.MEMBER_IS_INTERMEDIATE_ID:
- return MEMBER_IS_INTERMEDIATE;
- default:
- throw new IllegalArgumentException("Diagnostic Id: "+ diagnosticId +" is out of range");
- }
- }
-
- /**
- * @param key
- * @return the preference key for the corresponding diagnosticId in the el DiagnosticFactory
- */
- public static int getIdByKey(final String key)
- {
- if (BINARY_OP_BOTH_OPERANDS_NULL.equals(key))
- {
- return DiagnosticFactory.BINARY_OP_BOTH_OPERANDS_NULL_ID;
- }
- else if (BINARY_OP_POSSIBLE_DIVISION_BY_ZERO.equals(key))
- {
- return DiagnosticFactory.BINARY_OP_POSSIBLE_DIVISION_BY_ZERO_ID;
- }
- else if (BINARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION.equals(key))
- {
- return DiagnosticFactory.BINARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION_ID;
- }
- else if (BINARY_OP_CONSTANT_EXPRESSION_ALWAYS_EVAL_SAME.equals(key))
- {
- return DiagnosticFactory.BINARY_OP_CONSTANT_EXPRESSION_ALWAYS_EVAL_SAME_ID;
- }
- else if (BINARY_OP_EQUALITY_COMP_WITH_NULL_ALWAYS_EVAL_SAME.equals(key))
- {
- return DiagnosticFactory.BINARY_OP_EQUALITY_COMP_WITH_NULL_ALWAYS_EVAL_SAME_ID;
- }
- else if (BINARY_OP_CANNOT_COERCE_ARGUMENT_TO_BOOLEAN.equals(key))
- {
- return DiagnosticFactory.BINARY_OP_CANNOT_COERCE_ARGUMENT_TO_BOOLEAN_ID;
- }
- else if (BINARY_OP_FIRST_ARGUMENT_SHORT_CIRCUITS.equals(key))
- {
- return DiagnosticFactory.BINARY_OP_FIRST_ARGUMENT_SHORT_CIRCUITS_ID;
- }
- else if (BINARY_OP_SECOND_ARGUMENT_ALWAYS_EVAL_SAME.equals(key))
- {
- return DiagnosticFactory.BINARY_OP_SECOND_ARGUMENT_ALWAYS_EVAL_SAME_ID;
- }
- else if (BINARY_OP_NO_AVAILABLE_TYPE_COERCION.equals(key))
- {
- return DiagnosticFactory.BINARY_OP_NO_AVAILABLE_TYPE_COERCION_ID;
- }
- else if (BINARY_OP_COULD_NOT_COERCE_LITERALS_TO_NUMBERS.equals(key))
- {
- return DiagnosticFactory.BINARY_OP_COULD_NOT_COERCE_LITERALS_TO_NUMBERS_ID;
- }
- else if (UNARY_OP_CONSTANT_EXPRESSION_EVAL_SAME.equals(key))
- {
- return DiagnosticFactory.UNARY_OP_CONSTANT_EXPRESSION_EVAL_SAME_ID;
- }
- else if (UNARY_OP_EMPTY_ALWAYS_FALSE_ON_TYPE.equals(key))
- {
- return DiagnosticFactory.UNARY_OP_EMPTY_ALWAYS_FALSE_ON_TYPE_ID;
- }
- else if (UNARY_OP_MINUS_ON_NULL_ALWAYS_ZERO.equals(key))
- {
- return DiagnosticFactory.UNARY_OP_MINUS_ON_NULL_ALWAYS_ZERO_ID;
- }
- else if (UNARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION.equals(key))
- {
- return DiagnosticFactory.UNARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION_ID;
- }
- else if (UNARY_OP_CANNOT_COERCE_ARGUMENT_TO_BOOLEAN.equals(key))
- {
- return DiagnosticFactory.UNARY_OP_CANNOT_COERCE_ARGUMENT_TO_BOOLEAN_ID;
- }
- else if (TERNARY_OP_CHOICE_IS_ALWAYS_SAME.equals(key))
- {
- return DiagnosticFactory.TERNARY_OP_CHOICE_IS_ALWAYS_SAME_ID;
- }
- else if (TERNARY_OP_CANNOT_COERCE_CHOICE_TO_BOOLEAN.equals(key))
- {
- return DiagnosticFactory.TERNARY_OP_CANNOT_COERCE_CHOICE_TO_BOOLEAN_ID;
- }
- else if (UNARY_OP_STRING_CONVERSION_NOT_GUARANTEED.equals(key))
- {
- return DiagnosticFactory.UNARY_OP_STRING_CONVERSION_NOT_GUARANTEED_ID;
- }
- else if (CANNOT_APPLY_OPERATOR_TO_METHOD_BINDING.equals(key))
- {
- return DiagnosticFactory.CANNOT_APPLY_OPERATOR_TO_METHOD_BINDING_ID;
- }
- else if (MEMBER_NOT_FOUND.equals(key))
- {
- return DiagnosticFactory.MEMBER_NOT_FOUND_ID;
- }
- else if (VARIABLE_NOT_FOUND.equals(key))
- {
- return DiagnosticFactory.VARIABLE_NOT_FOUND_ID;
- }
- else if (MISSING_CLOSING_EXPR_BRACKET.equals(key))
- {
- return DiagnosticFactory.MISSING_CLOSING_EXPR_BRACKET_ID;
- }
- else if (GENERAL_SYNTAX_ERROR.equals(key))
- {
- return DiagnosticFactory.GENERAL_SYNTAX_ERROR_ID;
- }
- else if (EMPTY_EL_EXPRESSION.equals(key))
- {
- return DiagnosticFactory.EMPTY_EL_EXPRESSION_ID;
- }
- else if (BINARY_OP_DOT_WITH_VALUEB_NULL.equals(key))
- {
- return DiagnosticFactory.BINARY_OP_DOT_WITH_VALUEB_NULL_ID;
- }
- else if (BINARY_OP_DOT_WITH_DOTTED_KEY_SHOULD_USE_ARRAY.equals(key))
- {
- return DiagnosticFactory.BINARY_OP_DOT_WITH_DOTTED_KEY_SHOULD_USE_ARRAY_ID;
- }
- else if (POSSIBLE_ARRAY_INDEX_OUT_OF_BOUNDS.equals(key))
- {
- return DiagnosticFactory.POSSIBLE_ARRAY_INDEX_OUT_OF_BOUNDS_ID;
- }
- else if (BINARY_COMPARISON_WITH_ENUM_ALWAYS_SAME.equals(key))
- {
- return DiagnosticFactory.BINARY_COMPARISON_WITH_ENUM_ALWAYS_SAME_ID;
- }
- else if (BINARY_OP_COMPARISON_OF_ENUMS_INCOMPATIBLE.equals(key))
- {
- return DiagnosticFactory.BINARY_OP_COMPARISON_OF_ENUMS_INCOMPATIBLE_ID;
- }
- else if (MEMBER_IS_INTERMEDIATE.equals(key))
- {
- return DiagnosticFactory.MEMBER_IS_INTERMEDIATE_ID;
- }
- else
- {
- throw new IllegalArgumentException("Severity Key: "+ key);
- }
- }
-
- /**
- * e.g. createQualifiedKeyName("foo") -> org.eclipse.jst.jsf.core.foo
- * @param baseName
- * @return a plugin qualified key given the baseName
- *
- */
- private static String createQualifiedKeyName(final String baseName)
- {
- return JSFCorePlugin.PLUGIN_ID + "." + baseName;
- }
-
- /**
- * preference key. Match to DiagnosticFactory constants
- */
- public final static String BINARY_OP_BOTH_OPERANDS_NULL =
- createQualifiedKeyName("BINARY_OP_BOTH_OPERANDS_NULL");
- /**
- * preference key. Match to DiagnosticFactory constants
- */
- public final static String BINARY_OP_POSSIBLE_DIVISION_BY_ZERO =
- createQualifiedKeyName("BINARY_OP_POSSIBLE_DIVISION_BY_ZERO");
- /**
- * preference key. Match to DiagnosticFactory constants
- */
- public final static String BINARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION =
- createQualifiedKeyName("BINARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION");
- /**
- * preference key. Match to DiagnosticFactory constants
- */
- public final static String BINARY_OP_CONSTANT_EXPRESSION_ALWAYS_EVAL_SAME =
- createQualifiedKeyName("BINARY_OP_CONSTANT_EXPRESSION_ALWAYS_EVAL_SAME");
- /**
- * preference key. Match to DiagnosticFactory constants
- */
- public final static String BINARY_OP_EQUALITY_COMP_WITH_NULL_ALWAYS_EVAL_SAME =
- createQualifiedKeyName("BINARY_OP_EQUALITY_COMP_WITH_NULL_ALWAYS_EVAL_SAME");
- /**
- * preference key. Match to DiagnosticFactory constants
- */
- public final static String BINARY_OP_CANNOT_COERCE_ARGUMENT_TO_BOOLEAN =
- createQualifiedKeyName("BINARY_OP_CANNOT_COERCE_ARGUMENT_TO_BOOLEAN");
- /**
- * preference key. Match to DiagnosticFactory constants
- */
- public final static String BINARY_OP_FIRST_ARGUMENT_SHORT_CIRCUITS =
- createQualifiedKeyName("BINARY_OP_FIRST_ARGUMENT_SHORT_CIRCUITS");
- /**
- * preference key. Match to DiagnosticFactory constants
- */
- public final static String BINARY_OP_SECOND_ARGUMENT_ALWAYS_EVAL_SAME =
- createQualifiedKeyName("BINARY_OP_SECOND_ARGUMENT_ALWAYS_EVAL_SAME");
- /**
- * preference key. Match to DiagnosticFactory constants
- */
- public final static String BINARY_OP_NO_AVAILABLE_TYPE_COERCION =
- createQualifiedKeyName("BINARY_OP_NO_AVAILABLE_TYPE_COERCION");
- /**
- * preference key. Match to DiagnosticFactory constants
- */
- public final static String BINARY_OP_COULD_NOT_COERCE_LITERALS_TO_NUMBERS =
- createQualifiedKeyName("BINARY_OP_COULD_NOT_COERCE_LITERALS_TO_NUMBERS");
- /**
- * preference key. Match to DiagnosticFactory constants
- */
- public final static String UNARY_OP_CONSTANT_EXPRESSION_EVAL_SAME =
- createQualifiedKeyName("UNARY_OP_CONSTANT_EXPRESSION_EVAL_SAME");
- /**
- * preference key. Match to DiagnosticFactory constants
- */
- public final static String UNARY_OP_EMPTY_ALWAYS_FALSE_ON_TYPE =
- createQualifiedKeyName("UNARY_OP_EMPTY_ALWAYS_FALSE_ON_TYPE");
- /**
- * preference key. Match to DiagnosticFactory constants
- */
- public final static String UNARY_OP_MINUS_ON_NULL_ALWAYS_ZERO =
- createQualifiedKeyName("UNARY_OP_MINUS_ON_NULL_ALWAYS_ZERO");
- /**
- * preference key. Match to DiagnosticFactory constants
- */
- public final static String UNARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION =
- createQualifiedKeyName("UNARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION");
- /**
- * preference key. Match to DiagnosticFactory constants
- */
- public final static String UNARY_OP_CANNOT_COERCE_ARGUMENT_TO_BOOLEAN =
- createQualifiedKeyName("UNARY_OP_CANNOT_COERCE_ARGUMENT_TO_BOOLEAN");
- /**
- * preference key. Match to DiagnosticFactory constants
- */
- public final static String TERNARY_OP_CHOICE_IS_ALWAYS_SAME =
- createQualifiedKeyName("TERNARY_OP_CHOICE_IS_ALWAYS_SAME");
- /**
- * preference key. Match to DiagnosticFactory constants
- */
- public final static String TERNARY_OP_CANNOT_COERCE_CHOICE_TO_BOOLEAN =
- createQualifiedKeyName("TERNARY_OP_CANNOT_COERCE_CHOICE_TO_BOOLEAN");
- /**
- * preference key. Match to DiagnosticFactory constants
- */
- public final static String UNARY_OP_STRING_CONVERSION_NOT_GUARANTEED =
- createQualifiedKeyName("UNARY_OP_STRING_CONVERSION_NOT_GUARANTEED");
- /**
- * preference key. Match to DiagnosticFactory constants
- */
- public final static String CANNOT_APPLY_OPERATOR_TO_METHOD_BINDING =
- createQualifiedKeyName("CANNOT_APPLY_OPERATOR_TO_METHOD_BINDING");
- /**
- * preference key. Match to DiagnosticFactory constants
- */
- public final static String MEMBER_NOT_FOUND =
- createQualifiedKeyName("MEMBER_NOT_FOUND");
- /**
- * preference key. Match to DiagnosticFactory constants
- */
- public final static String VARIABLE_NOT_FOUND =
- createQualifiedKeyName("VARIABLE_NOT_FOUND");
- /**
- * preference key. Match to DiagnosticFactory constants
- */
- public final static String MISSING_CLOSING_EXPR_BRACKET =
- createQualifiedKeyName("MISSING_CLOSING_EXPR_BRACKET");
- /**
- * preference key. Match to DiagnosticFactory constants
- */
- public final static String GENERAL_SYNTAX_ERROR =
- createQualifiedKeyName("GENERAL_SYNTAX_ERROR");
- /**
- * preference key. Match to DiagnosticFactory constants
- */
- public final static String EMPTY_EL_EXPRESSION =
- createQualifiedKeyName("EMPTY_EL_EXPRESSION");
- /**
- * preference key. Match to DiagnosticFactory constants
- */
- public final static String BINARY_OP_DOT_WITH_VALUEB_NULL =
- createQualifiedKeyName("BINARY_OP_DOT_WITH_VALUEB_NULL");
- /**
- * preference key. Match to DiagnosticFactory constants
- */
- public final static String BINARY_OP_DOT_WITH_DOTTED_KEY_SHOULD_USE_ARRAY =
- createQualifiedKeyName("BINARY_OP_DOT_WITH_DOTTED_KEY_SHOULD_USE_ARRAY");
- /**
- * preference key. Match to DiagnosticFactory constants
- */
- public final static String POSSIBLE_ARRAY_INDEX_OUT_OF_BOUNDS =
- createQualifiedKeyName("POSSIBLE_ARRAY_INDEX_OUT_OF_BOUNDS");
- /**
- * preference key. Match to DiagnosticFactory constants
- */
- public final static String BINARY_COMPARISON_WITH_ENUM_ALWAYS_SAME =
- createQualifiedKeyName("BINARY_COMPARISON_WITH_ENUM_ALWAYS_SAME");
- /**
- * preference key. Match to DiagnosticFactory constants
- */
- public final static String BINARY_OP_COMPARISON_OF_ENUMS_INCOMPATIBLE =
- createQualifiedKeyName("BINARY_OP_COMPARISON_OF_ENUMS_INCOMPATIBLE");
-
- /**
- * preference key. Match to DiagnosticFactory constants
- */
- public final static String MEMBER_IS_INTERMEDIATE =
- createQualifiedKeyName("MEMBER_IS_INTERMEDIATE");
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/IJSFViewValidator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/IJSFViewValidator.java
deleted file mode 100644
index a51c914..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/IJSFViewValidator.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.validation.internal;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- * A validator for JSF views
- *
- * @author cbateman
- *
- */
-public interface IJSFViewValidator
-{
- /**
- * Validate the entire view file and report an problems using reporter.
- *
- * @param viewFile
- * @param reporter
- */
- void validateView(final IFile viewFile, final IValidationReporter reporter);
-
- /**
- * Validate only those regions specified in the viewFile and report problems
- * using reporter.
- *
- * @param viewFile
- * @param regions
- * @param reporter
- */
- void validateView(final IFile viewFile,
- final IStructuredDocumentRegion[] regions,
- final IValidationReporter reporter);
-
- /**
- * Implemented by callers of the view validator to receive notification
- * of problems discovered during validation.
- *
- */
- public interface IValidationReporter
- {
- /**
- * @param problem
- * @param start
- * @param length
- */
- void report(final Diagnostic problem, final int start, final int length);
-
- /**
- * @param message
- * @deprecated internally by design
- */
- void report(final IMessage message);
- }
-
- /**
- * An empty adapter implementation of IValidationReporter. All methods
- * are noops.
- *
- * @author cbateman
- *
- */
- public class ReporterAdapter implements IValidationReporter
- {
-
- public void report(Diagnostic problem, int start, int length)
- {
- // do nothing
- }
-
- public void report(IMessage message)
- {
- // do nothing
- }
-
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/IJSPSemanticValidatorTest.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/IJSPSemanticValidatorTest.java
deleted file mode 100644
index 454d31d..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/IJSPSemanticValidatorTest.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.validation.internal;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.core.internal.region.Region2ElementAdapter;
-import org.eclipse.jst.jsf.validation.internal.IJSFViewValidator.IValidationReporter;
-
-/**
- * Exposes certain private members for use by testing.
- *
- * NOT intended for use by production code.
- *
- * @author cbateman
- *
- */
-public interface IJSPSemanticValidatorTest
-{
- /**
- * Proxies the internal call to validate the containment of a particular
- * tag.
- *
- * @param adapter
- * @param node
- * @param uri
- * @param tagName
- * @param reporter
- * @param file
- * @param context
- */
- void validateContainment(Region2ElementAdapter adapter, IValidationReporter reporter, IFile file, IStructuredDocumentContext context);
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/JSFTypeComparatorPreferences.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/JSFTypeComparatorPreferences.java
deleted file mode 100644
index 9a6a537..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/JSFTypeComparatorPreferences.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.validation.internal;
-
-import org.eclipse.core.runtime.preferences.IScopeContext;
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jst.jsf.common.internal.types.TypeComparatorDiagnosticFactory;
-import org.eclipse.jst.jsf.common.internal.types.TypeComparatorPreferences;
-import org.eclipse.jst.jsf.core.internal.IJSFPreferenceModel;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-
-/**
- * Type comparator preferences for JSF.
- *
- * @author cbateman
- *
- */
-public class JSFTypeComparatorPreferences extends TypeComparatorPreferences
- implements IJSFPreferenceModel
-{
-
- private int[] _severities;
-
- /**
- * Loads the object from the preference store provided
- *
- * @param prefStore
- */
- public void load(IPreferenceStore prefStore)
- {
- loadSeverities(prefStore);
- }
-
- private void loadSeverities(final IPreferenceStore prefStore)
- {
- final int severities[] = getSeverities();
-
- for (int i = 0; i < TypeComparatorDiagnosticFactory.NUM_IDS; i++)
- {
- final String key = getKeyById(i);
-
- if (!prefStore.contains(key))
- {
- final int diagSeverity = getDefaultSeverity(i);
- final Severity severity = mapDiagToSeverity(diagSeverity);
-
- prefStore.setDefault(key, severity.toString());
- }
- final String storedSeverity = prefStore.getString(key);
- severities[i] = mapSeverityToDiag(storedSeverity);
- }
- }
-
- /**
- * Copies the object into the preference store but DOES NOT SAVE IT
- *
- * @param prefStore
- */
- public void commit(IPreferenceStore prefStore)
- {
- commitSeverities(prefStore);
- }
-
- private void commitSeverities(final IPreferenceStore prefStore)
- {
- final int severities[] = getSeverities();
-
- for (int i = 0; i < severities.length; i++)
- {
- final String key = getKeyById(i);
- prefStore
- .setValue(key, mapDiagToSeverity(severities[i]).toString());
- }
- }
-
- /**
- * Reverts the model to it's defaults. Does not commit to pref store.
- */
- public void setDefaults()
- {
- setProblemSeverityDefaults();
- }
-
- private void setProblemSeverityDefaults()
- {
- final int[] severities = getSeverities();
-
- for (int i = 0; i < TypeComparatorDiagnosticFactory.NUM_IDS; i++)
- {
- severities[i] = getDefaultSeverity(i);
- }
- }
-
- public Object getValueByKey(IScopeContext context, String key)
- {
- try
- {
- final Severity severity = getSeverity(key);
- return severity.toString();
- }
- catch (IllegalArgumentException e)
- {
- // getIdByKey will throw this exception if key is not a valid
- // severity key. Ignore the exception here and fall-through
- }
-
- return null; // not found
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.jsf.core.internal.IJSFPreferenceModel#getStoredValueByKey(org.eclipse.core.runtime.preferences.IScopeContext,
- * java.lang.String)
- */
- public Object getStoredValueByKey(IScopeContext context, String key)
- {
- try
- {
- return context.getNode("org.eclipse.jst.jsf.core").get(
- key,
- mapDiagToSeverity(getDefaultSeverity(getIdByKey(key)))
- .toString());
- }
- catch (IllegalArgumentException e)
- {
- // getIdByKey will throw this exception if key is not a valid
- // severity key. Ignore the exception here and fall-through
- }
-
- return null; // not found
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.jsf.core.internal.IJSFPreferenceModel#setValueByKey(org.eclipse.core.runtime.preferences.IScopeContext,
- * java.lang.String, java.lang.Object)
- */
- public Object setValueByKey(IScopeContext context, String key, Object value)
- {
- final Severity oldValue = getSeverity(key);
- setSeverity(key, (Severity) value);
- return oldValue;
- }
-
- /**
- * @param key
- * @return the severity
- */
- public Severity getSeverity(final String key)
- {
- final int severityDiag = _severities[getIdByKey(key)];
- final Severity severity = mapDiagToSeverity(severityDiag);
- return severity;
- }
-
- /**
- * @param key
- * @param severity
- */
- public void setSeverity(final String key, final Severity severity)
- {
- final int newSeverityDiag = mapSeverityToDiag(severity.toString());
- final int diagId = getIdByKey(key);
- _severities[diagId] = newSeverityDiag;
- }
-
- /**
- * @param diagnosticId
- * @return the severity as configured for diagnosticId. The value is
- * relative to the Diagnostic class severity scheme
- */
- public final int getDiagnosticSeverity(final int diagnosticId)
- {
- return getSeverities()[diagnosticId];
- }
-
- private int[] getSeverities()
- {
- if (_severities == null)
- {
- _severities = new int[TypeComparatorDiagnosticFactory.NUM_IDS];
- }
-
- return _severities;
- }
-
- /**
- * @param diagSeverity
- * @return a Severity preference value for a diagnostic severity
- */
- public static Severity mapDiagToSeverity(int diagSeverity)
- {
- switch (diagSeverity)
- {
- case Diagnostic.ERROR:
- return Severity.ERROR;
- case Diagnostic.WARNING:
- return Severity.WARNING;
- default:
- return Severity.IGNORE;
- }
- }
-
- /**
- * @param severity
- * @return a Diagnostic severity level for a severity pref string
- */
- public static int mapSeverityToDiag(String severity)
- {
- if ("error".equals(severity))
- {
- return Diagnostic.ERROR;
- }
- else if ("warning".equals(severity))
- {
- return Diagnostic.WARNING;
- }
- else if ("ignore".equals(severity))
- {
- return Diagnostic.OK;
- }
- else
- {
- throw new IllegalArgumentException("Invalid enum name: " + severity);
- }
- }
-
- /**
- * @param diagnosticId
- * @return the preference key for the corresponding diagnosticId in the el
- * DiagnosticFactory
- */
- public static String getKeyById(final int diagnosticId)
- {
- switch (diagnosticId)
- {
- case TypeComparatorDiagnosticFactory.INCOMPATIBLE_METHOD_TYPES_ID:
- return INCOMPATIBLE_METHOD_TYPES;
- case TypeComparatorDiagnosticFactory.INCOMPATIBLE_TYPES_ID:
- return INCOMPATIBLE_TYPES;
- case TypeComparatorDiagnosticFactory.METHOD_EXPRESSION_EXPECTED_ID:
- return METHOD_EXPRESSION_EXPECTED;
- case TypeComparatorDiagnosticFactory.PROPERTY_NOT_READABLE_ID:
- return PROPERTY_NOT_READABLE;
- case TypeComparatorDiagnosticFactory.PROPERTY_NOT_WRITABLE_ID:
- return PROPERTY_NOT_WRITABLE;
- case TypeComparatorDiagnosticFactory.VALUE_EXPRESSION_EXPECTED_ID:
- return VALUE_EXPRESSION_EXPECTED;
- default:
- throw new IllegalArgumentException("Diagnostic Id: "
- + diagnosticId + " is out of range");
- }
- }
-
- /**
- * @param key
- * @return the preference key for the corresponding diagnosticId in the el
- * DiagnosticFactory
- */
- public static int getIdByKey(final String key)
- {
- if (INCOMPATIBLE_METHOD_TYPES.equals(key))
- {
- return TypeComparatorDiagnosticFactory.INCOMPATIBLE_METHOD_TYPES_ID;
- }
- else if (INCOMPATIBLE_TYPES.equals(key))
- {
- return TypeComparatorDiagnosticFactory.INCOMPATIBLE_TYPES_ID;
- }
- else if (METHOD_EXPRESSION_EXPECTED.equals(key))
- {
- return TypeComparatorDiagnosticFactory.METHOD_EXPRESSION_EXPECTED_ID;
- }
- else if (PROPERTY_NOT_READABLE.equals(key))
- {
- return TypeComparatorDiagnosticFactory.PROPERTY_NOT_READABLE_ID;
- }
- else if (PROPERTY_NOT_WRITABLE.equals(key))
- {
- return TypeComparatorDiagnosticFactory.PROPERTY_NOT_WRITABLE_ID;
- }
- else if (VALUE_EXPRESSION_EXPECTED.equals(key))
- {
- return TypeComparatorDiagnosticFactory.VALUE_EXPRESSION_EXPECTED_ID;
- }
- else
- {
- throw new IllegalArgumentException("Severity Key: " + key);
- }
- }
-
- /**
- * e.g. createQualifiedKeyName("foo") -> org.eclipse.jst.jsf.core.foo
- *
- * @param baseName
- * @return a plugin qualified key given the baseName
- *
- */
- private static String createQualifiedKeyName(final String baseName)
- {
- return JSFCorePlugin.PLUGIN_ID + "." + baseName;
- }
-
- /**
- * preference key. Match to DiagnosticFactory constants
- */
- public final static String INCOMPATIBLE_METHOD_TYPES = createQualifiedKeyName("INCOMPATIBLE_METHOD_TYPES");
- /**
- * preference key. Match to DiagnosticFactory constants
- */
- public final static String INCOMPATIBLE_TYPES = createQualifiedKeyName("INCOMPATIBLE_TYPES");
- /**
- * preference key. Match to DiagnosticFactory constants
- */
- public final static String METHOD_EXPRESSION_EXPECTED = createQualifiedKeyName("METHOD_EXPRESSION_EXPECTED");
- /**
- * preference key. Match to DiagnosticFactory constants
- */
- public final static String PROPERTY_NOT_READABLE = createQualifiedKeyName("PROPERTY_NOT_READABLE");
- /**
- * preference key. Match to DiagnosticFactory constants
- */
- public final static String PROPERTY_NOT_WRITABLE = createQualifiedKeyName("PROPERTY_NOT_WRITABLE");
- /**
- * preference key. Match to DiagnosticFactory constants
- */
- public final static String VALUE_EXPRESSION_EXPECTED = createQualifiedKeyName("VALUE_EXPRESSION_EXPECTED");
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/JSFValidationContext.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/JSFValidationContext.java
deleted file mode 100644
index 0901a0e..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/JSFValidationContext.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.validation.internal;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jst.jsf.designtime.internal.view.IDTViewHandler;
-import org.eclipse.jst.jsf.designtime.resolver.IStructuredDocumentSymbolResolverFactory;
-import org.eclipse.jst.jsf.validation.internal.IJSFViewValidator.IValidationReporter;
-import org.eclipse.jst.jsf.validation.internal.el.diagnostics.DiagnosticFactory;
-
-/**
- * A context object used pass JSF validation information around. Not related to
- * the model context framework.
- *
- * @author cbateman
- *
- */
-public final class JSFValidationContext
-{
- private final ValidationPreferences _prefs;
- private final boolean _isIncremental;
- private final IDTViewHandler _adapter;
- private final DiagnosticFactory _diagnosticFactory;
- private final IFile _file;
- private final IValidationReporter _reporter;
- private final IStructuredDocumentSymbolResolverFactory _symbolResolverFactory;
-
- /**
- * @param isIncremental --
- * true if this is "as-you-type" validation, false if this is
- * "Build" or "Run Validation" validation *
- * @param prefs
- * @param adapter
- * @param diagnosticFactory
- * @param file
- * @param reporter
- * @param symbolResolveFactory
- */
- public JSFValidationContext(final boolean isIncremental,
- final ValidationPreferences prefs,
- final IDTViewHandler adapter,
- final DiagnosticFactory diagnosticFactory, final IFile file,
- final IValidationReporter reporter, final IStructuredDocumentSymbolResolverFactory symbolResolveFactory)
- {
- super();
- _isIncremental = isIncremental;
- _prefs = prefs;
- _adapter = adapter;
- _diagnosticFactory = diagnosticFactory;
- _file = file;
- _reporter = reporter;
- _symbolResolverFactory = symbolResolveFactory;
- }
-
- /**
- *
- * @return true if user preferences say we should do EL validation, false
- * otherwise
- */
- public final boolean shouldValidateEL()
- {
- _prefs.load();
- if (_isIncremental)
- {
- return _prefs.getElPrefs().isEnableIncrementalValidation();
- }
-
- return _prefs.getElPrefs().isEnableBuildValidation();
- }
-
-
- /**
- * @return the view handler
- */
- public IDTViewHandler getAdapter()
- {
- return _adapter;
- }
-
- /**
- * @return the validator
- */
-// public IValidator getValidator()
-// {
-// return _validator;
-// }
-
- /**
- * @return validation preferences
- */
- public ValidationPreferences getPrefs()
- {
- return _prefs;
- }
-
- /**
- * @return diagnostic factory
- */
- public DiagnosticFactory getDiagnosticFactory()
- {
- return _diagnosticFactory;
- }
-
- /**
- * @return the file
- */
- public IFile getFile()
- {
- return _file;
- }
-
- /**
- * @return the reporter.
- */
- public IValidationReporter getReporter()
- {
- return _reporter;
- }
-
- /**
- * @return the symbol resolver factory for this context
- */
- public IStructuredDocumentSymbolResolverFactory getSymbolResolverFactory()
- {
- return _symbolResolverFactory;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/JSFValidatorFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/JSFValidatorFactory.java
deleted file mode 100644
index 06ee772..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/JSFValidatorFactory.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.validation.internal;
-
-/**
- * A factory that is to construct JSF validators
- *
- * @author cbateman
- *
- */
-public class JSFValidatorFactory
-{
- /**
- * @return a default validator for XML-defined views.
- */
- public static IJSFViewValidator createDefaultXMLValidator()
- {
- return new XMLViewDefnValidator();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/LocalizedMessage.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/LocalizedMessage.java
deleted file mode 100644
index 11151c2..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/LocalizedMessage.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-/**
- *
- */
-package org.eclipse.jst.jsf.validation.internal;
-
-import java.util.Locale;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.wst.validation.internal.core.Message;
-
-/**
- * Localized version of the message.
- *
- * @author cbateman
- *
- */
-public class LocalizedMessage extends Message {
-
- private String _message = null;
-
- /**
- * @param severity
- * @param messageText
- */
- public LocalizedMessage(int severity, String messageText) {
- this(severity, messageText, null);
- }
-
- /**
- * @param severity
- * @param messageText
- * @param targetObject
- */
- public LocalizedMessage(int severity, String messageText, IResource targetObject) {
- this(severity, messageText, (Object) targetObject);
- }
-
- /**
- * @param severity
- * @param messageText
- * @param targetObject
- */
- public LocalizedMessage(int severity, String messageText, Object targetObject) {
- super(null, severity, null);
- setLocalizedMessage(messageText);
- setTargetObject(targetObject);
- }
-
- /**
- * @param message
- */
- public void setLocalizedMessage(String message) {
- _message = message;
- }
-
- /**
- * @return the message
- */
- public String getLocalizedMessage() {
- return _message;
- }
-
- public String getText() {
- return getLocalizedMessage();
- }
-
- public String getText(ClassLoader cl) {
- return getLocalizedMessage();
- }
-
- public String getText(Locale l) {
- return getLocalizedMessage();
- }
-
- public String getText(Locale l, ClassLoader cl) {
- return getLocalizedMessage();
- }
-}
\ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/Severity.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/Severity.java
deleted file mode 100644
index 06265b0..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/Severity.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.validation.internal;
-
-/**
- * Severity levels of problems
- */
-public enum Severity
-{
- /**
- * Indicates a problem severity of Error
- */
- ERROR
- {
- public java.lang.String toString() {
- return "error";
- }
- }
- ,
- /**
- * Indicates a problem severity of Warning
- */
- WARNING
- {
- public java.lang.String toString() {
- return "warning";
- }
- }
- ,
- /**
- * Indicates no problem should be shown
- */
- IGNORE
- {
- public java.lang.String toString() {
- return "ignore";
- }
- };
-
- /**
- * @param value
- * @return the enum based on the toString mappings
- */
- public static Severity valueOfString(String value)
- {
- if ("error".equals(value))
- {
- return ERROR;
- }
- else if ("warning".equals(value))
- {
- return WARNING;
- }
- else
- {
- return IGNORE;
- }
- }
- }
\ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/ValidationPreferences.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/ValidationPreferences.java
deleted file mode 100644
index d61f4c0..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/ValidationPreferences.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.validation.internal;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-
-/**
- * @author cbateman
- *
- */
-public class ValidationPreferences
-{
- private final IPreferenceStore _prefStore;
- private final ELValidationPreferences _elPrefs;
- private final JSFTypeComparatorPreferences _typeComparatorPrefs;
- /**
- * Constructor
- * @param prefStore
- */
- public ValidationPreferences(IPreferenceStore prefStore)
- {
- _prefStore = prefStore;
- _elPrefs = new ELValidationPreferences();
- _typeComparatorPrefs = new JSFTypeComparatorPreferences();
- }
-
- /**
- * @return the el preferences
- */
- public ELValidationPreferences getElPrefs()
- {
- return _elPrefs;
- }
-
- /**
- * @return the type comparator preferences.
- */
- public JSFTypeComparatorPreferences getTypeComparatorPrefs()
- {
- return _typeComparatorPrefs;
- }
-
- /**IPreferenceStore
- * The default preference loader
- */
- public void load()
- {
- load(_prefStore);
- }
-
- /**
- * Loads preferences from prefStore
- *
- * @param prefStore
- */
- private void load(IPreferenceStore prefStore)
- {
- _elPrefs.load(prefStore);
- _typeComparatorPrefs.load(prefStore);
- }
-
- /**
- * Commits but does not store the preferences
- *
- * @param prefStore
- */
- public void commit(IPreferenceStore prefStore)
- {
- _elPrefs.commit(prefStore);
- _typeComparatorPrefs.commit(prefStore);
- }
-
- /**
- * Reverts the model to it's defaults. Does not commit to pref store.
- */
- public void setDefaults()
- {
- _elPrefs.setDefaults();
- _typeComparatorPrefs.setDefaults();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/XMLViewDefnValidator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/XMLViewDefnValidator.java
deleted file mode 100644
index da1f97d..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/XMLViewDefnValidator.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.validation.internal;
-
-import java.io.IOException;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.core.internal.region.Region2AttrAdapter;
-import org.eclipse.jst.jsf.core.internal.region.Region2ElementAdapter;
-import org.eclipse.jst.jsf.core.internal.region.Region2ElementAdapter.NoElementException;
-import org.eclipse.jst.jsf.designtime.DTAppManagerUtil;
-import org.eclipse.jst.jsf.designtime.internal.view.IDTViewHandler;
-import org.eclipse.jst.jsf.designtime.resolver.IStructuredDocumentSymbolResolverFactory;
-import org.eclipse.jst.jsf.designtime.resolver.StructuredDocumentSymbolResolverFactory;
-import org.eclipse.jst.jsf.validation.internal.el.diagnostics.DiagnosticFactory;
-import org.eclipse.jst.jsf.validation.internal.strategy.AttributeValidatingStrategy;
-import org.eclipse.jst.jsf.validation.internal.strategy.ContainmentValidatingStrategy;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-/**
- * Validator for JSF view definitions that are structured in XML format
- *
- * @author cbateman
- *
- */
-public class XMLViewDefnValidator implements IJSFViewValidator
-{
- // TODO: should the source validator be a separate class in jsp.ui?
- // problem with simple split off is that preference must also be split off
- static final boolean DEBUG;
- static
- {
- final String value = Platform
- .getDebugOption("org.eclipse.jst.jsf.core/validation"); //$NON-NLS-1$
- DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
- }
-
- // default. Overridable by calling setSymbolResolverFactory
- private IStructuredDocumentSymbolResolverFactory _symbolResolverFactory =
- StructuredDocumentSymbolResolverFactory.getInstance();
-
- /**
- * Validates a JSP tag.
- *
- * Currently only attribute values with supplied annotation meta-data is
- * being validated. Also, only JSF EL is being validated and not JSP EL.
- *
- * This method may be extended in the future to validate tag semantics an
- * other cross attribute validations.
- *
- * @param container
- * @param jsfValidationContext
- *
- */
- private void validateTag(final IStructuredDocumentRegion container,
- final JSFValidationContext jsfValidationContext,
- final ContainmentValidatingStrategy containmentStrategy)
- {
- // TODO: later when we move to composite strategy, run in SafeRunner
- // to protect against exceptions generated in external code.
- try
- {
- final Region2ElementAdapter regionAdapter = new Region2ElementAdapter(
- container);
-
-// final IStructuredDocumentContext elementContext =
-// IStructuredDocumentContextFactory.INSTANCE
-// .getContext(container.getParentDocument(), container
-// .getStartOffset());
-
- if (containmentStrategy.isInteresting(regionAdapter))
- {
- containmentStrategy.validate(regionAdapter);
- }
-
- final AttributeValidatingStrategy strategy =
- new AttributeValidatingStrategy(jsfValidationContext);
-
- for (final Region2AttrAdapter attrAdapter : regionAdapter
- .getAttributes().values())
- {
- if (strategy.isInteresting(attrAdapter))
- {
- strategy.validate(attrAdapter);
- }
- }
- }
- catch (NoElementException ne)
- {
- // XXX:
- }
- }
-
- public void validateView(final IFile viewFile, final IValidationReporter reporter)
- {
- IStructuredModel model = null;
- if (DEBUG)
- {
- System.out.println("executing JSPSemanticsValidator.validateFile");
- }
-
- try
- {
- final JSFValidationContext jsfValidationContext =
- createValidationContext(false, viewFile, reporter);
-
- if (jsfValidationContext == null)
- {
- return;
- }
-
- model = StructuredModelManager.getModelManager().getModelForRead(
- viewFile);
-
- final IStructuredDocument structuredDoc =
- model.getStructuredDocument();
- final IStructuredDocumentRegion[] regions =
- structuredDoc.getStructuredDocumentRegions();
- validateRegions(regions, jsfValidationContext,
- new ContainmentValidatingStrategy(jsfValidationContext));
- }
- catch (final CoreException e)
- {
- JSFCorePlugin.log("Error validating JSF", e);
- }
- catch (final IOException e)
- {
- JSFCorePlugin.log("Error validating JSF", e);
- }
- finally
- {
- if (null != model)
- {
- model.releaseFromRead();
- }
- }
- }
-
- public void validateView(IFile viewFile,
- IStructuredDocumentRegion[] regions, IValidationReporter reporter)
- {
- final JSFValidationContext jsfValidationContext =
- createValidationContext(true, viewFile, reporter);
-
- if (jsfValidationContext == null)
- {
- return;
- }
-
- validateRegions(regions, jsfValidationContext,
- new ContainmentValidatingStrategy(jsfValidationContext));
- }
-
- private void validateRegions(final IStructuredDocumentRegion[] regions,
- final JSFValidationContext context,
- final ContainmentValidatingStrategy containmentValidator)
- {
- for (final IStructuredDocumentRegion curNode : regions)
- {
- if (curNode.getFirstRegion().getType() == DOMRegionContext.XML_TAG_OPEN)
- {
- validateTag(curNode, context, containmentValidator);
- }
- }
- }
-
- private JSFValidationContext createValidationContext(
- final boolean isIncremental, final IFile file,
- final IValidationReporter reporter)
- {
- final ValidationPreferences prefs = new ValidationPreferences(
- JSFCorePlugin.getDefault().getPreferenceStore());
- prefs.load();
- final DiagnosticFactory diagnosticFactory = new DiagnosticFactory();
-
- final IDTViewHandler viewHandler = DTAppManagerUtil.getViewHandler(file
- .getProject());
-
- // only validate files that our designtime supports
- if (viewHandler == null || !viewHandler.supportsViewDefinition(file))
- {
- return null;
- }
-
- return new JSFValidationContext(isIncremental, prefs, viewHandler,
- diagnosticFactory, file, reporter, _symbolResolverFactory);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/AppConfigValidationUtil.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/AppConfigValidationUtil.java
deleted file mode 100644
index 11b980c..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/AppConfigValidationUtil.java
+++ /dev/null
@@ -1,444 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.validation.internal.appconfig;
-
-import java.io.StringReader;
-import java.util.Iterator;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jdt.core.Flags;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.ITypeHierarchy;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jst.jsf.common.internal.types.TypeConstants;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.facesconfig.emf.ListEntriesType;
-import org.eclipse.jst.jsf.facesconfig.emf.ManagedBeanScopeType;
-import org.eclipse.jst.jsf.facesconfig.emf.MapEntriesType;
-import org.eclipse.jst.jsp.core.internal.java.jspel.JSPELParser;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ParseException;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.xml.core.internal.emf2xml.EMF2DOMSSEAdapter;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Node;
-
-/**
- * Common functions for app config validation
- *
- * @author cbateman
- *
- */
-public final class AppConfigValidationUtil
-{
- /**
- * Per the fully-qualified-classType in the Faces 1.2 schema and
- * the ClassName entity in the 1.1 DTD
- *
- * @param fullyQualifiedName
- * @param instanceOf
- * @param mustBeAClass
- * @param project
- * @return null if no problems or a Message if problem found
- */
- public static IMessage validateClassName(final String fullyQualifiedName,
- final String instanceOf,
- final boolean mustBeAClass,
- final IProject project)
- {
- try
- {
- IType type = getType(project, fullyQualifiedName);
- if (type == null || !type.exists())
- {
- return DiagnosticFactory
- .create_CANNOT_FIND_CLASS_NAME(fullyQualifiedName);
- }
-
- // must be a class, not an interface or enum
- if (mustBeAClass && !type.isClass())
- {
- return DiagnosticFactory
- .create_FULLY_QUALIFIED_NAME_MUST_BE_A_CLASS
- (fullyQualifiedName);
- }
-
- // must not be abstract since it must instantiable
- if (Flags.isAbstract(type.getFlags()))
- {
- return DiagnosticFactory
- .create_CLASS_MUST_BE_CONCRETE(fullyQualifiedName);
- }
-
- if (instanceOf != null)
- {
- if (!isInstanceOf(type, instanceOf))
- {
- // if we get to here, we haven't found the expected
- // the super type so error
- return DiagnosticFactory.create_CLASS_MUST_BE_INSTANCE_OF
- (fullyQualifiedName, Messages.AppConfigValidationUtil_0, instanceOf);
- }
- }
- }
- catch(JavaModelException jme)
- {
- // fall-through, not found
- JSFCorePlugin.log(jme,
- "Error resolving fully qualified class name: "+fullyQualifiedName); //$NON-NLS-1$
- }
-
- // either found the class or had an exception so don't report error
- return null;
- }
-
- private static IType getType(final IProject project,
- final String fullyQualifiedName) throws JavaModelException
- {
- final IJavaProject javaProject = JavaCore.create(project);
- return javaProject.findType(fullyQualifiedName);
- }
-
- /**
- * Per the faces-config-el-expressionType in the Faces 1.2 schema and
- * the Action entity in the 1.1 DTD
- *
- * @param textContent
- * @return an validation diagnostic or null if the textContent
- * represent an expected EL expression
- */
- public static IMessage validateELExpression(final String textContent)
- {
- final ELResultWrapper result = extractELExpression(textContent);
-
- if (result.elText != null)
- {
- JSPELParser parser = new JSPELParser(new StringReader(result.elText));
-
- try {
- parser.Expression();
- } catch (ParseException e) {
- // syntax error
- return DiagnosticFactory.create_SYNTAX_ERROR_IN_EL();
- }
-
- return null;
- }
-
- return result.message;
- }
-
- /**
- * @param textContent
- * @return the result of trying to extract an EL expression from the
- * textContent string. The content is expected to be of the form
- * #{elText}. elText in the return value will be set to this value
- * from within the braces. If a syntax error occurs in this extraction
- * message property of the result object will contain a validation message
- * and elText will be set to null.
- * TODO: move this somewhere more generic and shared.
- */
- public static ELResultWrapper extractELExpression(final String textContent)
- {
- final String elRegex = "#\\{(.*)\\}"; //$NON-NLS-1$
- Pattern pattern = Pattern.compile(elRegex);
- Matcher matcher = pattern.matcher(textContent.trim());
- if (matcher.matches())
- {
- final String elText = matcher.group(1).trim();
-
- if ("".equals(elText) || elText == null) //$NON-NLS-1$
- {
- return new ELResultWrapper(DiagnosticFactory.create_SYNTAX_ERROR_IN_EL(), null);
- }
- return new ELResultWrapper(null, elText);
- }
- return new ELResultWrapper(DiagnosticFactory.create_EL_EXPR_MUST_BE_IN_HASH_BRACES(), null);
- }
-
- /**
- * Value object that wraps the result of trying
- * to extract an EL expression from an arbitrary String
- */
- public static class ELResultWrapper
- {
- private final IMessage message;
- private final String elText;
-
- ELResultWrapper(IMessage message, String elText) {
- super();
- this.message = message;
- this.elText = elText;
- }
-
- /**
- * @return a message indicating a problem encountered
- * trying to extract, or null if no problem was encountered
- */
- public IMessage getMessage() {
- return message;
- }
-
- /**
- * @return the el expression string raw, stripped of any
- * sorrounding #{} syntax or null if could not be extracted
- */
- public String getElText() {
- return elText;
- }
- }
-
- /**
- * @param eObj
- * @return the offset character offset in to the XML document of the
- * XML node that eObj was constructed from or -1 if not
- * computable
- */
- public static int getStartOffset(EObject eObj)
- {
- IDOMNode node = getDomNode(eObj);
-
- if (node != null)
- {
- return node.getStartStructuredDocumentRegion().getStartOffset();
- }
-
- return -1;
- }
-
- /**
- * @param eObj
- * @return the length in characters of the XML node that
- * eObj was constructed from or -1 if no computable
- */
- public static int getLength(EObject eObj)
- {
- IDOMNode node = getDomNode(eObj);
-
- if (node != null)
- {
- return node.getEndStructuredDocumentRegion().getEndOffset()
- - node.getStartStructuredDocumentRegion().getStartOffset();
- }
-
- return -1;
- }
-
- /**
- * @param eObj
- * @return the DOM node that eObj was constructed from or
- * null if not computable
- */
- public static IDOMNode getDomNode(EObject eObj)
- {
- for (Iterator it = eObj.eAdapters().iterator(); it.hasNext();)
- {
- Adapter adapter = (Adapter) it.next();
-
- if (adapter instanceof EMF2DOMSSEAdapter)
- {
- final EMF2DOMSSEAdapter sseAdapter = (EMF2DOMSSEAdapter) adapter;
- final Node node = sseAdapter.getNode();
- if (node instanceof IDOMNode)
- {
- return (IDOMNode) node;
- }
- }
- }
-
- return null;
- }
-
- /**
- * @param scope
- * @return an error message if scope does not match a valid
- * scope enum.
- */
- public static IMessage validateManagedBeanScope(ManagedBeanScopeType scope)
- {
- // scope must be one of a few enums
- if (!"request".equals(scope.getTextContent()) //$NON-NLS-1$
- && !"session".equals(scope.getTextContent()) //$NON-NLS-1$
- && !"application".equals(scope.getTextContent()) //$NON-NLS-1$
- && !"none".equals(scope.getTextContent())) //$NON-NLS-1$
- {
- return DiagnosticFactory.create_BEAN_SCOPE_NOT_VALID();
- }
-
- return null;
- }
-
- /**
- * @param targetName
- * @param targetType the type of the object that mapEntries will be assigned to
- * @param mapEntries
- * @param project
- * @return null if okay or an error message if the mapEntries type is
- * invalid in some way
- * Note: when Java 1.5 support is added we can validate against the template types
- */
- public static IMessage validateMapEntries(String targetName, String targetType, MapEntriesType mapEntries, IProject project)
- {
- if (mapEntries == null || targetType == null || project == null)
- {
- throw new AssertionError("Arguments to validateMapEntries can't be null"); //$NON-NLS-1$
- }
-
- try
- {
- // TODO: do a bean look-up for targetName to verify that it a) matches the type
- // and b) exists on the bean
- IType type = getType(project, targetType);
-
- if (type != null &&
- !(isInstanceOf(type, Signature.toString(TypeConstants.TYPE_MAP))))
- {
- return DiagnosticFactory
- .create_MAP_ENTRIES_CAN_ONLY_BE_SET_ON_MAP_TYPE(targetName);
- }
- // TODO: validate the the map entries
- // TODO: validate the types of the map entries against the values present
- // TODO: validate the map key and value types against the template
- }
- catch (JavaModelException jme)
- {
- JSFCorePlugin.log(new Exception(jme), "Exception while validating mapEntries"); //$NON-NLS-1$
- }
- // if we get to here, we have not found anything meaningful to report
- return null;
- }
-
- /**
- * @param targetName
- * @param targetType the type of the object that mapEntries will be assigned to
- * @param listEntries
- * @param project
- * @return null if okay or an error message if the listEntries type is
- * invalid in some way
- * Note: when Java 1.5 support is added we can validate against the template types
- */
- public static IMessage validateListEntries(String targetName, String targetType, ListEntriesType listEntries, IProject project)
- {
- if (listEntries == null || targetType == null || project == null)
- {
- throw new AssertionError("Arguments to validateMapEntries can't be null"); //$NON-NLS-1$
- }
-
- try
- {
- IType type = getType(project, targetType);
- // TODO: do a bean look-up for targetName to verify that it a) matches the type
- // and b) exists on the bean
- if (type != null &&
- !(isInstanceOf(type, Signature.toString(TypeConstants.TYPE_LIST))))
- {
- return DiagnosticFactory
- .create_LIST_ENTRIES_CAN_ONLY_BE_SET_ON_LIST_TYPE(targetName);
- }
- // TODO: validate the the list entries
- // TODO: validate the types of the list entries against the values present
- // TODO: validate the value types against the template
- }
- catch (JavaModelException jme)
- {
- JSFCorePlugin.log(new Exception(jme), "Exception while validating mapEntries"); //$NON-NLS-1$
- }
- // if we get to here, we have not found anything meaningful to report
- return null;
- }
-
- /**
- * @param localeType
- * @return a diagnostic if 'localeType' does not match the
- * expected format or null if all is clear
- */
- public static IMessage validateLocaleType(final String localeType)
- {
- // based on the localeType in the Faces 1.2 schema. This is safe
- // to apply to 1.1 since it expects the same pattern even though
- // the DTD cannot validate it
- final String localeTypePattern = "[a-z]{2}(_|-)?([\\p{L}\\-\\p{Nd}]{2})?"; //$NON-NLS-1$
- final Matcher matcher = Pattern.compile(localeTypePattern).matcher(localeType);
-
- if (!matcher.matches())
- {
- return DiagnosticFactory.create_LOCALE_FORMAT_NOT_VALID();
- }
-
- return null;
- }
-
- /**
- * @param type
- * @param instanceOf
- * @return true if type instanceof instanceOf is true
- *
- * @throws JavaModelException
- */
- public static boolean isInstanceOf(final IType type, final String instanceOf) throws JavaModelException
- {
- if (instanceOf != null)
- {
- // must have either a no-arg constructor or an adapter constructor
- // that is of the type of instanceOf
-// IType constructorParam = getType(project, instanceOf);
-// if (constructorParam != null)
-// {
-// final String constructorMethodName =
-// type.getElementName();
-// final IMethod defaultConstructor =
-// type.getMethod(constructorMethodName, new String[0]);
-// final IMethod adapterConstructor =
-// type.getMethod(constructorMethodName, new String[]{instanceOf});
-// final boolean isDefaultConstructor =
-// defaultConstructor != null && defaultConstructor.isConstructor();
-// final boolean isAdapterConstructor =
-// adapterConstructor != null && adapterConstructor.isConstructor();
-// if (!isDefaultConstructor && !isAdapterConstructor)
-// {
- // TODO: no constructor == default constructor...
-// }
-// }
-
- // if the type is an exact match
- if (instanceOf.equals(type.getFullyQualifiedName()))
- {
- return true;
- }
-
- final ITypeHierarchy typeHierarchy =
- type.newSupertypeHierarchy(new NullProgressMonitor());
-
- final IType[] supers = typeHierarchy.getAllSupertypes(type);
- for (int i = 0; i < supers.length; i++)
- {
- if (instanceOf.equals(supers[i].getFullyQualifiedName()))
- {
- return true;
- }
- }
- }
- return false;
- }
-
- private AppConfigValidationUtil()
- {
- // no external construction
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/AppConfigValidator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/AppConfigValidator.java
deleted file mode 100644
index 6f51617..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/AppConfigValidator.java
+++ /dev/null
@@ -1,390 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.validation.internal.appconfig;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigUtils;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-import org.eclipse.jst.jsp.core.internal.Logger;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.eclipse.wst.validation.AbstractValidator;
-import org.eclipse.wst.validation.ValidationResult;
-import org.eclipse.wst.validation.ValidationState;
-import org.eclipse.wst.validation.internal.core.ValidationException;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
-import org.eclipse.wst.validation.internal.provisional.core.IValidator;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * General build-time validator for the JSF application configuration file (faces-config.xml)b
- *
- * @author cbateman
- *
- */
-public class AppConfigValidator extends AbstractValidator implements IValidator {
-
- @Override
- public ValidationResult validate(final IResource resource, final int kind,
- final ValidationState state, final IProgressMonitor monitor) {
- final ValidationResult vr = new ValidationResult();
- if (resource == null || !(resource instanceof IFile)) {
- return vr;
- }
- final IReporter reporter = vr.getReporter(monitor);
- validateFile((IFile) resource, reporter);
- return vr;
- }
-
- /**
- * @param helper
- * @return the scheduling rull for this validator
- */
- public ISchedulingRule getSchedulingRule(final IValidationContext helper) {
- // no scheduling rule
- return null;
- }
-
- /**
- * @param helper
- * @param reporter
- * @return the result of running validation
- * @throws ValidationException
- */
- public IStatus validateInJob(final IValidationContext helper, final IReporter reporter)
- throws ValidationException {
- IStatus status = Status.OK_STATUS;
- try {
- validate(helper, reporter);
- }
- catch (final ValidationException e) {
- Logger.logException(e);
- status = new Status(IStatus.ERROR, JSFCorePlugin.getDefault().getPluginID(), IStatus.ERROR, e.getLocalizedMessage(), e);
- }
- return status;
- }
-
- public void cleanup(final IReporter reporter) {
- // no cleanup
-
- }
-
- public void validate(final IValidationContext helper, final IReporter reporter)
- throws ValidationException
- {
- final String[] uris = helper.getURIs();
- final IWorkspaceRoot wsRoot = ResourcesPlugin.getWorkspace().getRoot();
- if (uris.length > 0) {
- IFile currentFile = null;
-
- for (int i = 0; i < uris.length && !reporter.isCancelled(); i++) {
- currentFile = wsRoot.getFile(new Path(uris[i]));
- if (currentFile != null && currentFile.exists()) {
-// if (shouldValidate(currentFile) && fragmentCheck(currentFile)) {
-
-// int percent = (i * 100) / uris.length + 1;
-//Message message = new LocalizedMessage(IMessage.LOW_SEVERITY, percent + "% " + uris[i]);
- // reporter.displaySubtask(this, message);
-
- validateFile(currentFile, reporter);
- }
- }
- }
-
- // copied from JSPValidator TODO: perhaps just use app config locator?
-// else {
-//
-// // if uris[] length 0 -> validate() gets called for each project
-// if (helper instanceof IWorkbenchContext) {
-//
-// IProject project = ((IWorkbenchContext) helper).getProject();
-// JSPFileVisitor visitor = new JSPFileVisitor(reporter);
-// try {
-// // collect all jsp files for the project
-// project.accept(visitor, IResource.DEPTH_INFINITE);
-// }
-// catch (CoreException e) {
-// if (DEBUG)
-// e.printStackTrace();
-// }
-// IFile[] files = visitor.getFiles();
-// for (int i = 0; i < files.length && !reporter.isCancelled(); i++) {
-// if (shouldValidate(files[i]) && fragmentCheck(files[i])) {
-// int percent = (i * 100) / files.length + 1;
-// Message message = new LocalizedMessage(IMessage.LOW_SEVERITY, percent + "% " + files[i].getFullPath().toString());
-// reporter.displaySubtask(this, message);
-//
-// validateFile(files[i], reporter);
-// }
-// if (DEBUG)
-// System.out.println("validating: [" + files[i] + "]"); //$NON-NLS-1$ //$NON-NLS-2$
-// }
-// }
-// }
- }
-
- private void validateFile(final IFile file, final IReporter reporter)
- {
- FacesConfigArtifactEdit facesConfigEdit = null;
-
- try
- {
- final IPath path = JSFAppConfigUtils.getWebContentFolderRelativePath(file);
- facesConfigEdit = FacesConfigArtifactEdit.
- getFacesConfigArtifactEditForRead(file.getProject(), path.toString());
-
- if (facesConfigEdit != null
- && facesConfigEdit.getFacesConfig()!=null)
- {
- final String version = validateVersioning(file, facesConfigEdit, reporter);
- validateModel(file, facesConfigEdit,reporter, version);
- }
- }
- finally
- {
- if (facesConfigEdit != null)
- {
- facesConfigEdit.dispose();
- }
- }
- }
-
- /**
- * Ensure that the expected project version (facet) jives with what is in
- * the faces-config. Generally this means:
- *
- * if (version == 1.1) then no 1.2 artifacts (error)
- * if (version == 1.2) then warn if using old artifacts (warning)
- */
- private String validateVersioning(final IFile file, final FacesConfigArtifactEdit facesConfigEdit, final IReporter reporter)
- {
- final String appConfigFileVersion = getAppConfigFileVersion(facesConfigEdit);
-
- if (appConfigFileVersion != null)
- {
- final String projectVersion = getJSFVersion(file.getProject());
-
- if (IJSFCoreConstants.FACET_VERSION_1_1.equals(projectVersion)
- || IJSFCoreConstants.FACET_VERSION_1_0.equals(projectVersion))
- {
- if (IJSFCoreConstants.FACET_VERSION_1_2.equals(appConfigFileVersion))
- {
- reporter.addMessage(this,
- DiagnosticFactory
- .create_APP_CONFIG_IS_NEWER_THAN_JSF_VERSION(file));
- }
- }
- else if (IJSFCoreConstants.FACET_VERSION_1_2.equals(projectVersion))
- {
- if (IJSFCoreConstants.FACET_VERSION_1_1.equals(appConfigFileVersion)
- || IJSFCoreConstants.FACET_VERSION_1_0.equals(appConfigFileVersion))
- {
- reporter.addMessage(this,
- DiagnosticFactory
- .create_APP_CONFIG_IS_OLDER_THAN_JSF_VERSION(file
- , appConfigFileVersion, projectVersion));
- }
- }
- // if no exact match, don't make any assumptions
- }
- return appConfigFileVersion;
- }
-
- /**
- * @param facesConfigEdit
- * @return the version of the app config file or null if not determinant
- */
- private String getAppConfigFileVersion(final FacesConfigArtifactEdit facesConfigEdit)
- {
- String appConfigVersion = null;
-
- final IDOMModel domModel = facesConfigEdit.getIDOMModel();
- final IDOMDocument document = domModel.getDocument();
- if (document == null) {return null;}
-
- final DocumentType docType = domModel.getDocument().getDoctype();
-
- // if we have DTD doctype then we're looking at 1.1 or before
- if (docType != null)
- {
- appConfigVersion = extractVersionFromPublicId(docType);
- // if not found in the public id, try the system id
- if (appConfigVersion == null)
- {
- appConfigVersion = extractVersionFromSystemId(docType);
- }
- }
- else
- {
- final NodeList rootNodes = domModel.getDocument().getChildNodes();
-
- for (int i = 0; i < rootNodes.getLength(); i++)
- {
- final Node node = rootNodes.item(i);
- if (node.getNodeType() == Node.ELEMENT_NODE
- && "faces-config".equals(node.getLocalName()))
- {
- final NamedNodeMap map = node.getAttributes();
- // the most accurate thing is the version
- final Node versionAttrib = map.getNamedItem("version");
-
- if (versionAttrib != null)
- {
- appConfigVersion = versionAttrib.getNodeValue();
- break;
- }
-
- // TODO: add additional heuristic to parse out
- // the schema
- }
- }
- }
-
- return appConfigVersion;
- }
-
-
-
- private void validateModel(final IFile file,
- final FacesConfigArtifactEdit facesConfigEdit,
- final IReporter reporter,
- final String version)
- {
- final FacesConfigType facesConfigType = facesConfigEdit.getFacesConfig();
- final FacesConfigValidator validator = new FacesConfigValidator(version);
- final List messages = new ArrayList();
- validator.validate(facesConfigType, messages, file);
-
- for (final Iterator it = messages.iterator(); it.hasNext();)
- {
- final IMessage message = (IMessage) it.next();
- reporter.addMessage(this, message);
- }
- }
-
- /**
- * @param project
- * @return the version string for the JSF facet on project
- * or null if not found
- */
- private String getJSFVersion(final IProject project)
- {
- try
- {
- final IFacetedProject facetedProject = ProjectFacetsManager.create(project);
- final Set facets = facetedProject.getProjectFacets();
-
- for (final Iterator it = facets.iterator(); it.hasNext();)
- {
- final IProjectFacetVersion facetVersion =
- (IProjectFacetVersion) it.next();
-
- if (IJSFCoreConstants.JSF_CORE_FACET_ID.equals(facetVersion.getProjectFacet().getId()))
- {
- return facetVersion.getVersionString();
- }
- }
- }
- catch (final CoreException ce)
- {
- JSFCorePlugin.log(ce, "Problem loading faceted project");
- // fall-through and return null
- }
- return null;
- }
-
- private String extractVersionFromPublicId(final DocumentType docType)
- {
- final String publicId = docType.getPublicId();
- final String publicIdRegex = "-\\/\\/(.*)\\/\\/(.*)\\/\\/.*";
-
- if (publicId != null)
- {
- final Pattern pattern = Pattern.compile(publicIdRegex);
- final Matcher matcher = pattern.matcher(publicId);
-
- if (matcher.matches())
- {
- final String classTypeString = matcher.group(2);
- final String[] classTypes = classTypeString.split("\\s+");
-
- // verify that the class type is a DTD
- if (classTypes.length > 0
- && "DTD".equals(classTypes[0]))
- {
- // either 1.0 or 1.1; be most conservative
- String appConfigVersion = IJSFCoreConstants.JSF_VERSION_1_0;
-
- // see if the version is in the public id
- if (IJSFCoreConstants.JSF_VERSION_1_1.equals(classTypes[classTypes.length-1]))
- {
- appConfigVersion = IJSFCoreConstants.FACET_VERSION_1_1;
- }
-
- return appConfigVersion;
- }
- }
- }
-
- return null;
- }
-
- private String extractVersionFromSystemId(final DocumentType docType)
- {
- final String systemId = docType.getSystemId();
- final String systemIdRegEx = "http:\\/\\/java.sun.com\\/dtd\\/web-facesconfig_(.*)\\.dtd";
- if (systemId != null)
- {
- final Pattern pattern = Pattern.compile(systemIdRegEx);
- final Matcher matcher = pattern.matcher(systemId);
-
- if (matcher.matches())
- {
- final String version = matcher.group(1);
- if ("1_1".equals(version)||"1_0".equals(version))
- {
- return version.replaceAll("_", ".");
- }
- }
- }
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/ApplicationValidationVisitor.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/ApplicationValidationVisitor.java
deleted file mode 100644
index 1dc04c9..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/ApplicationValidationVisitor.java
+++ /dev/null
@@ -1,299 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.validation.internal.appconfig;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.facesconfig.emf.DefaultLocaleType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
-import org.eclipse.jst.jsf.facesconfig.emf.LocaleConfigType;
-import org.eclipse.jst.jsf.facesconfig.emf.SupportedLocaleType;
-
-/**
- * Validator the <application> node of the app config model
- * @author cbateman
- *
- */
-public class ApplicationValidationVisitor extends EObjectValidationVisitor
-{
-
- /**
- * Default constructure
- * @param version
- */
- public ApplicationValidationVisitor(String version)
- {
- super(FacesConfigPackage.eINSTANCE.getFacesConfigType_Application(), version);
- }
-
- protected void doValidate(EObject object, List messages, IFile file) {
- // nothing to validate
- }
-
- protected EObjectValidationVisitor[] getChildNodeValidators() {
- return new EObjectValidationVisitor[]
- {
- // TODO: validate message and resource bundles
- // TODO: validate default render kit id
- new ActionListenerValidationVisitor(getVersion()),
- new NavigationHandlerValidationVisitor(getVersion()),
- new ViewHandlerValidationVisitor(getVersion()),
- new StateManagerValidationVisitior(getVersion()),
- new PropertyResolverValidationVisitor(getVersion()),
- new VariableResolverValidationVisitor(getVersion()),
- new ELResolverValidationVisitor(getVersion()),
- new LocaleConfigValidationVisitor(getVersion())
- };
- }
-
- /**
- * @param facesConfig
- * @param messages
- * @param file
- */
- protected void validateManagedBeanNames(FacesConfigType facesConfig, List messages, IFile file)
- {
-// final Map foundBeans = new HashMap();
-// final List firstCollisionInstance = new ArrayList();
-//
-// for (final Iterator it = facesConfig.getManagedBean().iterator(); it.hasNext();)
-// {
-// final ManagedBeanType managedBean = (ManagedBeanType) it.next();
-//
-// if (managedBean.getManagedBeanName() == null
-// || managedBean.getManagedBeanName().getTextContent() == null
-// || "".equals(managedBean.getManagedBeanName().getTextContent()))
-// {
-//
-// }
-
-// if (!foundBeans.containsKey(managedBean.getManagedBeanName()))
-// }
- }
-
- private static class LocaleConfigValidationVisitor extends EObjectValidationVisitor
- {
- /**
- * @param version
- */
- public LocaleConfigValidationVisitor(String version)
- {
- super(FacesConfigPackage.eINSTANCE.getApplicationType_LocaleConfig()
- , version);
- }
-
- protected void doValidate(EObject object, List messages, IFile file)
- {
- final LocaleConfigType localeConfig = (LocaleConfigType) object;
-
- DefaultLocaleType defaultLocale = localeConfig.getDefaultLocale();
-
- if (defaultLocale != null)
- {
- addMessageInfo(
- messages,
- AppConfigValidationUtil
- .validateLocaleType(defaultLocale.getTextContent())
- , defaultLocale, file);
- }
-
- for (final Iterator it = localeConfig.getSupportedLocale().iterator(); it.hasNext();)
- {
- final SupportedLocaleType supportedLocale =
- (SupportedLocaleType) it.next();
- addMessageInfo(
- messages,
- AppConfigValidationUtil
- .validateLocaleType(supportedLocale.getTextContent())
- , supportedLocale, file);
- }
-
- }
-
- protected EObjectValidationVisitor[] getChildNodeValidators() {
- // there are children, but we're going to validate in doValidate
- return NO_CHILDREN;
- }
-
- }
-
- private static class ActionListenerValidationVisitor extends ApplicationClassNameBasedValidationVisitor
- {
- /**
- * @param version
- */
- public ActionListenerValidationVisitor(final String version) {
- super(FacesConfigPackage.eINSTANCE.getApplicationType_ActionListener(),
- version,"javax.faces.event.ActionListener", true);
- }
- }
-
- private static class NavigationHandlerValidationVisitor extends ApplicationClassNameBasedValidationVisitor
- {
- /**
- * @param version
- */
- public NavigationHandlerValidationVisitor(final String version) {
- super(FacesConfigPackage.eINSTANCE.getApplicationType_NavigationHandler(),
- version,"javax.faces.application.NavigationHandler", true);
- }
- }
-
- private static class ViewHandlerValidationVisitor extends ApplicationClassNameBasedValidationVisitor
- {
- ViewHandlerValidationVisitor(final String version)
- {
- super(FacesConfigPackage.eINSTANCE.getApplicationType_ViewHandler(),
- version,"javax.faces.application.ViewHandler", true);
- }
- }
-
- private static class StateManagerValidationVisitior extends ApplicationClassNameBasedValidationVisitor
- {
- StateManagerValidationVisitior(final String version)
- {
- // must a concrete class with a zero arg constructor:
- // JSF1.1_3.2.3.2 and JSF1.2_3.2.4.2
- super(FacesConfigPackage.eINSTANCE.getApplicationType_StateManager(),
- version,"javax.faces.application.StateManager", true);
- }
- }
-
- private static class PropertyResolverValidationVisitor extends ApplicationClassNameBasedValidationVisitor
- {
- PropertyResolverValidationVisitor(final String version)
- {
- super(FacesConfigPackage.eINSTANCE.getApplicationType_PropertyResolver(),
- version,"javax.faces.el.PropertyResolver", true);
- }
-
- protected void doValidate(EObject object, List messages, IFile file) {
- super.doValidate(object, messages, file);
-
- // if this version greater than 1.1 then property resolvers are
- // deprecated in favour of el-resolvers
- final String version = getVersion();
- if (!IJSFCoreConstants.FACET_VERSION_1_0.equals(version) && !IJSFCoreConstants.FACET_VERSION_1_1.equals(version))
- {
- addMessageInfo(messages,
- DiagnosticFactory.create_API_DEPRECATED_AFTER_VERSION_ID
- ("property-resolver", IJSFCoreConstants.FACET_VERSION_1_1, "el-resolver")
- , object, file);
- }
- }
- }
-
- private static class VariableResolverValidationVisitor extends ApplicationClassNameBasedValidationVisitor
- {
- VariableResolverValidationVisitor(final String version)
- {
- super(FacesConfigPackage.eINSTANCE.getApplicationType_VariableResolver(),
- version, "javax.faces.el.VariableResolver", true);
- }
-
- protected void doValidate(EObject object, List messages, IFile file) {
- super.doValidate(object, messages, file);
- // if this version greater than 1.1 then property resolvers are
- // deprecated in favour of el-resolvers
- final String version = getVersion();
- if (!IJSFCoreConstants.JSF_VERSION_1_0.equals(version) && !IJSFCoreConstants.JSF_VERSION_1_1.equals(version))
- {
- addMessageInfo(messages,
- DiagnosticFactory.create_API_DEPRECATED_AFTER_VERSION_ID
- ("variable-resolver", IJSFCoreConstants.JSF_VERSION_1_1, "el-resolver")
- , object, file);
- }
-
- }
- }
-
- private static class ELResolverValidationVisitor extends ApplicationClassNameBasedValidationVisitor
- {
- ELResolverValidationVisitor(final String version)
- {
- // must be a class and have zero-arg constructor
- // JSF1.2_5.6.1.4
- super(FacesConfigPackage.eINSTANCE.getApplicationType_ELResolver(),
- version, "javax.el.ELResolver", true);
- }
-
- protected void doValidate(EObject object, List messages, IFile file) {
- // if this version less than 1.2 then property resolvers are
- // deprecated in favour of el-resolvers
- final String version = getVersion();
- if (IJSFCoreConstants.JSF_VERSION_1_0.equals(version) || IJSFCoreConstants.JSF_VERSION_1_1.equals(version))
- {
- addMessageInfo(messages,
- DiagnosticFactory.create_API_NOT_AVAILABLE_BEFORE_VERSION
- ("el-resolver", IJSFCoreConstants.JSF_VERSION_1_2, "variable-resolver or property-resolver")
- , object, file);
- }
- else
- {
- super.doValidate(object, messages, file);
- }
- }
- }
-
- private abstract static class ApplicationClassNameBasedValidationVisitor extends ClassNameEObjectValidationVisitor
- {
- private final String _instanceOf;
- private final boolean _mustBeClass;
-
- /**
- * @param feature
- * @param version
- * @param instanceOf
- * @param mustBeClass
- */
- protected ApplicationClassNameBasedValidationVisitor(EStructuralFeature feature,
- final String version, final String instanceOf, final boolean mustBeClass)
- {
- super(feature, version);
- _instanceOf = instanceOf;
- _mustBeClass = mustBeClass;
- }
-
- protected String getFullyQualifiedName(EObject eobj)
- {
- EStructuralFeature feature = eobj.eClass().getEStructuralFeature("textContent");
-
- if (feature != null)
- {
- return (String)eobj.eGet(feature);
- }
-
- return null;
- }
-
- @Override
- protected boolean mustBeClass() {
- return _mustBeClass;
- }
-
- protected EObjectValidationVisitor[] getChildNodeValidators() {
- // no children
- return NO_CHILDREN;
- }
-
- protected String getInstanceOf() {
- return _instanceOf;
- }
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/AttributeValidationVisitor.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/AttributeValidationVisitor.java
deleted file mode 100644
index 2ddd7e8..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/AttributeValidationVisitor.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.validation.internal.appconfig;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jst.jsf.facesconfig.emf.AttributeClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-
-/**
- * Validates the <attribute> element of components, converters etc.
- *
- * @author cbateman
- *
- */
-public class AttributeValidationVisitor extends EObjectValidationVisitor {
-
- /**
- * @param feature
- * @param version
- */
- public AttributeValidationVisitor(EStructuralFeature feature, String version) {
- // this validator can be attached to numerous parents so it
- // cannot hard-code its feature
- super(feature,version);
- }
-
- protected void doValidate(EObject object, List messages, IFile file) {
- // nothing to do
- }
-
- protected EObjectValidationVisitor[] getChildNodeValidators() {
- return new EObjectValidationVisitor[]
- {
- new AttributeClassValidationVisitor(getVersion())
- };
- }
-
- private static class AttributeClassValidationVisitor extends ClassNameEObjectValidationVisitor
- {
- /**
- * @param version
- */
- public AttributeClassValidationVisitor(
- String version) {
- super(FacesConfigPackage.eINSTANCE.getAttributeType_AttributeClass()
- , version);
- }
-
- protected String getFullyQualifiedName(EObject eobj) {
- return ((AttributeClassType)eobj).getTextContent();
- }
-
- protected String getInstanceOf() {
- // null since there is no instance of enforcement here
- return null;
- }
-
- protected EObjectValidationVisitor[] getChildNodeValidators() {
- return NO_CHILDREN;
- }
-
- @Override
- protected boolean mustBeClass()
- {
- // attribute could be a class or an enum
- return false;
- }
-
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/ClassNameEObjectValidationVisitor.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/ClassNameEObjectValidationVisitor.java
deleted file mode 100644
index 6ef8fa3..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/ClassNameEObjectValidationVisitor.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.validation.internal.appconfig;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-/**
- * Abstract validation visitor for classname based eobjects
- *
- * @author cbateman
- *
- */
-public abstract class ClassNameEObjectValidationVisitor extends
- EObjectValidationVisitor
-{
- /**
- * @param structuralFeature
- * @param version
- */
- public ClassNameEObjectValidationVisitor(
- EStructuralFeature structuralFeature, String version) {
- super(structuralFeature, version);
- }
-
- protected void doValidate(EObject object, List messages, IFile file)
- {
- String fullyQualifiedName = getFullyQualifiedName(object);
- // protect against null
- fullyQualifiedName = fullyQualifiedName == null ? "" : fullyQualifiedName;
- addMessageInfo(messages,
- AppConfigValidationUtil
- .validateClassName(fullyQualifiedName, getInstanceOf()
- , false, file.getProject()),object, file);
- }
-
- /**
- * @param eobj
- * @return the fully qualified name from the eobject
- */
- protected abstract String getFullyQualifiedName(EObject eobj);
-
- /**
- * @return a fully-qualified
- */
- protected abstract String getInstanceOf();
-
- /**
- * @return true if the class being named must be a class
- * and may not be an enum or interface
- */
- protected abstract boolean mustBeClass();
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/ComponentValidatorVisitor.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/ComponentValidatorVisitor.java
deleted file mode 100644
index 5ec0f3e..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/ComponentValidatorVisitor.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.validation.internal.appconfig;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jst.jsf.facesconfig.emf.ComponentClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-import org.eclipse.jst.jsf.facesconfig.emf.FacetNameType;
-
-/**
- * Validator for a <component>
- *
- * @author cbateman
- *
- */
-public class ComponentValidatorVisitor extends EObjectValidationVisitor
-{
- /**
- * @param version
- */
- public ComponentValidatorVisitor(final String version)
- {
- super(FacesConfigPackage.eINSTANCE.getFacesConfigType_Component(),
- version);
- }
-
- protected void doValidate(EObject object, List messages, IFile file) {
- // nothing in the tag to validate
- }
-
- protected EObjectValidationVisitor[] getChildNodeValidators() {
- return new EObjectValidationVisitor[]
- {
- new ComponentClassValidationVisitor(getVersion()),
- new AttributeValidationVisitor(FacesConfigPackage.eINSTANCE.getComponentType_Attribute(), getVersion()),
- new PropertyValidationVisitor
- (FacesConfigPackage.eINSTANCE.getComponentType_Property()
- ,FacesConfigPackage.eINSTANCE.getComponentType_ComponentClass()
- ,getVersion()),
- new ComponentFacetValidationVisitor(getVersion())
- };
- }
-
- private static class ComponentClassValidationVisitor extends ClassNameEObjectValidationVisitor
- {
- ComponentClassValidationVisitor(final String version)
- {
- super(FacesConfigPackage.eINSTANCE.getComponentType_ComponentClass(),
- version);
- }
-
- protected String getFullyQualifiedName(EObject eobj)
- {
- return ((ComponentClassType)eobj).getTextContent();
- }
-
- protected String getInstanceOf() {
- return "javax.faces.component.UIComponent";
- }
-
- protected EObjectValidationVisitor[] getChildNodeValidators() {
- return NO_CHILDREN;
- }
-
- @Override
- protected boolean mustBeClass() {
- // must a class
- return true;
- }
- }
-
- private static class ComponentFacetValidationVisitor extends EObjectValidationVisitor
- {
- /**
- * @param version
- */
- public ComponentFacetValidationVisitor(String version)
- {
- super(FacesConfigPackage.eINSTANCE.getComponentType_Facet(), version);
- }
-
- protected void doValidate(EObject object, List messages, IFile file) {
- // do nothing
- }
-
- protected EObjectValidationVisitor[] getChildNodeValidators() {
- return new EObjectValidationVisitor[]
- {
- new FacetNameValidationVisitor(getVersion())
- };
- }
-
- private static class FacetNameValidationVisitor extends EObjectValidationVisitor
- {
- /**
- * @param version
- */
- public FacetNameValidationVisitor(String version) {
- super(FacesConfigPackage.eINSTANCE.getFacetType_FacetName(),
- version);
- }
-
- protected void doValidate(EObject object, List messages, IFile file) {
- FacetNameType name = (FacetNameType) object;
- boolean isValid = false;
-
- if (name.getTextContent() != null
- || "".equals(name.getTextContent().trim()))
- {
- String nameValue = name.getTextContent().trim();
-
- // TODO: isJavaIdentifierStart seems broken...
- if (Character.isJavaIdentifierStart(nameValue.charAt(0)))
- {
- isValid = true;
- for (int i = 1; i < nameValue.length(); i++)
- {
- if (!Character.isJavaIdentifierPart(nameValue.charAt(i)))
- {
- isValid = false;
- }
- }
- }
- }
-
- if (!isValid)
- {
- addMessageInfo(messages,
- DiagnosticFactory.create_MUST_BE_A_VALID_JAVA_IDENT("Facet name")
- , object, file);
- }
- }
-
- protected EObjectValidationVisitor[] getChildNodeValidators() {
- return NO_CHILDREN;
- }
-
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/ConverterValidationVisitor.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/ConverterValidationVisitor.java
deleted file mode 100644
index 5fba0bc..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/ConverterValidationVisitor.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.validation.internal.appconfig;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jst.jsf.facesconfig.emf.ConverterClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.ConverterForClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-
-/**
- * Validates the converter
- */
-public class ConverterValidationVisitor extends EObjectValidationVisitor
-{
-
- /**
- * @param version
- */
- public ConverterValidationVisitor(final String version)
- {
- super(FacesConfigPackage.eINSTANCE.getFacesConfigType_Converter(),
- version);
- }
-
- protected void doValidate(EObject object, List messages, IFile file) {
- // nothing in the tag to validate
- }
-
- protected EObjectValidationVisitor[] getChildNodeValidators() {
- return new EObjectValidationVisitor[]
- {
- new ConverterClassValidationVisitor(getVersion())
- , new AttributeValidationVisitor(FacesConfigPackage.eINSTANCE.getConverterType_Attribute(), getVersion())
- , new PropertyValidationVisitor
- (FacesConfigPackage.eINSTANCE.getConverterType_Property()
- ,FacesConfigPackage.eINSTANCE.getConverterType_ConverterClass()
- ,getVersion())
- , new ConverterForClassValidationVisitor(getVersion())
- };
- }
-
- private static class ConverterClassValidationVisitor extends ClassNameEObjectValidationVisitor
- {
- ConverterClassValidationVisitor(final String version)
- {
- super(FacesConfigPackage.eINSTANCE.getConverterType_ConverterClass(),
- version);
- }
-
- protected String getFullyQualifiedName(EObject eobj)
- {
- return ((ConverterClassType)eobj).getTextContent();
- }
-
- protected String getInstanceOf() {
- return "javax.faces.convert.Converter";
- }
-
- protected EObjectValidationVisitor[] getChildNodeValidators() {
- return NO_CHILDREN;
- }
-
- @Override
- protected boolean mustBeClass() {
- // can't be an enum
- return true;
- }
- }
-
- private static class ConverterForClassValidationVisitor extends ClassNameEObjectValidationVisitor
- {
- ConverterForClassValidationVisitor(final String version)
- {
- super(FacesConfigPackage.eINSTANCE.getConverterType_ConverterForClass(),
- version);
- }
-
- protected String getFullyQualifiedName(EObject eobj)
- {
- return ((ConverterForClassType)eobj).getTextContent();
- }
-
- protected String getInstanceOf() {
- // no instanceof enforcement
- return null;
- }
-
- protected EObjectValidationVisitor[] getChildNodeValidators() {
- return NO_CHILDREN;
- }
-
- @Override
- protected boolean mustBeClass() {
- // could be a converter for all instances of an enum type
- return false;
- }
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/DiagnosticFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/DiagnosticFactory.java
deleted file mode 100644
index 219bd59..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/DiagnosticFactory.java
+++ /dev/null
@@ -1,412 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.validation.internal.appconfig;
-
-import java.text.MessageFormat;
-import java.util.Locale;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.wst.validation.internal.core.Message;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- * Factory for constructing diagnostic objects for AppConfig file validation
- *
- * @author cbateman
- *
- */
-public final class DiagnosticFactory
-{
- /**
- * Problem id
- */
- public final static int EL_EXPR_MUST_BE_IN_HASH_BRACES_ID = 0;
-
- /**
- * Problem id
- */
- public final static int SYNTAX_ERROR_IN_EL_ID = 1;
-
- /**
- * Problem id
- */
- public final static int CANNOT_FIND_CLASS_NAME_ID = 2;
-
- /**
- * Problem id
- */
- public final static int FULLY_QUALIFIED_NAME_MUST_BE_A_CLASS_ID = 3;
-
- /**
- * Problem id
- */
- public final static int CLASS_MUST_BE_INSTANCE_OF_ID = 4;
-
- /**
- * Problem id
- */
- public final static int CLASS_MUST_BE_CONCRETE_ID = 5;
-
- /**
- * TODO:
- */
- public final static int CLASS_MUST_HAVE_DEFAULT_OR_ADAPTER_CONSTRUCTOR_ID = 6;
-
- /**
- * Problem id
- */
- public final static int API_DEPRECATED_AFTER_VERSION_ID = 7;
-
- /**
- * Problem id
- */
- public final static int BEAN_PROPERTY_NOT_FOUND_ID = 8;
-
- /**
- * Problem id
- */
- public final static int MUST_BE_A_VALID_JAVA_IDENT_ID = 9;
-
- /**
- * Problem id
- */
- public final static int BEAN_SCOPE_NOT_VALID_ID = 10;
-
- /**
- * Problem id
- */
- public final static int MAP_ENTRIES_CAN_ONLY_BE_SET_ON_MAP_TYPE_ID = 11;
-
- /**
- * Problem id
- */
- public final static int LIST_ENTRIES_CAN_ONLY_BE_SET_ON_LIST_TYPE_ID = 12;
-
- /**
- * Problem id
- */
- public final static int API_NOT_AVAILABLE_BEFORE_VERSION_ID = 13;
-
- /**
- * Problem id
- */
- public final static int APP_CONFIG_IS_NEWER_THAN_JSF_VERSION_ID = 14;
- /**
- * Problem id
- */
- public final static int APP_CONFIG_IS_OLDER_THAN_JSF_VERSION_ID = 15;
-
- /**
- * Problem id
- */
- public final static int LOCALE_FORMAT_NOT_VALID_ID = 16;
-
- /**
- * @return message indicating text that should be EL was
- * not found sorrounded in #{} values
- */
- public static IMessage create_EL_EXPR_MUST_BE_IN_HASH_BRACES()
- {
- return new MyLocalizedMessage(IMessage.NORMAL_SEVERITY,
- Messages.EL_EXPR_MUST_BE_IN_HASH_BRACES_ID,
- null, EL_EXPR_MUST_BE_IN_HASH_BRACES_ID);
- }
-
- /**
- * @return message indicating that EL was found that
- * was empty or did not parse
- */
- public static IMessage create_SYNTAX_ERROR_IN_EL()
- {
- return new MyLocalizedMessage(IMessage.NORMAL_SEVERITY,
- Messages.SYNTAX_ERROR_IN_EL_ID,
- null, SYNTAX_ERROR_IN_EL_ID);
- }
-
- /**
- * @param className
- * @return message indicating that className can't be found as
- * a valid fully qualified class name
- */
- public static IMessage create_CANNOT_FIND_CLASS_NAME(final String className)
- {
- return new MyLocalizedMessage(IMessage.NORMAL_SEVERITY,
- MessageFormat.format(Messages.CANNOT_FIND_CLASS_NAME_ID,new Object[]{className}),
- null, CANNOT_FIND_CLASS_NAME_ID);
- }
-
- /**
- * @param fullyQualifiedName
- * @return the error message for a fullyQualifiedName that resolves to a type
- * that is not a class (i.e. an interface or enum) but is expected to be
- */
- public static IMessage create_FULLY_QUALIFIED_NAME_MUST_BE_A_CLASS(final String fullyQualifiedName)
- {
- return new MyLocalizedMessage(IMessage.NORMAL_SEVERITY,
- MessageFormat.format(Messages.FULLY_QUALIFIED_NAME_MUST_BE_A_CLASS_ID
- ,new Object[]{fullyQualifiedName})
- ,null, FULLY_QUALIFIED_NAME_MUST_BE_A_CLASS_ID);
- }
-
- /**
- * @param className
- * @param extensionType
- * @param expectedSuper
- * @return an error when a class name must be of type expectedSuper
- */
- public static IMessage create_CLASS_MUST_BE_INSTANCE_OF(final String className,
- final String extensionType,
- final String expectedSuper)
- {
- return new MyLocalizedMessage(IMessage.NORMAL_SEVERITY,
- MessageFormat.format(Messages.CLASS_MUST_BE_INSTANCE_OF_ID
- ,new Object[]{className, extensionType, expectedSuper})
- ,null, CLASS_MUST_BE_INSTANCE_OF_ID);
- }
-
-
- /**
- * @param className
- * @return error indicating that className must specify a class
- * that is concrete
- */
- public static IMessage create_CLASS_MUST_BE_CONCRETE(final String className)
- {
- return new MyLocalizedMessage(IMessage.NORMAL_SEVERITY,
- MessageFormat.format(Messages.CLASS_MUST_BE_CONCRETE_ID
- ,new Object[]{className})
- ,null, CLASS_MUST_BE_CONCRETE_ID);
- }
-
- /**
- * @param apiName -- name of deprecated API
- * @param afterVersion -- version after which deprecation is effective
- * @param useInstead -- name of API to use instead
- * @return an error indicating the use of a deprecated API
- */
- public static IMessage create_API_DEPRECATED_AFTER_VERSION_ID(final String apiName, final String afterVersion, final String useInstead)
- {
- return new MyLocalizedMessage(IMessage.NORMAL_SEVERITY,
- MessageFormat.format(Messages.API_DEPRECATED_AFTER_VERSION_ID
- ,new Object[]{apiName, afterVersion, useInstead})
- ,null, API_DEPRECATED_AFTER_VERSION_ID);
- }
-
- /**
- * @param propertyName
- * @param beanClassName
- * @return an error indicating that the propertyName was not
- * found on beanClassName
- */
- public static IMessage create_BEAN_PROPERTY_NOT_FOUND(final String propertyName, final String beanClassName)
- {
- return new MyLocalizedMessage(IMessage.NORMAL_SEVERITY,
- MessageFormat.format(Messages.BEAN_PROPERTY_NOT_FOUND_ID
- ,new Object[]{propertyName, beanClassName})
- ,null, BEAN_PROPERTY_NOT_FOUND_ID);
-
- }
-
-
- /**
- * @param nameOfId
- * @return an error indicating that some id must be a valid
- * Java identifier
- */
- public static IMessage create_MUST_BE_A_VALID_JAVA_IDENT(final String nameOfId)
- {
- return new MyLocalizedMessage(IMessage.NORMAL_SEVERITY,
- MessageFormat.format(Messages.MUST_BE_A_VALID_JAVA_IDENT_ID
- ,new Object[]{nameOfId})
- ,null, MUST_BE_A_VALID_JAVA_IDENT_ID);
- }
-
- /**
- * @return an error indicating an invalid bean scope enum value
- */
- public static IMessage create_BEAN_SCOPE_NOT_VALID()
- {
- return new MyLocalizedMessage(IMessage.NORMAL_SEVERITY,
- Messages.BEAN_SCOPE_NOT_VALID_ID
- , null, BEAN_SCOPE_NOT_VALID_ID);
- }
-
- /**
- * @param targetName
- * @return an error indicating that a map entry is being set on a target
- * object that is not a java.util.Map
- */
- public static IMessage create_MAP_ENTRIES_CAN_ONLY_BE_SET_ON_MAP_TYPE(String targetName)
- {
- return new MyLocalizedMessage(IMessage.NORMAL_SEVERITY,
- MessageFormat.format(Messages.MAP_ENTRIES_CAN_ONLY_BE_SET_ON_MAP_TYPE_ID,
- new Object[]{targetName}),
- null, MAP_ENTRIES_CAN_ONLY_BE_SET_ON_MAP_TYPE_ID);
- }
-
- /**
- * @param targetName
- * @return an error indicating that a list entry is being set on a target
- * object that is not a java.util.List
- */
- public static IMessage create_LIST_ENTRIES_CAN_ONLY_BE_SET_ON_LIST_TYPE(String targetName)
- {
- return new MyLocalizedMessage(IMessage.NORMAL_SEVERITY,
- MessageFormat.format(Messages.LIST_ENTRIES_CAN_ONLY_BE_SET_ON_LIST_TYPE_ID,
- new Object[]{targetName}),
- null, LIST_ENTRIES_CAN_ONLY_BE_SET_ON_LIST_TYPE_ID);
- }
-
- /**
- * @param apiName
- * @param beforeVersion
- * @param useInstead
- * @return a diagnostic indicating that an API is being used that is not yet
- * available in the current JSF version.
- */
- public static IMessage create_API_NOT_AVAILABLE_BEFORE_VERSION(final String apiName, final String beforeVersion, final String useInstead)
- {
- return new MyLocalizedMessage(IMessage.NORMAL_SEVERITY,
- MessageFormat.format(Messages.API_NOT_AVAILABLE_BEFORE_VERSION_ID
- ,new Object[]{apiName, beforeVersion, useInstead})
- ,null, API_NOT_AVAILABLE_BEFORE_VERSION_ID);
- }
-
- /**
- * @param file
- * @return a diagnostic indicating that the app config model in use is too
- * new for the selected JSF runtime version.
- */
- public static IMessage create_APP_CONFIG_IS_NEWER_THAN_JSF_VERSION(IFile file)
- {
- final IMessage message = new MyLocalizedMessage(IMessage.HIGH_SEVERITY,
- Messages.APP_CONFIG_IS_NEWER_THAN_JSF_VERSION_ID
- ,null, APP_CONFIG_IS_NEWER_THAN_JSF_VERSION_ID);
- message.setTargetObject(file);
- return message;
- }
-
- /**
- * @param file
- * @param appConfigVersion
- * @param projectVersion
- * @return a diagnostic indicating that the app config model in use is older
- * than the selected JSF runtime version.
- */
- public static IMessage create_APP_CONFIG_IS_OLDER_THAN_JSF_VERSION(IFile file, String appConfigVersion, String projectVersion)
- {
- final IMessage message = new MyLocalizedMessage(IMessage.NORMAL_SEVERITY,
- MessageFormat.format(
- Messages.APP_CONFIG_IS_OLDER_THAN_JSF_VERSION_ID,
- new Object[] {appConfigVersion, projectVersion})
- ,null, APP_CONFIG_IS_OLDER_THAN_JSF_VERSION_ID);
- message.setTargetObject(file);
- return message;
- }
-
- /**
- * @return a diagnostic indicating that the locale format does
- * not match what is expected
- */
- public static IMessage create_LOCALE_FORMAT_NOT_VALID()
- {
- IMessage message = new MyLocalizedMessage(IMessage.NORMAL_SEVERITY,
- Messages.LOCALE_FORMAT_NOT_VALID_ID
- ,null, LOCALE_FORMAT_NOT_VALID_ID);
- return message;
- }
-
- /**
- * Customized localizable message for app config validation
- * @author cbateman
- *
- */
- static class MyLocalizedMessage extends Message implements ILocalizedMessage
- {
- private final String _message;
- private final int _errorCode;
-
- /**
- * @param severity
- * @param messageText
- * @param targetObject
- * @param errorCode
- */
- public MyLocalizedMessage(int severity, String messageText, IResource targetObject, int errorCode) {
- this(severity, messageText, (Object) targetObject, errorCode);
- }
-
- /**
- * @param severity
- * @param messageText
- * @param targetObject
- * @param errorCode
- */
- private MyLocalizedMessage(int severity, String messageText, Object targetObject, int errorCode) {
- super(JSFCorePlugin.getDefault().getBundle().getSymbolicName(), severity,
- messageText);
- _message = messageText;
- setTargetObject(targetObject);
- _errorCode = errorCode;
- }
-
- /**
- * @return the localized message
- */
- public String getLocalizedMessage() {
- return _message;
- }
-
- /**
- * @see org.eclipse.wst.validation.internal.core.Message#getText()
- */
- public String getText() {
- return getLocalizedMessage();
- }
-
- /**
- * @see org.eclipse.wst.validation.internal.core.Message#getText(java.lang.ClassLoader)
- */
- public String getText(ClassLoader cl) {
- return getLocalizedMessage();
- }
-
- /**
- * @see org.eclipse.wst.validation.internal.core.Message#getText(java.util.Locale)
- */
- public String getText(Locale l) {
- return getLocalizedMessage();
- }
-
- public String getText(Locale l, ClassLoader cl) {
- return getLocalizedMessage();
- }
-
- /**
- * @return the error code related to this message
- */
- public int getErrorCode() {
- return _errorCode;
- }
-
-
- /**
- * @param offset
- * @return true if this message applies to document offset
- */
- public boolean appliesTo(int offset)
- {
- return (offset >= getOffset() && offset < getOffset()+getLength());
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/EObjectValidationVisitor.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/EObjectValidationVisitor.java
deleted file mode 100644
index a3b7909..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/EObjectValidationVisitor.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.validation.internal.appconfig;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- *
- * @author cbateman
- */
-public abstract class EObjectValidationVisitor
-{
- private EStructuralFeature _structuralFeature;
- private Map _childFeatures; // == null; lazy initialized in validate
- private final String _version;
-
- /**
- * Used to indicate no child nodes
- */
- protected final static EObjectValidationVisitor[] NO_CHILDREN =
- new EObjectValidationVisitor[0];
-
- /**
- * @param version
- *
- */
- public EObjectValidationVisitor(String version)
- {
- _version = version;
- }
-
- private EObjectValidationVisitor getVisitorForFeature(EStructuralFeature feature)
- {
- if (_childFeatures == null)
- {
- _childFeatures = new HashMap();
-
- EObjectValidationVisitor[] children = getChildNodeValidators();
-
- for (int i = 0; i < children.length; i++)
- {
- final EObjectValidationVisitor child = children[i];
- _childFeatures.put(child.getStructuralFeature(), child);
- }
- }
-
- return (EObjectValidationVisitor) _childFeatures.get(feature);
- }
-
- /**
- * @param structuralFeature
- * @param version
- */
- public EObjectValidationVisitor(EStructuralFeature structuralFeature, String version)
- {
- this(version);
- _structuralFeature = structuralFeature;
- }
-
- /**
- * @param eObject
- * @param messages
- * @param file
- */
- public final void validate(EObject eObject, List messages, IFile file)
- {
- doValidate(eObject, messages, file);
-
- List features = eObject.eClass().getEAllStructuralFeatures();
-
- for (final Iterator it = features.iterator(); it.hasNext();)
- {
- final EStructuralFeature feature = (EStructuralFeature) it.next();
- final EObjectValidationVisitor visitor =
- getVisitorForFeature(feature);
-
- if (visitor != null)
- {
- final Object obj = eObject.eGet(feature);
-
- if (obj instanceof List
- && feature.isMany())
- {
- for (final Iterator childIt = ((List)obj).iterator();
- childIt.hasNext();)
- {
- Object child = childIt.next();
- if (child instanceof EObject)
- {
- visitor.validate((EObject)child, messages, file);
- }
- }
- }
- else if (obj instanceof EObject)
- {
- visitor.validate((EObject)obj , messages, file);
- }
- }
- }
- }
-
- /**
- * Do the validation for this visitor on this node. Add any Message's to
- * the messages list
- *
- * @param eObject
- * @param messages
- * @param file
- */
- protected abstract void doValidate(EObject eObject, List messages, IFile file);
-
- /**
- * @return an array of visitors that validate children of the current node
- */
- protected abstract EObjectValidationVisitor[] getChildNodeValidators();
-
- /**
- * @return the structural feature
- */
- protected final EStructuralFeature getStructuralFeature()
- {
- return _structuralFeature;
- }
-
- /**
- * @return the version of the runtime
- */
- protected final String getVersion()
- {
- return _version;
- }
-
- /**
- * @param messages
- * @param message
- * @param eObj
- * @param file
- */
- protected static void addMessageInfo(List messages, IMessage message, EObject eObj, IFile file)
- {
- if (message != null)
- {
- message.setOffset(AppConfigValidationUtil.getStartOffset(eObj));
- message.setLength(AppConfigValidationUtil.getLength(eObj));
- message.setTargetObject(file);
- messages.add(message);
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/FacesConfigValidator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/FacesConfigValidator.java
deleted file mode 100644
index 66c2c28..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/FacesConfigValidator.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.validation.internal.appconfig;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-import org.eclipse.jst.jsf.facesconfig.emf.PhaseListenerType;
-
-/**
- * Top-level validator for the faces-config model
- *
- * @author cbateman
- *
- */
-public class FacesConfigValidator extends EObjectValidationVisitor
-{
- /**
- * constructor
- * @param version
- */
- public FacesConfigValidator(String version)
- {
- super(version);
- }
-
- protected EObjectValidationVisitor[] getChildNodeValidators()
- {
- return new EObjectValidationVisitor[]
- {
- new NavigationRuleValidator(getVersion())
- , new ApplicationValidationVisitor(getVersion())
- , new LifecycleValidationVisitor(getVersion())
- , new FactoryValidationVisitor(getVersion())
- , new ComponentValidatorVisitor(getVersion())
- , new ValidatorTypeValidationVisitor(getVersion())
- , new ConverterValidationVisitor(getVersion())
- , new ManagedBeanValidationVisitor(getVersion())
- , new RenderKitValidationVisitor(getVersion())
- };
- }
-
- protected void doValidate(EObject object, List messages, IFile file)
- {
- // nothing to do
- }
-
- private static class LifecycleValidationVisitor extends EObjectValidationVisitor
- {
- LifecycleValidationVisitor(final String version)
- {
- super(FacesConfigPackage.eINSTANCE.getFacesConfigType_Lifecycle(),
- version);
- }
-
- protected void doValidate(EObject object, List messages, IFile file) {
- // nothing to validate except in children
- }
-
- protected EObjectValidationVisitor[] getChildNodeValidators() {
- return new EObjectValidationVisitor[] {
- new PhaseListenerValidation(getVersion())
- };
- }
-
- private static class PhaseListenerValidation extends ClassNameEObjectValidationVisitor
- {
- PhaseListenerValidation(final String version)
- {
- super(FacesConfigPackage.eINSTANCE.getLifecycleType_PhaseListener(),
- version);
- }
- protected String getFullyQualifiedName(EObject eobj) {
- return ((PhaseListenerType)eobj).getTextContent();
- }
-
- protected String getInstanceOf() {
- return "javax.faces.event.PhaseListener";
- }
-
- protected EObjectValidationVisitor[] getChildNodeValidators() {
- // no children
- return NO_CHILDREN;
- }
- @Override
- protected boolean mustBeClass() {
- // must be a class
- return true;
- }
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/FactoryValidationVisitor.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/FactoryValidationVisitor.java
deleted file mode 100644
index 7ea5374..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/FactoryValidationVisitor.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.validation.internal.appconfig;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jst.jsf.facesconfig.emf.ApplicationFactoryType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesContextFactoryType;
-import org.eclipse.jst.jsf.facesconfig.emf.LifecycleFactoryType;
-import org.eclipse.jst.jsf.facesconfig.emf.RenderKitFactoryType;
-
-/**
- * @author cbateman
- *
- */
-public class FactoryValidationVisitor extends EObjectValidationVisitor
-{
- /**
- * @param version
- */
- public FactoryValidationVisitor(String version) {
- super(FacesConfigPackage.eINSTANCE.getFacesConfigType_Factory()
- ,version);
- }
-
- protected void doValidate(EObject object, List messages, IFile file) {
- // nothing to do except vaildate children
- }
-
- protected EObjectValidationVisitor[] getChildNodeValidators()
- {
- return new EObjectValidationVisitor[]
- {
- new ApplicationFactoryValidationVisitor(getVersion())
- , new FacesContextFactoryValidationVisitor(getVersion())
- , new LifecycleFactoryValidationVisitor(getVersion())
- , new RenderkitFactoryValidationVisitor(getVersion())
- };
- }
-
- private static class ApplicationFactoryValidationVisitor extends ClassNameEObjectValidationVisitor
- {
- ApplicationFactoryValidationVisitor(final String version)
- {
- super(FacesConfigPackage.eINSTANCE.getFactoryType_ApplicationFactory(),
- version);
- }
-
- protected String getFullyQualifiedName(EObject eobj)
- {
- return ((ApplicationFactoryType)eobj).getTextContent();
- }
-
- protected String getInstanceOf() {
- return "javax.faces.application.ApplicationFactory";
- }
-
- @Override
- protected boolean mustBeClass() {
- return true;
- }
-
- protected EObjectValidationVisitor[] getChildNodeValidators() {
- // none
- return NO_CHILDREN;
- }
-
- }
-
- private static class FacesContextFactoryValidationVisitor extends ClassNameEObjectValidationVisitor
- {
- FacesContextFactoryValidationVisitor(final String version)
- {
- super(FacesConfigPackage.eINSTANCE.getFactoryType_FacesContextFactory(),
- version);
- }
-
- protected String getFullyQualifiedName(EObject eobj)
- {
- return ((FacesContextFactoryType)eobj).getTextContent();
- }
-
- protected String getInstanceOf() {
- return "javax.faces.context.FacesContextFactory";
- }
-
- protected EObjectValidationVisitor[] getChildNodeValidators() {
- // none
- return NO_CHILDREN;
- }
-
- @Override
- protected boolean mustBeClass()
- {
- // must be a class
- return true;
- }
-
- }
-
- private static class LifecycleFactoryValidationVisitor extends ClassNameEObjectValidationVisitor
- {
- LifecycleFactoryValidationVisitor(final String version)
- {
- super(FacesConfigPackage.eINSTANCE.getFactoryType_LifecycleFactory(),
- version);
- }
-
- protected String getFullyQualifiedName(EObject eobj)
- {
- return ((LifecycleFactoryType)eobj).getTextContent();
- }
-
- protected String getInstanceOf() {
- return "javax.faces.lifecycle.LifecycleFactory";
- }
-
- protected EObjectValidationVisitor[] getChildNodeValidators() {
- // none
- return NO_CHILDREN;
- }
-
- @Override
- protected boolean mustBeClass() {
- // must be a class
- return true;
- }
-
- }
-
- private static class RenderkitFactoryValidationVisitor extends ClassNameEObjectValidationVisitor
- {
- RenderkitFactoryValidationVisitor(final String version)
- {
- super(FacesConfigPackage.eINSTANCE.getFactoryType_RenderKitFactory(),
- version);
- }
-
- protected String getFullyQualifiedName(EObject eobj)
- {
- return ((RenderKitFactoryType)eobj).getTextContent();
- }
-
- protected String getInstanceOf() {
- return "javax.faces.render.RenderKitFactory";
- }
-
- protected EObjectValidationVisitor[] getChildNodeValidators() {
- // none
- return NO_CHILDREN;
- }
-
- @Override
- protected boolean mustBeClass() {
- // must be a class
- return true;
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/ILocalizedMessage.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/ILocalizedMessage.java
deleted file mode 100644
index 33240d7..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/ILocalizedMessage.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.validation.internal.appconfig;
-
-/**
- * Used to expose internal message data to unit tests. Should not be used by clients
- * @author cbateman
- *
- */
-public interface ILocalizedMessage {
- /**
- * @return the error code
- */
- public int getErrorCode();
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/ManagedBeanValidationVisitor.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/ManagedBeanValidationVisitor.java
deleted file mode 100644
index 4f4d47c..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/ManagedBeanValidationVisitor.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.validation.internal.appconfig;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-import org.eclipse.jst.jsf.facesconfig.emf.ListEntriesType;
-import org.eclipse.jst.jsf.facesconfig.emf.ManagedBeanClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.ManagedBeanScopeType;
-import org.eclipse.jst.jsf.facesconfig.emf.ManagedBeanType;
-import org.eclipse.jst.jsf.facesconfig.emf.MapEntriesType;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- * Managed bean validator
- *
- * @author cbateman
- *
- */
-public class ManagedBeanValidationVisitor extends EObjectValidationVisitor
-{
- /**
- * @param version
- */
- public ManagedBeanValidationVisitor(final String version)
- {
- super(FacesConfigPackage.eINSTANCE.getFacesConfigType_ManagedBean()
- ,version);
- }
-
- protected void doValidate(EObject object, List messages, IFile file)
- {
- final ManagedBeanType managedBean = (ManagedBeanType) object;
-
- // TODO: validate managedBeanName is a valid Java id
-// final String managedBeanName =
-// managedBean.getManagedBeanName().getTextContent();
- validateScope(managedBean.getManagedBeanScope(), messages, file);
- validateClass(managedBean.getManagedBeanClass(), messages, file);
- validateEntryTypes(managedBean, messages, file);
- }
-
- private void validateScope(ManagedBeanScopeType scope, List messages, IFile file)
- {
- if (scope != null && scope.getTextContent() != null)
- {
- addMessageInfo(messages
- , AppConfigValidationUtil.validateManagedBeanScope(scope)
- , scope, file);
- }
- }
-
- private void validateClass(ManagedBeanClassType classType, List messages, IFile file)
- {
- if (classType != null)
- {
- String classTypeValue = classType.getTextContent();
- addMessageInfo(messages
- , AppConfigValidationUtil.validateClassName
- (classTypeValue == null ? "" : classTypeValue
- , null, true, // a managed bean must be a class
- file.getProject())
- , classType, file);
- }
- }
-
- private void validateEntryTypes(ManagedBeanType managedBeanType, List messages, IFile file)
- {
- // TODO: do a bean look-up for targetName to verify that it a) matches the type
- // and b) exists on the bean
- if (managedBeanType.getManagedBeanName()!= null
- && managedBeanType.getManagedBeanClass() != null)
- {
- final String propertyName =
- managedBeanType.getManagedBeanName().getTextContent();
- final String propertyClass =
- managedBeanType.getManagedBeanClass().getTextContent();
-
- if (propertyName == null || propertyClass == null
- || "".equals(propertyName.trim())
- || "".equals(propertyClass.trim()))
- {
- return;
- }
-
- IMessage message = null;
- EObject eObj = null;
- if (managedBeanType.getMapEntries() != null)
- {
- eObj = managedBeanType.getMapEntries();
- message =
- AppConfigValidationUtil
- .validateMapEntries
- (propertyName
- , propertyClass
- , (MapEntriesType) eObj
- , file.getProject());
- }
- else if (managedBeanType.getListEntries() != null)
- {
- eObj = managedBeanType.getListEntries();
- message =
- AppConfigValidationUtil
- .validateListEntries(
- propertyName
- , propertyClass
- , (ListEntriesType) eObj
- , file.getProject());
- }
- addMessageInfo(messages, message, eObj, file);
- }
- }
-
- protected EObjectValidationVisitor[] getChildNodeValidators() {
- return new EObjectValidationVisitor[]
- {
- new ManagedPropertyValidationVisitor(getVersion())
- };
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/ManagedPropertyValidationVisitor.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/ManagedPropertyValidationVisitor.java
deleted file mode 100644
index 27dd66c..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/ManagedPropertyValidationVisitor.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.validation.internal.appconfig;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-import org.eclipse.jst.jsf.facesconfig.emf.ListEntriesType;
-import org.eclipse.jst.jsf.facesconfig.emf.ManagedPropertyType;
-import org.eclipse.jst.jsf.facesconfig.emf.MapEntriesType;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- * Validates managed bean properties
- *
- */
-public class ManagedPropertyValidationVisitor extends EObjectValidationVisitor
-{
- /**
- * @param version
- */
- public ManagedPropertyValidationVisitor(String version) {
- super(FacesConfigPackage.eINSTANCE.getManagedBeanType_ManagedProperty()
- ,version);
- }
-
- protected void doValidate(final EObject object, final List messages, final IFile file)
- {
- // TODO: do a bean look-up for propertyName to verify that it a) matches the type
- // and b) exists on the bean
- final ManagedPropertyType managedPropertyType =
- (ManagedPropertyType) object;
-
- if (managedPropertyType.getPropertyName() == null
- || managedPropertyType.getPropertyClass() == null)
- {
- // don't bother if the basics aren't correct
- return;
- }
-
- final String propertyName =
- managedPropertyType.getPropertyName().getTextContent();
- final String propertyClass =
- managedPropertyType.getPropertyClass().getTextContent();
-
- if (propertyName == null || propertyClass == null
- || "".equals(propertyName.trim())
- || "".equals(propertyClass.trim()))
- {
- return;
- }
-
- IMessage message = null;
- EObject eObj = null;
- if (managedPropertyType.getMapEntries() != null)
- {
- eObj = managedPropertyType.getMapEntries();
- message =
- AppConfigValidationUtil
- .validateMapEntries
- (propertyName
- , propertyClass
- , (MapEntriesType) eObj
- , file.getProject());
- }
- else if (managedPropertyType.getListEntries() != null)
- {
- eObj = managedPropertyType.getListEntries();
- message =
- AppConfigValidationUtil
- .validateListEntries(
- propertyName
- , propertyClass
- , (ListEntriesType) eObj
- , file.getProject());
- }
-
- addMessageInfo(messages, message, eObj, file);
- }
-
- protected EObjectValidationVisitor[] getChildNodeValidators() {
- return new EObjectValidationVisitor[]
- {
- new PropertyNameValidationVisitor(FacesConfigPackage.eINSTANCE.getManagedPropertyType_PropertyName(),
- FacesConfigPackage.eINSTANCE.getManagedBeanType_ManagedBeanClass(), getVersion())
- };
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/Messages.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/Messages.java
deleted file mode 100644
index fb62b62..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/Messages.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.validation.internal.appconfig;
-
-import org.eclipse.osgi.util.NLS;
-
-class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.jst.jsf.validation.internal.appconfig.messages"; //$NON-NLS-1$
-
-
-
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- /**
- * see messages.properties
- */
- public static String AppConfigValidationUtil_0;
-
- /**
- * see messages.properties
- */
- public static String EL_EXPR_MUST_BE_IN_HASH_BRACES_ID;
-
- /**
- * see messages.properties
- */
- public static String SYNTAX_ERROR_IN_EL_ID;
-
- /**
- * see messages.properties
- */
- public static String CANNOT_FIND_CLASS_NAME_ID;
-
- /**
- * see messages.properties
- */
- public static String FULLY_QUALIFIED_NAME_MUST_BE_A_CLASS_ID;
-
- /**
- * see messages.properties
- */
- public static String CLASS_MUST_BE_INSTANCE_OF_ID;
-
- /**
- * see messages.properties
- */
- public static String CLASS_MUST_BE_CONCRETE_ID;
-
- /**
- * see messages.properties
- */
- public static String API_DEPRECATED_AFTER_VERSION_ID;
-
- /**
- * see messages.properties
- */
- public static String BEAN_PROPERTY_NOT_FOUND_ID;
-
- /**
- * see messages.properties
- */
- public static String MUST_BE_A_VALID_JAVA_IDENT_ID;
-
- /**
- * see messages.properties
- */
- public static String BEAN_SCOPE_NOT_VALID_ID;
-
- /**
- * see messages.properties
- */
- public static String MAP_ENTRIES_CAN_ONLY_BE_SET_ON_MAP_TYPE_ID;
-
- /**
- * see messages.properties
- */
- public static String LIST_ENTRIES_CAN_ONLY_BE_SET_ON_LIST_TYPE_ID;
-
- /**
- * see messages.properties
- */
- public static String API_NOT_AVAILABLE_BEFORE_VERSION_ID;
-
- /**
- * see messages.properties
- */
- public static String APP_CONFIG_IS_NEWER_THAN_JSF_VERSION_ID;
-
- /**
- * see messages.properties
- */
- public static String APP_CONFIG_IS_OLDER_THAN_JSF_VERSION_ID;
-
- /**
- * see messages.properties
- */
- public static String LOCALE_FORMAT_NOT_VALID_ID;
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/NavigationCaseValidationVisitor.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/NavigationCaseValidationVisitor.java
deleted file mode 100644
index 9c2c516..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/NavigationCaseValidationVisitor.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.validation.internal.appconfig;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-import org.eclipse.jst.jsf.facesconfig.emf.FromActionType;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- * NavigationCase validation visitor.
- *
- * @author cbateman
- *
- */
-public class NavigationCaseValidationVisitor extends EObjectValidationVisitor
-{
- /**
- * @param version
- *
- */
- public NavigationCaseValidationVisitor(final String version)
- {
- super(FacesConfigPackage.eINSTANCE.getNavigationRuleType_NavigationCase()
- , version);
- }
-
- protected void doValidate(EObject object, List messages, IFile file)
- {
- // nothing to do
- }
-
- protected EObjectValidationVisitor[] getChildNodeValidators()
- {
- return new EObjectValidationVisitor[]
- {
- new FromActionValidationVisitor(getVersion())
- };
- }
-
- private static class FromActionValidationVisitor extends EObjectValidationVisitor
- {
- /**
- * @param version
- *
- */
- public FromActionValidationVisitor(String version) {
- super(FacesConfigPackage.eINSTANCE.getNavigationCaseType_FromAction(),
- version);
- }
-
- protected void doValidate(EObject object, List messages, IFile file)
- {
- if (object instanceof FromActionType)
- {
- final FromActionType actionType = (FromActionType) object;
- IMessage message = AppConfigValidationUtil.validateELExpression
- (actionType.getTextContent());
- addMessageInfo(messages, message, actionType, file);
- }
- }
-
- protected EObjectValidationVisitor[] getChildNodeValidators()
- {
- return NO_CHILDREN;
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/NavigationRuleValidator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/NavigationRuleValidator.java
deleted file mode 100644
index 97b9df0..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/NavigationRuleValidator.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.validation.internal.appconfig;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-
-/**
- * Recursive validator for navigation-rule
- *
- * @author cbateman
- *
- */
-public class NavigationRuleValidator extends EObjectValidationVisitor
-{
- /**
- * Constructor
- * @param version
- */
- public NavigationRuleValidator(final String version)
- {
- super(FacesConfigPackage.eINSTANCE.getFacesConfigType_NavigationRule()
- , version);
- }
-
- protected void doValidate(EObject eobj, List messages, IFile file)
- {
- // nothing to do
- }
-
- protected EObjectValidationVisitor[] getChildNodeValidators()
- {
- return new EObjectValidationVisitor[]
- {
- new NavigationCaseValidationVisitor(getVersion())
- };
- }
-// private static class FromViewIdValidator extends ViewIdValidator
-// {
-// FromViewIdValidator()
-// {
-// super(Node.ELEMENT_NODE, "from-view-id");
-// }
-//
-// protected void doValidate(Node node, List messages, IFile file)
-// {
-// // only validate if a custom navigation handler is not set
-// // since we can only validate against what the default navigation
-// // handler will expect
-// if (!hasCustomNavigationHandler(file))
-// {
-// final String textContent = node.getTextContent();
-// final IProject project = file.getProject();
-//
-//
-// }
-// }
-//
-// private boolean hasCustomNavigationHandler(IFile file)
-// {
-// JSFAppConfigManager configManager =
-// JSFAppConfigManager.getInstance(file.getProject());
-//
-// for (final Iterator appIt = configManager.getApplications().iterator(); appIt.hasNext();)
-// {
-// ApplicationType appType = (ApplicationType) appIt.next();
-// if (appType.getNavigationHandler().size() > 0)
-// {
-// return true;
-// }
-// }
-//
-// return false;
-// }
-//
-// protected NodeValidationVisitor[] getChildNodeValidators() {
-// return EMPTY_CHILDREN;
-// }
-// }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/NodeValidationVisitor.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/NodeValidationVisitor.java
deleted file mode 100644
index aa2f781..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/NodeValidationVisitor.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.validation.internal.appconfig;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * Visits an app config DOM tree and calls validators based on the
- * configured validator tree
- *
- * @author cbateman
- *
- */
-public abstract class NodeValidationVisitor
-{
- private final short _nodeType;
- private final String _nodeName;
- private final Map _attributeVisitors;
- private final Map _elementVisitors;
-
- /**
- * Used to indicate no child nodes
- */
- protected final static NodeValidationVisitor[] EMPTY_CHILDREN = new NodeValidationVisitor[0];
-
- /**
- * @param nodeType
- * @param nodeName
- */
- public NodeValidationVisitor(short nodeType, String nodeName)
- {
- _nodeType = nodeType;
- _nodeName = nodeName;
- _attributeVisitors = new HashMap();
- _elementVisitors = new HashMap();
-
- NodeValidationVisitor[] childVisitors = getChildNodeValidators();
-
- for (int i = 0; i < childVisitors.length; i++)
- {
- final NodeValidationVisitor visitor = childVisitors[i];
-
- switch(visitor.getNodeType())
- {
- case Node.ATTRIBUTE_NODE:
- _attributeVisitors.put(visitor.getNodeName(), visitor);
- break;
-
- case Node.ELEMENT_NODE:
- _elementVisitors.put(visitor.getNodeName(), visitor);
- break;
- }
- }
- }
-
- /**
- * @param node
- * @param messages
- * @param file
- */
- public final void validate(Node node, List messages, IFile file)
- {
- doValidate(node, messages, file);
-
- final NamedNodeMap attributes = node.getAttributes();
-
- for (int i = 0; attributes != null && i < attributes.getLength(); i++)
- {
- final Node attr = attributes.item(i);
- final NodeValidationVisitor visitor =
- (NodeValidationVisitor) _attributeVisitors.get(attr.getNodeName());
- if (visitor != null)
- {
- visitor.validate(attr, messages, file);
- }
- }
-
- for (int i = 0; i < node.getChildNodes().getLength(); i++)
- {
- final Node child = node.getChildNodes().item(i);
- final NodeValidationVisitor visitor =
- (NodeValidationVisitor) _elementVisitors.get(child.getNodeName());
- if (visitor != null)
- {
- visitor.validate(child, messages, file);
- }
- }
- }
-
- /**
- * Do the validation for this visitor on this node. Add any Message's to
- * the messages list
- *
- * @param node
- * @param messages
- * @param file
- */
- protected abstract void doValidate(Node node, List messages, IFile file);
-
- /**
- * @return an array of visitors that validate children of the current node
- */
- protected abstract NodeValidationVisitor[] getChildNodeValidators();
-
- /**
- * @return the node type for this validator
- */
- protected short getNodeType()
- {
- return _nodeType;
- }
-
- /**
- * @return the node name for this validator
- */
- protected String getNodeName()
- {
- return _nodeName;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/PropertyNameValidationVisitor.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/PropertyNameValidationVisitor.java
deleted file mode 100644
index f58804d..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/PropertyNameValidationVisitor.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.validation.internal.appconfig;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jst.jsf.facesconfig.emf.PropertyNameType;
-
-/**
- * Validate the validation property name
- *
- * @author cbateman
- */
-class PropertyNameValidationVisitor extends EObjectValidationVisitor
-{
- private final EStructuralFeature _parentClassNameFeature;
-
- /**
- * @param feature
- * @param parentClassNameFeature
- * @param version
- */
- public PropertyNameValidationVisitor(EStructuralFeature feature,
- EStructuralFeature parentClassNameFeature, String version)
- {
- super(feature, version);
- _parentClassNameFeature = parentClassNameFeature;
- }
-
- protected EObjectValidationVisitor[] getChildNodeValidators()
- {
- return PropertyValidationVisitor.NO_CHILDREN;
- }
-
- protected void doValidate(EObject object, List messages, IFile file)
- {
- final String parentClassType = getParentClassType(object);
-
- if (parentClassType != null)
- {
- String typeSig =
- PropertyValidationVisitor.validateProperty((PropertyNameType)object
- , file.getProject(), parentClassType);
- final String propertyName =
- ((PropertyNameType)object).getTextContent();
-
- if (typeSig == null)
- {
- PropertyValidationVisitor.addMessageInfo(messages,
- DiagnosticFactory
- .create_BEAN_PROPERTY_NOT_FOUND
- (propertyName, parentClassType)
- , object, file);
- }
- }
- }
-
- private String getParentClassType(EObject object)
- {
- String parentClassType = null;
-
- // need to derive the parent's type
- final EObject property = object.eContainer();
- if (property != null)
- {
- EObject owningObject = property.eContainer();
-
- if (owningObject != null)
- {
- final EObject parentClassTypeObject =
- (EObject) owningObject.eGet(_parentClassNameFeature);
-
- if (parentClassTypeObject != null)
- {
- final EStructuralFeature feature =
- parentClassTypeObject.eClass()
- .getEStructuralFeature("textContent");
-
- if (feature != null)
- {
- parentClassType = (String)
- parentClassTypeObject.eGet(feature);
- }
- }
- }
- }
-
- return parentClassType;
- }
-}
\ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/PropertyValidationVisitor.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/PropertyValidationVisitor.java
deleted file mode 100644
index be9f5ec..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/PropertyValidationVisitor.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.validation.internal.appconfig;
-
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jst.jsf.common.util.JDTBeanIntrospector;
-import org.eclipse.jst.jsf.common.util.JDTBeanProperty;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-import org.eclipse.jst.jsf.facesconfig.emf.PropertyNameType;
-
-/**
- * Validates property's
- *
- */
-public class PropertyValidationVisitor extends EObjectValidationVisitor
-{
- private final EStructuralFeature _parentClassName;
-
- /**
- * @param feature
- * @param parentClassName
- * @param version
- */
- public PropertyValidationVisitor(EStructuralFeature feature, EStructuralFeature parentClassName, String version) {
- // this validator can be attached to numerous parents so it
- // cannot hard-code its feature
- super(feature,version);
- _parentClassName = parentClassName;
- }
-
- protected void doValidate(EObject object, List messages, IFile file) {
- // validate the class type here because we need knowledge
- // of the property name to do it
- //TODO:
-// final PropertyType property = (PropertyType) object;
-// final String propertyClass =
-// property.getPropertyClass().getTextContent();
-// final String propertySignature =
-// validateProperty(property.getPropertyName()
-// , file.getProject(), _parentClassType);
-//
-// if (propertySignature != null
-// && Signature.)
-// {
-// Signature.create
-// }
- }
-
- protected EObjectValidationVisitor[] getChildNodeValidators() {
- return new EObjectValidationVisitor[]
- {
- new PropertyNameValidationVisitor(FacesConfigPackage.eINSTANCE.getPropertyType_PropertyName(),
- _parentClassName, getVersion())
- };
- }
-
- static String validateProperty(PropertyNameType object, IProject project, String parentClassType)
- {
- String signatureBeanProperty = null;
- try
- {
- IJavaProject javaProject = JavaCore.create(project);
- IType type = javaProject.findType(parentClassType);
-
- if (type != null)
- {
- final JDTBeanIntrospector introspector =
- new JDTBeanIntrospector(type);
-
- final Map properties = introspector.getProperties();
-
- final String propertyName = object.getTextContent();
- if (properties.containsKey(propertyName))
- {
- final JDTBeanProperty beanProperty =
- (JDTBeanProperty) properties.get(propertyName);
- signatureBeanProperty =
- beanProperty.getTypeSignature();
- }
- }
- }
- catch(JavaModelException jme)
- {
- JSFCorePlugin
- .log(new Exception(jme),
- "Problem validating on parent: "+parentClassType);
- }
-
- return signatureBeanProperty;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/RenderKitValidationVisitor.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/RenderKitValidationVisitor.java
deleted file mode 100644
index a7b474b..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/RenderKitValidationVisitor.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.validation.internal.appconfig;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-import org.eclipse.jst.jsf.facesconfig.emf.RenderKitClassType;
-
-/**
- * Validates the renderkit
- */
-public class RenderKitValidationVisitor extends EObjectValidationVisitor
-{
-
- /**
- * @param version
- */
- public RenderKitValidationVisitor(String version)
- {
- super(FacesConfigPackage.eINSTANCE.getFacesConfigType_RenderKit()
- ,version);
- }
-
- protected void doValidate(EObject object, List messages, IFile file)
- {
- // nothing to do
- }
-
- protected EObjectValidationVisitor[] getChildNodeValidators()
- {
- return new EObjectValidationVisitor[]
- {
- new RenderKitClassValidationVisitor(getVersion()),
- new RendererValidationVisitor(getVersion())
- };
- }
-
- private static class RenderKitClassValidationVisitor extends ClassNameEObjectValidationVisitor
- {
- /**
- * @param version
- */
- public RenderKitClassValidationVisitor(String version)
- {
- super(FacesConfigPackage.eINSTANCE.getRenderKitType_RenderKitClass()
- , version);
- }
-
- protected String getFullyQualifiedName(EObject eobj)
- {
- return ((RenderKitClassType)eobj).getTextContent();
- }
-
- protected String getInstanceOf() {
- return "javax.faces.render.RenderKit";
- }
-
- protected EObjectValidationVisitor[] getChildNodeValidators() {
- return NO_CHILDREN;
- }
-
- @Override
- protected boolean mustBeClass() {
- // must be a class
- return true;
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/RendererValidationVisitor.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/RendererValidationVisitor.java
deleted file mode 100644
index d92fabd..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/RendererValidationVisitor.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.validation.internal.appconfig;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-import org.eclipse.jst.jsf.facesconfig.emf.RendererClassType;
-
-/**
- * Renderer validation
- *
- */
-public class RendererValidationVisitor extends EObjectValidationVisitor {
-
- /**
- * @param version
- */
- public RendererValidationVisitor(String version)
- {
- super(FacesConfigPackage.eINSTANCE.getRenderKitType_Renderer(),
- version);
- }
-
- protected void doValidate(EObject object, List messages, IFile file) {
- // nothing to do
- }
-
- protected EObjectValidationVisitor[] getChildNodeValidators() {
- return new EObjectValidationVisitor[]
- {
- new RendererClassValidationVisitor(getVersion())
- , new AttributeValidationVisitor
- (FacesConfigPackage.eINSTANCE.getRendererType_Attribute()
- , getVersion())
- };
- }
-
- private static class RendererClassValidationVisitor extends ClassNameEObjectValidationVisitor
- {
- /**
- * @param version
- */
- public RendererClassValidationVisitor(String version)
- {
- super(FacesConfigPackage.eINSTANCE.getRendererType_RendererClass()
- , version);
- }
-
- protected String getFullyQualifiedName(EObject eobj)
- {
- return ((RendererClassType)eobj).getTextContent();
- }
-
- protected String getInstanceOf() {
- return "javax.faces.render.Renderer";
- }
-
- protected EObjectValidationVisitor[] getChildNodeValidators() {
- return NO_CHILDREN;
- }
-
- @Override
- protected boolean mustBeClass() {
- // must be a class
- return true;
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/ValidatorTypeValidationVisitor.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/ValidatorTypeValidationVisitor.java
deleted file mode 100644
index 512e3c7..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/ValidatorTypeValidationVisitor.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.validation.internal.appconfig;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-import org.eclipse.jst.jsf.facesconfig.emf.ValidatorClassType;
-
-/**
- * Validation visitor for the Validator faces config model sub-type
- * @author cbateman
- *
- */
-public class ValidatorTypeValidationVisitor extends EObjectValidationVisitor {
-
- /**
- * @param version
- */
- public ValidatorTypeValidationVisitor(final String version)
- {
- super(FacesConfigPackage.eINSTANCE.getFacesConfigType_Validator(),
- version);
- }
-
- protected void doValidate(EObject object, List messages, IFile file) {
- // nothing in the tag to validate
- }
-
- protected EObjectValidationVisitor[] getChildNodeValidators() {
- return new EObjectValidationVisitor[]
- {
- new ValidatorClassValidationVisitor(getVersion()),
- new AttributeValidationVisitor(FacesConfigPackage.eINSTANCE.getValidatorType_Attribute(), getVersion()),
- new PropertyValidationVisitor
- (FacesConfigPackage.eINSTANCE.getValidatorType_Property()
- ,FacesConfigPackage.eINSTANCE.getValidatorType_ValidatorClass()
- ,getVersion()),
- };
- }
-
- private static class ValidatorClassValidationVisitor extends ClassNameEObjectValidationVisitor
- {
- ValidatorClassValidationVisitor(final String version)
- {
- super(FacesConfigPackage.eINSTANCE.getValidatorType_ValidatorClass(),
- version);
- }
-
- protected String getFullyQualifiedName(EObject eobj)
- {
- return ((ValidatorClassType)eobj).getTextContent();
- }
-
- protected String getInstanceOf() {
- return "javax.faces.validator.Validator";
- }
-
- protected EObjectValidationVisitor[] getChildNodeValidators() {
- return NO_CHILDREN;
- }
-
- @Override
- protected boolean mustBeClass() {
- // must be a class
- return true;
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/ViewIdValidator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/ViewIdValidator.java
deleted file mode 100644
index 6c2a067..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/ViewIdValidator.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.validation.internal.appconfig;
-
-
-/**
- * @author cbateman
- *
- */
-public abstract class ViewIdValidator extends NodeValidationVisitor
-{
- /**
- * @param nodeType
- * @param nodeName
- */
- protected ViewIdValidator(final short nodeType, final String nodeName)
- {
- super(nodeType, nodeName);
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/messages.properties b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/messages.properties
deleted file mode 100644
index 37da684..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/messages.properties
+++ /dev/null
@@ -1,27 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2007 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are 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:
-# Oracle Corporation - initial API and implementation
-###############################################################################
-EL_EXPR_MUST_BE_IN_HASH_BRACES_ID=EL expression must be of the form #{expression}
-SYNTAX_ERROR_IN_EL_ID=Syntax error in EL
-CANNOT_FIND_CLASS_NAME_ID=Cannot find fully qualified class: {0}
-FULLY_QUALIFIED_NAME_MUST_BE_A_CLASS_ID=Fully qualified name must be a class: {0}
-CLASS_MUST_BE_INSTANCE_OF_ID=Class {0} must {1} the type {2}
-CLASS_MUST_BE_CONCRETE_ID=Class {0} must be concrete (not abstract)
-API_DEPRECATED_AFTER_VERSION_ID=API {0} is deprecated after JSF {1}. Use {2} instead.
-BEAN_PROPERTY_NOT_FOUND_ID=Bean property {0} not found on parent class {1}
-MUST_BE_A_VALID_JAVA_IDENT_ID={0} must be a valid Java identifier
-BEAN_SCOPE_NOT_VALID_ID=Managed bean scope must be one of: request, session, application, none
-MAP_ENTRIES_CAN_ONLY_BE_SET_ON_MAP_TYPE_ID=Map entries can only be set on objects of type Map. {0} is not an instance of type java.util.Map
-LIST_ENTRIES_CAN_ONLY_BE_SET_ON_LIST_TYPE_ID=List entries can only be set on objects of type List. {0} is not an instance of type java.util.List
-API_NOT_AVAILABLE_BEFORE_VERSION_ID=API {0} is not avaiable before JSF {1}. Use {2} instead.
-APP_CONFIG_IS_NEWER_THAN_JSF_VERSION_ID=Faces 1.2 application configuration cannot be used in projects for Faces 1.1 or before
-APP_CONFIG_IS_OLDER_THAN_JSF_VERSION_ID=Faces {0} application configuration being used in Faces {1} project. Not all Faces {1} features will be available"
-LOCALE_FORMAT_NOT_VALID_ID=Locale format must be of the form lang_[_country[_variant]] like en or en_US or ja_JP_SJIS
-AppConfigValidationUtil_0=extend
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/ConstraintsFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/ConstraintsFactory.java
deleted file mode 100644
index 0df2966..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/ConstraintsFactory.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: ConstraintsFactory.java,v 1.1 2007/02/28 21:16:02 cbateman Exp $
- */
-package org.eclipse.jst.jsf.validation.internal.constraints;
-
-import org.eclipse.emf.ecore.EFactory;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Factory</b> for the model.
- * It provides a create method for each non-abstract class of the model.
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.validation.internal.constraints.ConstraintsPackage
- * @generated
- */
-public interface ConstraintsFactory extends EFactory {
- /**
- * The singleton instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- ConstraintsFactory eINSTANCE = org.eclipse.jst.jsf.validation.internal.constraints.impl.ConstraintsFactoryImpl.init();
-
- /**
- * Returns a new object of class '<em>Tag Id</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Tag Id</em>'.
- * @generated
- */
- TagId createTagId();
-
- /**
- * Returns a new object of class '<em>Tag Set</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Tag Set</em>'.
- * @generated
- */
- TagSet createTagSet();
-
- /**
- * Returns a new object of class '<em>Contains Tag Constraint</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Contains Tag Constraint</em>'.
- * @generated
- */
- ContainsTagConstraint createContainsTagConstraint();
-
- /**
- * Returns the package supported by this factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the package supported by this factory.
- * @generated
- */
- ConstraintsPackage getConstraintsPackage();
-
-} //ConstraintsFactory
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/ConstraintsPackage.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/ConstraintsPackage.java
deleted file mode 100644
index 5e140ea..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/ConstraintsPackage.java
+++ /dev/null
@@ -1,353 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: ConstraintsPackage.java,v 1.4 2008/02/01 21:52:24 gkessler Exp $
- */
-package org.eclipse.jst.jsf.validation.internal.constraints;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Package</b> for the model.
- * It contains accessors for the meta objects to represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.validation.internal.constraints.ConstraintsFactory
- * @model kind="package"
- * @generated
- */
-@SuppressWarnings("hiding")
-public interface ConstraintsPackage extends EPackage {
- /**
- * The package name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String eNAME = "constraints";
-
- /**
- * The package namespace URI.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String eNS_URI = "http://org.eclipse.jst.jsf.core/constraints.ecore";
-
- /**
- * The package namespace name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String eNS_PREFIX = "cnst";
-
- /**
- * The singleton instance of the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- ConstraintsPackage eINSTANCE = org.eclipse.jst.jsf.validation.internal.constraints.impl.ConstraintsPackageImpl.init();
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.jsf.validation.internal.constraints.impl.TagIdImpl <em>Tag Id</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.validation.internal.constraints.impl.TagIdImpl
- * @see org.eclipse.jst.jsf.validation.internal.constraints.impl.ConstraintsPackageImpl#getTagId()
- * @generated
- */
- int TAG_ID = 0;
-
- /**
- * The feature id for the '<em><b>Uri</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TAG_ID__URI = 0;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TAG_ID__NAME = 1;
-
- /**
- * The number of structural features of the '<em>Tag Id</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TAG_ID_FEATURE_COUNT = 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.jsf.validation.internal.constraints.impl.TagSetImpl <em>Tag Set</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.validation.internal.constraints.impl.TagSetImpl
- * @see org.eclipse.jst.jsf.validation.internal.constraints.impl.ConstraintsPackageImpl#getTagSet()
- * @generated
- */
- int TAG_SET = 1;
-
- /**
- * The feature id for the '<em><b>Tags</b></em>' reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TAG_SET__TAGS = 0;
-
- /**
- * The number of structural features of the '<em>Tag Set</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TAG_SET_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.jsf.validation.internal.constraints.impl.ContainsTagConstraintImpl <em>Contains Tag Constraint</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.validation.internal.constraints.impl.ContainsTagConstraintImpl
- * @see org.eclipse.jst.jsf.validation.internal.constraints.impl.ConstraintsPackageImpl#getContainsTagConstraint()
- * @generated
- */
- int CONTAINS_TAG_CONSTRAINT = 2;
-
- /**
- * The feature id for the '<em><b>Set Generator</b></em>' reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int CONTAINS_TAG_CONSTRAINT__SET_GENERATOR = 0;
-
- /**
- * The feature id for the '<em><b>Satisfies Set</b></em>' reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int CONTAINS_TAG_CONSTRAINT__SATISFIES_SET = 1;
-
- /**
- * The number of structural features of the '<em>Contains Tag Constraint</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int CONTAINS_TAG_CONSTRAINT_FEATURE_COUNT = 2;
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.jsf.validation.internal.constraints.TagId <em>Tag Id</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Tag Id</em>'.
- * @see org.eclipse.jst.jsf.validation.internal.constraints.TagId
- * @generated
- */
- EClass getTagId();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.validation.internal.constraints.TagId#getUri <em>Uri</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Uri</em>'.
- * @see org.eclipse.jst.jsf.validation.internal.constraints.TagId#getUri()
- * @see #getTagId()
- * @generated
- */
- EAttribute getTagId_Uri();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.validation.internal.constraints.TagId#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jst.jsf.validation.internal.constraints.TagId#getName()
- * @see #getTagId()
- * @generated
- */
- EAttribute getTagId_Name();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.jsf.validation.internal.constraints.TagSet <em>Tag Set</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Tag Set</em>'.
- * @see org.eclipse.jst.jsf.validation.internal.constraints.TagSet
- * @generated
- */
- EClass getTagSet();
-
- /**
- * Returns the meta object for the reference list '{@link org.eclipse.jst.jsf.validation.internal.constraints.TagSet#getTags <em>Tags</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the reference list '<em>Tags</em>'.
- * @see org.eclipse.jst.jsf.validation.internal.constraints.TagSet#getTags()
- * @see #getTagSet()
- * @generated
- */
- EReference getTagSet_Tags();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.jsf.validation.internal.constraints.ContainsTagConstraint <em>Contains Tag Constraint</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Contains Tag Constraint</em>'.
- * @see org.eclipse.jst.jsf.validation.internal.constraints.ContainsTagConstraint
- * @generated
- */
- EClass getContainsTagConstraint();
-
- /**
- * Returns the meta object for the reference '{@link org.eclipse.jst.jsf.validation.internal.constraints.ContainsTagConstraint#getSetGenerator <em>Set Generator</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the reference '<em>Set Generator</em>'.
- * @see org.eclipse.jst.jsf.validation.internal.constraints.ContainsTagConstraint#getSetGenerator()
- * @see #getContainsTagConstraint()
- * @generated
- */
- EReference getContainsTagConstraint_SetGenerator();
-
- /**
- * Returns the meta object for the reference '{@link org.eclipse.jst.jsf.validation.internal.constraints.ContainsTagConstraint#getSatisfiesSet <em>Satisfies Set</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the reference '<em>Satisfies Set</em>'.
- * @see org.eclipse.jst.jsf.validation.internal.constraints.ContainsTagConstraint#getSatisfiesSet()
- * @see #getContainsTagConstraint()
- * @generated
- */
- EReference getContainsTagConstraint_SatisfiesSet();
-
- /**
- * Returns the factory that creates the instances of the model.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the factory that creates the instances of the model.
- * @generated
- */
- ConstraintsFactory getConstraintsFactory();
-
- /**
- * <!-- begin-user-doc -->
- * Defines literals for the meta objects that represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @generated
- */
- interface Literals {
- /**
- * The meta object literal for the '{@link org.eclipse.jst.jsf.validation.internal.constraints.impl.TagIdImpl <em>Tag Id</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.validation.internal.constraints.impl.TagIdImpl
- * @see org.eclipse.jst.jsf.validation.internal.constraints.impl.ConstraintsPackageImpl#getTagId()
- * @generated
- */
- // @SuppressWarnings("hiding")
- EClass TAG_ID = eINSTANCE.getTagId();
-
- /**
- * The meta object literal for the '<em><b>Uri</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- // @SuppressWarnings("hiding")
- EAttribute TAG_ID__URI = eINSTANCE.getTagId_Uri();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- // @SuppressWarnings("hiding")
- EAttribute TAG_ID__NAME = eINSTANCE.getTagId_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.jsf.validation.internal.constraints.impl.TagSetImpl <em>Tag Set</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.validation.internal.constraints.impl.TagSetImpl
- * @see org.eclipse.jst.jsf.validation.internal.constraints.impl.ConstraintsPackageImpl#getTagSet()
- * @generated
- */
- // @SuppressWarnings("hiding")
- EClass TAG_SET = eINSTANCE.getTagSet();
-
- /**
- * The meta object literal for the '<em><b>Tags</b></em>' reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- // @SuppressWarnings("hiding")
- EReference TAG_SET__TAGS = eINSTANCE.getTagSet_Tags();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.jsf.validation.internal.constraints.impl.ContainsTagConstraintImpl <em>Contains Tag Constraint</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.validation.internal.constraints.impl.ContainsTagConstraintImpl
- * @see org.eclipse.jst.jsf.validation.internal.constraints.impl.ConstraintsPackageImpl#getContainsTagConstraint()
- * @generated
- */
- // @SuppressWarnings("hiding")
- EClass CONTAINS_TAG_CONSTRAINT = eINSTANCE.getContainsTagConstraint();
-
- /**
- * The meta object literal for the '<em><b>Set Generator</b></em>' reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- // @SuppressWarnings("hiding")
- EReference CONTAINS_TAG_CONSTRAINT__SET_GENERATOR = eINSTANCE.getContainsTagConstraint_SetGenerator();
-
- /**
- * The meta object literal for the '<em><b>Satisfies Set</b></em>' reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- // @SuppressWarnings("hiding")
- EReference CONTAINS_TAG_CONSTRAINT__SATISFIES_SET = eINSTANCE.getContainsTagConstraint_SatisfiesSet();
-
- }
-
-} //ConstraintsPackage
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/ContainsTagConstraint.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/ContainsTagConstraint.java
deleted file mode 100644
index d91e5c0..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/ContainsTagConstraint.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: ContainsTagConstraint.java,v 1.2 2007/04/16 19:53:29 itrimble Exp $
- */
-package org.eclipse.jst.jsf.validation.internal.constraints;
-
-import org.eclipse.emf.ecore.EObject;
-
-import org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.SetGenerator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Contains Tag Constraint</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.validation.internal.constraints.ContainsTagConstraint#getSetGenerator <em>Set Generator</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.validation.internal.constraints.ContainsTagConstraint#getSatisfiesSet <em>Satisfies Set</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jst.jsf.validation.internal.constraints.ConstraintsPackage#getContainsTagConstraint()
- * @model
- * @generated
- */
-public interface ContainsTagConstraint extends EObject {
- /**
- * Returns the value of the '<em><b>Set Generator</b></em>' reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Set Generator</em>' reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Set Generator</em>' reference.
- * @see #setSetGenerator(SetGenerator)
- * @see org.eclipse.jst.jsf.validation.internal.constraints.ConstraintsPackage#getContainsTagConstraint_SetGenerator()
- * @model extendedMetaData="kind='element' name='set-generator'"
- * @generated
- */
- SetGenerator getSetGenerator();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.validation.internal.constraints.ContainsTagConstraint#getSetGenerator <em>Set Generator</em>}' reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Set Generator</em>' reference.
- * @see #getSetGenerator()
- * @generated
- */
- void setSetGenerator(SetGenerator value);
-
- /**
- * Returns the value of the '<em><b>Satisfies Set</b></em>' reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Satisfies Set</em>' reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Satisfies Set</em>' reference.
- * @see #setSatisfiesSet(TagSet)
- * @see org.eclipse.jst.jsf.validation.internal.constraints.ConstraintsPackage#getContainsTagConstraint_SatisfiesSet()
- * @model extendedMetaData="kind='element' name='satisfies-set'"
- * @generated
- */
- TagSet getSatisfiesSet();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.validation.internal.constraints.ContainsTagConstraint#getSatisfiesSet <em>Satisfies Set</em>}' reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Satisfies Set</em>' reference.
- * @see #getSatisfiesSet()
- * @generated
- */
- void setSatisfiesSet(TagSet value);
-
-} // ContainsTagConstraint
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/TagId.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/TagId.java
deleted file mode 100644
index 5c5ebb1..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/TagId.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: TagId.java,v 1.1 2007/02/28 21:16:02 cbateman Exp $
- */
-package org.eclipse.jst.jsf.validation.internal.constraints;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Tag Id</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.validation.internal.constraints.TagId#getUri <em>Uri</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.validation.internal.constraints.TagId#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jst.jsf.validation.internal.constraints.ConstraintsPackage#getTagId()
- * @model
- * @generated
- */
-public interface TagId extends EObject {
- /**
- * Returns the value of the '<em><b>Uri</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Uri</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Uri</em>' attribute.
- * @see #setUri(String)
- * @see org.eclipse.jst.jsf.validation.internal.constraints.ConstraintsPackage#getTagId_Uri()
- * @model extendedMetaData="kind='element'"
- * @generated
- */
- String getUri();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.validation.internal.constraints.TagId#getUri <em>Uri</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Uri</em>' attribute.
- * @see #getUri()
- * @generated
- */
- void setUri(String value);
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jst.jsf.validation.internal.constraints.ConstraintsPackage#getTagId_Name()
- * @model extendedMetaData="kind='element'"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.validation.internal.constraints.TagId#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-
-} // TagId
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/TagSet.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/TagSet.java
deleted file mode 100644
index 5c60d5d..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/TagSet.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: TagSet.java,v 1.1 2007/02/28 21:16:02 cbateman Exp $
- */
-package org.eclipse.jst.jsf.validation.internal.constraints;
-
-import org.eclipse.emf.common.util.EList;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Tag Set</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.validation.internal.constraints.TagSet#getTags <em>Tags</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jst.jsf.validation.internal.constraints.ConstraintsPackage#getTagSet()
- * @model
- * @generated
- */
-public interface TagSet extends EObject {
- /**
- * Returns the value of the '<em><b>Tags</b></em>' reference list.
- * The list contents are of type {@link org.eclipse.jst.jsf.validation.internal.constraints.TagId}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Tags</em>' reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Tags</em>' reference list.
- * @see org.eclipse.jst.jsf.validation.internal.constraints.ConstraintsPackage#getTagSet_Tags()
- * @model type="org.eclipse.jst.jsf.validation.internal.constraints.TagId"
- * @generated
- */
- EList getTags();
-
-} // TagSet
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/impl/ConstraintsFactoryImpl.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/impl/ConstraintsFactoryImpl.java
deleted file mode 100644
index f83091d..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/impl/ConstraintsFactoryImpl.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: ConstraintsFactoryImpl.java,v 1.2 2007/03/22 23:56:16 cbateman Exp $
- */
-package org.eclipse.jst.jsf.validation.internal.constraints.impl;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-
-import org.eclipse.emf.ecore.impl.EFactoryImpl;
-
-import org.eclipse.emf.ecore.plugin.EcorePlugin;
-
-import org.eclipse.jst.jsf.validation.internal.constraints.*;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model <b>Factory</b>.
- * <!-- end-user-doc -->
- * @generated
- */
-public class ConstraintsFactoryImpl extends EFactoryImpl implements ConstraintsFactory {
- /**
- * Creates the default factory implementation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the constraints factory
- * @generated
- */
- public static ConstraintsFactory init() {
- try {
- ConstraintsFactory theConstraintsFactory = (ConstraintsFactory)EPackage.Registry.INSTANCE.getEFactory("http://org.eclipse.jst.jsf.core/constraints.ecore");
- if (theConstraintsFactory != null) {
- return theConstraintsFactory;
- }
- }
- catch (Exception exception) {
- EcorePlugin.INSTANCE.log(exception);
- }
- return new ConstraintsFactoryImpl();
- }
-
- /**
- * Creates an instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public ConstraintsFactoryImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param eClass
- * @return the eobject for the class
- * @generated
- */
- public EObject create(EClass eClass) {
- switch (eClass.getClassifierID()) {
- case ConstraintsPackage.TAG_ID: return createTagId();
- case ConstraintsPackage.TAG_SET: return createTagSet();
- case ConstraintsPackage.CONTAINS_TAG_CONSTRAINT: return createContainsTagConstraint();
- default:
- throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new tag id
- * @generated
- */
- public TagId createTagId() {
- TagIdImpl tagId = new TagIdImpl();
- return tagId;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new tag set
- * @generated
- */
- public TagSet createTagSet() {
- TagSetImpl tagSet = new TagSetImpl();
- return tagSet;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new Contains Tag Constraint
- * @generated
- */
- public ContainsTagConstraint createContainsTagConstraint() {
- ContainsTagConstraintImpl containsTagConstraint = new ContainsTagConstraintImpl();
- return containsTagConstraint;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the constraints package
- * @generated
- */
- public ConstraintsPackage getConstraintsPackage() {
- return (ConstraintsPackage)getEPackage();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the package
- * @deprecated
- * @generated
- */
- public static ConstraintsPackage getPackage() {
- return ConstraintsPackage.eINSTANCE;
- }
-
-} //ConstraintsFactoryImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/impl/ConstraintsPackageImpl.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/impl/ConstraintsPackageImpl.java
deleted file mode 100644
index fc60ec7..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/impl/ConstraintsPackageImpl.java
+++ /dev/null
@@ -1,329 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: ConstraintsPackageImpl.java,v 1.3 2007/04/16 19:53:19 itrimble Exp $
- */
-package org.eclipse.jst.jsf.validation.internal.constraints.impl;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-
-import org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.TraitTypesPackage;
-
-import org.eclipse.jst.jsf.validation.internal.constraints.ConstraintsFactory;
-import org.eclipse.jst.jsf.validation.internal.constraints.ConstraintsPackage;
-import org.eclipse.jst.jsf.validation.internal.constraints.ContainsTagConstraint;
-import org.eclipse.jst.jsf.validation.internal.constraints.TagId;
-import org.eclipse.jst.jsf.validation.internal.constraints.TagSet;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model <b>Package</b>.
- * <!-- end-user-doc -->
- * @generated
- */
-public class ConstraintsPackageImpl extends EPackageImpl implements ConstraintsPackage {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass tagIdEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass tagSetEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass containsTagConstraintEClass = null;
-
- /**
- * Creates an instance of the model <b>Package</b>, registered with
- * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
- * package URI value.
- * <p>Note: the correct way to create the package is via the static
- * factory method {@link #init init()}, which also performs
- * initialization of the package, or returns the registered package,
- * if one already exists.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.emf.ecore.EPackage.Registry
- * @see org.eclipse.jst.jsf.validation.internal.constraints.ConstraintsPackage#eNS_URI
- * @see #init()
- * @generated
- */
- private ConstraintsPackageImpl() {
- super(eNS_URI, ConstraintsFactory.eINSTANCE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static boolean isInited = false;
-
- /**
- * Creates, registers, and initializes the <b>Package</b> for this
- * model, and for any others upon which it depends. Simple
- * dependencies are satisfied by calling this method on all
- * dependent packages before doing anything else. This method drives
- * initialization for interdependent packages directly, in parallel
- * with this package, itself.
- * <p>Of this package and its interdependencies, all packages which
- * have not yet been registered by their URI values are first created
- * and registered. The packages are then initialized in two steps:
- * meta-model objects for all of the packages are created before any
- * are initialized, since one package's meta-model objects may refer to
- * those of another.
- * <p>Invocation of this method will not affect any packages that have
- * already been initialized.
- * <!-- begin-user-doc -->
- * @return the initialized package
- * <!-- end-user-doc -->
- * @see #eNS_URI
- * @see #createPackageContents()
- * @see #initializePackageContents()
- * @generated
- */
- public static ConstraintsPackage init() {
- if (isInited) return (ConstraintsPackage)EPackage.Registry.INSTANCE.getEPackage(ConstraintsPackage.eNS_URI);
-
- // Obtain or create and register package
- ConstraintsPackageImpl theConstraintsPackage = (ConstraintsPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof ConstraintsPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new ConstraintsPackageImpl());
-
- isInited = true;
-
- // Initialize simple dependencies
- TraitTypesPackage.eINSTANCE.eClass();
-
- // Create package meta-data objects
- theConstraintsPackage.createPackageContents();
-
- // Initialize created meta-data
- theConstraintsPackage.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- theConstraintsPackage.freeze();
-
- return theConstraintsPackage;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getTagId() {
- return tagIdEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getTagId_Uri() {
- return (EAttribute)tagIdEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getTagId_Name() {
- return (EAttribute)tagIdEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getTagSet() {
- return tagSetEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EReference getTagSet_Tags() {
- return (EReference)tagSetEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getContainsTagConstraint() {
- return containsTagConstraintEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EReference getContainsTagConstraint_SetGenerator() {
- return (EReference)containsTagConstraintEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EReference getContainsTagConstraint_SatisfiesSet() {
- return (EReference)containsTagConstraintEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public ConstraintsFactory getConstraintsFactory() {
- return (ConstraintsFactory)getEFactoryInstance();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isCreated = false;
-
- /**
- * Creates the meta-model objects for the package. This method is
- * guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void createPackageContents() {
- if (isCreated) return;
- isCreated = true;
-
- // Create classes and their features
- tagIdEClass = createEClass(TAG_ID);
- createEAttribute(tagIdEClass, TAG_ID__URI);
- createEAttribute(tagIdEClass, TAG_ID__NAME);
-
- tagSetEClass = createEClass(TAG_SET);
- createEReference(tagSetEClass, TAG_SET__TAGS);
-
- containsTagConstraintEClass = createEClass(CONTAINS_TAG_CONSTRAINT);
- createEReference(containsTagConstraintEClass, CONTAINS_TAG_CONSTRAINT__SET_GENERATOR);
- createEReference(containsTagConstraintEClass, CONTAINS_TAG_CONSTRAINT__SATISFIES_SET);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isInitialized = false;
-
- /**
- * Complete the initialization of the package and its meta-model. This
- * method is guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void initializePackageContents() {
- if (isInitialized) return;
- isInitialized = true;
-
- // Initialize package
- setName(eNAME);
- setNsPrefix(eNS_PREFIX);
- setNsURI(eNS_URI);
-
- // Obtain other dependent packages
- TraitTypesPackage theTraitTypesPackage = (TraitTypesPackage)EPackage.Registry.INSTANCE.getEPackage(TraitTypesPackage.eNS_URI);
-
- // Add supertypes to classes
-
- // Initialize classes and features; add operations and parameters
- initEClass(tagIdEClass, TagId.class, "TagId", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getTagId_Uri(), ecorePackage.getEString(), "uri", null, 0, 1, TagId.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getTagId_Name(), ecorePackage.getEString(), "name", null, 0, 1, TagId.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(tagSetEClass, TagSet.class, "TagSet", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getTagSet_Tags(), this.getTagId(), null, "tags", null, 0, -1, TagSet.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(containsTagConstraintEClass, ContainsTagConstraint.class, "ContainsTagConstraint", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getContainsTagConstraint_SetGenerator(), theTraitTypesPackage.getSetGenerator(), null, "setGenerator", null, 0, 1, ContainsTagConstraint.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getContainsTagConstraint_SatisfiesSet(), this.getTagSet(), null, "satisfiesSet", null, 0, 1, ContainsTagConstraint.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- // Create resource
- createResource(eNS_URI);
-
- // Create annotations
- // http:///org/eclipse/emf/ecore/util/ExtendedMetaData
- createExtendedMetaDataAnnotations();
- }
-
- /**
- * Initializes the annotations for <b>http:///org/eclipse/emf/ecore/util/ExtendedMetaData</b>.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected void createExtendedMetaDataAnnotations() {
- String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData";
- addAnnotation
- (getTagId_Uri(),
- source,
- new String[] {
- "kind", "element",
- "name", "uri"
- });
- addAnnotation
- (getTagId_Name(),
- source,
- new String[] {
- "kind", "element",
- "name", "name"
- });
- addAnnotation
- (getTagSet_Tags(),
- source,
- new String[] {
- "kind", "element",
- "name", "tagId"
- });
- addAnnotation
- (getContainsTagConstraint_SetGenerator(),
- source,
- new String[] {
- "kind", "element",
- "name", "set-generator"
- });
- addAnnotation
- (getContainsTagConstraint_SatisfiesSet(),
- source,
- new String[] {
- "kind", "element",
- "name", "satisfies-set"
- });
- }
-
-} //ConstraintsPackageImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/impl/ContainsTagConstraintImpl.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/impl/ContainsTagConstraintImpl.java
deleted file mode 100644
index d3fad71..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/impl/ContainsTagConstraintImpl.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: ContainsTagConstraintImpl.java,v 1.3 2007/04/16 19:53:19 itrimble Exp $
- */
-package org.eclipse.jst.jsf.validation.internal.constraints.impl;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-
-import org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.SetGenerator;
-
-import org.eclipse.jst.jsf.validation.internal.constraints.ConstraintsPackage;
-import org.eclipse.jst.jsf.validation.internal.constraints.ContainsTagConstraint;
-import org.eclipse.jst.jsf.validation.internal.constraints.TagSet;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Contains Tag Constraint</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.validation.internal.constraints.impl.ContainsTagConstraintImpl#getSetGenerator <em>Set Generator</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.validation.internal.constraints.impl.ContainsTagConstraintImpl#getSatisfiesSet <em>Satisfies Set</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class ContainsTagConstraintImpl extends EObjectImpl implements ContainsTagConstraint {
- /**
- * The cached value of the '{@link #getSetGenerator() <em>Set Generator</em>}' reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSetGenerator()
- * @generated
- * @ordered
- */
- protected SetGenerator setGenerator = null;
-
- /**
- * The cached value of the '{@link #getSatisfiesSet() <em>Satisfies Set</em>}' reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSatisfiesSet()
- * @generated
- * @ordered
- */
- protected TagSet satisfiesSet = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected ContainsTagConstraintImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EClass eStaticClass() {
- return ConstraintsPackage.Literals.CONTAINS_TAG_CONSTRAINT;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public SetGenerator getSetGenerator() {
- if (setGenerator != null && setGenerator.eIsProxy()) {
- InternalEObject oldSetGenerator = (InternalEObject)setGenerator;
- setGenerator = (SetGenerator)eResolveProxy(oldSetGenerator);
- if (setGenerator != oldSetGenerator) {
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.RESOLVE, ConstraintsPackage.CONTAINS_TAG_CONSTRAINT__SET_GENERATOR, oldSetGenerator, setGenerator));
- }
- }
- return setGenerator;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the set generator
- * <!-- end-user-doc -->
- * @generated
- */
- public SetGenerator basicGetSetGenerator() {
- return setGenerator;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setSetGenerator(SetGenerator newSetGenerator) {
- SetGenerator oldSetGenerator = setGenerator;
- setGenerator = newSetGenerator;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ConstraintsPackage.CONTAINS_TAG_CONSTRAINT__SET_GENERATOR, oldSetGenerator, setGenerator));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public TagSet getSatisfiesSet() {
- if (satisfiesSet != null && satisfiesSet.eIsProxy()) {
- InternalEObject oldSatisfiesSet = (InternalEObject)satisfiesSet;
- satisfiesSet = (TagSet)eResolveProxy(oldSatisfiesSet);
- if (satisfiesSet != oldSatisfiesSet) {
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.RESOLVE, ConstraintsPackage.CONTAINS_TAG_CONSTRAINT__SATISFIES_SET, oldSatisfiesSet, satisfiesSet));
- }
- }
- return satisfiesSet;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the tag set that must be satisfied
- * <!-- end-user-doc -->
- * @generated
- */
- public TagSet basicGetSatisfiesSet() {
- return satisfiesSet;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setSatisfiesSet(TagSet newSatisfiesSet) {
- TagSet oldSatisfiesSet = satisfiesSet;
- satisfiesSet = newSatisfiesSet;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ConstraintsPackage.CONTAINS_TAG_CONSTRAINT__SATISFIES_SET, oldSatisfiesSet, satisfiesSet));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case ConstraintsPackage.CONTAINS_TAG_CONSTRAINT__SET_GENERATOR:
- if (resolve) return getSetGenerator();
- return basicGetSetGenerator();
- case ConstraintsPackage.CONTAINS_TAG_CONSTRAINT__SATISFIES_SET:
- if (resolve) return getSatisfiesSet();
- return basicGetSatisfiesSet();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case ConstraintsPackage.CONTAINS_TAG_CONSTRAINT__SET_GENERATOR:
- setSetGenerator((SetGenerator)newValue);
- return;
- case ConstraintsPackage.CONTAINS_TAG_CONSTRAINT__SATISFIES_SET:
- setSatisfiesSet((TagSet)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eUnset(int featureID) {
- switch (featureID) {
- case ConstraintsPackage.CONTAINS_TAG_CONSTRAINT__SET_GENERATOR:
- setSetGenerator((SetGenerator)null);
- return;
- case ConstraintsPackage.CONTAINS_TAG_CONSTRAINT__SATISFIES_SET:
- setSatisfiesSet((TagSet)null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case ConstraintsPackage.CONTAINS_TAG_CONSTRAINT__SET_GENERATOR:
- return setGenerator != null;
- case ConstraintsPackage.CONTAINS_TAG_CONSTRAINT__SATISFIES_SET:
- return satisfiesSet != null;
- }
- return super.eIsSet(featureID);
- }
-
-} //ContainsTagConstraintImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/impl/TagIdImpl.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/impl/TagIdImpl.java
deleted file mode 100644
index a4f9985..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/impl/TagIdImpl.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: TagIdImpl.java,v 1.1 2007/02/28 21:16:02 cbateman Exp $
- */
-package org.eclipse.jst.jsf.validation.internal.constraints.impl;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-
-import org.eclipse.jst.jsf.validation.internal.constraints.ConstraintsPackage;
-import org.eclipse.jst.jsf.validation.internal.constraints.TagId;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Tag Id</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.validation.internal.constraints.impl.TagIdImpl#getUri <em>Uri</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.validation.internal.constraints.impl.TagIdImpl#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class TagIdImpl extends EObjectImpl implements TagId {
- /**
- * The default value of the '{@link #getUri() <em>Uri</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUri()
- * @generated
- * @ordered
- */
- protected static final String URI_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getUri() <em>Uri</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUri()
- * @generated
- * @ordered
- */
- protected String uri = URI_EDEFAULT;
-
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected TagIdImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EClass eStaticClass() {
- return ConstraintsPackage.Literals.TAG_ID;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getUri() {
- return uri;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setUri(String newUri) {
- String oldUri = uri;
- uri = newUri;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ConstraintsPackage.TAG_ID__URI, oldUri, uri));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName() {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setName(String newName) {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ConstraintsPackage.TAG_ID__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case ConstraintsPackage.TAG_ID__URI:
- return getUri();
- case ConstraintsPackage.TAG_ID__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case ConstraintsPackage.TAG_ID__URI:
- setUri((String)newValue);
- return;
- case ConstraintsPackage.TAG_ID__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eUnset(int featureID) {
- switch (featureID) {
- case ConstraintsPackage.TAG_ID__URI:
- setUri(URI_EDEFAULT);
- return;
- case ConstraintsPackage.TAG_ID__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case ConstraintsPackage.TAG_ID__URI:
- return URI_EDEFAULT == null ? uri != null : !URI_EDEFAULT.equals(uri);
- case ConstraintsPackage.TAG_ID__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String toString() {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (uri: ");
- result.append(uri);
- result.append(", name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
-} //TagIdImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/impl/TagSetImpl.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/impl/TagSetImpl.java
deleted file mode 100644
index f389914..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/impl/TagSetImpl.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: TagSetImpl.java,v 1.1 2007/02/28 21:16:02 cbateman Exp $
- */
-package org.eclipse.jst.jsf.validation.internal.constraints.impl;
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.util.EList;
-
-import org.eclipse.emf.ecore.EClass;
-
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-
-import org.eclipse.emf.ecore.util.EObjectResolvingEList;
-
-import org.eclipse.jst.jsf.validation.internal.constraints.ConstraintsPackage;
-import org.eclipse.jst.jsf.validation.internal.constraints.TagId;
-import org.eclipse.jst.jsf.validation.internal.constraints.TagSet;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Tag Set</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.validation.internal.constraints.impl.TagSetImpl#getTags <em>Tags</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class TagSetImpl extends EObjectImpl implements TagSet {
- /**
- * The cached value of the '{@link #getTags() <em>Tags</em>}' reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTags()
- * @generated
- * @ordered
- */
- protected EList tags = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected TagSetImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EClass eStaticClass() {
- return ConstraintsPackage.Literals.TAG_SET;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EList getTags() {
- if (tags == null) {
- tags = new EObjectResolvingEList(TagId.class, this, ConstraintsPackage.TAG_SET__TAGS);
- }
- return tags;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case ConstraintsPackage.TAG_SET__TAGS:
- return getTags();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case ConstraintsPackage.TAG_SET__TAGS:
- getTags().clear();
- getTags().addAll((Collection)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eUnset(int featureID) {
- switch (featureID) {
- case ConstraintsPackage.TAG_SET__TAGS:
- getTags().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case ConstraintsPackage.TAG_SET__TAGS:
- return tags != null && !tags.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
-} //TagSetImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/util/ConstraintsAdapterFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/util/ConstraintsAdapterFactory.java
deleted file mode 100644
index ff1de0e..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/util/ConstraintsAdapterFactory.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: ConstraintsAdapterFactory.java,v 1.1 2007/02/28 21:16:02 cbateman Exp $
- */
-package org.eclipse.jst.jsf.validation.internal.constraints.util;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-
-import org.eclipse.emf.ecore.EObject;
-
-import org.eclipse.jst.jsf.validation.internal.constraints.*;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Adapter Factory</b> for the model.
- * It provides an adapter <code>createXXX</code> method for each class of the model.
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.validation.internal.constraints.ConstraintsPackage
- * @generated
- */
-public class ConstraintsAdapterFactory extends AdapterFactoryImpl {
- /**
- * The cached model package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected static ConstraintsPackage modelPackage;
-
- /**
- * Creates an instance of the adapter factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public ConstraintsAdapterFactory() {
- if (modelPackage == null) {
- modelPackage = ConstraintsPackage.eINSTANCE;
- }
- }
-
- /**
- * Returns whether this factory is applicable for the type of the object.
- * <!-- begin-user-doc -->
- * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
- * <!-- end-user-doc -->
- * @return whether this factory is applicable for the type of the object.
- * @generated
- */
- public boolean isFactoryForType(Object object) {
- if (object == modelPackage) {
- return true;
- }
- if (object instanceof EObject) {
- return ((EObject)object).eClass().getEPackage() == modelPackage;
- }
- return false;
- }
-
- /**
- * The switch the delegates to the <code>createXXX</code> methods.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected ConstraintsSwitch modelSwitch =
- new ConstraintsSwitch() {
- public Object caseTagId(TagId object) {
- return createTagIdAdapter();
- }
- public Object caseTagSet(TagSet object) {
- return createTagSetAdapter();
- }
- public Object caseContainsTagConstraint(ContainsTagConstraint object) {
- return createContainsTagConstraintAdapter();
- }
- public Object defaultCase(EObject object) {
- return createEObjectAdapter();
- }
- };
-
- /**
- * Creates an adapter for the <code>target</code>.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param target the object to adapt.
- * @return the adapter for the <code>target</code>.
- * @generated
- */
- public Adapter createAdapter(Notifier target) {
- return (Adapter)modelSwitch.doSwitch((EObject)target);
- }
-
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.jst.jsf.validation.internal.constraints.TagId <em>Tag Id</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.jst.jsf.validation.internal.constraints.TagId
- * @generated
- */
- public Adapter createTagIdAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.jst.jsf.validation.internal.constraints.TagSet <em>Tag Set</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.jst.jsf.validation.internal.constraints.TagSet
- * @generated
- */
- public Adapter createTagSetAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.jst.jsf.validation.internal.constraints.ContainsTagConstraint <em>Contains Tag Constraint</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.jst.jsf.validation.internal.constraints.ContainsTagConstraint
- * @generated
- */
- public Adapter createContainsTagConstraintAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for the default case.
- * <!-- begin-user-doc -->
- * This default implementation returns null.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @generated
- */
- public Adapter createEObjectAdapter() {
- return null;
- }
-
-} //ConstraintsAdapterFactory
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/util/ConstraintsResourceFactoryImpl.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/util/ConstraintsResourceFactoryImpl.java
deleted file mode 100644
index e0da2ca..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/util/ConstraintsResourceFactoryImpl.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: ConstraintsResourceFactoryImpl.java,v 1.1 2007/02/28 21:16:02 cbateman Exp $
- */
-package org.eclipse.jst.jsf.validation.internal.constraints.util;
-
-import org.eclipse.emf.common.util.URI;
-
-import org.eclipse.emf.ecore.resource.Resource;
-
-import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl;
-
-import org.eclipse.emf.ecore.xmi.XMLResource;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Resource Factory</b> associated with the package.
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.validation.internal.constraints.util.ConstraintsResourceImpl
- * @generated
- */
-public class ConstraintsResourceFactoryImpl extends ResourceFactoryImpl {
- /**
- * Creates an instance of the resource factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public ConstraintsResourceFactoryImpl() {
- super();
- }
-
- /**
- * Creates an instance of the resource.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Resource createResource(URI uri) {
- XMLResource result = new ConstraintsResourceImpl(uri);
- result.getDefaultSaveOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE);
- result.getDefaultLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE);
-
- result.getDefaultSaveOptions().put(XMLResource.OPTION_SCHEMA_LOCATION, Boolean.TRUE);
-
- result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE);
- result.getDefaultSaveOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE);
-
- result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_LEXICAL_HANDLER, Boolean.TRUE);
- return result;
- }
-
-} //ConstraintsResourceFactoryImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/util/ConstraintsResourceImpl.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/util/ConstraintsResourceImpl.java
deleted file mode 100644
index c397df0..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/util/ConstraintsResourceImpl.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: ConstraintsResourceImpl.java,v 1.1 2007/02/28 21:16:02 cbateman Exp $
- */
-package org.eclipse.jst.jsf.validation.internal.constraints.util;
-
-import org.eclipse.emf.common.util.URI;
-
-import org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Resource </b> associated with the package.
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.validation.internal.constraints.util.ConstraintsResourceFactoryImpl
- * @generated
- */
-public class ConstraintsResourceImpl extends XMLResourceImpl {
- /**
- * Creates an instance of the resource.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param uri the URI of the new resource.
- * @generated
- */
- public ConstraintsResourceImpl(URI uri) {
- super(uri);
- }
-
-} //ConstraintsResourceImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/util/ConstraintsSwitch.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/util/ConstraintsSwitch.java
deleted file mode 100644
index 9628616..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/util/ConstraintsSwitch.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: ConstraintsSwitch.java,v 1.2 2007/04/09 02:40:07 cbateman Exp $
- */
-package org.eclipse.jst.jsf.validation.internal.constraints.util;
-
-import java.util.List;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-
-import org.eclipse.jst.jsf.validation.internal.constraints.*;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Switch</b> for the model's inheritance hierarchy.
- * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
- * to invoke the <code>caseXXX</code> method for each class of the model,
- * starting with the actual class of the object
- * and proceeding up the inheritance hierarchy
- * until a non-null result is returned,
- * which is the result of the switch.
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.validation.internal.constraints.ConstraintsPackage
- * @generated
- */
-public class ConstraintsSwitch {
- /**
- * The cached model package
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected static ConstraintsPackage modelPackage;
-
- /**
- * Creates an instance of the switch.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public ConstraintsSwitch() {
- if (modelPackage == null) {
- modelPackage = ConstraintsPackage.eINSTANCE;
- }
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc -->
- * @param theEObject
- * <!-- end-user-doc -->
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * @generated
- */
- public Object doSwitch(EObject theEObject) {
- return doSwitch(theEObject.eClass(), theEObject);
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc -->
- * @param theEClass
- * @param theEObject
- * <!-- end-user-doc -->
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * @generated
- */
- protected Object doSwitch(EClass theEClass, EObject theEObject) {
- if (theEClass.eContainer() == modelPackage) {
- return doSwitch(theEClass.getClassifierID(), theEObject);
- }
- List eSuperTypes = theEClass.getESuperTypes();
- return
- eSuperTypes.isEmpty() ?
- defaultCase(theEObject) :
- doSwitch((EClass)eSuperTypes.get(0), theEObject);
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc -->
- * @param classifierID
- * @param theEObject
- * <!-- end-user-doc -->
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * @generated
- */
- protected Object doSwitch(int classifierID, EObject theEObject) {
- switch (classifierID) {
- case ConstraintsPackage.TAG_ID: {
- TagId tagId = (TagId)theEObject;
- Object result = caseTagId(tagId);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case ConstraintsPackage.TAG_SET: {
- TagSet tagSet = (TagSet)theEObject;
- Object result = caseTagSet(tagSet);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case ConstraintsPackage.CONTAINS_TAG_CONSTRAINT: {
- ContainsTagConstraint containsTagConstraint = (ContainsTagConstraint)theEObject;
- Object result = caseContainsTagConstraint(containsTagConstraint);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- default: return defaultCase(theEObject);
- }
- }
-
- /**
- * Returns the result of interpretting the object as an instance of '<em>Tag Id</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpretting the object as an instance of '<em>Tag Id</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public Object caseTagId(TagId object) {
- return null;
- }
-
- /**
- * Returns the result of interpretting the object as an instance of '<em>Tag Set</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpretting the object as an instance of '<em>Tag Set</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public Object caseTagSet(TagSet object) {
- return null;
- }
-
- /**
- * Returns the result of interpretting the object as an instance of '<em>Contains Tag Constraint</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpretting the object as an instance of '<em>Contains Tag Constraint</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public Object caseContainsTagConstraint(ContainsTagConstraint object) {
- return null;
- }
-
- /**
- * Returns the result of interpretting the object as an instance of '<em>EObject</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch, but this is the last case anyway.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpretting the object as an instance of '<em>EObject</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject)
- * @generated
- */
- public Object defaultCase(EObject object) {
- return null;
- }
-
-} //ConstraintsSwitch
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/util/ConstraintsXMLProcessor.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/util/ConstraintsXMLProcessor.java
deleted file mode 100644
index 3d80420..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/constraints/util/ConstraintsXMLProcessor.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: ConstraintsXMLProcessor.java,v 1.1 2007/02/28 21:16:02 cbateman Exp $
- */
-package org.eclipse.jst.jsf.validation.internal.constraints.util;
-
-import java.util.Map;
-
-import org.eclipse.emf.ecore.EPackage;
-
-import org.eclipse.emf.ecore.xmi.util.XMLProcessor;
-
-import org.eclipse.jst.jsf.validation.internal.constraints.ConstraintsPackage;
-
-/**
- * This class contains helper methods to serialize and deserialize XML documents
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-public class ConstraintsXMLProcessor extends XMLProcessor {
- /**
- * Public constructor to instantiate the helper.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public ConstraintsXMLProcessor() {
- super((EPackage.Registry.INSTANCE));
- ConstraintsPackage.eINSTANCE.eClass();
- }
-
- /**
- * Register for "*" and "xml" file extensions the ConstraintsResourceFactoryImpl factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected Map getRegistrations() {
- if (registrations == null) {
- super.getRegistrations();
- registrations.put(XML_EXTENSION, new ConstraintsResourceFactoryImpl());
- registrations.put(STAR_EXTENSION, new ConstraintsResourceFactoryImpl());
- }
- return registrations;
- }
-
-} //ConstraintsXMLProcessor
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/ASTSemanticValidator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/ASTSemanticValidator.java
deleted file mode 100644
index e8b2ba9..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/ASTSemanticValidator.java
+++ /dev/null
@@ -1,612 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.validation.internal.el;
-
-import java.io.IOException;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.jst.jsf.common.internal.types.BooleanLiteralType;
-import org.eclipse.jst.jsf.common.internal.types.FloatLiteralType;
-import org.eclipse.jst.jsf.common.internal.types.IntegerLiteralType;
-import org.eclipse.jst.jsf.common.internal.types.LiteralType;
-import org.eclipse.jst.jsf.common.internal.types.MethodType;
-import org.eclipse.jst.jsf.common.internal.types.NullLiteralType;
-import org.eclipse.jst.jsf.common.internal.types.SignatureBasedType;
-import org.eclipse.jst.jsf.common.internal.types.StringLiteralType;
-import org.eclipse.jst.jsf.common.internal.types.ValueType;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IWorkspaceContextResolver;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.symbol.IInstanceSymbol;
-import org.eclipse.jst.jsf.context.symbol.IPropertySymbol;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.context.symbol.internal.util.IObjectSymbolBasedValueType;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.designtime.resolver.IStructuredDocumentSymbolResolverFactory;
-import org.eclipse.jst.jsf.designtime.resolver.ISymbolContextResolver;
-import org.eclipse.jst.jsf.validation.internal.IJSFViewValidator.IValidationReporter;
-import org.eclipse.jst.jsf.validation.internal.el.diagnostics.DiagnosticFactory;
-import org.eclipse.jst.jsf.validation.internal.el.operators.BinaryOperator;
-import org.eclipse.jst.jsf.validation.internal.el.operators.BracketOperator;
-import org.eclipse.jst.jsf.validation.internal.el.operators.DotOperator;
-import org.eclipse.jst.jsf.validation.internal.el.operators.TernaryChoiceOperator;
-import org.eclipse.jst.jsf.validation.internal.el.operators.UnaryOperator;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ASTAddExpression;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ASTAndExpression;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ASTChoiceExpression;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ASTEqualityExpression;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ASTExpression;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ASTFunctionInvocation;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ASTLiteral;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ASTMultiplyExpression;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ASTOperatorExpression;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ASTOrExpression;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ASTRelationalExpression;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ASTUnaryExpression;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ASTValue;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ASTValuePrefix;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ASTValueSuffix;
-import org.eclipse.jst.jsp.core.internal.java.jspel.JSPELParser;
-import org.eclipse.jst.jsp.core.internal.java.jspel.JSPELParserConstants;
-import org.eclipse.jst.jsp.core.internal.java.jspel.JSPELParserVisitor;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ParseException;
-import org.eclipse.jst.jsp.core.internal.java.jspel.SimpleNode;
-import org.eclipse.jst.jsp.core.internal.java.jspel.Token;
-
-
-class ASTSemanticValidator implements JSPELParserVisitor, IExpressionSemanticValidator
-{
- private final IFile _targetFile;
- private final ASTExpression _expr;
- private final IStructuredDocumentContext _context;
- private final ISymbolContextResolver _symbolResolver;
-// private final List<IMessage> _messages;
- private final EvaluationTracker _tracker;
- private final DiagnosticFactory _diagnosticFactory;
- private final IValidationReporter _reporter;
-
- ASTSemanticValidator(final ASTExpression expr,
- final IStructuredDocumentContext context,
- final IStructuredDocumentSymbolResolverFactory symbolResolverFactory,
- final IValidationReporter reporter)
- {
- final IWorkspaceContextResolver resolver = IStructuredDocumentContextResolverFactory.INSTANCE
- .getWorkspaceContextResolver(context);
-
- if (resolver != null)
- {
- _targetFile = (IFile) resolver.getResource();
- }
- else
- {
- _targetFile = null;
- }
-
- _expr = expr;
- _context = context;
- _symbolResolver = symbolResolverFactory.getSymbolContextResolver(context);
- _tracker = new EvaluationTracker();
- _diagnosticFactory = new DiagnosticFactory();
- _reporter = reporter;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.validation.internal.el.IExpressionSemanticValidator#validate()
- */
- public void validate()
- {
- _expr.jjtAccept(this, _tracker);
- }
-
- public Object visit(final ASTAddExpression node, final Object data)
- {
- performBinaryEvaluation(node, (EvaluationTracker)data);
- return data;
- }
-
- public Object visit(final ASTAndExpression node, final Object data)
- {
- performBinaryEvaluation(node, (EvaluationTracker)data);
- return data;
- }
-
- public Object visit(final ASTChoiceExpression node, final Object data)
- {
- if (node.jjtGetNumChildren() != 3)
- {
- throw new AssertionError("Binary operators should always have two sub-expressions");
- }
-
- // evaluate choice argument
- node.jjtGetChild(0).jjtAccept(this, data);
- final ValueType choiceArg = ((EvaluationTracker)data).getValueType();
- // evaluate when true argument
- node.jjtGetChild(1).jjtAccept(this, data);
- final ValueType whenTrueArg = ((EvaluationTracker)data).getValueType();
- //evaluate when false argument
- node.jjtGetChild(2).jjtAccept(this, data);
- final ValueType whenFalseArg = ((EvaluationTracker)data).getValueType();
-
-
- if (choiceArg != null && whenTrueArg != null && whenFalseArg != null)
- {
- final TernaryChoiceOperator operator =
- new TernaryChoiceOperator(_diagnosticFactory);
-
- final Diagnostic diagnostic =
- operator.validate(choiceArg/* whenTrueArg, whenFalseArg*/);
-
- if (diagnostic.getSeverity() != Diagnostic.OK)
- {
- final Token firstToken = node.getFirstToken();
- final int offset = _context.getDocumentPosition() + firstToken.beginColumn - 1;
- final int length = node.getLastToken().endColumn - firstToken.beginColumn+1;
- _reporter.report(diagnostic, offset, length);
- }
-
- ((EvaluationTracker)data).setType(operator.perform(choiceArg, whenTrueArg, whenFalseArg));
- }
- else
- {
- ((EvaluationTracker)data).setType(null);
- }
-
- return data;
- }
-
- public Object visit(final ASTEqualityExpression node, final Object data)
- {
- performBinaryEvaluation(node, (EvaluationTracker)data);
- return data;
- }
-
- public Object visit(final ASTExpression node, final Object data) {
- return node.childrenAccept(this, data);
- }
-
- public Object visit(final ASTFunctionInvocation node, final Object data)
- {
- // when we see a function invocation, null the type
- // we do not validate function invocations currently
- final Object retVal = node.childrenAccept(this, data);
- ((EvaluationTracker)data).setType(null);
- return retVal;
- }
-
- public Object visit(final ASTLiteral node, final Object data)
- {
- // note, there is an implicit assumption here that literals
- // are all terminals (leafs in the tree)
- if (node.jjtGetNumChildren() > 0)
- {
- throw new AssertionError("Literals should be terminal");
- }
-
- LiteralType type = null;
-
- final Token literalToken = node.getFirstToken();
-
- switch (literalToken.kind)
- {
- case JSPELParserConstants.STRING_LITERAL:
- type = new StringLiteralType(stripQuotes(literalToken.image));
- break;
-
- case JSPELParserConstants.INTEGER_LITERAL:
- type = new IntegerLiteralType(Long.parseLong(literalToken.image));
- break;
-
- case JSPELParserConstants.FLOATING_POINT_LITERAL:
- type = new FloatLiteralType(Double.parseDouble(literalToken.image));
- break;
-
- case JSPELParserConstants.FALSE:
- type = BooleanLiteralType.FALSE;
- break;
-
- case JSPELParserConstants.TRUE:
- type = BooleanLiteralType.TRUE;
- break;
-
- case JSPELParserConstants.NULL:
- type = NullLiteralType.SINGLETON;
- break;
-
- default:
- JSFCorePlugin.log("Unknown EL literal: " +literalToken.toString(), new Throwable("This throwable simply used to mark a stack trace"));
- }
-
- ((EvaluationTracker)data).setType(type);
- return data;
- }
-
- private String stripQuotes(final String stringLiteral)
- {
- if (stringLiteral.startsWith("'")
- || stringLiteral.startsWith("\""))
-
- {
- if (stringLiteral.length() > 2)
- {
- // take 'literal' -> literal
- return stringLiteral.substring(1, stringLiteral.length()-1);
- }
- // if only two characters, then the empty string
- return "";
- }
-
- return stringLiteral;
- }
-
- public Object visit(final ASTMultiplyExpression node, final Object data)
- {
- performBinaryEvaluation(node, (EvaluationTracker)data);
- return data;
- }
-
- public Object visit(final ASTOrExpression node, final Object data)
- {
- performBinaryEvaluation(node, (EvaluationTracker)data);
- return data;
- }
-
- public Object visit(final ASTRelationalExpression node, final Object data)
- {
- performBinaryEvaluation(node, (EvaluationTracker)data);
- return data;
- }
-
- public Object visit(final ASTUnaryExpression node, final Object data)
- {
- // assertion here is that this expression decomposes:
- // UnaryExpr -> Value
- // UnaryExpr -> UnaryOp UnaryExpression
- // since UnaryOp is a terminal (-,!,not,empty) node will
- // always have exactly one child
- node.childrenAccept(this, data);
- final SignatureBasedType type = ((EvaluationTracker)data).getType();
-
- if (type != null)
- {
- final Token firstToken = node.getFirstToken();
- if (UnaryOperator.isUnaryOperator(firstToken))
- {
- if (type instanceof ValueType)
- {
- final UnaryOperator unaryOp = UnaryOperator.createUnaryOperator(firstToken, _diagnosticFactory);
- final Diagnostic diagnostic = unaryOp.validate((ValueType)type);
-
- if (diagnostic.getSeverity() != Diagnostic.OK)
- {
- final int offset = _context.getDocumentPosition() + firstToken.beginColumn - 1;
- final int length = node.getLastToken().endColumn - firstToken.beginColumn+1;
- _reporter.report(diagnostic, offset, length);
- }
-
- ((EvaluationTracker)data).
- setType(unaryOp.performOperation ((ValueType)type));
- }
- // cannot apply operations to method bindings
- else
- {
- final int offset = _context.getDocumentPosition() +
- firstToken.beginColumn - 1;
- final int length = node.getLastToken().endColumn -
- firstToken.beginColumn+1;
-
- Diagnostic diagnostic =
- _diagnosticFactory.create_CANNOT_APPLY_OPERATOR_TO_METHOD_BINDING();
-
- _reporter.report(diagnostic, offset, length);
- }
- }
- }
-
- return data;
- }
-
- public Object visit(final ASTValue node, final Object data) {
- final ValueExpressionTracker tracker = new ValueExpressionTracker();
-
- ((EvaluationTracker)data).setValueTracker(tracker);
-
- node.childrenAccept(this, data);
-
- final SignatureBasedType type = ((EvaluationTracker)data).getType();
-
- // now check the tracker. If the last property in the expression
- // is non-null (i.e. the value has one or more suffices) then we
- // to very the leaf node (i.e. 'z' in #{x.y.z}) is more than just
- // an intermediate value used to get to other properties
- if (type instanceof IObjectSymbolBasedValueType
- && ((IObjectSymbolBasedValueType)type).getSymbol() instanceof IPropertySymbol
- && ((IPropertySymbol)((IObjectSymbolBasedValueType)type).getSymbol()).isIntermediate())
- {
- final int offset = tracker.getCurPropertySymbolOffset();
- final int length = tracker.getCurPropertySymbolLength();
- final Diagnostic diagnostic =
- _diagnosticFactory.create_MEMBER_IS_INTERMEDIATE(
- ((IPropertySymbol)((IObjectSymbolBasedValueType)type).getSymbol()).getName());
- _reporter.report(diagnostic, offset, length);
- }
-
- return data;
- }
-
- public Object visit(final ASTValuePrefix node, final Object data)
- {
- if (node.jjtGetNumChildren() == 0)
- {
- final Token token = node.getFirstToken();
- final String image = token.image;
-
- final ISymbol symbol = _symbolResolver.getVariable(image);
-
- if (symbol == null)
- {
- final int offset =
- _context.getDocumentPosition() + token.beginColumn - 1;
- final int length = token.endColumn - token.beginColumn + 1;
-
- final Diagnostic diagnostic =
- _diagnosticFactory.create_VARIABLE_NOT_FOUND(image);
-
- if (diagnostic.getSeverity() != Diagnostic.OK)
- {
- _reporter.report(diagnostic, offset, length);
- }
- }
- else if (symbol instanceof IInstanceSymbol)
- {
- final IObjectSymbolBasedValueType symbolType =
- IObjectSymbolBasedValueType.getInstance(symbol);
- ((EvaluationTracker) data).setType(symbolType);
- }
- }
-
- return node.childrenAccept(this, data);
- }
-
- public Object visit(final ASTValueSuffix node, final Object data)
- {
- final ValueExpressionTracker tracker = ((EvaluationTracker) data).getValueTracker();
- final SignatureBasedType type = ((EvaluationTracker) data).getType();
-
- if (type instanceof IObjectSymbolBasedValueType)
- {
- final IObjectSymbolBasedValueType symbolType =
- (IObjectSymbolBasedValueType) type;
- final Token firstToken = node.getFirstToken();
-
- if (node.jjtGetNumChildren() == 0
- && firstToken.kind == JSPELParserConstants.DOT)
- {
- final Token dotId = node.getLastToken();
-
- final int offset =
- _context.getDocumentPosition() + dotId.beginColumn - 1;
- final int length = dotId.endColumn - dotId.beginColumn + 1;
-
- final DotOperator dotOp = new DotOperator(_diagnosticFactory, _targetFile);
-
- final StringLiteralType suffixLiteral = new StringLiteralType(dotId.image);
- final Diagnostic diagnostic =
- dotOp.validate(symbolType,
- suffixLiteral);
-
- if (diagnostic.getSeverity() != Diagnostic.OK)
- {
- _reporter.report(diagnostic, offset, length);
- ((EvaluationTracker) data).setType(null);
- }
- else
- {
- // // if the base (value-a) is a map, then using the bracket value-a['y'] type
- // // syntax is recommended. Note that we do this here instead of
- // // DotOperator so that we don't tie the default property resolver
- // // behaviour to that operator class. If someone changes the rules
- // // of how the prop resolver interprets the base, then they may want to
- // // write their own validator that doesn't do this
- // if (symbolType.getSymbol().supportsCoercion(TypeConstants.TYPE_MAP))
- // {
- // _messages.add(ValidationMessageFactory.createFromDiagnostic(
- // DiagnosticFactory.create_BINARY_OP_DOT_WITH_VALUEA_MAP_SHOULD_USE_ARRAY
- // (symbolType.getSymbol().getName(), dotId.image),
- // startOffset, length, _targetFile));
- // }
-
- ((EvaluationTracker) data).setType(dotOp.performOperation(symbolType,
- suffixLiteral));
- tracker.setCurMemberSymbol(offset, length);
- }
-
- // we finished with the single dot suffix here
- return data;
- }
- else if (firstToken.kind == JSPELParserConstants.LBRACKET)
- {
- final EvaluationTracker subExprTracker = new EvaluationTracker();
- node.childrenAccept(this, subExprTracker);
-
- final SignatureBasedType subExprType = subExprTracker.getType();
-
- if (subExprType instanceof ValueType)
- {
- final Token lastToken = node.getLastToken();
- final int offset =
- _context.getDocumentPosition() + firstToken.beginColumn - 1;
- final int length = lastToken.endColumn - firstToken.beginColumn + 1;
-
- final BracketOperator bracketOperator = new BracketOperator(_diagnosticFactory, _targetFile);
-
- final Diagnostic diagnostic =
- bracketOperator.validate(symbolType,
- (ValueType)subExprType);
-
- if (diagnostic.getSeverity() != Diagnostic.OK)
- {
- _reporter.report(diagnostic, offset, length);
- ((EvaluationTracker) data).setType(null);
- }
- else
- {
- ((EvaluationTracker) data).setType(bracketOperator.performOperation(symbolType,
- (ValueType)subExprType));
- tracker.setCurMemberSymbol(offset, length);
- }
- }
- // we are finished with the bracketed suffix at this point.
- return data;
- }
- }
-
- // don't bother to accept children, since if we haven't done
- // something above, there's not much sensible we can do with it
- // clear the type first though
- ((EvaluationTracker) data).setType(null);
- return data; //node.childrenAccept(this, data);
- }
-
- public Object visit(final SimpleNode node, final Object data) {
- return node.childrenAccept(this, data);
- }
-
- /**
- * Copies stored messages into the validation reporter
- * @param validator
- * @param reporter
- */
-// public void reportFindings(final IValidator validator, final IReporter reporter)
-// {
-// for (final IMessage message : _messages)
-// {
-// // don't report messages that have no severity.
-// if ((message.getSeverity() & IMessage.ALL_MESSAGES) != 0)
-// {
-// reporter.addMessage(validator, message);
-// }
-// }
-// }
-
- private void performBinaryEvaluation(final ASTOperatorExpression node, final EvaluationTracker tracker)
- {
- if (node.jjtGetNumChildren() < 2)
- {
- throw new AssertionError("Binary operators should always have at least two sub-expressions");
- }
- else if (node.getOperatorTokens().size() != node.jjtGetNumChildren()-1)
- {
- throw new AssertionError("Binary operators should always have one operator token less than number of sub-expressions");
- }
-
- // evaluate left-most argument
- node.jjtGetChild(0).jjtAccept(this, tracker);
-
- ValueType curType = getValueTypeForBinaryOperation(tracker.getType(), (SimpleNode) node.jjtGetChild(0));
-
- for (int child = 1; child < node.jjtGetNumChildren(); child++)
- {
- // evaluate next argument running left-to-right
- node.jjtGetChild(child).jjtAccept(this, tracker);
- final ValueType secondType =
- getValueTypeForBinaryOperation(tracker.getType(), (SimpleNode) node.jjtGetChild(child));
-
- if (curType != null && secondType != null)
- {
- final BinaryOperator operator =
- BinaryOperator.getBinaryOperator((Token)node.getOperatorTokens().get(child-1), _diagnosticFactory, _context);
-
- final Diagnostic diagnostic = operator.validate(curType, secondType);
-
- if (diagnostic.getSeverity() != Diagnostic.OK)
- {
- final Token firstToken = node.getFirstToken();
- final int offset = _context.getDocumentPosition() + firstToken.beginColumn - 1;
- final int length = node.getLastToken().endColumn - firstToken.beginColumn+1;
- _reporter.report(diagnostic, offset, length);
- }
-
- curType = operator.performOperation(curType, secondType);
- }
- }
-
- tracker.setType(curType);
- }
-
- private ValueType getValueTypeForBinaryOperation(final SignatureBasedType type, final SimpleNode node)
- {
- if (type instanceof ValueType)
- {
- return (ValueType) type;
- }
- else if (type instanceof MethodType)
- {
- final int offset = _context.getDocumentPosition() + node.getFirstToken().beginColumn - 1;
- final int length = node.getLastToken().endColumn - node.getFirstToken().beginColumn+1;
- final Diagnostic diagnostic = _diagnosticFactory.create_CANNOT_APPLY_OPERATOR_TO_METHOD_BINDING();
- _reporter.report(diagnostic, offset, length);
- }
-
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.validation.internal.el.IExpressionSemanticValidator#getMessages()
- */
-// public List getMessages()
-// {
-// if (!_validatorHasBeenCalled)
-// {
-// throw new AssertionError("Should not call getMessages before validate has been called");
-// }
-// return _messages;
-// }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.validation.internal.el.IExpressionSemanticValidator#getExpressionType()
- */
- public SignatureBasedType getExpressionType()
- {
- return _tracker.getType();
- }
-
- /**
- * @param args
- * @throws IOException
- * @throws ParseException
- */
- public static void main(final String[] args) throws IOException, ParseException
- {
- String elText = "";
- int nextCharacter;
-
- while(((nextCharacter = System.in.read()) != -1))
- {
- final char nextChar = (char) nextCharacter;
-
- if (nextChar == '\n')
- {
- final JSPELParser parser = JSPELParser.createParser(elText);
- final ASTExpression expr = parser.Expression();
- expr.dump("");
-
- elText = "";
- }
- else
- {
- elText += nextChar;
- }
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/ELExpressionValidator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/ELExpressionValidator.java
deleted file mode 100644
index 71ccead..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/ELExpressionValidator.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.validation.internal.el;
-
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.jst.jsf.common.internal.types.CompositeType;
-import org.eclipse.jst.jsf.common.internal.types.SignatureBasedType;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.designtime.resolver.IStructuredDocumentSymbolResolverFactory;
-import org.eclipse.jst.jsf.validation.internal.IJSFViewValidator.IValidationReporter;
-import org.eclipse.jst.jsf.validation.internal.el.diagnostics.DiagnosticFactory;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ASTExpression;
-import org.eclipse.jst.jsp.core.internal.java.jspel.JSPELParser;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ParseException;
-import org.eclipse.jst.jsp.core.internal.java.jspel.Token;
-import org.eclipse.jst.jsp.core.internal.java.jspel.TokenMgrError;
-
-/**
- * Validates a single expression string
- *
- * @author cbateman
- *
- */
-public class ELExpressionValidator
-{
- private final IStructuredDocumentContext _context;
- private final String _elText;
- private final DiagnosticFactory _diagnosticFactory;
-
- private ASTSemanticValidator _semanticValidator;
- private final IStructuredDocumentSymbolResolverFactory _symbolResolverFactory;
- private final IValidationReporter _reporter;
-
- /**
- * @param context
- * @param elText
- * @param symbolResolverFactory
- * @param reporter
- */
- public ELExpressionValidator(final IStructuredDocumentContext context,
- final String elText,
- final IStructuredDocumentSymbolResolverFactory symbolResolverFactory,
- final IValidationReporter reporter)
- {
- _context = context;
- _elText = elText;
- _diagnosticFactory = new DiagnosticFactory();
- _symbolResolverFactory = symbolResolverFactory;
- _reporter = reporter;
- }
-
- /**
- * Validates a single EL expression in an XML attribute value
- * @return an ASTExpression for the node
- */
- public ASTExpression validateXMLNode()
- {
- JSPELParser elParser = JSPELParser.createParser(_elText);
- // =
- try {
- //final long startParsing = System.currentTimeMillis();
- final ASTExpression expr = elParser.Expression();
- //final long endParsing = System.currentTimeMillis();
- //final long startSemantics = System.currentTimeMillis();
- validateSemantics(expr, _context);
- //final long endSemantics = System.currentTimeMillis();
-
- //System.out.println("Time to parse '"+elText+"' = "+(endParsing-startParsing));
- //System.out.println("Time to semantic checking '"+elText+"' = "+(endSemantics-startSemantics));
-
- // if the parser bailed before parsing the whole
- // expression, raise a warning that there is probably
- // some syntatical issue
- if (expr.getLastToken().endColumn < _elText.trim().length()-1)
- {
- final int offset = _context.getDocumentPosition() + expr.getLastToken().endColumn;
- final int length = _elText.trim().length() - expr.getLastToken().endColumn;
- final Diagnostic diagnostic =
- _diagnosticFactory.create_GENERAL_SYNTAX_ERROR();
-
- _reporter.report(diagnostic, offset, length);
- }
-
- return expr;
- }
- catch (ParseException e) {
- Token curTok = e.currentToken;
- int offset = _context.getDocumentPosition() + curTok.beginColumn;
- int length = curTok.endColumn - curTok.beginColumn + 1;
- final Diagnostic diagnostic = _diagnosticFactory.create_GENERAL_SYNTAX_ERROR();
- _reporter.report(diagnostic, offset, length);
- return null;
- }
- catch (TokenMgrError te) {
- final int offset = _context.getDocumentPosition();
- final int length = _elText.length();
- final Diagnostic diagnostic =
- _diagnosticFactory.create_GENERAL_SYNTAX_ERROR();
- _reporter.report(diagnostic, offset, length);
- return null;
- }
- }
-
- /**
- * @return the type of the expression or null if
- * the type could not be evaluated
- */
- public CompositeType getExpressionType()
- {
- if (_semanticValidator != null)
- {
- final SignatureBasedType type =
- _semanticValidator.getExpressionType();
-
- if (type != null)
- {
- return type.toCompositeType();
- }
- }
-
- return null;
- }
-
-
- /**
- * @return the EL semantic validator for this expression validitor or
- * null if one has not yet been constructor. One will only be construct
- * if validate is called and the expression does not have any syntax errors.
- */
- public IExpressionSemanticValidator getSemanticValidator()
- {
- return _semanticValidator;
- }
-
- /**
- * Validates the context-specific data for one EL expressino
- *
- * @param expr
- * @param file
- * @param reporter
- * @param context
- */
- private void validateSemantics(ASTExpression expr,IStructuredDocumentContext context)
- {
- _semanticValidator = new ASTSemanticValidator(expr, context, _symbolResolverFactory, _reporter);
- _semanticValidator.validate();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/EvaluationTracker.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/EvaluationTracker.java
deleted file mode 100644
index aec1b21..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/EvaluationTracker.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.validation.internal.el;
-
-import org.eclipse.jst.jsf.common.internal.types.SignatureBasedType;
-import org.eclipse.jst.jsf.common.internal.types.ValueType;
-
-/**
- * Used to track the evaulation of an EL expression AST
- *
- * @author cbateman
- *
- */
-class EvaluationTracker
-{
- private ValueExpressionTracker _valueTracker;
- private SignatureBasedType _type;
-
- /**
- * @return the current value expression tracker or null if not set
- */
- public ValueExpressionTracker getValueTracker() {
- return _valueTracker;
- }
-
- /**
- * @param valueTracker
- */
- public void setValueTracker(ValueExpressionTracker valueTracker) {
- _valueTracker = valueTracker;
- }
-
- /**
- * @return the currently resolved type or null if not yet resolved
- * or not able to resolve
- */
- public SignatureBasedType getType() {
- return _type;
- }
-
- /**
- * @param type
- */
- public void setType(SignatureBasedType type) {
- _type = type;
- }
-
- /**
- * @return if getType() is a ValueType, returns it otherwise null
- */
- public ValueType getValueType()
- {
- if (_type instanceof ValueType)
- {
- return (ValueType) _type;
- }
-
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/IExpressionSemanticValidator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/IExpressionSemanticValidator.java
deleted file mode 100644
index 636fffe..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/IExpressionSemanticValidator.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.validation.internal.el;
-
-import org.eclipse.jst.jsf.common.internal.types.SignatureBasedType;
-
-/**
- * Exposes certain parts of the ASTSemanticValidator without exposing the whole class
- * Primarily this was done for JUnit testing
- *
- * @author cbateman
- *
- */
-public interface IExpressionSemanticValidator {
-
- /**
- * Performs the semantic validatino
- */
- public abstract void validate();
-
- /**
- * @return the value type of fully resolved expression
- * or null if not resolved (or could not be resolved)
- */
- public abstract SignatureBasedType getExpressionType();
-
-}
\ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/QuickFixAssistant.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/QuickFixAssistant.java
deleted file mode 100644
index 89ff50f..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/QuickFixAssistant.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.validation.internal.el;
-
-
-/**
- * @author cbateman
- *
- */
-public class QuickFixAssistant //extends CorrectionAssistantProvider
-{
-/* public IContentAssistant getCorrectionAssistant(ISourceViewer sourceViewer) {
- IContentAssistant ca = null;
-
- if (sourceViewer != null) {
- ContentAssistant assistant = new ContentAssistant();
-
- if (sourceViewer != null) {
- IContentAssistProcessor correctionProcessor = new CorrectionProcessorXML(sourceViewer);
- assistant.setContentAssistProcessor(correctionProcessor, IJSPPartitions.JSP_DEFAULT_EL2);
- }
- ca = assistant;
- }
-
- return ca;
-
- }
-
- private class CorrectionProcessorXML extends StructuredCorrectionProcessor {
- /**
- * quick assist processor
- */
-/* protected IQuickAssistProcessor fQuickAssistProcessor;
- /**
- * quick fix processor
- */
-/* protected IQuickFixProcessor fQuickFixProcessor;
-
- /**
- * @param sourceViewer
- */
-/* public CorrectionProcessorXML(ISourceViewer sourceViewer) {
- super(sourceViewer);
- }
-
- protected IQuickAssistProcessor getQuickAssistProcessor() {
- if (fQuickAssistProcessor == null)
- fQuickAssistProcessor = new IQuickAssistProcessor()
- {
- public boolean canAssist(StructuredTextViewer viewer, int offset)
- {
- return true;
- }
-
- /**
- * Collects proposals for assistant at the given offset.
- */
-/* public ICompletionProposal[] getProposals(StructuredTextViewer viewer, int offset) throws CoreException
- {
- final IStructuredDocumentContext context = IStructuredDocumentContextFactory.INSTANCE.getContext(viewer, offset);
- final ITextRegionContextResolver resolver = IStructuredDocumentContextResolverFactory.INSTANCE.getTextRegionResolver(context);
-
- if (resolver == null)
- {
- return new ICompletionProposal[0];
- }
-
- final String regionType = resolver.getRegionType();
- final List proposals = new ArrayList();
-
- if (DOMJSPRegionContexts.JSP_VBL_CONTENT.equals(regionType))
- {
- final String elText = resolver.getRegionText();
- final StringReader reader = new StringReader(elText);
- final JSPELParser parser = new JSPELParser(reader);
-
- try
- {
- final ASTExpression expr = parser.Expression();
- final IExpressionSemanticValidator validator = new ASTSemanticValidator(expr, context);
- validator.validate();
-
-// for (final Iterator it = validator.getMessages().iterator(); it.hasNext();)
-// {
-// // TODO:MyLocalizedMessage message = (MyLocalizedMessage) it.next();
-//
-// if (message.appliesTo(offset))
-// {
- throw new UnsupportedOperationException("TODO:");
-// switch(message.getErrorCode())
-// {
- //TODO:
-// case Messages.ERROR_CODE_BEANNAME_NOT_FOUND:
-// {
-// final String beanName =
-// (String) message.getAttribute("name");
-// proposals.add(new ELContentAssistProposal(beanName, ((IFile)message.getTargetObject()).getProject()));
-// }
-// break;
-// }
-// }
-// }
- }
- catch (ParseException pe)
- {
- // left empty on purpose
- }
- }
-
- return (ICompletionProposal[]) proposals.toArray(new ICompletionProposal[0]);
- }
- };
-
- return fQuickAssistProcessor;
- }
-
- protected IQuickFixProcessor getQuickFixProcessor() {
- if (fQuickFixProcessor == null)
- {
- // TODO: should use the approach where possible, but the Annotation doesn't pass
- // enough info
- fQuickFixProcessor = new QuickFixProcessorXML()
- {
- public boolean canFix(Annotation annnotation)
- {
- return true;
- }
-
- public ICompletionProposal[] getProposals(Annotation annnotation) throws CoreException
- {
- return new ICompletionProposal[0];
- }
- };
- }
-
- return fQuickFixProcessor;
- }
- }*/
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/ValueExpressionTracker.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/ValueExpressionTracker.java
deleted file mode 100644
index 702f997..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/ValueExpressionTracker.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.validation.internal.el;
-
-
-class ValueExpressionTracker
-{
- private int _curPropertySymbolOffset;
- private int _curPropertySymbolLength;
-
- /**
- * @param offset
- * @param length
- */
- public void setCurMemberSymbol(int offset, int length)
- {
- _curPropertySymbolOffset = offset;
- _curPropertySymbolLength = length;
- }
-
- /**
- * @return the offset of the current property symbol or 0 if no current property symbol
- */
- public int getCurPropertySymbolOffset()
- {
- return _curPropertySymbolOffset;
- }
-
- /**
- * @return the length of the current property symbol or 0 if no current property symbol
- */
- public int getCurPropertySymbolLength()
- {
- return _curPropertySymbolLength;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/diagnostics/DiagnosticFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/diagnostics/DiagnosticFactory.java
deleted file mode 100644
index 64e8381..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/diagnostics/DiagnosticFactory.java
+++ /dev/null
@@ -1,561 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation7
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.validation.internal.el.diagnostics;
-
-import java.text.MessageFormat;
-
-import org.eclipse.emf.common.util.BasicDiagnostic;
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.jst.jsf.validation.internal.ELValidationPreferences;
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Factory for all operator diagnostics. Class should
- * not be implemented, instantiated or sub-classed.
- *
- * @author cbateman
- *
- */
-public final class DiagnosticFactory
-{
- /**
- * The id used in the source field of all Diagnostic's created by this factory
- * to uniquely identify EL validation as their source type.
- */
- public final static String SOURCE_ID = "org.eclipse.jst.jsf.validation.el.Diagnostics";//$NON-NLS-1$
-
- /**
- * Problem id
- */
- public final static int BINARY_OP_BOTH_OPERANDS_NULL_ID = 0;
- /**
- * Problem id
- */
- public final static int BINARY_OP_POSSIBLE_DIVISION_BY_ZERO_ID = 1;
- /**
- * Problem id
- */
- public final static int BINARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION_ID = 2;
- /**
- * Problem id
- */
- public final static int BINARY_OP_CONSTANT_EXPRESSION_ALWAYS_EVAL_SAME_ID = 3;
- /**
- * Problem id
- */
- public final static int BINARY_OP_EQUALITY_COMP_WITH_NULL_ALWAYS_EVAL_SAME_ID = 4;
- /**
- * Problem id
- */
- public final static int BINARY_OP_CANNOT_COERCE_ARGUMENT_TO_BOOLEAN_ID = 5;
- /**
- * Problem id
- */
- public final static int BINARY_OP_FIRST_ARGUMENT_SHORT_CIRCUITS_ID = 6;
- /**
- * Problem id
- */
- public final static int BINARY_OP_SECOND_ARGUMENT_ALWAYS_EVAL_SAME_ID = 7;
- /**
- * Problem id
- */
- public final static int BINARY_OP_NO_AVAILABLE_TYPE_COERCION_ID = 8;
- /**
- * Problem id
- */
- public final static int BINARY_OP_COULD_NOT_COERCE_LITERALS_TO_NUMBERS_ID = 9;
- /**
- * Problem id
- */
- public final static int UNARY_OP_CONSTANT_EXPRESSION_EVAL_SAME_ID = 10;
- /**
- * Problem id
- */
- public final static int UNARY_OP_EMPTY_ALWAYS_FALSE_ON_TYPE_ID = 11;
- /**
- * Problem id
- */
- public final static int UNARY_OP_MINUS_ON_NULL_ALWAYS_ZERO_ID = 12;
- /**
- * Problem id
- */
- public final static int UNARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION_ID = 13;
- /**
- * Problem id
- */
- public final static int UNARY_OP_CANNOT_COERCE_ARGUMENT_TO_BOOLEAN_ID = 14;
- /**
- * Problem id
- */
- public final static int TERNARY_OP_CHOICE_IS_ALWAYS_SAME_ID = 15;
- /**
- * Problem id
- */
- public final static int TERNARY_OP_CANNOT_COERCE_CHOICE_TO_BOOLEAN_ID = 16;
- /**
- * Problem id
- */
- public final static int UNARY_OP_STRING_CONVERSION_NOT_GUARANTEED_ID = 17;
- /**
- * Problem id
- */
- public final static int CANNOT_APPLY_OPERATOR_TO_METHOD_BINDING_ID = 18;
- /**
- * Problem id
- */
- public final static int MEMBER_NOT_FOUND_ID = 19;
- /**
- * Problem id
- */
- public final static int VARIABLE_NOT_FOUND_ID = 20;
- /**
- * Problem id
- */
- public final static int MISSING_CLOSING_EXPR_BRACKET_ID = 21;
- /**
- * Problem id
- */
- public final static int GENERAL_SYNTAX_ERROR_ID = 22;
- /**
- * Problem id
- */
- public final static int EMPTY_EL_EXPRESSION_ID = 23;
-
- /**
- *
- */
- public final static int BINARY_OP_DOT_WITH_VALUEB_NULL_ID = 24;
-
- /**
- * Identifies a problem where we have x.y and x is a map. In this case
- * the recommend syntax is x['y']
- */
- public final static int BINARY_OP_DOT_WITH_DOTTED_KEY_SHOULD_USE_ARRAY_ID = 25;
-
- /**
- * Indicates that a numeric array accessor is being used with a value
- * which is either < 0 or may be greater than the assumed size of the array
- */
- public final static int POSSIBLE_ARRAY_INDEX_OUT_OF_BOUNDS_ID = 26;
-
- /**
- * Identifies the problem where an expr like bean.enumProp == 'blah'
- * but 'blah' does not match any of the possible enum constants, meaning
- * that the operation will always resolve to a constant value (in this case false)
- */
- public final static int BINARY_COMPARISON_WITH_ENUM_ALWAYS_SAME_ID = 27;
-
- /**
- * Identifies a problem where two enum variables are compared but the enums are
- * not compatible. i.e. bean.enum1 < bean.enum2. Enum.compareTo() may throw
- * an exception in this case (CCE).
- */
- public final static int BINARY_OP_COMPARISON_OF_ENUMS_INCOMPATIBLE_ID = 28;
-
- /**
- * Indicates a situation such as x.y where x is a bundle and
- * 'x.y.z' exists, but x.y while partially valid, does not have a value
- * associated.
- */
- public final static int MEMBER_IS_INTERMEDIATE_ID = 29;
-
- /**
- * Count of ids
- */
- public final static int NUM_IDS = 30;
-
- /**
- * @param operatorName
- * @return a configured diagnostic
- */
- public Diagnostic create_BINARY_OP_BOTH_OPERANDS_NULL(final String operatorName)
- {
- final String message = NLS.bind(
- Messages.BINARY_OP_BOTH_OPERANDS_NULL, operatorName);
- return create(BINARY_OP_BOTH_OPERANDS_NULL_ID, message);
- }
-
- private static Diagnostic DIAGNOSTIC_POSSIBLE_DIV_BY_ZERO;
-
- /**
- * @return a configured diagnostic
- */
- public Diagnostic create_BINARY_OP_POSSIBLE_DIVISION_BY_ZERO()
- {
- if (DIAGNOSTIC_POSSIBLE_DIV_BY_ZERO == null)
- {
- final String message = Messages.POSSIBLE_DIV_BY_ZERO;
- DIAGNOSTIC_POSSIBLE_DIV_BY_ZERO =
- create(BINARY_OP_POSSIBLE_DIVISION_BY_ZERO_ID, message);
- }
- return DIAGNOSTIC_POSSIBLE_DIV_BY_ZERO;
- }
-
- /**
- * @param operatorName
- * @return a configured diagnostic
- */
- public Diagnostic create_BINARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION(final String operatorName)
- {
- final String message =
- NLS.bind(Messages.BINARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION, operatorName);
- return create(BINARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION_ID, message);
- }
-
- /**
- * @param operatorName
- * @param value
- * @return a configured diagnostic
- */
- public Diagnostic create_BINARY_OP_CONSTANT_EXPRESSION_ALWAYS_EVAL_SAME(final String operatorName, final String value)
- {
- final String message =
- NLS.bind(Messages.BINARY_OP_CONSTANT_EXPRESSION_ALWAYS_EVAL_SAME,operatorName, value);
- return create(BINARY_OP_CONSTANT_EXPRESSION_ALWAYS_EVAL_SAME_ID, message);
- }
-
- /**
- * @param value
- * @return a configured diagnostic
- */
- public Diagnostic create_BINARY_OP_EQUALITY_COMP_WITH_NULL_ALWAYS_EVAL_SAME(final String value)
- {
- final String message =
- NLS.bind(Messages.BINARY_OP_EQUALITY_COMP_WITH_NULL_ALWAYS_EVAL_SAME, value);
- return create(BINARY_OP_EQUALITY_COMP_WITH_NULL_ALWAYS_EVAL_SAME_ID, message);
- }
-
- /**
- * @param whichArgument
- * @return a configured diagnostic
- */
- public Diagnostic create_BINARY_OP_CANNOT_COERCE_ARGUMENT_TO_BOOLEAN(final String whichArgument)
- {
- final String message =
- NLS.bind(Messages.BINARY_OP_CANNOT_COERCE_ARGUMENT_TO_BOOLEAN, whichArgument);
- return create(BINARY_OP_CANNOT_COERCE_ARGUMENT_TO_BOOLEAN_ID, message);
- }
-
- /**
- * @param shortCircuitValue
- * @param operatorName
- * @return a configured diagnostic
- */
- public Diagnostic create_BINARY_OP_FIRST_ARGUMENT_SHORT_CIRCUITS(boolean shortCircuitValue, String operatorName)
- {
- final String message =
- NLS.bind(Messages.BINARY_OP_FIRST_ARGUMENT_SHORT_CIRCUITS,
- Boolean.valueOf(shortCircuitValue), operatorName);
- return create(BINARY_OP_FIRST_ARGUMENT_SHORT_CIRCUITS_ID, message);
- }
-
- /**
- * @param shortCircuitValue
- * @param operatorName
- * @return a configured diagnostic
- */
- public Diagnostic create_BINARY_OP_SECOND_ARGUMENT_ALWAYS_EVAL_SAME(final boolean shortCircuitValue, final String operatorName)
- {
- final String message =
- NLS.bind(Messages.BINARY_OP_SECOND_ARGUMENT_ALWAYS_EVAL_SAME,
- Boolean.valueOf(shortCircuitValue), operatorName);
-
- return create(BINARY_OP_SECOND_ARGUMENT_ALWAYS_EVAL_SAME_ID, message);
- }
-
- private static Diagnostic DIAGNOSTIC_NO_AVAILABLE_TYPE_COERCION;
-
- /**
- * @return a configured diagnostic
- */
- public Diagnostic create_BINARY_OP_NO_AVAILABLE_TYPE_COERCION()
- {
- if (DIAGNOSTIC_NO_AVAILABLE_TYPE_COERCION == null)
- {
- DIAGNOSTIC_NO_AVAILABLE_TYPE_COERCION =
- create(BINARY_OP_NO_AVAILABLE_TYPE_COERCION_ID,
- Messages.BINARY_OP_NO_AVAILABLE_TYPE_COERCION);
- }
-
- return DIAGNOSTIC_NO_AVAILABLE_TYPE_COERCION;
- }
-
- private static Diagnostic DIAGNOSTIC_COULD_NOT_COERCE_LITERALS;
-
- /**
- * @return a configured diagnostic
- */
- public Diagnostic create_BINARY_OP_COULD_NOT_COERCE_LITERALS_TO_NUMBERS()
- {
- if (DIAGNOSTIC_COULD_NOT_COERCE_LITERALS == null)
- {
- DIAGNOSTIC_COULD_NOT_COERCE_LITERALS =
- create(BINARY_OP_COULD_NOT_COERCE_LITERALS_TO_NUMBERS_ID,
- Messages.BINARY_OP_COULD_NOT_COERCE_LITERALS_TO_NUMBERS);
- }
-
- return DIAGNOSTIC_COULD_NOT_COERCE_LITERALS;
- }
-
- /**
- * @param operatorName
- * @param value
- * @return a configured diagnostic
- */
- public Diagnostic create_UNARY_OP_CONSTANT_EXPRESSION_EVAL_SAME_ID(final String operatorName, final String value)
- {
- final String message =
- NLS.bind(Messages.UNARY_OP_CONSTANT_EXPRESSION_EVAL_SAME,
- operatorName, value);
- return create(UNARY_OP_CONSTANT_EXPRESSION_EVAL_SAME_ID, message);
- }
-
- /**
- * @return a configured diagnostic
- */
- public Diagnostic create_UNARY_OP_EMPTY_ALWAYS_FALSE_ON_TYPE()
- {
- return create(UNARY_OP_EMPTY_ALWAYS_FALSE_ON_TYPE_ID,
- Messages.UNARY_OP_EMPTY_ALWAYS_FALSE_ON_TYPE);
- }
-
- /**
- * @return a configured diagnostic
- */
- public Diagnostic create_UNARY_OP_MINUS_ON_NULL_ALWAYS_ZERO()
- {
- return create(UNARY_OP_MINUS_ON_NULL_ALWAYS_ZERO_ID,
- Messages.UNARY_OP_MINUS_ON_NULL_ALWAYS_ZERO);
- }
-
- /**
- * @param operatorName
- * @return a configured diagnostic
- */
- public Diagnostic create_UNARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION(final String operatorName)
- {
- final String message =
- NLS.bind(Messages.UNARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION,
- operatorName);
- return create(UNARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION_ID, message);
- }
-
- /**
- * @param operatorName
- * @return a configured diagnostic
- */
- public Diagnostic create_UNARY_OP_STRING_CONVERSION_NOT_GUARANTEED(final String operatorName)
- {
- final String message =
- NLS.bind(Messages.UNARY_OP_STRING_CONVERSION_NOT_GUARANTEED,
- operatorName);
- return create(UNARY_OP_STRING_CONVERSION_NOT_GUARANTEED_ID, message);
- }
-
- /**
- * @return a configured diagnostic
- */
- public Diagnostic create_UNARY_OP_CANNOT_COERCE_ARGUMENT_TO_BOOLEAN()
- {
- return create(UNARY_OP_CANNOT_COERCE_ARGUMENT_TO_BOOLEAN_ID,
- Messages.UNARY_OP_CANNOT_COERCE_ARGUMENT_TO_BOOLEAN);
- }
-
- /**
- * @param result
- * @param whichSelected
- * @return a configured diagnostic
- */
- public Diagnostic create_TERNARY_OP_CHOICE_IS_ALWAYS_SAME(boolean result, String whichSelected)
- {
- final String message =
- NLS.bind(Messages.TERNARY_OP_CHOICE_IS_ALWAYS_SAME,
- Boolean.valueOf(result), whichSelected);
- return create(TERNARY_OP_CHOICE_IS_ALWAYS_SAME_ID, message);
- }
-
- /**
- * @return a configured diagnostic
- */
- public Diagnostic create_TERNARY_OP_CANNOT_COERCE_CHOICE_TO_BOOLEAN()
- {
- return create(TERNARY_OP_CANNOT_COERCE_CHOICE_TO_BOOLEAN_ID,
- Messages.TERNARY_OP_CANNOT_COERCE_CHOICE_TO_BOOLEAN_ID);
- }
-
- /**
- * Method bindings cannot participate in expressions involving operators
- * Per JSP 1.1 spec section 5.2.1
- *
- * @return a configured message
- */
- public Diagnostic create_CANNOT_APPLY_OPERATOR_TO_METHOD_BINDING()
- {
- return create(CANNOT_APPLY_OPERATOR_TO_METHOD_BINDING_ID,
- Messages.CANNOT_APPLY_OPERATORS_TO_MB);
- }
-
- /**
- * @param curMemberSymbol
- * @param owningMember
- * @return a configured message
- */
- public Diagnostic create_MEMBER_NOT_FOUND(String curMemberSymbol, String owningMember)
- {
- return create(MEMBER_NOT_FOUND_ID,
- NLS.bind(Messages.VM_PROP_NAME_NOT_FOUND, curMemberSymbol, owningMember));
- }
-
- /**
- * @param variableName
- * @return a configured message
- */
- public Diagnostic create_VARIABLE_NOT_FOUND(String variableName)
- {
- return create(VARIABLE_NOT_FOUND_ID
- , NLS.bind(Messages.VM_ROOT_NAME_NOT_FOUND, variableName));
- }
-
- /**
- * @return a configured message
- */
- public Diagnostic create_MISSING_CLOSING_EXPR_BRACKET()
- {
- return create(MISSING_CLOSING_EXPR_BRACKET_ID
- , Messages.MISSING_CLOSING_EXPR_BRACKET);
- }
-
- /**
- * @return a configured message
- */
- public Diagnostic create_GENERAL_SYNTAX_ERROR()
- {
- return create(GENERAL_SYNTAX_ERROR_ID, Messages.GENERAL_SYNTAX_ERROR);
- }
-
- /**
- * @return a configured message
- */
- public Diagnostic create_EMPTY_EL_EXPRESSION()
- {
- return create(EMPTY_EL_EXPRESSION_ID, Messages.EMPTY_EL_EXPRESSION);
- }
-
- /**
- * @param operatorName
- * @return a configured diagnostic
- */
- public Diagnostic create_BINARY_OP_DOT_WITH_VALUEB_NULL(final String operatorName)
- {
- return create(BINARY_OP_DOT_WITH_VALUEB_NULL_ID
- , Messages.bind(Messages.BINARY_OP_DOT_WITH_VALUEB_NULL, operatorName));
- }
-
- /**
- * @param valAName
- * @param valueBName
- * @return a configured diagnostic
- */
- public Diagnostic create_BINARY_OP_DOT_WITH_VALUEA_MAP_SHOULD_USE_ARRAY(final String valAName, final String valueBName)
- {
- final Object[] formatArgs = new Object[] {valAName, valueBName};
- return create(BINARY_OP_DOT_WITH_DOTTED_KEY_SHOULD_USE_ARRAY_ID,
- MessageFormat.format(Messages.BINARY_OP_DOT_WITH_DOTTED_KEY_SHOULD_USE_ARRAY,formatArgs));
- }
-
- /**
- * @param value
- * @return an array index out of bounds diagnostic
- */
- public Diagnostic create_POSSIBLE_ARRAY_INDEX_OUT_OF_BOUNDS(final Integer value)
- {
- final Object[] formatArgs = new Object[] {value};
-
- return create(POSSIBLE_ARRAY_INDEX_OUT_OF_BOUNDS_ID
- , MessageFormat.format(Messages.POSSIBLE_ARRAY_INDEX_OUT_OF_BOUNDS,formatArgs));
- }
-
- /**
- * @param operatorName
- * @param invariantResult
- * @param enumName
- * @param fieldName
- * @return a diagnostic
- */
- public Diagnostic create_BINARY_COMPARISON_WITH_ENUM_AND_CONST_ALWAYS_SAME(final String operatorName, final boolean invariantResult, final String enumName, final String fieldName)
- {
- return create(BINARY_COMPARISON_WITH_ENUM_ALWAYS_SAME_ID
- , MessageFormat.format(Messages.BINARY_COMPARISON_WITH_ENUM_AND_CONST_ALWAYS_SAME
- , new Object[] {operatorName
- , Boolean.valueOf(invariantResult), enumName, fieldName}));
- }
-
- /**
- * @param operatorName
- * @param invariantResult
- * @param enumName1
- * @param enumName2
- * @return a diagnostic
- */
- public Diagnostic create_BINARY_COMPARISON_WITH_TWO_ENUMS_ALWAYS_SAME(final String operatorName, final boolean invariantResult, final String enumName1, final String enumName2)
- {
- return create(BINARY_COMPARISON_WITH_ENUM_ALWAYS_SAME_ID
- , MessageFormat.format(Messages.BINARY_COMPARISON_WITH_TWO_ENUMS_ALWAYS_SAME
- , new Object[] {operatorName
- , Boolean.valueOf(invariantResult), enumName1, enumName2}));
- }
-
- /**
- * @param operatorName
- * @param invariantResult
- * @param enumName
- * @param nonEnum
- * @return a diagnostic
- */
- public Diagnostic create_BINARY_COMPARISON_WITH_ENUM_AND_UNCOERCABLE_NONCONST_ALWAYS_SAME(final String operatorName, final boolean invariantResult, final String enumName, final String nonEnum)
- {
- return create(BINARY_COMPARISON_WITH_ENUM_ALWAYS_SAME_ID
- , MessageFormat.format(Messages.BINARY_COMPARISON_WITH_ENUM_AND_UNCOERCABLE_NONCONST_ALWAYS_SAME
- , new Object[] {operatorName
- , Boolean.valueOf(invariantResult), enumName, nonEnum}));
- }
-
- /**
- * @return a diagnostic
- */
- public Diagnostic create_BINARY_OP_COMPARISON_OF_ENUMS_INCOMPATIBLE()
- {
- return create(BINARY_OP_COMPARISON_OF_ENUMS_INCOMPATIBLE_ID
- , Messages.BINARY_OP_COMPARISON_OF_ENUMS_INCOMPATIBLE);
- }
-
- /**
- * @param intermediateMemberName
- * @return a diagnostic
- */
- public Diagnostic create_MEMBER_IS_INTERMEDIATE(final String intermediateMemberName)
- {
- return create(MEMBER_IS_INTERMEDIATE_ID
- , NLS.bind(Messages.MEMBER_IS_INTERMEDIATE
- , intermediateMemberName));
- }
-
- private BasicDiagnostic create(int diagnosticId, String message)
- {
- final int severity = ELValidationPreferences.getDefaultSeverity(diagnosticId);
- return new BasicDiagnostic(severity, SOURCE_ID
- , diagnosticId
- , message
- , null);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/diagnostics/Messages.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/diagnostics/Messages.java
deleted file mode 100644
index c14a851..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/diagnostics/Messages.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.validation.internal.el.diagnostics;
-
-import org.eclipse.osgi.util.NLS;
-
-class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.jst.jsf.validation.internal.el.diagnostics.messages"; //$NON-NLS-1$
-
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- /**
- * see messages.properties
- */
- public static String POSSIBLE_DIV_BY_ZERO;
- /**
- * see messages.properties
- */
- public static String UNARY_OP_EMPTY_ALWAYS_FALSE_ON_TYPE;
- /**
- * see messages.properties
- */
- public static String UNARY_OP_CANNOT_COERCE_ARGUMENT_TO_BOOLEAN;
- /**
- * see messages.properties
- */
- public static String TERNARY_OP_CANNOT_COERCE_CHOICE_TO_BOOLEAN_ID;
- /**
- * see messages.properties
- */
- public static String BINARY_OP_BOTH_OPERANDS_NULL;
- /**
- * see messages.properties
- */
- public static String BINARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION;
- /**
- * see messages.properties
- */
- public static String BINARY_OP_CONSTANT_EXPRESSION_ALWAYS_EVAL_SAME;
- /**
- * see messages.properties
- */
- public static String BINARY_OP_EQUALITY_COMP_WITH_NULL_ALWAYS_EVAL_SAME;
- /**
- * see messages.properties
- */
- public static String BINARY_OP_CANNOT_COERCE_ARGUMENT_TO_BOOLEAN;
- /**
- * see messages.properties
- */
- public static String BINARY_OP_FIRST_ARGUMENT_SHORT_CIRCUITS;
- /**
- * see messages.properties
- */
- public static String BINARY_OP_SECOND_ARGUMENT_ALWAYS_EVAL_SAME;
- /**
- * see messages.properties
- */
- public static String BINARY_OP_NO_AVAILABLE_TYPE_COERCION;
- /**
- * see messages.properties
- */
- public static String BINARY_OP_COULD_NOT_COERCE_LITERALS_TO_NUMBERS;
- /**
- * see messages.properties
- */
- public static String UNARY_OP_CONSTANT_EXPRESSION_EVAL_SAME;
- /**
- * see messages.properties
- */
- public static String UNARY_OP_MINUS_ON_NULL_ALWAYS_ZERO;
- /**
- * see messages.properties
- */
- public static String UNARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION;
- /**
- * see messages.properties
- */
- public static String UNARY_OP_STRING_CONVERSION_NOT_GUARANTEED;
- /**
- * see messages.properties
- */
- public static String TERNARY_OP_CHOICE_IS_ALWAYS_SAME;
- /**
- * see messages.properties
- */
- public static String VM_PROP_NAME_NOT_FOUND;
- /**
- * see messages.properties
- */
- public static String VM_ROOT_NAME_NOT_FOUND;
- /**
- * see messages.properties
- */
- public static String CANNOT_APPLY_OPERATORS_TO_MB;
- /**
- * see messages.properties
- */
- public static String MISSING_CLOSING_EXPR_BRACKET;
- /**
- * see messages.properties
- */
- public static String GENERAL_SYNTAX_ERROR;
- /**
- * see messages.properties
- */
- public static String EMPTY_EL_EXPRESSION;
- /**
- * see messages.properties
- */
- public static String BINARY_OP_DOT_WITH_VALUEB_NULL;
- /**
- * see messages.properties
- */
- public static String BINARY_OP_DOT_WITH_DOTTED_KEY_SHOULD_USE_ARRAY;
-
- /**
- * see messages.properties
- */
- public static String POSSIBLE_ARRAY_INDEX_OUT_OF_BOUNDS;
- /**
- * see messages.properties
- */
- public static String BINARY_COMPARISON_WITH_ENUM_AND_CONST_ALWAYS_SAME;
- /**
- * see messages.properties
- */
- public static String BINARY_COMPARISON_WITH_TWO_ENUMS_ALWAYS_SAME;
- /**
- * see messages.properties
- */
- public static String BINARY_OP_COMPARISON_OF_ENUMS_INCOMPATIBLE;
-
- /**
- * see messages.properties
- */
- public static String BINARY_COMPARISON_WITH_ENUM_AND_UNCOERCABLE_NONCONST_ALWAYS_SAME;
- /**
- * see messages.properties
- */
- public static String MEMBER_IS_INTERMEDIATE;
-
- private Messages() {
- // do nothing; no external instantiation
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/diagnostics/messages.properties b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/diagnostics/messages.properties
deleted file mode 100644
index 8f78e7c..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/diagnostics/messages.properties
+++ /dev/null
@@ -1,44 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2008 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are 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:
-# Oracle Corporation - initial API and implementation
-###############################################################################
-GENERAL_SYNTAX_ERROR=Syntax error in EL
-EMPTY_EL_EXPRESSION=Empty EL expression
-
-VM_ROOT_NAME_NOT_FOUND = {0} cannot be resolved
-VM_PROP_NAME_NOT_FOUND = {0} cannot be resolved as a member of {1}
-CANNOT_APPLY_OPERATORS_TO_MB=Cannot apply expression operators to method bindings
-MISSING_CLOSING_EXPR_BRACKET=Missing closing bracket on expression
-
-POSSIBLE_DIV_BY_ZERO=Possible division by zero
-UNARY_OP_EMPTY_ALWAYS_FALSE_ON_TYPE=This empty expression always evaluates to false. Only string, maps, arrays and collection have meaningful values for the empty operator
-UNARY_OP_CANNOT_COERCE_ARGUMENT_TO_BOOLEAN=Not operator does not support type coercion.
-TERNARY_OP_CANNOT_COERCE_CHOICE_TO_BOOLEAN_ID=Could not coerce choice argument to boolean
-BINARY_OP_BOTH_OPERANDS_NULL={0} with operand ''null'' is always zero
-BINARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION=Could not make numeric conversion for {0} operation
-BINARY_OP_CONSTANT_EXPRESSION_ALWAYS_EVAL_SAME=This {0} will always result a value of {1}
-BINARY_OP_EQUALITY_COMP_WITH_NULL_ALWAYS_EVAL_SAME=Comparisons with null always evaluates to {0}
-BINARY_OP_CANNOT_COERCE_ARGUMENT_TO_BOOLEAN=Cannot coerce {0} argument to boolean
-BINARY_OP_FIRST_ARGUMENT_SHORT_CIRCUITS=The first boolean argument is always {0}. The second argument will never be evaluated and the {1} will always evaluate to {0}.
-BINARY_OP_SECOND_ARGUMENT_ALWAYS_EVAL_SAME=The second boolean argument is always {0}. The {1} will always evaluate to {0}
-BINARY_OP_NO_AVAILABLE_TYPE_COERCION=Cannot coerce arguments for this operator
-BINARY_OP_COULD_NOT_COERCE_LITERALS_TO_NUMBERS=Could not coerce literals to numbers
-UNARY_OP_CONSTANT_EXPRESSION_EVAL_SAME=This {0} will always result a value of {1}
-UNARY_OP_MINUS_ON_NULL_ALWAYS_ZERO=Unary minus applied to null is always zero
-UNARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION=Could not make numeric conversion for {0} operation
-UNARY_OP_STRING_CONVERSION_NOT_GUARANTEED=Type coercion for {0} operator not guaranteed for possible runtime types: {1}
-TERNARY_OP_CHOICE_IS_ALWAYS_SAME=Choice argument is always {0}. {1} argument is always returned
-BINARY_OP_DOT_WITH_VALUEB_NULL=Applying the {0} operator with null second argument always results in null
-BINARY_OP_DOT_WITH_DOTTED_KEY_SHOULD_USE_ARRAY=Array syntax is preferred when accessing Map properties with keys containing dots (i.e. {0}[''{1}''])
-POSSIBLE_ARRAY_INDEX_OUT_OF_BOUNDS=Possible array index out of bound on list/array access with value: {0}
-BINARY_COMPARISON_WITH_ENUM_AND_CONST_ALWAYS_SAME=Comparison using {0} will always evaluate to {1}. Enumeration type {2} does not have a constant named {3}
-BINARY_OP_COMPARISON_OF_ENUMS_INCOMPATIBLE=Comparison of incompatible enumeration vales may cause a ClassCastException.
-BINARY_COMPARISON_WITH_TWO_ENUMS_ALWAYS_SAME=Comparison using {0} will always evaulate to {1}. Enumeration type {2} is not equality comparable with {3}
-BINARY_COMPARISON_WITH_ENUM_AND_UNCOERCABLE_NONCONST_ALWAYS_SAME=Comparison using {0} will always evaulate to {1}. Enumeration type {2} is not equality comparable with non-enumeration type {3}
-MEMBER_IS_INTERMEDIATE={0} is an intermediate property which does not have its own value associated with it.
\ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/AddArithmeticBinaryOperator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/AddArithmeticBinaryOperator.java
deleted file mode 100644
index e1975f0..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/AddArithmeticBinaryOperator.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.validation.internal.el.operators;
-
-import java.math.BigDecimal;
-
-import org.eclipse.jst.jsf.validation.internal.el.diagnostics.DiagnosticFactory;
-
-/**
- * Represents the arithmetic + operator in EL
- *
- * @author cbateman
- *
- */
-/*package*/ class AddArithmeticBinaryOperator extends NoDivArithmeticBinaryOperator {
-
- private static final String ADDITION = "addition";
-
- AddArithmeticBinaryOperator(DiagnosticFactory diagnosticFactory) {
- super(diagnosticFactory);
- }
-
- protected Long doRealOperation(Long firstArg, Long secondArg)
- {
- return Long.valueOf(firstArg.longValue() + secondArg.longValue());
- }
-
- protected Double doRealOperation(Double firstArg, Double secondArg) {
- return Double.valueOf(firstArg.doubleValue() + secondArg.doubleValue());
- }
-
- protected BigDecimal doRealOperation(BigDecimal firstArg,
- BigDecimal secondArg)
- {
- return firstArg.add(secondArg);
- }
-
- protected String getOperatorName() {
- return ADDITION;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/AndBinaryOperator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/AndBinaryOperator.java
deleted file mode 100644
index 2ce58ce..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/AndBinaryOperator.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.validation.internal.el.operators;
-
-import org.eclipse.jst.jsf.validation.internal.el.diagnostics.DiagnosticFactory;
-
-
-/**
- * Encapsulates the 'and'/'&&' boolean-AND operator
- * Based on JSP.2.3.6.1
- *
- * @author cbateman
- *
- */
-/*package*/class AndBinaryOperator extends LogicalBinaryOperator
-{
-
- AndBinaryOperator(DiagnosticFactory diagnosticFactory) {
- super(diagnosticFactory);
- }
-
- protected boolean doRealOperation(Boolean firstArg, Boolean secondArg)
- {
- return (firstArg.booleanValue() && secondArg.booleanValue());
- }
-
- protected String readableOperatorName()
- {
- return "logical-AND";
- }
-
- protected boolean shortCircuitValue() {
- // AND short-circuits on false
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/ArithmeticBinaryOperator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/ArithmeticBinaryOperator.java
deleted file mode 100644
index 3f70000..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/ArithmeticBinaryOperator.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.validation.internal.el.operators;
-
-import java.math.BigDecimal;
-
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.jst.jsf.common.internal.types.ValueType;
-import org.eclipse.jst.jsf.validation.internal.el.diagnostics.DiagnosticFactory;
-
-/**
- * Super for all arithmetic binary operators -- +, -, *,/,%
- *
- * @author cbateman
- *
- */
-/*package*/ abstract class ArithmeticBinaryOperator extends BinaryOperator
-{
- ArithmeticBinaryOperator(DiagnosticFactory diagnosticFactory)
- {
- super(diagnosticFactory);
- }
-
- public abstract ValueType performOperation(ValueType firstArg, ValueType secondArg);
- public abstract Diagnostic validate(ValueType firstArg, ValueType secondArg);
-
- /**
- * @param firstArg
- * @param secondArg
- * @return the result of firstArg op secondArg
- */
- protected abstract Long doRealOperation(Long firstArg, Long secondArg);
-
- /**
- * @param firstArg
- * @param secondArg
- * @return the result of firstArg op secondArg
- */
- protected abstract Double doRealOperation(Double firstArg, Double secondArg);
-
- /**
- * @param firstArg
- * @param secondArg
- * @return the result of firstArg op secondArg
- */
- protected abstract BigDecimal doRealOperation(BigDecimal firstArg, BigDecimal secondArg);
-
- /**
- * @return human-readable name of the operator
- */
- protected abstract String getOperatorName();
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/BinaryOperator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/BinaryOperator.java
deleted file mode 100644
index 58661da..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/BinaryOperator.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.validation.internal.el.operators;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.jst.jsf.common.internal.types.ValueType;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IWorkspaceContextResolver;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigUtils;
-import org.eclipse.jst.jsf.validation.internal.el.diagnostics.DiagnosticFactory;
-import org.eclipse.jst.jsp.core.internal.java.jspel.JSPELParserConstants;
-import org.eclipse.jst.jsp.core.internal.java.jspel.Token;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-/**
- * Represents an abstract EL binary operator that always
- * takes arguments and produces a single results
- *
- * @author cbateman
- *
- */
-public abstract class BinaryOperator
-{
- /**
- * the factory used to construct diagnostics
- */
- protected final DiagnosticFactory _diagnosticFactory;
-
- /**
- * @param operatorToken
- * @param diagnosticFactory
- * @param context -- the current EL document context; must not be null
- * @return a binary operator based on the provided token
- * @throws IllegalArgumentException if the token is not a recognized
- * EL binary operator token or if context is null
- */
- public static BinaryOperator getBinaryOperator(Token operatorToken, DiagnosticFactory diagnosticFactory, IStructuredDocumentContext context)
- {
- if (context == null)
- {
- throw new IllegalArgumentException("Context must not be null"); //$NON-NLS-1$
- }
- final String facetVersion = determineJSFVersion(context);
-
- switch (operatorToken.kind)
- {
- case JSPELParserConstants.AND1:
- case JSPELParserConstants.AND2:
- return new AndBinaryOperator(diagnosticFactory);
-
- case JSPELParserConstants.OR1:
- case JSPELParserConstants.OR2:
- return new OrBinaryOperator(diagnosticFactory);
-
- case JSPELParserConstants.EQ1:
- case JSPELParserConstants.EQ2:
- return new EqualsBinaryRelationalOperator(diagnosticFactory,facetVersion);
-
- case JSPELParserConstants.NEQ1:
- case JSPELParserConstants.NEQ2:
- return new NotEqualsBinaryRelationalOperator(diagnosticFactory,facetVersion);
-
- case JSPELParserConstants.GT1:
- case JSPELParserConstants.GT2:
- return new GreaterThanRelationalBinaryOperator(diagnosticFactory,facetVersion);
-
- case JSPELParserConstants.GE1:
- case JSPELParserConstants.GE2:
- return new GreaterThanEqRelationalBinaryOperator(diagnosticFactory,facetVersion);
-
- case JSPELParserConstants.LT1:
- case JSPELParserConstants.LT2:
- return new LessThanRelationalBinaryOperator(diagnosticFactory,facetVersion);
-
- case JSPELParserConstants.LE1:
- case JSPELParserConstants.LE2:
- return new LessThanEqRelationalBinaryOperator(diagnosticFactory,facetVersion);
-
- case JSPELParserConstants.PLUS:
- return new AddArithmeticBinaryOperator(diagnosticFactory);
-
- case JSPELParserConstants.MINUS:
- return new SubtractArithmeticBinaryOperator(diagnosticFactory);
-
- case JSPELParserConstants.MULTIPLY:
- return new MultiplyArithmeticBinaryOperator(diagnosticFactory);
-
- case JSPELParserConstants.DIVIDE1:
- case JSPELParserConstants.DIVIDE2:
- return new DivArithmeticBinaryOperator(diagnosticFactory);
-
- case JSPELParserConstants.MODULUS1:
- case JSPELParserConstants.MODULUS2:
- return new ModArithmeticBinaryOperator(diagnosticFactory);
- }
-
- throw new IllegalArgumentException("Unknown binary operator: "+operatorToken.image); //$NON-NLS-1$
- }
-
- /**
- *
- * Constructor
- */
- BinaryOperator(DiagnosticFactory diagnosticFactory)
- {
- /* no construction or sub-classing outside package*/
- _diagnosticFactory = diagnosticFactory;
- }
-
- /**
- * If both arguments are literals and the operation can be performed, then
- * the return must be a new LiteralType transformed using this operator.
- *
- * If one or both of the arg is not a literal and the operaton can be performed, then
- * the return is a new ValueType transformed per the rules of the operator
- *
- * If the operation cannot be performed on ValueType, return null
- *
- * @param firstArg
- * @param secondArg
- * @return a new value type after the operation is performed
- */
- public abstract ValueType performOperation(ValueType firstArg, ValueType secondArg);
-
-
- /**
- * @param firstArg
- * @param secondArg
- * @return a Diagnostic interpreting whether it is valid to perform the
- * operation on the two arguments
- */
- public abstract Diagnostic validate(ValueType firstArg, ValueType secondArg);
-
- private static String determineJSFVersion(IStructuredDocumentContext context)
- {
- final IWorkspaceContextResolver wkResolver =
- IStructuredDocumentContextResolverFactory.
- INSTANCE.getWorkspaceContextResolver(context);
-
- IProject project = wkResolver.getProject();
-
- IProjectFacetVersion projectVersion = JSFAppConfigUtils.getProjectFacet(project);
-
- if (projectVersion != null)
- {
- return projectVersion.getVersionString();
- }
-
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/BracketOperator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/BracketOperator.java
deleted file mode 100644
index 4cfc74e..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/BracketOperator.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.validation.internal.el.operators;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jst.jsf.common.internal.types.LiteralType;
-import org.eclipse.jst.jsf.common.internal.types.SignatureBasedType;
-import org.eclipse.jst.jsf.common.internal.types.TypeCoercer;
-import org.eclipse.jst.jsf.common.internal.types.TypeCoercionException;
-import org.eclipse.jst.jsf.common.internal.types.TypeConstants;
-import org.eclipse.jst.jsf.common.internal.types.TypeTransformer;
-import org.eclipse.jst.jsf.common.internal.types.ValueType;
-import org.eclipse.jst.jsf.context.symbol.IObjectSymbol;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.context.symbol.internal.util.IObjectSymbolBasedValueType;
-import org.eclipse.jst.jsf.designtime.el.AbstractDTPropertyResolver;
-import org.eclipse.jst.jsf.validation.internal.el.diagnostics.DiagnosticFactory;
-
-/**
- * Handles the operator 'bracket' where bracket(expr-a, id-b) == 'expr-a[id-b]' in EL syntax
- *
- * @author cbateman
- *
- */
-public class BracketOperator extends MemberAccessorOperator
-{
- private static final String OPERATOR_NAME_ARRAY_ACCESSOR = "array ('[]') accessor";
-
- /**
- * @param diagnosticFactory
- * @param file
- */
- public BracketOperator(final DiagnosticFactory diagnosticFactory, final IFile file)
- {
- super(file, diagnosticFactory);
- }
-
- protected SignatureBasedType handlePerformObjectSymbolValue(
- IObjectSymbolBasedValueType firstArg, ValueType secondArg)
- {
- // per JSP.2.3.4 step 5.2, if value-a is a list or array access
- if (firstArg.isInstanceOf(TypeConstants.TYPE_LIST)
- || Signature.getArrayCount(firstArg.getSignature()) > 0)
- {
- return handlePerformNumericPropertyAccessorBase(firstArg, secondArg);
- }
-
- // per JSP.2.3.4 step 5, if value-a is a map or if it is not
- // a list or array (and therefore a bean), treat it as named property accessed object
- // if firstArg is a map then we must treat the access like a map.get(secondArg)
-
- // if we don't have a literal value with which to derive value-b, then
- // we can't get a property
- if (secondArg instanceof LiteralType)
- {
- return handlePerformNamedPropertyAccessorBase(firstArg, (LiteralType)secondArg);
- }
-
- return null;
- }
-
- protected Diagnostic validateObjectSymbolValue(IObjectSymbolBasedValueType firstArg,
- ValueType secondArg)
- {
- // per JSP.2.3.4 step 5.2, if value-a is a list or array access
- if (firstArg.isInstanceOf(TypeConstants.TYPE_LIST)
- || firstArg.getSymbol().getTypeDescriptor().isArray())
- {
- return validateNumericPropertyAccessorBase(firstArg, secondArg);
- }
-
- // per JSP.2.3.4 step 5, if value-a is a map or if it is not
- // a list or array (and therefore a bean), treat it as named property accessed object
- // if firstArg is a map then we must treat the access like a map.get(secondArg)
- if (secondArg instanceof LiteralType)
- {
- return validateNamedPropertyAccessorBase(firstArg, (LiteralType) secondArg);
- }
- // otherwise, there's nothing we can guarantee
- return Diagnostic.OK_INSTANCE;
- }
-
- private Diagnostic validateNumericPropertyAccessorBase(IObjectSymbolBasedValueType firstArg,
- ValueType secondArg)
- {
- try
- {
- // secondArg must successfully coerce to integer
- TypeCoercer.coerceToNumber(TypeTransformer.transformBoxPrimitives(secondArg.getSignature()));
-
- if (secondArg instanceof LiteralType)
- {
- // this will throw a TypeCoercionExceptino if it won't
- // coerce
- Integer integerValue =
- (Integer) ((LiteralType)secondArg).coerceToNumber(Integer.class);
-
- if (integerValue.intValue() < 0)
- {
- return _diagnosticFactory.create_POSSIBLE_ARRAY_INDEX_OUT_OF_BOUNDS(integerValue);
- }
- }
- else
- {
- // if the argument is a non-literal string, we can't verify
- // that the coercion to integer won't throw an exception
- // at runtime
- if (TypeCoercer.typeIsString(secondArg.getSignature()))
- {
- return _diagnosticFactory.create_UNARY_OP_STRING_CONVERSION_NOT_GUARANTEED(OPERATOR_NAME_ARRAY_ACCESSOR);
- }
- }
-
- // TODO: attempt to detect ArrayIndexOutOfBoundsException
- return Diagnostic.OK_INSTANCE;
- }
- catch (TypeCoercionException e)
- {
- return _diagnosticFactory.create_BINARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION(OPERATOR_NAME_ARRAY_ACCESSOR);
- }
- }
-
- private SignatureBasedType handlePerformNumericPropertyAccessorBase(IObjectSymbolBasedValueType firstArg,
- ValueType secondArg)
- {
- AbstractDTPropertyResolver propResolver = getPropertyResolver();
- int index = 0;
- if (secondArg instanceof LiteralType)
- {
- try {
- index = ((LiteralType)secondArg).coerceToNumber(Integer.class).intValue();
- } catch (TypeCoercionException e) {
- // suppress, just use index = 0
- // this maybe should be an assertion...
- }
- }
-
- final ISymbol symbol =
- propResolver.getProperty(firstArg.getSymbol(), index);
-
- if (symbol instanceof IObjectSymbol)
- {
- return IObjectSymbolBasedValueType.getInstance(symbol);
- }
-
- // if can't be resolved, return null
- return null;
- }
-
- @Override
- protected String getOperatorName()
- {
- return Messages.getString("BracketOperator.Name");
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/DivArithmeticBinaryOperator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/DivArithmeticBinaryOperator.java
deleted file mode 100644
index b1d3059..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/DivArithmeticBinaryOperator.java
+++ /dev/null
@@ -1,261 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.validation.internal.el.operators;
-
-import java.math.BigDecimal;
-
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jst.jsf.common.internal.types.FloatLiteralType;
-import org.eclipse.jst.jsf.common.internal.types.IAssignable;
-import org.eclipse.jst.jsf.common.internal.types.IntegerLiteralType;
-import org.eclipse.jst.jsf.common.internal.types.LiteralType;
-import org.eclipse.jst.jsf.common.internal.types.TypeCoercer;
-import org.eclipse.jst.jsf.common.internal.types.TypeCoercionException;
-import org.eclipse.jst.jsf.common.internal.types.TypeConstants;
-import org.eclipse.jst.jsf.common.internal.types.TypeTransformer;
-import org.eclipse.jst.jsf.common.internal.types.ValueType;
-import org.eclipse.jst.jsf.validation.internal.el.diagnostics.DiagnosticFactory;
-
-/**
- * Represents dividing EL binary operators: div and / (same operator)
- * Based on JSP.2.3.5.2
- *
- * @author cbateman
- *
- */
-/*package*/ class DivArithmeticBinaryOperator extends ArithmeticBinaryOperator
-{
-
- private static final String DIVISION = "division";
-
- DivArithmeticBinaryOperator(DiagnosticFactory diagnosticFactory) {
- super(diagnosticFactory);
- // TODO Auto-generated constructor stub
- }
-
- public ValueType performOperation(ValueType firstArg, ValueType secondArg)
- {
- // JSP.2.3.5.2, step one: if both null then always 0
- if (TypeCoercer.typeIsNull(firstArg.getSignature())
- && TypeCoercer.typeIsNull(secondArg.getSignature()))
- {
- return new IntegerLiteralType(0);
- }
-
- final String boxedFirstArg = TypeTransformer.transformBoxPrimitives(firstArg.getSignature());
- final String boxedSecondArg = TypeTransformer.transformBoxPrimitives(secondArg.getSignature());
-
- // JSP.2.3.5.2, step 2: if one arg is BigInteger or BigDecimal
- // then coerce to BigDecimal and do div
- if (TypeConstants.TYPE_BIG_DOUBLE.equals(boxedFirstArg)
- || TypeConstants.TYPE_BIG_DOUBLE.equals(boxedSecondArg)
- || TypeConstants.TYPE_BIG_INTEGER.equals(boxedFirstArg)
- || TypeConstants.TYPE_BIG_INTEGER.equals(boxedSecondArg))
- {
- return performBigDecimal(firstArg, secondArg);
- }
-
- return performDouble(firstArg, secondArg);
- }
-
- public Diagnostic validate(ValueType firstArg, ValueType secondArg) {
- // JSP.2.3.5.2, step one: if both null then always 0
- if (TypeCoercer.typeIsNull(firstArg.getSignature())
- && TypeCoercer.typeIsNull(secondArg.getSignature()))
- {
- return _diagnosticFactory.create_BINARY_OP_BOTH_OPERANDS_NULL(DIVISION);
- }
-
- final String boxedFirstArg = TypeTransformer.transformBoxPrimitives(firstArg.getSignature());
- final String boxedSecondArg = TypeTransformer.transformBoxPrimitives(secondArg.getSignature());
-
- // JSP.2.3.5.2, step 2: if one arg is BigInteger or BigDecimal
- // then coerce to BigDecimal and do div
- if (TypeConstants.TYPE_BIG_DOUBLE.equals(boxedFirstArg)
- || TypeConstants.TYPE_BIG_DOUBLE.equals(boxedSecondArg)
- || TypeConstants.TYPE_BIG_INTEGER.equals(boxedFirstArg)
- || TypeConstants.TYPE_BIG_INTEGER.equals(boxedSecondArg))
- {
- return validateBigDecimal(firstArg, secondArg);
- }
-
- return validateDouble(firstArg, secondArg);
- }
-
- private ValueType performBigDecimal(ValueType firstArg, ValueType secondArg)
- {
- // since one or the other args must be either big decimal or big int,
- // we don't have two literals, so it is sufficient to ensure that we can
- // coerce both to numbers and check for div by zero and div of zero
- try
- {
- TypeCoercer.coerceToNumber(TypeTransformer.transformBoxPrimitives(firstArg.getSignature()));
- TypeCoercer.coerceToNumber(TypeTransformer.transformBoxPrimitives(secondArg.getSignature()));
-
- // if we get to here, the result is always BigDecimal unless we have
- // a div by zero
- if (secondArg instanceof LiteralType)
- {
- final Number coercedValue = ((LiteralType)secondArg).coerceToNumber(BigDecimal.class);
- if (((BigDecimal)coercedValue).equals(new BigDecimal(0)))
- {
- return null;
- }
- }
-
- return new ValueType(TypeConstants.TYPE_BIG_DOUBLE, IAssignable.ASSIGNMENT_TYPE_RHS);
- }
- catch (TypeCoercionException ce)
- {
- return null;
- }
- }
-
- private ValueType performDouble(ValueType firstArg, ValueType secondArg)
- {
- try
- {
- TypeCoercer.coerceToNumber(TypeTransformer.transformBoxPrimitives(firstArg.getSignature()));
- TypeCoercer.coerceToNumber(TypeTransformer.transformBoxPrimitives(secondArg.getSignature()));
-
- Number secondValue = null;
- if (secondArg instanceof LiteralType)
- {
- secondValue = ((LiteralType)secondArg).coerceToNumber(Double.class);
- // if the second value is definitely 0, then return null since
- // we have a div by zero
- if (secondValue.doubleValue() == 0.0)
- {
- return null;
- }
- }
-
- Number firstValue = null;
-
- if (firstArg instanceof LiteralType)
- {
- firstValue = ((LiteralType)firstArg).coerceToNumber(Double.class);
- }
-
- if (firstValue != null && secondValue != null)
- {
- return new FloatLiteralType(
- doRealOperation(new Double(firstValue.doubleValue())
- , new Double(secondValue.doubleValue())).doubleValue());
- }
-
- // if not both literals and could coerce, then the type is double
- return new ValueType(Signature.SIG_DOUBLE, IAssignable.ASSIGNMENT_TYPE_RHS);
- }
- catch (TypeCoercionException ce)
- {
- // could not coerce for the operation
- return null;
- }
- }
-
- private Diagnostic validateBigDecimal(ValueType firstArg, ValueType secondArg)
- {
- // since one or the other args must be either big decimal or big int,
- // we don't have two literals, so it is sufficient to ensure that we can
- // coerce both to numbers and check for div by zero and div of zero
- try
- {
- TypeCoercer.coerceToNumber(TypeTransformer.transformBoxPrimitives(firstArg.getSignature()));
- TypeCoercer.coerceToNumber(TypeTransformer.transformBoxPrimitives(secondArg.getSignature()));
-
- // if we get to here, the result is always BigDecimal unless we have
- // a div by zero
- if (secondArg instanceof LiteralType)
- {
- final Number coercedValue = ((LiteralType)secondArg).coerceToNumber(BigDecimal.class);
- if (((BigDecimal)coercedValue).equals(new BigDecimal(0)))
- {
- return _diagnosticFactory.create_BINARY_OP_POSSIBLE_DIVISION_BY_ZERO();
- }
- }
-
- // everything's okay if we get here
- return Diagnostic.OK_INSTANCE;
- }
- catch (TypeCoercionException ce)
- {
- return _diagnosticFactory.create_BINARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION(DIVISION);
- }
- }
-
- private Diagnostic validateDouble(ValueType firstArg, ValueType secondArg)
- {
- try
- {
- TypeCoercer.coerceToNumber(TypeTransformer.transformBoxPrimitives(firstArg.getSignature()));
- TypeCoercer.coerceToNumber(TypeTransformer.transformBoxPrimitives(secondArg.getSignature()));
-
- Number secondValue = null;
- if (secondArg instanceof LiteralType)
- {
- secondValue = ((LiteralType)secondArg).coerceToNumber(Double.class);
- // if the second value is definitely 0, then return null since
- // we have a div by zero
- if (secondValue.doubleValue() == 0.0)
- {
- return _diagnosticFactory.create_BINARY_OP_POSSIBLE_DIVISION_BY_ZERO();
- }
- }
-
- Number firstValue = null;
-
- if (firstArg instanceof LiteralType)
- {
- firstValue = ((LiteralType)firstArg).coerceToNumber(Double.class);
- }
-
- if (firstValue != null && secondValue != null)
- {
- String result
- = Double.toString(
- doRealOperation(new Double(firstValue.doubleValue()),
- new Double(secondValue.doubleValue())).doubleValue());
-
- return _diagnosticFactory.create_BINARY_OP_CONSTANT_EXPRESSION_ALWAYS_EVAL_SAME(DIVISION, result);
- }
-
- // if not both literals and could coerce, then the type is double
- return Diagnostic.OK_INSTANCE;
- }
- catch (TypeCoercionException ce)
- {
- // could not coerce for the operation
- return _diagnosticFactory.create_BINARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION(DIVISION);
- }
- }
-
- protected BigDecimal doRealOperation(BigDecimal firstArg, BigDecimal secondArg) {
- // per JSP.2.3.5.2, step 2
- return firstArg.divide(secondArg, BigDecimal.ROUND_HALF_UP);
- }
-
- protected Double doRealOperation(Double firstArg, Double secondArg)
- {
- return new Double(firstArg.doubleValue() / secondArg.doubleValue());
- }
-
- protected Long doRealOperation(Long firstArg, Long secondArg) {
- return Long.valueOf(firstArg.longValue() / secondArg.longValue());
- }
-
- protected String getOperatorName() {
- return DIVISION;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/DotOperator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/DotOperator.java
deleted file mode 100644
index 72720ce..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/DotOperator.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.validation.internal.el.operators;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.jst.jsf.common.internal.types.LiteralType;
-import org.eclipse.jst.jsf.common.internal.types.SignatureBasedType;
-import org.eclipse.jst.jsf.common.internal.types.ValueType;
-import org.eclipse.jst.jsf.context.symbol.internal.util.IObjectSymbolBasedValueType;
-import org.eclipse.jst.jsf.validation.internal.el.diagnostics.DiagnosticFactory;
-
-/**
- * Handles the operator 'dot' where dot(expr-a, id-b) == 'expr-a.id-b' in EL syntax
- *
- * @author cbateman
- *
- */
-public class DotOperator extends MemberAccessorOperator
-{
- /**
- * @param diagnosticFactory
- * @param file
- */
- public DotOperator(final DiagnosticFactory diagnosticFactory, final IFile file)
- {
- super(file, diagnosticFactory);
- }
-
- protected SignatureBasedType handlePerformObjectSymbolValue(
- IObjectSymbolBasedValueType firstArg, ValueType secondArg)
- {
- // the dot operator (unlike the bracket) can only treat firstArg as
- // a named property accessor object
- // if we don't have a literal value with which to derive value-b, then
- // we can't get a property
- if (secondArg instanceof LiteralType)
- {
- return handlePerformNamedPropertyAccessorBase(firstArg, (LiteralType)secondArg);
- }
- return null;
- }
-
- public Diagnostic validateObjectSymbolValue(IObjectSymbolBasedValueType firstArg,
- ValueType secondArg)
- {
- Diagnostic diag = Diagnostic.OK_INSTANCE;
-
- if (secondArg instanceof LiteralType)
- {
- diag = validateNamedPropertyAccessorBase(firstArg, (LiteralType) secondArg);
- }
-
- return diag;
- }
-
- @Override
- protected String getOperatorName()
- {
- return Messages.getString("DotOperator.Name");
- }
-}
\ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/EmptyUnaryOperator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/EmptyUnaryOperator.java
deleted file mode 100644
index 812d1cb..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/EmptyUnaryOperator.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.validation.internal.el.operators;
-
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jst.jsf.common.internal.types.BooleanLiteralType;
-import org.eclipse.jst.jsf.common.internal.types.NullLiteralType;
-import org.eclipse.jst.jsf.common.internal.types.StringLiteralType;
-import org.eclipse.jst.jsf.common.internal.types.TypeConstants;
-import org.eclipse.jst.jsf.common.internal.types.ValueType;
-import org.eclipse.jst.jsf.validation.internal.el.diagnostics.DiagnosticFactory;
-
-/**
- * Represents the EL unary operator '-' on a ValueType
- * as described by JSP.2.3.7
- *
- * @author cbateman
- *
- */
-/*package*/ class EmptyUnaryOperator extends UnaryOperator
-{
- private static final String EMPTY = "empty";
-
- EmptyUnaryOperator(DiagnosticFactory diagnosticFactory)
- {
- super(diagnosticFactory);
- }
-
- public ValueType performOperation(ValueType type)
- {
- if (type instanceof StringLiteralType)
- {
- if ("".equals(((StringLiteralType)type).getLiteralValue()))
- {
- // if the string is empty, operator always returns true
- return BooleanLiteralType.TRUE;
- }
-
- // if the string is empty, operator always returns true
- return BooleanLiteralType.FALSE;
- }
-
- // empty(null) is always true
- if (type instanceof NullLiteralType)
- {
- return BooleanLiteralType.TRUE;
- }
-
- // if the type is not string, array, Map, or Collection
- // then empty is always false
- String testSig = type.getSignature();
-
- if (!TypeConstants.TYPE_STRING.equals(testSig)
- && !type.isInstanceOf(TypeConstants.TYPE_COLLECTION)
- && !type.isInstanceOf(TypeConstants.TYPE_MAP)
- && Signature.getTypeSignatureKind(testSig) != Signature.ARRAY_TYPE_SIGNATURE)
- {
- return BooleanLiteralType.FALSE;
- }
-
- // otherwise, return a generic boolean type
- return new ValueType(TypeConstants.TYPE_BOOLEAN, type.getAssignability());
- }
-
- public Diagnostic validate(ValueType type)
- {
- // empty always validates to false unless:
- // the value is an empty string, array, map or collection
- // one thing we do is see if the thing is a literal. If it is
- // we can warn that the value could be folded
- if (type instanceof StringLiteralType)
- {
- String condition;
-
- if ("".equals(((StringLiteralType)type).getLiteralValue()))
- {
- condition = "true";
- }
- else
- {
- condition = "false";
- }
-
- return _diagnosticFactory.
- create_UNARY_OP_CONSTANT_EXPRESSION_EVAL_SAME_ID
- (EMPTY,condition);
- }
-
- // empty(null) is always true
- if (type instanceof NullLiteralType)
- {
- return _diagnosticFactory.
- create_UNARY_OP_CONSTANT_EXPRESSION_EVAL_SAME_ID
- (EMPTY,"true");
- }
-
- // if the type is not string, array, Map, or Collection warn that
- // this may be always false
- String testSig = type.getSignature();
-
- if (!TypeConstants.TYPE_STRING.equals(testSig)
- && !type.isInstanceOf(TypeConstants.TYPE_COLLECTION)
- && !type.isInstanceOf(TypeConstants.TYPE_MAP)
- && Signature.getTypeSignatureKind(testSig) != Signature.ARRAY_TYPE_SIGNATURE)
- {
- return _diagnosticFactory.create_UNARY_OP_EMPTY_ALWAYS_FALSE_ON_TYPE();
- }
-
- return Diagnostic.OK_INSTANCE;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/EqualityRelationalBinaryOperator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/EqualityRelationalBinaryOperator.java
deleted file mode 100644
index fcfca03..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/EqualityRelationalBinaryOperator.java
+++ /dev/null
@@ -1,539 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.validation.internal.el.operators;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jst.jsf.common.internal.types.BooleanLiteralType;
-import org.eclipse.jst.jsf.common.internal.types.IAssignable;
-import org.eclipse.jst.jsf.common.internal.types.LiteralType;
-import org.eclipse.jst.jsf.common.internal.types.StringLiteralType;
-import org.eclipse.jst.jsf.common.internal.types.TypeCoercer;
-import org.eclipse.jst.jsf.common.internal.types.TypeCoercionException;
-import org.eclipse.jst.jsf.common.internal.types.TypeConstants;
-import org.eclipse.jst.jsf.common.internal.types.TypeTransformer;
-import org.eclipse.jst.jsf.common.internal.types.ValueType;
-import org.eclipse.jst.jsf.common.util.TypeUtil;
-import org.eclipse.jst.jsf.context.symbol.internal.util.IObjectSymbolBasedValueType;
-import org.eclipse.jst.jsf.validation.internal.el.diagnostics.DiagnosticFactory;
-
-/**
- * A relational binary operator for equality: "==" or "!="
- *
- * @author cbateman
- *
- */
-/*package*/ abstract class EqualityRelationalBinaryOperator extends RelationalBinaryOperator
-{
- EqualityRelationalBinaryOperator(final DiagnosticFactory diagnosticFactory, String jsfVersion)
- {
- super(diagnosticFactory, jsfVersion);
- }
-
- /**
- * @param firstArg
- * @param secondArg
- * @return the result of the operation
- */
- protected abstract boolean doRealOperation(Boolean firstArg, Boolean secondArg);
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.validation.internal.el.operators.BinaryOperator#performOperation(org.eclipse.jst.jsf.core.internal.types.ValueType, org.eclipse.jst.jsf.core.internal.types.ValueType)
- */
- public ValueType performOperation(ValueType firstArg, ValueType secondArg)
- {
- // JSP.2.3.5.7 step 2 if either operand is null, then not equal
- if (TypeCoercer.typeIsNull(firstArg.getSignature())
- || TypeCoercer.typeIsNull(secondArg.getSignature()))
- {
- return BooleanLiteralType.FALSE;
- }
-
- String boxedFirstType = TypeTransformer.transformBoxPrimitives(firstArg.getSignature());
- String boxedSecondType = TypeTransformer.transformBoxPrimitives(secondArg.getSignature());
-
- // JSP.2.3.5.7 step 3, if either is BigDecimal, promote both and compare
- if (TypeConstants.TYPE_BIG_DOUBLE.equals(boxedFirstType)
- || TypeConstants.TYPE_BIG_DOUBLE.equals(boxedSecondType))
- {
- return handleNumericComparison(firstArg, secondArg, BigDecimal.class);
- }
-
- // JSP.2.3.5.7, step 4 if either is a float or double, promote both to
- // double and compare
- if (TypeConstants.TYPE_BOXED_DOUBLE.equals(boxedFirstType)
- || TypeConstants.TYPE_BOXED_FLOAT.equals(boxedFirstType)
- || TypeConstants.TYPE_BOXED_DOUBLE.equals(boxedSecondType)
- || TypeConstants.TYPE_BOXED_FLOAT.equals(boxedSecondType))
- {
- return handleNumericComparison(firstArg, secondArg, Double.class);
- }
-
- // JSP.2.3.5.7, step 5 if either is a big integer, promote and compare
- if (TypeConstants.TYPE_BIG_INTEGER.equals(boxedFirstType)
- || TypeConstants.TYPE_BIG_INTEGER.equals(boxedSecondType))
- {
- return handleNumericComparison(firstArg, secondArg, BigInteger.class);
- }
-
- // JSP.2.3.5.7, step 6 if either is Long or smaller, coerce both to Long
- if (TypeConstants.TYPE_BOXED_LONG.equals(boxedFirstType)
- || TypeConstants.TYPE_BOXED_LONG.equals(boxedSecondType)
- || TypeConstants.TYPE_BOXED_INTEGER.equals(boxedFirstType)
- || TypeConstants.TYPE_BOXED_INTEGER.equals(boxedSecondType)
- || TypeConstants.TYPE_BOXED_SHORT.equals(boxedFirstType)
- || TypeConstants.TYPE_BOXED_SHORT.equals(boxedSecondType)
- || TypeConstants.TYPE_BOXED_BYTE.equals(boxedFirstType)
- || TypeConstants.TYPE_BOXED_BYTE.equals(boxedSecondType)
- || TypeConstants.SIGNATURE_BOXED_CHARACTER.equals(boxedFirstType)
- || TypeConstants.SIGNATURE_BOXED_CHARACTER.equals(boxedSecondType))
- {
- return handleNumericComparison(firstArg, secondArg, Long.class);
- }
-
- // JSP.2.3.5.7, step 7 if either is a boolean, coerce to boolean
- if (TypeConstants.TYPE_BOXED_BOOLEAN.equals(boxedFirstType)
- || TypeConstants.TYPE_BOXED_BOOLEAN.equals(boxedSecondType))
- {
- return handleBooleanComparison(firstArg, secondArg);
- }
-
- // Unified EL 1.8.2, step 8 if either is a enum, then coerce both to enum
- // NOTE: we handle the JSF 1.1 case also where enums are treated as non-coercable
- // Object's
- if (firstArg.isEnumType() || secondArg.isEnumType())
- {
- return handleEnumComparison(firstArg, secondArg);
- }
-
- // JSP.2.3.5.7, step 8 if either is a string, coerce to string and
- // compare lexically
- if (TypeConstants.TYPE_STRING.equals(boxedFirstType)
- || TypeConstants.TYPE_STRING.equals(boxedSecondType))
- {
- return handleStringComparison(firstArg, secondArg);
- }
-
- // otherwise, an equal compare will be done A.equals(B). Since
- return new ValueType(TypeConstants.TYPE_BOOLEAN, IAssignable.ASSIGNMENT_TYPE_RHS);
- }
-
- private ValueType handleEnumComparison(ValueType firstArg,
- ValueType secondArg)
- {
- assert firstArg.isEnumType() || secondArg.isEnumType();
-
- // if the first is not an enum, then we have non-Enum == Enum case
- if (!firstArg.isEnumType())
- {
- return handleComparsionOfEnumAndNonEnum(secondArg, firstArg);
- }
-
- // if the second is not an enum, then we have Enum == non-Enum case
- if (!secondArg.isEnumType())
- {
- return handleComparsionOfEnumAndNonEnum(firstArg, secondArg);
- }
-
- // only other case is they are both enums. Check if they are directly
- // comparable.
- if (TypeUtil.canNeverBeEqual(firstArg.getSignature(), secondArg.getSignature()))
- {
- boolean result = doRealOperation("foo", "notFoo"); // just simulate the operation where the operands are not equal //$NON-NLS-1$ //$NON-NLS-2$
-
- return BooleanLiteralType.valueOf(result);
- }
-
- // otherwise, all we know is that it's a boolean
- return new ValueType(TypeConstants.TYPE_BOOLEAN, IAssignable.ASSIGNMENT_TYPE_RHS);
- }
-
- private ValueType handleComparsionOfEnumAndNonEnum(ValueType enumType,
- ValueType nonEnumType)
- {
- // the only literal value that could have got us here is a
- // StringLiteralValue since the others a filtered out before this is
- // called
- if (nonEnumType instanceof LiteralType)
- {
- assert nonEnumType instanceof StringLiteralType;
-
- Diagnostic result = validateIfEnumToStringComparison(((StringLiteralType)nonEnumType).getLiteralValue(), enumType);
-
- if (result != null)
- {
- // compare two things that aren't equal
- return BooleanLiteralType.valueOf(doRealOperation("foo", "foo_")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- return new ValueType(TypeConstants.TYPE_BOOLEAN, IAssignable.ASSIGNMENT_TYPE_RHS);
- }
-
- // if the arg is a String, then we can't prove anything before runtime
- if (nonEnumType.isInstanceOf(TypeConstants.TYPE_STRING))
- {
- return new ValueType(TypeConstants.TYPE_BOOLEAN, IAssignable.ASSIGNMENT_TYPE_RHS);
- }
- // otherwise, we know it will result in a problem since one is an enum
- // and the other isn't so simply do a comparison on two things that aren't equals
- return BooleanLiteralType.valueOf(doRealOperation("foo", "foo_")); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public Diagnostic validate(ValueType firstArg, ValueType secondArg) {
-
- // JSP.2.3.5.7 step 2 if either operand is null, then not equal
- if (TypeCoercer.typeIsNull(firstArg.getSignature())
- || TypeCoercer.typeIsNull(secondArg.getSignature()))
- {
- // TODO: this is a strange thing to do...
- final boolean result = doRealOperation(Integer.valueOf(4), null);
- return _diagnosticFactory.create_BINARY_OP_EQUALITY_COMP_WITH_NULL_ALWAYS_EVAL_SAME(Boolean.toString(result));
- }
-
- final String boxedFirstType =
- TypeTransformer.transformBoxPrimitives(firstArg.getSignature());
- final String boxedSecondType =
- TypeTransformer.transformBoxPrimitives(secondArg.getSignature());
-
- // JSP.2.3.5.7 step 3, if either is BigDecimal, promote both and compare
- if (TypeConstants.TYPE_BIG_DOUBLE.equals(boxedFirstType)
- || TypeConstants.TYPE_BIG_DOUBLE.equals(boxedSecondType))
- {
- return validateNumericComparison(firstArg, secondArg, BigDecimal.class);
- }
-
- // JSP.2.3.5.7, step 4 if either is a float or double, promote both to
- // double and compare
- if (TypeConstants.TYPE_BOXED_DOUBLE.equals(boxedFirstType)
- || TypeConstants.TYPE_BOXED_FLOAT.equals(boxedFirstType)
- || TypeConstants.TYPE_BOXED_DOUBLE.equals(boxedSecondType)
- || TypeConstants.TYPE_BOXED_FLOAT.equals(boxedSecondType))
- {
- return validateNumericComparison(firstArg, secondArg, Double.class);
- }
-
- // JSP.2.3.5.7, step 5 if either is a big integer, promote and compare
- if (TypeConstants.TYPE_BIG_INTEGER.equals(boxedFirstType)
- || TypeConstants.TYPE_BIG_INTEGER.equals(boxedSecondType))
- {
- return validateNumericComparison(firstArg, secondArg, BigInteger.class);
- }
-
- // JSP.2.3.5.7, step 6 if either is Long or smaller, coerce both to Long
- if (TypeConstants.TYPE_BOXED_LONG.equals(boxedFirstType)
- || TypeConstants.TYPE_BOXED_LONG.equals(boxedSecondType)
- || TypeConstants.TYPE_BOXED_INTEGER.equals(boxedFirstType)
- || TypeConstants.TYPE_BOXED_INTEGER.equals(boxedSecondType)
- || TypeConstants.TYPE_BOXED_SHORT.equals(boxedFirstType)
- || TypeConstants.TYPE_BOXED_SHORT.equals(boxedSecondType)
- || TypeConstants.TYPE_BOXED_BYTE.equals(boxedFirstType)
- || TypeConstants.TYPE_BOXED_BYTE.equals(boxedSecondType)
- || TypeConstants.SIGNATURE_BOXED_CHARACTER.equals(boxedFirstType)
- || TypeConstants.SIGNATURE_BOXED_CHARACTER.equals(boxedSecondType))
- {
- return validateNumericComparison(firstArg, secondArg, Long.class);
- }
-
- // JSP.2.3.5.7, step 7 if either is a boolean, coerce to boolean
- if (TypeConstants.TYPE_BOXED_BOOLEAN.equals(boxedFirstType)
- || TypeConstants.TYPE_BOXED_BOOLEAN.equals(boxedSecondType))
- {
- return validateBooleanComparison(firstArg, secondArg);
- }
-
- // Unified EL 1.8.2, step 8 if either is a enum, then coerce both to enum
- // NOTE: we handle the JSF 1.1 case also where enums are treated as non-coercable
- // Object's
- if (firstArg.isEnumType() || secondArg.isEnumType())
- {
- return validateEnumComparison(firstArg, secondArg);
- }
-
- // JSP.2.3.5.7, step 8 if either is a string, coerce to string and
- // compare lexically
- if (TypeConstants.TYPE_STRING.equals(boxedFirstType)
- || TypeConstants.TYPE_STRING.equals(boxedSecondType))
- {
- return validateStringComparison(firstArg, secondArg);
- }
-
- // otherwise, an equal compare will be done A.equals(B). Since
- return Diagnostic.OK_INSTANCE;
- }
-
-
- /**
- * Both types are coerced to boolean before comparison
- *
- * @param firstArg
- * @param secondArg
- * @return the result of the comparison
- */
- private ValueType handleBooleanComparison(ValueType firstArg, ValueType secondArg)
- {
- boolean canCoerceFirstArg =
- TypeCoercer.canCoerceToBoolean(TypeTransformer.transformBoxPrimitives(firstArg.getSignature()));
- boolean canCoerceSecondArg = TypeCoercer.canCoerceToBoolean(TypeTransformer.transformBoxPrimitives(secondArg.getSignature()));
-
- if (! (canCoerceFirstArg && canCoerceSecondArg))
- {
- return null;
- }
-
- if (firstArg instanceof LiteralType && secondArg instanceof LiteralType)
- {
- try
- {
- Boolean firstValue = ((LiteralType)firstArg).coerceToBoolean();
- Boolean secondValue = ((LiteralType)secondArg).coerceToBoolean();
-
- if (firstValue != null && secondValue != null)
- {
- boolean result = doRealOperation(firstValue, secondValue);
- return result ?
- BooleanLiteralType.TRUE :
- BooleanLiteralType.FALSE;
- }
- }
- catch (TypeCoercionException tce)
- {
- throw new AssertionError("should never get here; have already checked coercability above"); //$NON-NLS-1$
- }
- }
-
- // otherwise, we have a valid comparison that results in boolean
- return new ValueType(TypeConstants.TYPE_BOOLEAN, IAssignable.ASSIGNMENT_TYPE_RHS);
- }
-
- private Diagnostic validateBooleanComparison(ValueType firstType, ValueType secondType)
- {
- boolean canCoerceFirstArg =
- TypeCoercer.canCoerceToBoolean(TypeTransformer.transformBoxPrimitives(firstType.getSignature()));
- boolean canCoerceSecondArg = TypeCoercer.canCoerceToBoolean(TypeTransformer.transformBoxPrimitives(secondType.getSignature()));
-
- if (!canCoerceFirstArg)
- {
- return _diagnosticFactory.create_BINARY_OP_CANNOT_COERCE_ARGUMENT_TO_BOOLEAN(Messages.getString("EqualityRelationalBinaryOperator.FirstArgument")); //$NON-NLS-1$
- }
-
- if (!canCoerceSecondArg)
- {
- return _diagnosticFactory.create_BINARY_OP_CANNOT_COERCE_ARGUMENT_TO_BOOLEAN(Messages.getString("EqualityRelationalBinaryOperator.SecondArgument")); //$NON-NLS-1$
- }
-
- if (firstType instanceof LiteralType && secondType instanceof LiteralType)
- {
- try
- {
- Boolean firstValue = ((LiteralType)firstType).coerceToBoolean();
- Boolean secondValue = ((LiteralType)secondType).coerceToBoolean();
-
- if (firstValue != null && secondValue != null)
- {
- final boolean result =
- doRealOperation(firstValue, secondValue);
- return _diagnosticFactory.
- create_BINARY_OP_CONSTANT_EXPRESSION_ALWAYS_EVAL_SAME(getOperationName(), Boolean.toString(result));
- }
- }
- catch (TypeCoercionException tce)
- {
- throw new AssertionError("should never get here; have already checked coercability above"); //$NON-NLS-1$
- }
- }
-
- // otherwise, we have a valid comparison
- return Diagnostic.OK_INSTANCE;
- }
-
- @Override
- protected Diagnostic validateStringComparison(ValueType firstType,
- ValueType secondType)
- {
- String firstValue = null;
-
- if (firstType instanceof LiteralType)
- {
- firstValue = ((LiteralType)firstType).getLiteralValue();
- }
-
- String secondValue = null;
- if (secondType instanceof LiteralType)
- {
- secondValue = ((LiteralType)secondType).getLiteralValue();
- }
-
- if (firstValue != null)
- {
- Diagnostic result = validateIfEnumToStringComparison(firstValue, secondType);
-
- if (result != null)
- {
- return result;
- }
- }
-
- if (secondValue != null)
- {
- Diagnostic result = validateIfEnumToStringComparison(secondValue, firstType);
-
- if (result != null)
- {
- return result;
- }
- }
-
- // if it's a string to enum compare, do the default parent thing
- return super.validateStringComparison(firstType, secondType);
- }
-
-
- @Override
- protected ValueType handleStringComparison(ValueType firstType,
- ValueType secondType)
- {
- String firstValue = null;
-
- if (firstType instanceof LiteralType)
- {
- firstValue = ((LiteralType)firstType).getLiteralValue();
- }
-
- String secondValue = null;
- if (secondType instanceof LiteralType)
- {
- secondValue = ((LiteralType)secondType).getLiteralValue();
- }
-
- if (firstValue != null)
- {
- Diagnostic result = validateIfEnumToStringComparison(firstValue, secondType);
-
- if (result != null)
- {
- return handleIfEnumToNonMemberStringComparison(firstValue, secondType);
- }
- }
-
- if (secondValue != null)
- {
- Diagnostic result = validateIfEnumToStringComparison(secondValue, firstType);
-
- if (result != null)
- {
- return handleIfEnumToNonMemberStringComparison(secondValue, firstType);
- }
- }
-
- // otherwise, do the super thing
- return super.handleStringComparison(firstType, secondType);
- }
-
- private Diagnostic validateEnumComparison(final ValueType firstArg, final ValueType secondArg)
- {
- assert firstArg.isEnumType() || secondArg.isEnumType();
-
- // if the first is not an enum, then we have non-Enum == Enum case
- if (!firstArg.isEnumType())
- {
- return validateComparsionOfEnumAndNonEnum(firstArg, secondArg);
- }
-
- // if the second is not an enum, then we have Enum == non-Enum case
- if (!secondArg.isEnumType())
- {
- return validateComparsionOfEnumAndNonEnum(secondArg, firstArg);
- }
-
- // only other case is they are both enums. Check if they are directly
- // comparable.
- if (TypeUtil.canNeverBeEqual(firstArg.getSignature(), secondArg.getSignature()))
- {
- return _diagnosticFactory.
- create_BINARY_COMPARISON_WITH_TWO_ENUMS_ALWAYS_SAME
- (getOperationName()
- , doRealOperation("foo", "notFoo") // just simulate the operation where the operands are not equal //$NON-NLS-1$ //$NON-NLS-2$
- , TypeUtil.getFullyQualifiedName(firstArg.getSignature())
- , TypeUtil.getFullyQualifiedName(secondArg.getSignature()));
- }
-
- // otherwise, it's all good
- return Diagnostic.OK_INSTANCE;
- }
-
- private Diagnostic validateComparsionOfEnumAndNonEnum(final ValueType nonEnumType, final ValueType enumType)
- {
- // the only literal value that could have got us here is a
- // StringLiteralValue since the others a filtered out before this is
- // called
- if (nonEnumType instanceof LiteralType)
- {
- assert nonEnumType instanceof StringLiteralType;
-
- Diagnostic result = validateIfEnumToStringComparison(((StringLiteralType)nonEnumType).getLiteralValue(), enumType);
-
- if (result != null)
- {
- return result;
- }
- return Diagnostic.OK_INSTANCE;
- }
-
- // if the arg is a String, then we can't prove anything before runtime
- if (nonEnumType.isInstanceOf(TypeConstants.TYPE_STRING))
- {
- return Diagnostic.OK_INSTANCE;
- }
- // otherwise, we know it will result in a problem since one is an enum
- // and the other isn't
- return _diagnosticFactory.
- create_BINARY_COMPARISON_WITH_ENUM_AND_UNCOERCABLE_NONCONST_ALWAYS_SAME
- (getOperationName()
- , doRealOperation("foo", "notFoo") // just simulate the operation where the operands are not equal //$NON-NLS-1$ //$NON-NLS-2$
- , TypeUtil.getFullyQualifiedName(enumType.getSignature())
- , TypeUtil.getFullyQualifiedName(nonEnumType.getSignature()));
- }
-
- private Diagnostic validateIfEnumToStringComparison(final String literalValue, final ValueType validateIfEnum)
- {
- if (validateIfEnum.isEnumType()
- && validateIfEnum instanceof IObjectSymbolBasedValueType)
- {
- final IObjectSymbolBasedValueType symbolValueType =
- (IObjectSymbolBasedValueType) validateIfEnum;
-
- IType type = symbolValueType.getSymbol().getTypeDescriptor().resolveType(symbolValueType.getSymbol().getTypeDescriptor().getTypeSignature());
-
- if (type != null && !TypeUtil.isEnumMember(type, literalValue))
- {
- return _diagnosticFactory.
- create_BINARY_COMPARISON_WITH_ENUM_AND_CONST_ALWAYS_SAME
- (getOperationName()
- , doRealOperation(literalValue, literalValue+"_") // just simulate the operation where the operands are not equal //$NON-NLS-1$
- , TypeUtil.getFullyQualifiedName(validateIfEnum.getSignature())
- , literalValue);
- }
- }
-
- return null;
- }
-
- private ValueType handleIfEnumToNonMemberStringComparison(final String literalValue, final ValueType enumValueType)
- {
- // we need to apply the real operation to literalValue and any string that !equals(literalValue)
- // since it's not a member of the enum
- return BooleanLiteralType.valueOf(doRealOperation(literalValue, literalValue+"_")); //$NON-NLS-1$
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/EqualsBinaryRelationalOperator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/EqualsBinaryRelationalOperator.java
deleted file mode 100644
index 3fa99f4..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/EqualsBinaryRelationalOperator.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.validation.internal.el.operators;
-
-import org.eclipse.jst.jsf.validation.internal.el.diagnostics.DiagnosticFactory;
-
-/**
- * Represents the equals -- ==/eq EL binary operator
- *
- * @author cbateman
- *
- */
-/*package*/ class EqualsBinaryRelationalOperator extends
- EqualityRelationalBinaryOperator
-{
-
- EqualsBinaryRelationalOperator(final DiagnosticFactory diagnosticFactory, String jsfVersion) {
- super(diagnosticFactory, jsfVersion);
- }
-
- /**
- * @param firstArg
- * @param secondArg
- * @return the result of the operation
- */
- protected boolean doRealOperation(Number firstArg, Number secondArg)
- {
- return firstArg.equals(secondArg);
- }
-
- /**
- * @param firstArg
- * @param secondArg
- * @return the result of the operation
- */
- protected boolean doRealOperation(Boolean firstArg, Boolean secondArg)
- {
- return firstArg.equals(secondArg);
- }
-
- /**
- * @param firstArg
- * @param secondArg
- * @return the result of the operation
- */
- protected boolean doRealOperation(String firstArg, String secondArg)
- {
- return firstArg.equals(secondArg);
- }
-
- protected String getOperationName()
- {
- return Messages.getString("EqualsBinaryRelationalOperator.OperationName"); //$NON-NLS-1$
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/GreaterThanEqRelationalBinaryOperator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/GreaterThanEqRelationalBinaryOperator.java
deleted file mode 100644
index edab570..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/GreaterThanEqRelationalBinaryOperator.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.validation.internal.el.operators;
-
-import org.eclipse.jst.jsf.validation.internal.el.diagnostics.DiagnosticFactory;
-
-/**
- * Encapsulates the EL greater-than-eq operator -- ">="/ge
- *
- * @author cbateman
- *
- */
-/*package*/ class GreaterThanEqRelationalBinaryOperator extends
- LtGtRelationalBinaryOperator
-{
- GreaterThanEqRelationalBinaryOperator(final DiagnosticFactory diagnosticFactory, String jsfVersion) {
- super(diagnosticFactory, jsfVersion);
- }
-
- protected boolean doRealOperation(Number firstArg, Number secondArg)
- {
- return ((Comparable)firstArg).compareTo(secondArg) >= 0;
- }
-
- protected boolean doRealOperation(String firstArg, String secondArg)
- {
- return firstArg.compareTo(secondArg) >= 0;
- }
-
- protected String getOperationName()
- {
- return Messages.getString("GreaterThanEqRelationalBinaryOperator.OperationName"); //$NON-NLS-1$
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/GreaterThanRelationalBinaryOperator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/GreaterThanRelationalBinaryOperator.java
deleted file mode 100644
index 78a62a7..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/GreaterThanRelationalBinaryOperator.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.validation.internal.el.operators;
-
-import org.eclipse.jst.jsf.validation.internal.el.diagnostics.DiagnosticFactory;
-
-/**
- * Represents the EL greater than operator -- ">"/gt
- * @author cbateman
- *
- */
-/*package*/ class GreaterThanRelationalBinaryOperator extends
- LtGtRelationalBinaryOperator {
-
- GreaterThanRelationalBinaryOperator(final DiagnosticFactory diagnosticFactory, String jsfVersion)
- {
- super(diagnosticFactory, jsfVersion);
- }
-
- protected boolean doRealOperation(Number firstArg, Number secondArg)
- {
- return ((Comparable)firstArg).compareTo(secondArg) > 0;
- }
-
- protected boolean doRealOperation(String firstArg, String secondArg)
- {
- return firstArg.compareTo(secondArg) > 0;
- }
-
- protected String getOperationName()
- {
- return Messages.getString("GreaterThanRelationalBinaryOperator.OperationName"); //$NON-NLS-1$
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/LessThanEqRelationalBinaryOperator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/LessThanEqRelationalBinaryOperator.java
deleted file mode 100644
index 24dc5e2..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/LessThanEqRelationalBinaryOperator.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.validation.internal.el.operators;
-
-import org.eclipse.jst.jsf.validation.internal.el.diagnostics.DiagnosticFactory;
-
-
-/**
- * Encapsulates the EL less-than-equal operator -- "<="/le
- *
- * @author cbateman
- *
- */
-/*package*/ class LessThanEqRelationalBinaryOperator extends
- LtGtRelationalBinaryOperator
-{
- LessThanEqRelationalBinaryOperator(final DiagnosticFactory diagnosticFactory, String jsfVersion) {
- super(diagnosticFactory, jsfVersion);
- }
-
- protected boolean doRealOperation(Number firstArg, Number secondArg)
- {
- return ((Comparable)firstArg).compareTo(secondArg) <= 0;
- }
-
- protected boolean doRealOperation(String firstArg, String secondArg)
- {
- return firstArg.compareTo(secondArg) <= 0;
- }
-
- protected String getOperationName()
- {
- return Messages.getString("LessThanEqRelationalBinaryOperator.OperationName"); //$NON-NLS-1$
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/LessThanRelationalBinaryOperator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/LessThanRelationalBinaryOperator.java
deleted file mode 100644
index 7b8e7ea..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/LessThanRelationalBinaryOperator.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.validation.internal.el.operators;
-
-import org.eclipse.jst.jsf.validation.internal.el.diagnostics.DiagnosticFactory;
-
-/**
- * The "<"/"lt" less-than EL operator
- *
- * @author cbateman
- *
- */
-/*package*/ class LessThanRelationalBinaryOperator extends
- LtGtRelationalBinaryOperator
-{
- LessThanRelationalBinaryOperator(final DiagnosticFactory diagnosticFactory, String jsfVersion)
- {
- super(diagnosticFactory, jsfVersion);
- }
-
- protected boolean doRealOperation(Number firstArg, Number secondArg)
- {
- return ((Comparable)firstArg).compareTo(secondArg) < 0;
- }
-
- protected boolean doRealOperation(String firstArg, String secondArg)
- {
- return firstArg.compareTo(secondArg) < 0;
- }
-
- protected String getOperationName()
- {
- return Messages.getString("LessThanRelationalBinaryOperator.OperationName"); //$NON-NLS-1$
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/LogicalBinaryOperator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/LogicalBinaryOperator.java
deleted file mode 100644
index 41b897f..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/LogicalBinaryOperator.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.validation.internal.el.operators;
-
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.jst.jsf.common.internal.types.BooleanLiteralType;
-import org.eclipse.jst.jsf.common.internal.types.IAssignable;
-import org.eclipse.jst.jsf.common.internal.types.LiteralType;
-import org.eclipse.jst.jsf.common.internal.types.TypeCoercer;
-import org.eclipse.jst.jsf.common.internal.types.TypeCoercionException;
-import org.eclipse.jst.jsf.common.internal.types.TypeConstants;
-import org.eclipse.jst.jsf.common.internal.types.TypeTransformer;
-import org.eclipse.jst.jsf.common.internal.types.ValueType;
-import org.eclipse.jst.jsf.validation.internal.el.diagnostics.DiagnosticFactory;
-
-/**
- * Represents a logical binary operator per JSP.2.3.6.1 (logical and/or)
- *
- * @author cbateman
- *
- */
-/*package*/abstract class LogicalBinaryOperator extends BinaryOperator
-{
- LogicalBinaryOperator(DiagnosticFactory diagnosticFactory) {
- super(diagnosticFactory);
- }
-
- public ValueType performOperation(ValueType firstArg, ValueType secondArg)
- {
- final boolean canCoerceFirstArg =
- TypeCoercer.canCoerceToBoolean(TypeTransformer.transformBoxPrimitives(firstArg.getSignature()));
- final boolean canCoerceSecondArg =
- TypeCoercer.canCoerceToBoolean(TypeTransformer.transformBoxPrimitives(secondArg.getSignature()));
-
- // if can't perform, must return null
- if (! (canCoerceFirstArg && canCoerceSecondArg))
- {
- return null;
- }
-
- Boolean firstArgResolvedValue = null;
-
- if (firstArg instanceof LiteralType)
- {
- try
- {
- firstArgResolvedValue = ((LiteralType)firstArg).coerceToBoolean();
- }
- catch (TypeCoercionException tce)
- {
- // should never be throw due to already checking if can coerce
- throw new AssertionError("coercion already checked; this should never be reached");
- }
- }
-
- Boolean secondArgResolvedValue = null;
- if (secondArg instanceof LiteralType)
- {
- try
- {
- secondArgResolvedValue = ((LiteralType)secondArg).coerceToBoolean();
- }
- catch (TypeCoercionException tce)
- {
- // should never be throw due to already checking if can coerce
- throw new AssertionError("coercion already checked; this should never be reached");
- }
- }
-
- if (firstArgResolvedValue != null && secondArgResolvedValue != null)
- {
- boolean result =
- doRealOperation(firstArgResolvedValue, secondArgResolvedValue);
-
- return result ? BooleanLiteralType.TRUE : BooleanLiteralType.FALSE;
-
- }
-
- // otherwise, just return a boolean
- // result can only be an rvalue
- return new ValueType(TypeConstants.TYPE_BOOLEAN, IAssignable.ASSIGNMENT_TYPE_RHS);
- }
-
- public Diagnostic validate(ValueType firstArg, ValueType secondArg)
- {
- final boolean canCoerceFirstArg =
- TypeCoercer.canCoerceToBoolean(TypeTransformer.transformBoxPrimitives(firstArg.getSignature()));
- final boolean canCoerceSecondArg =
- TypeCoercer.canCoerceToBoolean(TypeTransformer.transformBoxPrimitives(secondArg.getSignature()));
-
- if (!canCoerceFirstArg)
- {
- return _diagnosticFactory.
- create_BINARY_OP_CANNOT_COERCE_ARGUMENT_TO_BOOLEAN("first");
- //return new BasicDiagnostic(Diagnostic.ERROR, "", 0, "Cannot coerce first argument of "+readableOperatorName()+" to boolean", null);
- }
-
- if (!canCoerceSecondArg)
- {
- return _diagnosticFactory.
- create_BINARY_OP_CANNOT_COERCE_ARGUMENT_TO_BOOLEAN("first");
-
- //return new BasicDiagnostic(Diagnostic.ERROR, "", 0, "Cannot coerce second argument of "+readableOperatorName()+" to boolean", null);
- }
-
- if (firstArg instanceof LiteralType)
- {
- try
- {
- final Boolean boolValue =
- ((LiteralType)firstArg).coerceToBoolean();
-
- if (boolValue.booleanValue() == shortCircuitValue())
- {
- return _diagnosticFactory.
- create_BINARY_OP_FIRST_ARGUMENT_SHORT_CIRCUITS
- (shortCircuitValue(), readableOperatorName());
- }
- }
- catch (TypeCoercionException tce)
- {
- // should never be throw due to already checking if can coerce
- throw new AssertionError("coercion already checked; this should never be reached");
- }
- }
-
- if (secondArg instanceof LiteralType)
- {
- try
- {
- final Boolean boolValue =
- ((LiteralType)secondArg).coerceToBoolean();
-
- if (boolValue.booleanValue() == shortCircuitValue())
- {
- return _diagnosticFactory.
- create_BINARY_OP_SECOND_ARGUMENT_ALWAYS_EVAL_SAME
- (shortCircuitValue(), readableOperatorName());
- }
- }
- catch (TypeCoercionException tce)
- {
- // should never be throw due to already checking if can coerce
- throw new AssertionError("coercion already checked; this should never be reached");
- }
- }
-
- // otherwise, nothing to report
- return Diagnostic.OK_INSTANCE;
- }
-
- /**
- * @return a human readable name for the operator
- */
- protected abstract String readableOperatorName();
-
- /**
- * @return the boolean value on which the operator short-circuits
- */
- protected abstract boolean shortCircuitValue();
-
- /**
- * @param firstArg
- * @param secondArg
- * @return the result of performing the operator to two actual values
- */
- protected abstract boolean doRealOperation(Boolean firstArg, Boolean secondArg);
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/LtGtRelationalBinaryOperator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/LtGtRelationalBinaryOperator.java
deleted file mode 100644
index e4695ac..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/LtGtRelationalBinaryOperator.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.validation.internal.el.operators;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jst.jsf.common.internal.types.BooleanLiteralType;
-import org.eclipse.jst.jsf.common.internal.types.IAssignable;
-import org.eclipse.jst.jsf.common.internal.types.TypeCoercer;
-import org.eclipse.jst.jsf.common.internal.types.TypeConstants;
-import org.eclipse.jst.jsf.common.internal.types.TypeTransformer;
-import org.eclipse.jst.jsf.common.internal.types.ValueType;
-import org.eclipse.jst.jsf.common.util.TypeUtil;
-import org.eclipse.jst.jsf.validation.internal.el.diagnostics.DiagnosticFactory;
-
-/**
- * Encapsulates the EL binary operators "<", ">", "<=", ">="
- *
- * @author cbateman
- *
- */
-/*package*/ abstract class LtGtRelationalBinaryOperator extends RelationalBinaryOperator
-{
- LtGtRelationalBinaryOperator(final DiagnosticFactory diagnosticFactory, String jsfVersion)
- {
- super(diagnosticFactory, jsfVersion);
- }
-
- protected abstract boolean doRealOperation(Number firstArg, Number secondArg);
-
- protected abstract boolean doRealOperation(String firstArg, String secondArg);
-
- public ValueType performOperation(ValueType firstArg, ValueType secondArg)
- {
- // JSP.2.3.5.6 step 2 if either operand is null, then always false
- if (TypeCoercer.typeIsNull(firstArg.getSignature())
- || TypeCoercer.typeIsNull(secondArg.getSignature()))
- {
- return BooleanLiteralType.FALSE;
- }
-
- String boxedFirstType = TypeTransformer.transformBoxPrimitives(firstArg.getSignature());
- String boxedSecondType = TypeTransformer.transformBoxPrimitives(secondArg.getSignature());
-
- // JSP.2.3.5.6 step 3, if either is BigDecimal, promote both and compare
- if (TypeConstants.TYPE_BIG_DOUBLE.equals(boxedFirstType)
- || TypeConstants.TYPE_BIG_DOUBLE.equals(boxedSecondType))
- {
- return handleNumericComparison(firstArg, secondArg, BigDecimal.class);
- }
-
- // JSP.2.3.5.6, step 4 if either is a float or double, promote both to
- // double and compare
- if (TypeConstants.TYPE_BOXED_DOUBLE.equals(boxedFirstType)
- || TypeConstants.TYPE_BOXED_FLOAT.equals(boxedFirstType)
- || TypeConstants.TYPE_BOXED_DOUBLE.equals(boxedSecondType)
- || TypeConstants.TYPE_BOXED_FLOAT.equals(boxedSecondType))
- {
- return handleNumericComparison(firstArg, secondArg, Double.class);
- }
-
- // JSP.2.3.5.6, step 5 if either is a big integer, promote and compare
- if (TypeConstants.TYPE_BIG_INTEGER.equals(boxedFirstType)
- || TypeConstants.TYPE_BIG_INTEGER.equals(boxedSecondType))
- {
- return handleNumericComparison(firstArg, secondArg, BigInteger.class);
- }
-
- // JSP.2.3.5.6, step 6 if either is Long or smaller, coerce both to Long
- if (TypeConstants.TYPE_BOXED_LONG.equals(boxedFirstType)
- || TypeConstants.TYPE_BOXED_LONG.equals(boxedSecondType)
- || TypeConstants.TYPE_BOXED_INTEGER.equals(boxedFirstType)
- || TypeConstants.TYPE_BOXED_INTEGER.equals(boxedSecondType)
- || TypeConstants.TYPE_BOXED_SHORT.equals(boxedFirstType)
- || TypeConstants.TYPE_BOXED_SHORT.equals(boxedSecondType)
- || TypeConstants.TYPE_BOXED_BYTE.equals(boxedFirstType)
- || TypeConstants.TYPE_BOXED_BYTE.equals(boxedSecondType)
- || TypeConstants.SIGNATURE_BOXED_CHARACTER.equals(boxedFirstType)
- || TypeConstants.SIGNATURE_BOXED_CHARACTER.equals(boxedSecondType))
- {
- return handleNumericComparison(firstArg, secondArg, Long.class);
- }
-
- // JSP.2.3.5.7, step 7 if either is a string, coerce to string and
- // compare lexically
- if (TypeConstants.TYPE_STRING.equals(boxedFirstType)
- || TypeConstants.TYPE_STRING.equals(boxedSecondType))
- {
- return handleStringComparison(firstArg, secondArg);
- }
-
- // JSP.2.3.5.7, steps 8 and 9 -- if either one implements the
- // Comparable interface, then as far as we can determine statically
- // (compareTo may not work on the other arg, but who knows),
- // we are good
- if (firstArg.isInstanceOf(TypeConstants.TYPE_COMPARABLE)
- || secondArg.isInstanceOf(TypeConstants.TYPE_COMPARABLE))
- {
- if (checkIfIncompatibleEnums(firstArg, secondArg))
- {
- // error: no point in validating further since expr will probably throw an exception
- return null;
- }
-
- return new ValueType(Signature.SIG_BOOLEAN, IAssignable.ASSIGNMENT_TYPE_RHS);
- }
-
- // JSP.2.3.5.6, step 10 -- otherwise, error
- return null;
-
- }
-
- public Diagnostic validate(ValueType firstArg, ValueType secondArg)
- {
- // JSP.2.3.5.6 step 2 if either operand is null, then always false
- if (TypeCoercer.typeIsNull(firstArg.getSignature())
- || TypeCoercer.typeIsNull(secondArg.getSignature()))
- {
- return _diagnosticFactory.
- create_BINARY_OP_EQUALITY_COMP_WITH_NULL_ALWAYS_EVAL_SAME(Messages.getString("LtGtRelationalBinaryOperator.ConstantName.False")); //$NON-NLS-1$
- }
-
- String boxedFirstType = TypeTransformer.transformBoxPrimitives(firstArg.getSignature());
- String boxedSecondType = TypeTransformer.transformBoxPrimitives(secondArg.getSignature());
-
- // JSP.2.3.5.6 step 3, if either is BigDecimal, promote both and compare
- if (TypeConstants.TYPE_BIG_DOUBLE.equals(boxedFirstType)
- || TypeConstants.TYPE_BIG_DOUBLE.equals(boxedSecondType))
- {
- return validateNumericComparison(firstArg, secondArg, BigDecimal.class);
- }
-
- // JSP.2.3.5.6, step 4 if either is a float or double, promote both to
- // double and compare
- if (TypeConstants.TYPE_BOXED_DOUBLE.equals(boxedFirstType)
- || TypeConstants.TYPE_BOXED_FLOAT.equals(boxedFirstType)
- || TypeConstants.TYPE_BOXED_DOUBLE.equals(boxedSecondType)
- || TypeConstants.TYPE_BOXED_FLOAT.equals(boxedSecondType))
- {
- return validateNumericComparison(firstArg, secondArg, Double.class);
- }
-
- // JSP.2.3.5.6, step 5 if either is a big integer, promote and compare
- if (TypeConstants.TYPE_BIG_INTEGER.equals(boxedFirstType)
- || TypeConstants.TYPE_BIG_INTEGER.equals(boxedSecondType))
- {
- return validateNumericComparison(firstArg, secondArg, BigInteger.class);
- }
-
- // JSP.2.3.5.6, step 6 if either is Long or smaller, coerce both to Long
- if (TypeConstants.TYPE_BOXED_LONG.equals(boxedFirstType)
- || TypeConstants.TYPE_BOXED_LONG.equals(boxedSecondType)
- || TypeConstants.TYPE_BOXED_INTEGER.equals(boxedFirstType)
- || TypeConstants.TYPE_BOXED_INTEGER.equals(boxedSecondType)
- || TypeConstants.TYPE_BOXED_SHORT.equals(boxedFirstType)
- || TypeConstants.TYPE_BOXED_SHORT.equals(boxedSecondType)
- || TypeConstants.TYPE_BOXED_BYTE.equals(boxedFirstType)
- || TypeConstants.TYPE_BOXED_BYTE.equals(boxedSecondType)
- || TypeConstants.SIGNATURE_BOXED_CHARACTER.equals(boxedFirstType)
- || TypeConstants.SIGNATURE_BOXED_CHARACTER.equals(boxedSecondType))
- {
- return validateNumericComparison(firstArg, secondArg, Long.class);
- }
-
- // JSP.2.3.5.7, step 7 if either is a string, coerce to string and
- // compare lexically
- if (TypeConstants.TYPE_STRING.equals(boxedFirstType)
- || TypeConstants.TYPE_STRING.equals(boxedSecondType))
- {
- return validateStringComparison(firstArg, secondArg);
- }
-
- // JSP.2.3.5.7, steps 8 and 9 -- if either one implements the
- // Comparable interface, then as far as we can determine statically
- // (compareTo may not work on the other arg, but who knows),
- // we are good
- if (firstArg.isInstanceOf(TypeConstants.TYPE_COMPARABLE)
- || secondArg.isInstanceOf(TypeConstants.TYPE_COMPARABLE))
- {
- Diagnostic diag = Diagnostic.OK_INSTANCE;
- if(checkIfIncompatibleEnums(firstArg, secondArg))
- {
- diag = _diagnosticFactory.create_BINARY_OP_COMPARISON_OF_ENUMS_INCOMPATIBLE();
- }
- return diag;
- }
-
- // JSP.2.3.5.6, step 10 -- otherwise, error
- return _diagnosticFactory.create_BINARY_OP_NO_AVAILABLE_TYPE_COERCION();
- }
-
- /**
- * @param firstArg
- * @param secondArg
- * @return diagnostic if firstArg and secondArg are incompatible with each other
- * for compareTo purpose or OK if not
- */
- private boolean checkIfIncompatibleEnums(ValueType firstArg,
- ValueType secondArg)
- {
- if (firstArg.isEnumType()
- && secondArg.isEnumType()
- && !TypeUtil.isEnumsCompareCompatible(firstArg.getSignature()
- , secondArg.getSignature()))
- {
- return true;
- }
-
- return false;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/MemberAccessorOperator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/MemberAccessorOperator.java
deleted file mode 100644
index 505a125..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/MemberAccessorOperator.java
+++ /dev/null
@@ -1,309 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.validation.internal.el.operators;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.jst.jsf.common.internal.types.LiteralType;
-import org.eclipse.jst.jsf.common.internal.types.NullLiteralType;
-import org.eclipse.jst.jsf.common.internal.types.SignatureBasedType;
-import org.eclipse.jst.jsf.common.internal.types.TypeCoercer;
-import org.eclipse.jst.jsf.common.internal.types.TypeConstants;
-import org.eclipse.jst.jsf.common.internal.types.ValueType;
-import org.eclipse.jst.jsf.context.symbol.IMethodSymbol;
-import org.eclipse.jst.jsf.context.symbol.IObjectSymbol;
-import org.eclipse.jst.jsf.context.symbol.IPropertySymbol;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.context.symbol.internal.util.IMethodSymbolBasedType;
-import org.eclipse.jst.jsf.context.symbol.internal.util.IObjectSymbolBasedValueType;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.designtime.DesignTimeApplicationManager;
-import org.eclipse.jst.jsf.designtime.el.AbstractDTMethodResolver;
-import org.eclipse.jst.jsf.designtime.el.AbstractDTPropertyResolver;
-import org.eclipse.jst.jsf.validation.internal.el.diagnostics.DiagnosticFactory;
-
-/**
- * Super-class for all operators whose function is to access members of an EL
- * object. i.e. the "." and "[]" operators
- *
- * @author cbateman
- *
- */
-public abstract class MemberAccessorOperator
-{
- /**
- * The source file for the EL expression in which this operator is being
- * evaluated.
- */
- protected final IFile _file;
-
- /**
- * the common factory used to create diagnostics
- */
- protected final DiagnosticFactory _diagnosticFactory;
-
- // TODO: need to reconcile with BinaryOperator? performOperation must return
- // SignatureBasedType since it may return a method. This can't happen
- // with other operators (besides eqiv [])
- /**
- * @param file
- * @param diagnosticFactory
- */
- protected MemberAccessorOperator(final IFile file,
- final DiagnosticFactory diagnosticFactory)
- {
- _file = file;
- _diagnosticFactory = diagnosticFactory;
- }
-
- /**
- * @param firstArg
- * @param secondArg
- * @return the result of validating the dot operation with these arguments.
- */
- public Diagnostic validate(final ValueType firstArg, final ValueType secondArg)
- {
- if (!(firstArg instanceof IObjectSymbolBasedValueType))
- {
- throw new AssertionError(
- "The first argument of the member operator must always be a symbol resolvable value type");
- }
-
- if (TypeCoercer.typeIsNull(secondArg.getSignature()))
- {
- return _diagnosticFactory
- .create_BINARY_OP_DOT_WITH_VALUEB_NULL(getOperatorName());
- }
-
- return validateObjectSymbolValue(
- (IObjectSymbolBasedValueType) firstArg, secondArg);
- }
-
- /**
- * @param firstArg
- * @param secondArg
- * @return the diagnostic for member(firstArg, secondArg)
- */
- protected abstract Diagnostic validateObjectSymbolValue(
- IObjectSymbolBasedValueType firstArg, ValueType secondArg);
-
- /**
- * @param firstArg
- * @param secondArg
- * @return a validation of a named property accessible base (map or bean)
- * given an a literal key argument
- */
- protected Diagnostic validateNamedPropertyAccessorBase(
- final IObjectSymbolBasedValueType firstArg, final LiteralType secondArg)
- {
- final IObjectSymbol curBaseSymbol = firstArg.getSymbol();
-
- final ISymbol nextSymbol =
- getMemberSymbol(firstArg.getSymbol(), secondArg
- .getLiteralValueRaw());
-
- // if the x in x.y is an unconstrained map an it returns
- // a java.lang.Object, then return null. We can't really say
- // anything meaningful about such a property anyway.
- // TODO: do we need to refine the type descriptor on such
- // a property object to make this more precise?
- if (curBaseSymbol.supportsCoercion(TypeConstants.TYPE_MAP)
- && nextSymbol instanceof IPropertySymbol
- && TypeConstants.TYPE_JAVAOBJECT
- .equals(((IPropertySymbol) nextSymbol)
- .getTypeDescriptor().getTypeSignature()))
- {
- // if we get a symbol back that's a generic object coming from a map
- // then stop validating; we can't tell anything for sure
- return Diagnostic.OK_INSTANCE;
- }
-
- if (nextSymbol == null)
- {
- return _diagnosticFactory.create_MEMBER_NOT_FOUND(secondArg
- .getLiteralValue(), firstArg.getSymbol().getName());
- }
-
- return Diagnostic.OK_INSTANCE;
- }
-
- /**
- * @param firstArg
- * @param secondArg
- * @return the resolved type for the operation or null if not computable
- */
- public SignatureBasedType performOperation(final ValueType firstArg,
- final ValueType secondArg)
- {
- if (!(firstArg instanceof IObjectSymbolBasedValueType))
- {
- return null;
- }
-
- // per JSP.2.3.4, if value-b is null, then return null (not literal
- // null)
- if (TypeCoercer.typeIsNull(secondArg.getSignature()))
- {
- return null;
- }
-
- return handlePerformObjectSymbolValue(
- (IObjectSymbolBasedValueType) firstArg, secondArg);
- }
-
- /**
- * @param firstArg --
- * represents value-a (expr-a after step 1) in JSP.2.3.4
- * @param secondArg --
- * represents value-b (expr-b after step 3) in JSP.2.3.4
- * @return the new ValueType for this operation or null
- */
- protected abstract SignatureBasedType handlePerformObjectSymbolValue(
- IObjectSymbolBasedValueType firstArg, ValueType secondArg);
-
- /**
- * @param firstArg
- * @param secondArg
- * @return the resolved type for firstArg[secondArg] treating firstArg as a
- * type that uses a named property accessor (i.e. a map or bean but
- * not a list or array) or null if unresolved
- */
- protected SignatureBasedType handlePerformNamedPropertyAccessorBase(
- final IObjectSymbolBasedValueType firstArg, final LiteralType secondArg)
- {
- final ISymbol symbol =
- getMemberSymbol(firstArg.getSymbol(), secondArg
- .getLiteralValueRaw());
-
- if (symbol instanceof IPropertySymbol)
- {
- return new IObjectSymbolBasedValueType((IPropertySymbol) symbol);
- }
- else if (symbol instanceof IMethodSymbol)
- {
- return new IMethodSymbolBasedType((IMethodSymbol) symbol);
- }
-
- // fall-through and return null
- // per JSP2.3.4 steps 5 and 6, return null literal if map, null (error)
- // otherwise
- if (firstArg.isInstanceOf(TypeConstants.TYPE_MAP))
- {
- return NullLiteralType.SINGLETON;
- }
- return null;
- }
-
- /**
- * @param symbol
- * @param name
- * @return the member symbol of 'symbol' corresponding to 'name' or null if
- * there is no such member
- */
- protected final ISymbol getMemberSymbol(final IObjectSymbol symbol,
- final Object name)
- {
- ISymbol memberSymbol = getPropertySymbol(symbol, name);
-
- if (memberSymbol != null)
- {
- return memberSymbol;
- }
-
- memberSymbol = getMethodSymbol(symbol, name);
-
- // otherwise, see if it's a valid method
- if (memberSymbol != null)
- {
- return memberSymbol;
- }
-
- // if not a property or method, then not a valid member
- return null;
- }
-
- /**
- * @param symbol
- * @param name
- * @return the property symbol called name relative to 'symbol' or null if
- * one doesn't exist
- */
- protected final ISymbol getPropertySymbol(final ISymbol symbol,
- final Object name)
- {
- final AbstractDTPropertyResolver resolver = getPropertyResolver();
-
- if (resolver != null)
- {
- return resolver.getProperty(symbol, name);
- }
-
- JSFCorePlugin.log("Error acquiring property resolver", new Throwable());
- return null;
- }
-
- /**
- * @param symbol
- * @param name
- * @return the method symbol on 'symbol' corresponding to 'name' or null if
- * no such member
- */
- protected final IMethodSymbol getMethodSymbol(final IObjectSymbol symbol,
- final Object name)
- {
- final AbstractDTMethodResolver resolver = getMethodResolver();
-
- if (resolver != null)
- {
- return resolver.getMethod(symbol, name);
- }
-
- JSFCorePlugin.log("Error acquiring property resolver", new Throwable());
- return null;
-
- }
-
- /**
- * @return the property resolver for the current source file
- */
- protected final AbstractDTPropertyResolver getPropertyResolver()
- {
- final DesignTimeApplicationManager manager =
- DesignTimeApplicationManager.getInstance(_file.getProject());
-
- if (manager != null)
- {
- return manager.getPropertyResolver();
- }
-
- return null;
- }
-
- /**
- * @return the method resolver for the current source file
- */
- protected final AbstractDTMethodResolver getMethodResolver()
- {
- final DesignTimeApplicationManager manager =
- DesignTimeApplicationManager.getInstance(_file.getProject());
-
- if (manager != null)
- {
- return manager.getMethodResolver();
- }
- return null;
- }
-
- /**
- * @return a user-readable name of the operator (i.e. dot or bracket)
- */
- protected abstract String getOperatorName();
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/Messages.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/Messages.java
deleted file mode 100644
index 22c4c56..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/Messages.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.validation.internal.el.operators;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-class Messages {
- private static final String BUNDLE_NAME = "org.eclipse.jst.jsf.validation.internal.el.operators.messages"; //$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
- .getBundle(BUNDLE_NAME);
-
- private Messages() {
- // no external instantiation
- }
-
- /**
- * @param key
- * @return the string or !key! if not found
- */
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/MinusUnaryOperator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/MinusUnaryOperator.java
deleted file mode 100644
index 7dcdc3b..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/MinusUnaryOperator.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.validation.internal.el.operators;
-
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jst.jsf.common.internal.types.FloatLiteralType;
-import org.eclipse.jst.jsf.common.internal.types.IAssignable;
-import org.eclipse.jst.jsf.common.internal.types.IntegerLiteralType;
-import org.eclipse.jst.jsf.common.internal.types.LiteralType;
-import org.eclipse.jst.jsf.common.internal.types.StringLiteralType;
-import org.eclipse.jst.jsf.common.internal.types.TypeCoercer;
-import org.eclipse.jst.jsf.common.internal.types.TypeCoercionException;
-import org.eclipse.jst.jsf.common.internal.types.TypeConstants;
-import org.eclipse.jst.jsf.common.internal.types.TypeTransformer;
-import org.eclipse.jst.jsf.common.internal.types.ValueType;
-import org.eclipse.jst.jsf.validation.internal.el.diagnostics.DiagnosticFactory;
-
-/**
- * Represents the EL unary operator '-' on a ValueType
- * as described by JSP.2.3.5.4
- *
- *
- * @author cbateman
- *
- */
-/*package*/class MinusUnaryOperator extends UnaryOperator
-{
- private static final String UNARY_MINUS = "unary minus";
-
- MinusUnaryOperator(DiagnosticFactory diagnosticFactory)
- {
- super(diagnosticFactory);
- }
-
- public Diagnostic validate(ValueType type)
- {
- // must coerce to numeric type
- try
- {
- // if coerceTypeNumber doesn't throw an exception, then
- // give the benefit of the doubt
- final String coercedType =
- TypeCoercer.
- coerceToNumber(TypeTransformer.
- transformBoxPrimitives(type.getSignature()));
-
- if (TypeCoercer.typeIsNull(coercedType))
- {
- // null always coerces to 0L on this operator
- return _diagnosticFactory.
- create_UNARY_OP_MINUS_ON_NULL_ALWAYS_ZERO();
- }
-
- // JSP.2.3.5.4, step 2 if BigDecimal or BigInteger, then can't be
- // literal and retains type
- if (TypeConstants.TYPE_BIG_DOUBLE.equals(coercedType)
- || TypeConstants.TYPE_BIG_INTEGER.equals(coercedType))
- {
- return Diagnostic.OK_INSTANCE;
- }
-
- // JSP.2.4.5.4, step 3: if String
- // note, use uncoerced type, since type coercer will return null for strings
- if (TypeCoercer.typeIsString(type.getSignature()))
- {
- // if it's a string and we have the value, we can determine for
- // sure whether or not it's coercable to a number
- // per JSP.2.3.5.4 step 3.1
- if (type instanceof StringLiteralType)
- {
- String literalValue = ((LiteralType)type).getLiteralValue();
- if (literalValue.indexOf('.') > -1
- || literalValue.indexOf('e') > -1
- || literalValue.indexOf('E') > -1)
- {
- // if it coerces to double, then it's a double
- ((LiteralType)type).coerceToNumber(Double.class);
- // this is okay, because an expression like #{-3.3} can't be folded
- return Diagnostic.OK_INSTANCE;
- }
- // per JSP.2.3.5.4, step 3.2 try to coerce to long
- // if it coerces to long, then it's a long
- ((LiteralType)type).coerceToNumber(Long.class);
- // this is okay, because an expression like #{-3} can't be folded
- return Diagnostic.OK_INSTANCE;
- }
- // if non-literal string, warn that coercion to number is not
- // guaranteed since Long.valueOf and Double.valueOf
- // (unlike Boolean.valueOf) throw NumberFormatExceptions
- return _diagnosticFactory.create_UNARY_OP_STRING_CONVERSION_NOT_GUARANTEED(UNARY_MINUS);
- }
-
- // JSP.2.3.5.4, step 4, for all numeric types, retain type,
- // validate constant folding
- // note that this return true for big int and decimal, so those cases
- // must already have been handled.
- if (TypeCoercer.typeIsNumeric(coercedType))
- {
- // otherwise, we are fine
- return Diagnostic.OK_INSTANCE;
- }
-
- }
- catch (TypeCoercionException tce)
- {
- // fallthrough to error below
- }
- // otherwise, error
- return _diagnosticFactory.create_UNARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION(UNARY_MINUS);
- }
-
- /**
- * Based on JSP.2.3.5.4
- *
- * @param type
- * @return type of type after a minus is applied or null if unknown
- */
- public ValueType performOperation(ValueType type)
- {
- try
- {
- final String boxedType =
- TypeTransformer.transformBoxPrimitives(type.getSignature());
- // check for valid type coercion
- String coercedType = TypeCoercer.coerceToNumber(boxedType);
-
- if (TypeCoercer.typeIsNull(coercedType))
- {
- // null always coerces to 0L on this operator
- return new IntegerLiteralType(0L);
- }
-
- // JSP.2.3.5.4, step 2 if BigDecimal or BigInteger, then can't be
- // literal and retains type
- if (TypeConstants.TYPE_BIG_DOUBLE.equals(coercedType))
- {
- return new ValueType(TypeConstants.TYPE_BIG_DOUBLE, IAssignable.ASSIGNMENT_TYPE_RHS);
- }
- else if (TypeConstants.TYPE_BIG_INTEGER.equals(coercedType))
- {
- return new ValueType(TypeConstants.TYPE_BIG_INTEGER, IAssignable.ASSIGNMENT_TYPE_RHS);
- }
-
- if (TypeCoercer.typeIsString(type.getSignature()))
- {
- // if it's string and we have the value, we can determine for
- // sure whether or not it's coercable to a number
- // per JSP.2.3.5.4 step 3
- if (type instanceof StringLiteralType)
- {
- String literalValue = ((LiteralType)type).getLiteralValue();
- if (literalValue.indexOf('.') > -1
- || literalValue.indexOf('e') > -1
- || literalValue.indexOf('E') > -1)
- {
- // if it coerces to double, then it's a double
- Number value = ((LiteralType)type).coerceToNumber(Double.class);
- return new FloatLiteralType(-1 * value.doubleValue());
- }
-
- // if it coerces to long, then it's a long
- Number value = ((LiteralType)type).coerceToNumber(Long.class);
- return new IntegerLiteralType(-1 * value.longValue());
- }
-
- // otherwise, just return a long typed value
- return new ValueType(Signature.SIG_LONG, IAssignable.ASSIGNMENT_TYPE_RHS);
- }
-
- // JSP.2.3.5.4
- // big integer and big decimal retain type
- // all numeric types retain type
- if (TypeCoercer.typeIsNumeric(boxedType))
- {
- // integer and float literals are special because -1 or -1.0
- // is syntically minusOp(1) and minusOp(1.0)
- if (type instanceof IntegerLiteralType)
- {
- return new IntegerLiteralType(-1 * ((IntegerLiteralType)type).coerceToNumber(Long.class).longValue());
- }
- else if (type instanceof FloatLiteralType)
- {
- return new FloatLiteralType(-1 * ((FloatLiteralType)type).coerceToNumber(Double.class).doubleValue());
- }
- return type;
- }
-
- // all other cases, return null
- // even is type represents a String, without it's value, we have
- // no idea how to coerce it without it's value
- // fall through and return null
- }
- catch (TypeCoercionException tce)
- {
- // do nothing, fall through and return null
- }
-
- return null;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/ModArithmeticBinaryOperator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/ModArithmeticBinaryOperator.java
deleted file mode 100644
index ba4765b..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/ModArithmeticBinaryOperator.java
+++ /dev/null
@@ -1,383 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.validation.internal.el.operators;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jst.jsf.common.internal.types.FloatLiteralType;
-import org.eclipse.jst.jsf.common.internal.types.IAssignable;
-import org.eclipse.jst.jsf.common.internal.types.IntegerLiteralType;
-import org.eclipse.jst.jsf.common.internal.types.LiteralType;
-import org.eclipse.jst.jsf.common.internal.types.TypeCoercer;
-import org.eclipse.jst.jsf.common.internal.types.TypeCoercionException;
-import org.eclipse.jst.jsf.common.internal.types.TypeConstants;
-import org.eclipse.jst.jsf.common.internal.types.TypeTransformer;
-import org.eclipse.jst.jsf.common.internal.types.ValueType;
-import org.eclipse.jst.jsf.validation.internal.el.diagnostics.DiagnosticFactory;
-
-/**
- * Represents the EL modulo operator: % or mod
- * Based JSP.2.3.5.3
- *
- * @author cbateman
- *
- */
-/*package*/ class ModArithmeticBinaryOperator extends ArithmeticBinaryOperator
-{
- private static final String MODULO = "modulo";
-
- ModArithmeticBinaryOperator(DiagnosticFactory diagnosticFactory) {
- super(diagnosticFactory);
- }
-
- public ValueType performOperation(ValueType firstArg, ValueType secondArg)
- {
- // JSP.2.3.5.3, step 1 if both null, then return zero
- if (TypeCoercer.typeIsNull(firstArg.getSignature())
- && TypeCoercer.typeIsNull(secondArg.getSignature()))
- {
- return IntegerLiteralType.ZERO;
- }
-
- final String boxedFirstArg = TypeTransformer.transformBoxPrimitives(firstArg.getSignature());
- final String boxedSecondArg = TypeTransformer.transformBoxPrimitives(secondArg.getSignature());
-
- // JSP.2.3.5.3, step 2, if either arg is BigDecimal, Float, Double
- // or String (ignoring whether it is value coercable), then coerce
- // to Double and do op
- if (TypeConstants.TYPE_BIG_DOUBLE.equals(boxedFirstArg)
- || TypeConstants.TYPE_BIG_DOUBLE.equals(boxedSecondArg)
- || TypeConstants.TYPE_BOXED_DOUBLE.equals(boxedFirstArg)
- || TypeConstants.TYPE_BOXED_DOUBLE.equals(boxedSecondArg)
- || TypeConstants.TYPE_BOXED_FLOAT.equals(boxedFirstArg)
- || TypeConstants.TYPE_BOXED_FLOAT.equals(boxedSecondArg))
- {
- // TODO: handle case where one is a literal or resolvable string value
- // that containss ".", "e" or "E"
- return performDouble(firstArg, secondArg);
- }
-
- // JSP.2.3.5.3, step 3, if either arg is a BigInteger, coerce
- // both to BigInteger
- if (TypeConstants.TYPE_BIG_INTEGER.equals(boxedFirstArg)
- || TypeConstants.TYPE_BIG_INTEGER.equals(boxedSecondArg))
- {
- return performBigInteger(firstArg, secondArg);
- }
-
- // JSP.2.3.5.3, step 4, otherwise try to perform as a Long op
- return performLong(firstArg, secondArg);
- }
-
- public Diagnostic validate(ValueType firstArg, ValueType secondArg) {
- // JSP.2.3.5.3, step 1 if both null, then return zero
- if (TypeCoercer.typeIsNull(firstArg.getSignature())
- && TypeCoercer.typeIsNull(secondArg.getSignature()))
- {
- return _diagnosticFactory.create_BINARY_OP_BOTH_OPERANDS_NULL(MODULO);
- }
-
- final String boxedFirstArg = TypeTransformer.transformBoxPrimitives(firstArg.getSignature());
- final String boxedSecondArg = TypeTransformer.transformBoxPrimitives(secondArg.getSignature());
-
- // JSP.2.3.5.3, step 2, if either arg is BigDecimal, Float, Double
- // or String (ignoring whether it is value coercable), then coerce
- // to Double and do op
- if (TypeConstants.TYPE_BIG_DOUBLE.equals(boxedFirstArg)
- || TypeConstants.TYPE_BIG_DOUBLE.equals(boxedSecondArg)
- || TypeConstants.TYPE_BOXED_DOUBLE.equals(boxedFirstArg)
- || TypeConstants.TYPE_BOXED_DOUBLE.equals(boxedSecondArg)
- || TypeConstants.TYPE_BOXED_FLOAT.equals(boxedFirstArg)
- || TypeConstants.TYPE_BOXED_FLOAT.equals(boxedSecondArg))
- {
- // TODO: handle case where one is a literal or resolvable string value
- // that containss ".", "e" or "E"
- return validateDouble(firstArg, secondArg);
- }
-
- // JSP.2.3.5.3, step 3, if either arg is a BigInteger, coerce
- // both to BigInteger
- if (TypeConstants.TYPE_BIG_INTEGER.equals(boxedFirstArg)
- || TypeConstants.TYPE_BIG_INTEGER.equals(boxedSecondArg))
- {
- return validateBigInteger(firstArg, secondArg);
- }
-
- // JSP.2.3.5.3, step 4, otherwise try to perform as a Long op
- return validateLong(firstArg, secondArg);
- }
-
- private ValueType performDouble(ValueType firstArg, ValueType secondArg)
- {
- try
- {
- TypeCoercer.coerceToNumber(TypeTransformer.transformBoxPrimitives(firstArg.getSignature()));
- TypeCoercer.coerceToNumber(TypeTransformer.transformBoxPrimitives(secondArg.getSignature()));
-
- Number secondValue = null;
-
- if (secondArg instanceof LiteralType)
- {
- secondValue = ((LiteralType)secondArg).coerceToNumber(Double.class);
-
- if (secondValue.doubleValue() == 0.0)
- {
- // division by zero
- return null;
- }
- }
-
- Number firstValue = null;
-
- if (firstArg instanceof LiteralType)
- {
- firstValue = ((LiteralType)firstArg).coerceToNumber(Double.class);
- }
-
- if (firstValue != null && secondValue != null)
- {
- return new FloatLiteralType(
- doRealOperation(new Double(firstValue.doubleValue()),
- new Double(secondValue.doubleValue())).doubleValue());
- }
-
- // if we get to here, the coercion is valid, so a Double will be
- // returned
- return new ValueType(Signature.SIG_DOUBLE, IAssignable.ASSIGNMENT_TYPE_RHS);
- }
- catch (TypeCoercionException tce)
- {
- // could not coerce, so null
- return null;
- }
- }
-
- private ValueType performBigInteger(ValueType firstArg, ValueType secondArg)
- {
- try
- {
- TypeCoercer.coerceToNumber(TypeTransformer.transformBoxPrimitives(firstArg.getSignature()));
- TypeCoercer.coerceToNumber(TypeTransformer.transformBoxPrimitives(secondArg.getSignature()));
-
- // check second arg for zero
- if (secondArg instanceof LiteralType)
- {
- if (((LiteralType)secondArg).coerceToNumber(BigInteger.class).equals(BigInteger.ZERO))
- {
- // division by zero
- return null;
- }
- }
-
- // since one of the args is BigInteger, they are not both literals,
- // so if we get to here, we have a successful mod of two
- // big integers to one big integer
- return new ValueType(TypeConstants.TYPE_BIG_INTEGER, IAssignable.ASSIGNMENT_TYPE_RHS);
- }
- catch (TypeCoercionException tce)
- {
- // no coercion
- return null;
- }
- }
-
- private ValueType performLong(ValueType firstArg, ValueType secondArg)
- {
- try
- {
- TypeCoercer.coerceToNumber(TypeTransformer.transformBoxPrimitives(firstArg.getSignature()));
- TypeCoercer.coerceToNumber(TypeTransformer.transformBoxPrimitives(secondArg.getSignature()));
-
- Number secondValue = null;
-
- if (secondArg instanceof LiteralType)
- {
- secondValue = ((LiteralType)secondArg).coerceToNumber(Long.class);
-
- if (secondValue.longValue() == 0)
- {
- // division by zero
- return null;
- }
- }
-
- Number firstValue = null;
-
- if (firstArg instanceof LiteralType)
- {
- firstValue = ((LiteralType)firstArg).coerceToNumber(Long.class);
- }
-
- if (firstValue != null && secondValue != null)
- {
- return new IntegerLiteralType(
- doRealOperation(Long.valueOf(firstValue.longValue()),
- Long.valueOf(secondValue.longValue())).longValue());
- }
-
- // if we get to here, the coercion is valid, so a Long will be
- // returned
- return new ValueType(Signature.SIG_LONG, IAssignable.ASSIGNMENT_TYPE_RHS);
- }
- catch (TypeCoercionException tce)
- {
- // could not coerce, so null
- return null;
- }
- }
-
- private Diagnostic validateDouble(ValueType firstArg, ValueType secondArg)
- {
- try
- {
- TypeCoercer.coerceToNumber(TypeTransformer.transformBoxPrimitives(firstArg.getSignature()));
- TypeCoercer.coerceToNumber(TypeTransformer.transformBoxPrimitives(secondArg.getSignature()));
-
- Number secondValue = null;
-
- if (secondArg instanceof LiteralType)
- {
- secondValue = ((LiteralType)secondArg).coerceToNumber(Double.class);
-
- if (secondValue.doubleValue() == 0.0)
- {
- // division by zero
- return _diagnosticFactory.create_BINARY_OP_POSSIBLE_DIVISION_BY_ZERO();
- }
- }
-
- Number firstValue = null;
-
- if (firstArg instanceof LiteralType)
- {
- firstValue = ((LiteralType)firstArg).coerceToNumber(Double.class);
- }
-
- if (firstValue != null && secondValue != null)
- {
- return _diagnosticFactory.
- create_BINARY_OP_CONSTANT_EXPRESSION_ALWAYS_EVAL_SAME
- (MODULO, Double.toString(
- firstValue.doubleValue()%secondValue.doubleValue()));
- }
-
- // if we get to here, the coercion is valid, so a Double will be
- // returned and everything is good
- return Diagnostic.OK_INSTANCE;
- }
- catch (TypeCoercionException tce)
- {
- // could not coerce, so error
- return _diagnosticFactory.
- create_BINARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION(MODULO);
- }
- }
-
- private Diagnostic validateBigInteger(ValueType firstArg, ValueType secondArg)
- {
- try
- {
- TypeCoercer.coerceToNumber(TypeTransformer.transformBoxPrimitives(firstArg.getSignature()));
- TypeCoercer.coerceToNumber(TypeTransformer.transformBoxPrimitives(secondArg.getSignature()));
-
- // check second arg for zero
- if (secondArg instanceof LiteralType)
- {
- if (((LiteralType)secondArg).coerceToNumber(BigInteger.class).equals(BigInteger.ZERO))
- {
- // division by zero
- return _diagnosticFactory.create_BINARY_OP_POSSIBLE_DIVISION_BY_ZERO();
- }
- }
-
- // since one of the args is BigInteger, they are not both literals,
- // so if we get to here, we have a successful mod of two
- // big integers to one big integer
- return Diagnostic.OK_INSTANCE;
- }
- catch (TypeCoercionException tce)
- {
- // no coercion
- return _diagnosticFactory.
- create_BINARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION(MODULO);
- }
- }
-
- private Diagnostic validateLong(ValueType firstArg, ValueType secondArg)
- {
- try
- {
- TypeCoercer.coerceToNumber(TypeTransformer.transformBoxPrimitives(firstArg.getSignature()));
- TypeCoercer.coerceToNumber(TypeTransformer.transformBoxPrimitives(secondArg.getSignature()));
-
- Number secondValue = null;
-
- if (secondArg instanceof LiteralType)
- {
- secondValue = ((LiteralType)secondArg).coerceToNumber(Long.class);
-
- if (secondValue.longValue() == 0)
- {
- // division by zero
- return _diagnosticFactory.
- create_BINARY_OP_POSSIBLE_DIVISION_BY_ZERO();
- }
- }
-
- Number firstValue = null;
-
- if (firstArg instanceof LiteralType)
- {
- firstValue = ((LiteralType)firstArg).coerceToNumber(Long.class);
- }
-
- if (firstValue != null && secondValue != null)
- {
- return _diagnosticFactory.
- create_BINARY_OP_CONSTANT_EXPRESSION_ALWAYS_EVAL_SAME
- (MODULO, Long.toString(firstValue.longValue()%secondValue.longValue()));
- }
-
- // if we get to here, the coercion is valid, so a Long will be
- // returned
- return Diagnostic.OK_INSTANCE;
- }
- catch (TypeCoercionException tce)
- {
- // could not coerce, so error
- return _diagnosticFactory.
- create_BINARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION(MODULO);
- }
- }
-
- protected Long doRealOperation(Long firstArg, Long secondArg) {
- return Long.valueOf(firstArg.longValue() % secondArg.longValue());
- }
-
- protected Double doRealOperation(Double firstArg, Double secondArg) {
- return new Double(firstArg.doubleValue() % secondArg.doubleValue());
- }
-
- protected BigDecimal doRealOperation(BigDecimal firstArg,
- BigDecimal secondArg) {
- return new BigDecimal(firstArg.doubleValue() % secondArg.doubleValue());
- }
-
- protected String getOperatorName() {
- return MODULO;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/MultiplyArithmeticBinaryOperator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/MultiplyArithmeticBinaryOperator.java
deleted file mode 100644
index 7076622..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/MultiplyArithmeticBinaryOperator.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.validation.internal.el.operators;
-
-import java.math.BigDecimal;
-
-import org.eclipse.jst.jsf.validation.internal.el.diagnostics.DiagnosticFactory;
-
-/**
- * Represents the EL Multiply arithmetic binary operator "*"
- *
- * @author cbateman
- *
- */
-/*package*/ class MultiplyArithmeticBinaryOperator extends
- NoDivArithmeticBinaryOperator
-{
- private static final String MULTIPLICATION = "multiplication";
-
-
- MultiplyArithmeticBinaryOperator(DiagnosticFactory diagnosticFactory)
- {
- super(diagnosticFactory);
- }
-
- protected Long doRealOperation(Long firstArg, Long secondArg)
- {
- return Long.valueOf(firstArg.longValue() * secondArg.longValue());
- }
-
- protected Double doRealOperation(Double firstArg, Double secondArg)
- {
- return new Double(firstArg.doubleValue() * secondArg.doubleValue());
- }
-
- protected BigDecimal doRealOperation(BigDecimal firstArg,
- BigDecimal secondArg)
- {
- return firstArg.multiply(secondArg);
- }
-
- protected String getOperatorName() {
- return MULTIPLICATION;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/NoDivArithmeticBinaryOperator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/NoDivArithmeticBinaryOperator.java
deleted file mode 100644
index 5bdc163..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/NoDivArithmeticBinaryOperator.java
+++ /dev/null
@@ -1,300 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.validation.internal.el.operators;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jst.jsf.common.internal.types.FloatLiteralType;
-import org.eclipse.jst.jsf.common.internal.types.IAssignable;
-import org.eclipse.jst.jsf.common.internal.types.IntegerLiteralType;
-import org.eclipse.jst.jsf.common.internal.types.LiteralType;
-import org.eclipse.jst.jsf.common.internal.types.TypeCoercer;
-import org.eclipse.jst.jsf.common.internal.types.TypeCoercionException;
-import org.eclipse.jst.jsf.common.internal.types.TypeConstants;
-import org.eclipse.jst.jsf.common.internal.types.TypeTransformer;
-import org.eclipse.jst.jsf.common.internal.types.ValueType;
-import org.eclipse.jst.jsf.validation.internal.el.diagnostics.DiagnosticFactory;
-
-/**
- * Represents non-dividing arithmetic EL operators: +,-,*
- * Based on JSP.2.3.5.1
- *
- * @author cbateman
- *
- */
-/*package*/ abstract class NoDivArithmeticBinaryOperator extends ArithmeticBinaryOperator
-{
- NoDivArithmeticBinaryOperator(DiagnosticFactory diagnosticFactory) {
- super(diagnosticFactory);
- }
-
- protected abstract Long doRealOperation(Long firstArg, Long secondArg);
-
- protected abstract Double doRealOperation(Double firstArg, Double secondArg);
-
- public ValueType performOperation(ValueType firstArg, ValueType secondArg)
- {
- // JSP.2.3.5.1, step 1, if either arg is null, return (Long) 0
- if (TypeCoercer.typeIsNull(firstArg.getSignature())
- && TypeCoercer.typeIsNull(secondArg.getSignature()))
- {
- return new IntegerLiteralType(0);
- }
-
- final String boxedFirstArg = TypeTransformer.transformBoxPrimitives(firstArg.getSignature());
- final String boxedSecondArg = TypeTransformer.transformBoxPrimitives(secondArg.getSignature());
-
- // JSP.2.3.5.1, step 2, if either arg is a BigDecimal, coerce to BigDecimal
- // and apply
- if (TypeConstants.TYPE_BIG_DOUBLE.equals(boxedFirstArg)
- || TypeConstants.TYPE_BIG_DOUBLE.equals(boxedSecondArg))
- {
- return handleNumericArithmetic(firstArg, secondArg, BigDecimal.class);
- }
-
- // JSP.2.3.5.1, step 3, if either arg is float or double or
- // a String containing "., e or E", then coerce if the other is
- // a big int, coerce up to BigDecimal, else to Double
- // Note: we are ignoring strings we can't resolve to figure out
- // if the contain "., e or E". Assume they always do
- if (TypeConstants.TYPE_BOXED_DOUBLE.equals(boxedFirstArg)
- ||TypeConstants.TYPE_BOXED_DOUBLE.equals(boxedSecondArg)
- ||TypeConstants.TYPE_BOXED_FLOAT.equals(boxedFirstArg)
- ||TypeConstants.TYPE_BOXED_FLOAT.equals(boxedSecondArg))
- {
- if (TypeConstants.TYPE_BIG_INTEGER.equals(boxedFirstArg)
- ||TypeConstants.TYPE_BIG_INTEGER.equals(boxedSecondArg))
- {
- // if the other operand is BigInteger, treat as BigDecimal
- return handleNumericArithmetic(firstArg, secondArg, BigDecimal.class);
- }
-
- // otherwise as double
- return handleNumericArithmetic(firstArg, secondArg, Double.class);
- }
-
- // JSP.2.3.5.1, step 4, if one is a big integer, coerce to big integer
- if (TypeConstants.TYPE_BIG_INTEGER.equals(boxedFirstArg)
- || TypeConstants.TYPE_BIG_INTEGER.equals(boxedSecondArg))
- {
- return handleNumericArithmetic(firstArg, secondArg, BigInteger.class);
- }
-
- // JSP.2.3.5.1, step 5, otherwise, try to coerce to Long
- return handleNumericArithmetic(firstArg, secondArg, Long.class);
- }
-
- public Diagnostic validate(ValueType firstArg, ValueType secondArg)
- {
- // JSP.2.3.5.1, step 1, if either arg is null, return (Long) 0
- if (TypeCoercer.typeIsNull(firstArg.getSignature())
- && TypeCoercer.typeIsNull(secondArg.getSignature()))
- {
- return _diagnosticFactory.create_BINARY_OP_BOTH_OPERANDS_NULL(getOperatorName());
- }
-
- final String boxedFirstArg = TypeTransformer.transformBoxPrimitives(firstArg.getSignature());
- final String boxedSecondArg = TypeTransformer.transformBoxPrimitives(secondArg.getSignature());
-
- // JSP.2.3.5.1, step 2, if either arg is a BigDecimal, coerce to BigDecimal
- // and apply
- if (TypeConstants.TYPE_BIG_DOUBLE.equals(boxedFirstArg)
- || TypeConstants.TYPE_BIG_DOUBLE.equals(boxedSecondArg))
- {
- return validateNumericArithmetic(firstArg, secondArg, BigDecimal.class);
- }
-
- // JSP.2.3.5.1, step 3, if either arg is float or double or
- // a String containing "., e or E", then coerce if the other is
- // a big int, coerce up to BigDecimal, else to Double
- // Note: we are ignoring strings we can't resolve to figure out
- // if the contain "., e or E". Assume they always do
- if (TypeConstants.TYPE_BOXED_DOUBLE.equals(boxedFirstArg)
- ||TypeConstants.TYPE_BOXED_DOUBLE.equals(boxedSecondArg)
- ||TypeConstants.TYPE_BOXED_FLOAT.equals(boxedFirstArg)
- ||TypeConstants.TYPE_BOXED_FLOAT.equals(boxedSecondArg))
- {
- if (TypeConstants.TYPE_BIG_INTEGER.equals(boxedFirstArg)
- ||TypeConstants.TYPE_BIG_INTEGER.equals(boxedSecondArg))
- {
- // if the other operand is BigInteger, treat as BigDecimal
- return validateNumericArithmetic(firstArg, secondArg, BigDecimal.class);
- }
-
- // otherwise as double
- return validateNumericArithmetic(firstArg, secondArg, Double.class);
- }
-
- // JSP.2.3.5.1, step 4, if one is a big integer, coerce to big integer
- if (TypeConstants.TYPE_BIG_INTEGER.equals(boxedFirstArg)
- || TypeConstants.TYPE_BIG_INTEGER.equals(boxedSecondArg))
- {
- return validateNumericArithmetic(firstArg, secondArg, BigInteger.class);
- }
-
- // JSP.2.3.5.1, step 5, otherwise, try to coerce to Long
- return validateNumericArithmetic(firstArg, secondArg, Long.class);
- }
-
- /**
- * @param firstArg
- * @param secondArg
- * @param numberType
- * @return a value type based on the result of the arithmetic operation
- */
- protected ValueType handleNumericArithmetic(ValueType firstArg, ValueType secondArg, Class numberType)
- {
- try
- {
-// final String coercedFirstArg =
- TypeCoercer.coerceToNumber(TypeTransformer.transformBoxPrimitives(firstArg.getSignature()));
-// final String coercedSecondArg =
- TypeCoercer.coerceToNumber(TypeTransformer.transformBoxPrimitives(secondArg.getSignature()));
-
- if (firstArg instanceof LiteralType && secondArg instanceof LiteralType)
- {
- try
- {
- Number firstValue =
- ((LiteralType)firstArg).coerceToNumber(numberType);
- Number secondValue =
- ((LiteralType)secondArg).coerceToNumber(numberType);
-
- LiteralType result = null;
-
- if (numberType == Double.class)
- {
- Double resultValue =
- doRealOperation((Double)firstValue,
- (Double) secondValue);
- result = new FloatLiteralType(resultValue.doubleValue());
- }
- else if (numberType == Long.class)
- {
- Long resultValue =
- doRealOperation((Long) firstValue, (Long) secondValue);
- result = new IntegerLiteralType(resultValue.longValue());
- }
- else
- {
- throw new AssertionError("unsupport arithmetic upcast type");
- }
-
- return result;
- }
- catch (TypeCoercionException tce)
- {
- // could happen if two string literals passed
- return null;
- }
- }
-
- // if we get to here, then we have two valid numeric arith
- // types, but at least one is not a literal, so the best we can
- // say is that the return will be the same asthe type of numeric
- // coercion
- if (numberType == BigDecimal.class)
- {
- return new ValueType(TypeConstants.TYPE_BIG_DOUBLE, IAssignable.ASSIGNMENT_TYPE_RHS);
- }
- else if (numberType == Double.class)
- {
- return new ValueType(Signature.SIG_DOUBLE, IAssignable.ASSIGNMENT_TYPE_RHS);
- }
- else if (numberType == BigInteger.class)
- {
- return new ValueType(TypeConstants.TYPE_BIG_INTEGER, IAssignable.ASSIGNMENT_TYPE_RHS);
- }
- else
- {
- return new ValueType(Signature.SIG_LONG, IAssignable.ASSIGNMENT_TYPE_RHS);
- }
- }
- catch (TypeCoercionException tce)
- {
- // coercion to number failed, so no go
- return null;
- }
- }
-
- /**
- * @param firstArg
- * @param secondArg
- * @param numberType
- * @return a diagnostic validating the arithmetic expr firstArg op secondArg
- */
- protected Diagnostic validateNumericArithmetic(ValueType firstArg, ValueType secondArg, Class numberType)
- {
- try
- {
-// final String coercedFirstArg =
- TypeCoercer.coerceToNumber(TypeTransformer.transformBoxPrimitives(firstArg.getSignature()));
-// final String coercedSecondArg =
- TypeCoercer.coerceToNumber(TypeTransformer.transformBoxPrimitives(secondArg.getSignature()));
-
- if (firstArg instanceof LiteralType && secondArg instanceof LiteralType)
- {
- try
- {
- Number firstValue =
- ((LiteralType)firstArg).coerceToNumber(numberType);
- Number secondValue =
- ((LiteralType)secondArg).coerceToNumber(numberType);
-
- Number result = null;
-
- if (numberType == Double.class)
- {
- result =
- doRealOperation((Double)firstValue,
- (Double) secondValue);
- }
- else if (numberType == Long.class)
- {
- result =
- doRealOperation((Long) firstValue, (Long) secondValue);
- }
- else
- {
- throw new AssertionError("unsupport arithmetic upcast type");
- }
-
- return _diagnosticFactory.
- create_BINARY_OP_CONSTANT_EXPRESSION_ALWAYS_EVAL_SAME
- (getOperatorName(), result.toString());
- }
- catch (TypeCoercionException tce)
- {
- // could happen when two strings are passed
- return _diagnosticFactory.
- create_BINARY_OP_COULD_NOT_COERCE_LITERALS_TO_NUMBERS();
- }
- }
-
- // if we get to here, then we have two valid numeric arith
- // types, but at least one is not a literal
- // everything should be ok
- return Diagnostic.OK_INSTANCE;
- }
- catch (TypeCoercionException tce)
- {
- // coercion to number failed, so no go
- return _diagnosticFactory.
- create_BINARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION(getOperatorName());
- }
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/NotEqualsBinaryRelationalOperator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/NotEqualsBinaryRelationalOperator.java
deleted file mode 100644
index 1d62454..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/NotEqualsBinaryRelationalOperator.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.validation.internal.el.operators;
-
-import org.eclipse.jst.jsf.validation.internal.el.diagnostics.DiagnosticFactory;
-
-/**
- * Represents the not equals -- "!="/ne EL binary operator
- * @author cbateman
- *
- */
-/*package*/ class NotEqualsBinaryRelationalOperator extends
- EqualityRelationalBinaryOperator {
-
- NotEqualsBinaryRelationalOperator(final DiagnosticFactory diagnosticFactory, String jsfVersion)
- {
- super(diagnosticFactory, jsfVersion);
- }
-
- protected boolean doRealOperation(Number firstArg, Number secondArg) {
- return !firstArg.equals(secondArg);
- }
-
- protected boolean doRealOperation(Boolean firstArg, Boolean secondArg) {
- return !firstArg.equals(secondArg);
- }
-
- protected boolean doRealOperation(String firstArg, String secondArg) {
- return !firstArg.equals(secondArg);
- }
-
- protected String getOperationName()
- {
- return Messages.getString("NotEqualsBinaryRelationalOperator.OperationName"); //$NON-NLS-1$
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/NotUnaryOperator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/NotUnaryOperator.java
deleted file mode 100644
index dd1d5db..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/NotUnaryOperator.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.validation.internal.el.operators;
-
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.jst.jsf.common.internal.types.BooleanLiteralType;
-import org.eclipse.jst.jsf.common.internal.types.LiteralType;
-import org.eclipse.jst.jsf.common.internal.types.TypeCoercer;
-import org.eclipse.jst.jsf.common.internal.types.TypeCoercionException;
-import org.eclipse.jst.jsf.common.internal.types.TypeConstants;
-import org.eclipse.jst.jsf.common.internal.types.TypeTransformer;
-import org.eclipse.jst.jsf.common.internal.types.ValueType;
-import org.eclipse.jst.jsf.validation.internal.el.diagnostics.DiagnosticFactory;
-
-/**
- * Represents te EL unary operators "!" and "not" on a ValueType
- * as described by JSP.2.3.6.2
- *
- * @author cbateman
- *
- */
-/*package*/ class NotUnaryOperator extends UnaryOperator
-{
- NotUnaryOperator(DiagnosticFactory diagnosticFactory)
- {
- super(diagnosticFactory);
- }
-
- public Diagnostic validate(ValueType type)
- {
- boolean canCoerce =
- TypeCoercer.canCoerceToBoolean(TypeTransformer.transformBoxPrimitives(type.getSignature()));
-
- if (canCoerce)
- {
- // check for constant evaluation
- if (type instanceof LiteralType)
- {
- try
- {
- Boolean coercedValue = ((LiteralType)type).coerceToBoolean();
-
- // we are logically notting, so coerced is true, then false
- // if false then true
- return _diagnosticFactory.create_UNARY_OP_CONSTANT_EXPRESSION_EVAL_SAME_ID(
- "not"
- , Boolean.valueOf(!coercedValue.booleanValue()).toString());
-
- }
- catch (TypeCoercionException tce)
- {
- throw new AssertionError("coerce should not throw exception");
- }
- }
-
- return Diagnostic.OK_INSTANCE;
- }
- return _diagnosticFactory.create_UNARY_OP_CANNOT_COERCE_ARGUMENT_TO_BOOLEAN();
- }
-
- public ValueType performOperation(ValueType type)
- {
- boolean canCoerce =
- TypeCoercer.canCoerceToBoolean(TypeTransformer.transformBoxPrimitives(type.getSignature()));
-
- if (canCoerce)
- {
- if (type instanceof LiteralType)
- {
- try
- {
- Boolean coercedValue = ((LiteralType)type).coerceToBoolean();
-
- // we are logically notting, so coerced is true, then false
- // if false then true
- return
- coercedValue.booleanValue() ?
- BooleanLiteralType.FALSE :
- BooleanLiteralType.TRUE;
- }
- catch (TypeCoercionException tce)
- {
- throw new AssertionError("coerce should not throw exception");
- }
- }
-
- return new ValueType(TypeConstants.TYPE_BOOLEAN, type.getAssignability());
- }
- return null;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/OrBinaryOperator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/OrBinaryOperator.java
deleted file mode 100644
index 33bd4be..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/OrBinaryOperator.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.validation.internal.el.operators;
-
-import org.eclipse.jst.jsf.validation.internal.el.diagnostics.DiagnosticFactory;
-
-/**
- * Encapsulates the 'and'/'&&' boolean-AND operator
- * Based on JSP.2.3.6.1
- *
- * @author cbateman
- *
- */
-/*package*/class OrBinaryOperator extends LogicalBinaryOperator
-{
- OrBinaryOperator(DiagnosticFactory diagnosticFactory)
- {
- super(diagnosticFactory);
- }
-
- protected boolean doRealOperation(Boolean firstArg, Boolean secondArg)
- {
- return (firstArg.booleanValue() || secondArg.booleanValue());
- }
-
- protected String readableOperatorName()
- {
- return "logical-OR";
- }
-
- protected boolean shortCircuitValue()
- {
- // OR short-circuits on true
- return true;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/RelationalBinaryOperator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/RelationalBinaryOperator.java
deleted file mode 100644
index 924ec98..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/RelationalBinaryOperator.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.validation.internal.el.operators;
-
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.jst.jsf.common.internal.types.BooleanLiteralType;
-import org.eclipse.jst.jsf.common.internal.types.IAssignable;
-import org.eclipse.jst.jsf.common.internal.types.LiteralType;
-import org.eclipse.jst.jsf.common.internal.types.TypeCoercer;
-import org.eclipse.jst.jsf.common.internal.types.TypeCoercionException;
-import org.eclipse.jst.jsf.common.internal.types.TypeConstants;
-import org.eclipse.jst.jsf.common.internal.types.TypeTransformer;
-import org.eclipse.jst.jsf.common.internal.types.ValueType;
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.validation.internal.el.diagnostics.DiagnosticFactory;
-
-
-/**
- * Super-class of all relational binary ops - "==", "!=", "<", ">", "<=", ">="
- * @author cbateman
- *
- */
-/*package*/ abstract class RelationalBinaryOperator extends BinaryOperator
-{
- private final String _jsfVersion;
-
- RelationalBinaryOperator(final DiagnosticFactory diagnosticFactory, final String jsfVersion)
- {
- super(diagnosticFactory);
- _jsfVersion = jsfVersion;
- }
-
- /**
- * @param firstArg
- * @param secondArg
- * @return the result of the operation
- */
- protected abstract boolean doRealOperation(Number firstArg, Number secondArg);
-
- /**
- * @param firstArg
- * @param secondArg
- * @return the result of the operation
- */
- protected abstract boolean doRealOperation(String firstArg, String secondArg);
-
- /**
- * @return the operation's user readable name
- */
- protected abstract String getOperationName();
-
- /**
- * Performs a the operation, casting both args to BigDecimal first
- *
- * @param firstArg
- * @param secondArg
- * @param numberType
- * @return the result of the comparison or null if indeterminate
- */
- protected ValueType handleNumericComparison(ValueType firstArg, ValueType secondArg, Class numberType)
- {
- try
- {
- TypeCoercer.coerceToNumber(TypeTransformer.transformBoxPrimitives(firstArg.getSignature()));
- TypeCoercer.coerceToNumber(TypeTransformer.transformBoxPrimitives(secondArg.getSignature()));
-
- Number firstValue = null;
- if (firstArg instanceof LiteralType)
- {
- firstValue = ((LiteralType)firstArg).coerceToNumber(numberType);
- }
-
- Number secondValue = null;
- if (secondArg instanceof LiteralType)
- {
- secondValue = ((LiteralType)secondArg).coerceToNumber(numberType);
- }
-
- if (firstValue != null && secondValue != null)
- {
- boolean result = doRealOperation(firstValue, secondValue);
-
- return result ? BooleanLiteralType.TRUE : BooleanLiteralType.FALSE;
- }
-
- // if we get to here, we only know that both can be up cast to BigDecimal
- // and compared. This will yield a boolean result
- // this value cannot be lhs
- return new ValueType(TypeConstants.TYPE_BOOLEAN, IAssignable.ASSIGNMENT_TYPE_RHS);
- }
- catch (TypeCoercionException tce)
- {
- // no valid coercion, so return null
- return null;
- }
- }
-
- /**
- * @param firstType
- * @param secondType
- * @param numberType
- * @return a diagnostic validating the relational comparison of firstType to secondType
- */
- protected Diagnostic validateNumericComparison(ValueType firstType, ValueType secondType, Class numberType)
- {
- try
- {
- TypeCoercer.coerceToNumber(TypeTransformer.transformBoxPrimitives(firstType.getSignature()));
- TypeCoercer.coerceToNumber(TypeTransformer.transformBoxPrimitives(secondType.getSignature()));
-
- Number firstValue = null;
- if (firstType instanceof LiteralType)
- {
- firstValue = ((LiteralType)firstType).coerceToNumber(numberType);
- }
-
- Number secondValue = null;
- if (secondType instanceof LiteralType)
- {
- secondValue = ((LiteralType)secondType).coerceToNumber(numberType);
- }
-
- if (firstValue != null && secondValue != null)
- {
- boolean result = doRealOperation(firstValue, secondValue);
-
- return _diagnosticFactory.
- create_BINARY_OP_CONSTANT_EXPRESSION_ALWAYS_EVAL_SAME
- (getOperationName(), Boolean.toString(result));
- }
-
- // if we get to here, we only know that both can be up cast to BigDecimal
- // and compared. This condition is okay
- return Diagnostic.OK_INSTANCE;
- }
- catch (TypeCoercionException tce)
- {
- // could not make numeric coercion for valid comparison
- return _diagnosticFactory.create_BINARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION(getOperationName());
- }
- }
-
- /**
- * @param firstType
- * @param secondType
- * @return the result of the operation
- */
- protected ValueType handleStringComparison(ValueType firstType, ValueType secondType)
- {
- String firstValue = null;
-
- if (firstType instanceof LiteralType)
- {
- firstValue = ((LiteralType)firstType).getLiteralValue();
- }
-
- String secondValue = null;
- if (secondType instanceof LiteralType)
- {
- secondValue = ((LiteralType)secondType).getLiteralValue();
- }
-
- if (firstValue != null && secondValue != null)
- {
- boolean newValue = doRealOperation(firstValue, secondValue);
- return newValue ? BooleanLiteralType.TRUE : BooleanLiteralType.FALSE;
- }
-
- // if don't have all literals, just return boolean type
- return new ValueType(TypeConstants.TYPE_BOOLEAN, IAssignable.ASSIGNMENT_TYPE_RHS);
- }
-
- /**
- * @param firstType
- * @param secondType
- * @return a diagnostic validating the string comparison of firstType to secondType
- */
- protected Diagnostic validateStringComparison(ValueType firstType, ValueType secondType)
- {
- String firstValue = null;
-
- if (firstType instanceof LiteralType)
- {
- firstValue = ((LiteralType)firstType).getLiteralValue();
- }
-
- String secondValue = null;
- if (secondType instanceof LiteralType)
- {
- secondValue = ((LiteralType)secondType).getLiteralValue();
- }
-
- if (firstValue != null && secondValue != null)
- {
- boolean newValue = doRealOperation(firstValue, secondValue);
- return _diagnosticFactory.
- create_BINARY_OP_CONSTANT_EXPRESSION_ALWAYS_EVAL_SAME
- (getOperationName(), Boolean.toString(newValue));
- }
-
- // if don't have all literals, just return boolean type
- return Diagnostic.OK_INSTANCE;
- }
-
-
- /**
- * @return the current JSF version string
- */
- protected final String getJsfVersion() {
- return _jsfVersion;
- }
-
- /**
- * @return true if the JSF version for this operator is JSF 1.1 or 1.0
- */
- protected final boolean isPreJSF12()
- {
- return IJSFCoreConstants.JSF_VERSION_1_1.equals(_jsfVersion)
- || IJSFCoreConstants.JSF_VERSION_1_0.equals(_jsfVersion);
- }
-
- /**
- * @return true if the JSF version for this operator is JSF 1.2 or later
- */
- protected final boolean isJSF12OrLater()
- {
- return !isPreJSF12();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/SubtractArithmeticBinaryOperator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/SubtractArithmeticBinaryOperator.java
deleted file mode 100644
index 2879cec..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/SubtractArithmeticBinaryOperator.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.validation.internal.el.operators;
-
-import java.math.BigDecimal;
-
-import org.eclipse.jst.jsf.validation.internal.el.diagnostics.DiagnosticFactory;
-
-/**
- * Represents the EL arithmetic subtraction binary operator
- *
- * @author cbateman
- *
- */
-/*package*/ class SubtractArithmeticBinaryOperator extends
- NoDivArithmeticBinaryOperator
-{
-
- private static final String SUBTRACTION = "subtraction";
-
- SubtractArithmeticBinaryOperator(DiagnosticFactory diagnosticFactory) {
- super(diagnosticFactory);
- }
-
- protected Long doRealOperation(Long firstArg, Long secondArg)
- {
- return Long.valueOf(firstArg.longValue() - secondArg.longValue());
- }
-
- protected Double doRealOperation(Double firstArg, Double secondArg)
- {
- return new Double(firstArg.doubleValue() - secondArg.doubleValue());
- }
-
- protected BigDecimal doRealOperation(BigDecimal firstArg,
- BigDecimal secondArg)
- {
- return firstArg.subtract(secondArg);
- }
-
- protected String getOperatorName()
- {
- return SUBTRACTION;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/TernaryChoiceOperator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/TernaryChoiceOperator.java
deleted file mode 100644
index c50d8ab..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/TernaryChoiceOperator.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.validation.internal.el.operators;
-
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.jst.jsf.common.internal.types.IAssignable;
-import org.eclipse.jst.jsf.common.internal.types.LiteralType;
-import org.eclipse.jst.jsf.common.internal.types.TypeCoercer;
-import org.eclipse.jst.jsf.common.internal.types.TypeCoercionException;
-import org.eclipse.jst.jsf.common.internal.types.TypeTransformer;
-import org.eclipse.jst.jsf.common.internal.types.ValueType;
-import org.eclipse.jst.jsf.validation.internal.el.diagnostics.DiagnosticFactory;
-
-/**
- * Represents the ternary choice op in EL: a ? b :c
- * Based on JSP.2.3.8
- *
- * @author cbateman
- *
- */
-public class TernaryChoiceOperator
-{
- private final DiagnosticFactory _diagnosticFactory;
-
-
- /**
- * @param diagnosticFactory
- */
- public TernaryChoiceOperator(DiagnosticFactory diagnosticFactory)
- {
- super();
- _diagnosticFactory = diagnosticFactory;
- }
-
- /**
- * @param choiceArg
- * @param whenTrueArg
- * @param whenFalseArg
- * @return the result of the choice arguments or null if indeterminant
- */
- public ValueType perform(ValueType choiceArg, ValueType whenTrueArg, ValueType whenFalseArg)
- {
- final boolean isChoiceBoolean =
- TypeCoercer.canCoerceToBoolean(TypeTransformer.transformBoxPrimitives(choiceArg.getSignature()));
-
- if (isChoiceBoolean)
- {
- if (choiceArg instanceof LiteralType)
- {
- try
- {
- Boolean result = ((LiteralType)choiceArg).coerceToBoolean();
-
- if (result != null)
- {
- return result.booleanValue() ? whenTrueArg : whenFalseArg;
- }
- }
- catch (TypeCoercionException tce)
- {
- return null;
- }
- }
-
- final String boxedWhenTrueArg =
- TypeTransformer.transformBoxPrimitives(whenTrueArg.getSignature());
-
- final String boxedWhenFalseArg =
- TypeTransformer.transformBoxPrimitives(whenFalseArg.getSignature());
- // check if the two results are the same type
- // TODO: could increase accuracy by appoximating type:i.e. if both
- // are numeric etc.
- if (boxedWhenTrueArg.equals(boxedWhenFalseArg))
- {
- return new ValueType(whenTrueArg, IAssignable.ASSIGNMENT_TYPE_RHS);
- }
-
- // otherwise, we have no idea what the resulting type is
- return null;
- }
-
- // if choice is not boolean, then can't resolve
- return null;
- }
-
- /**
- * @param choiceArg
- * @return a diagnostic validating the choice expr with these arguments
- */
- public Diagnostic validate(ValueType choiceArg)
- {
- final boolean isChoiceBoolean =
- TypeCoercer.canCoerceToBoolean(TypeTransformer.transformBoxPrimitives(choiceArg.getSignature()));
-
- if (isChoiceBoolean)
- {
- if (choiceArg instanceof LiteralType)
- {
- try
- {
- Boolean result = ((LiteralType)choiceArg).coerceToBoolean();
-
- if (result != null)
- {
- String whichSelected = result.booleanValue() ? "first" : "second";
- return _diagnosticFactory.
- create_TERNARY_OP_CHOICE_IS_ALWAYS_SAME
- (result.booleanValue(), whichSelected);
- }
- }
- catch (TypeCoercionException tce)
- {
- return _diagnosticFactory.
- create_TERNARY_OP_CANNOT_COERCE_CHOICE_TO_BOOLEAN();
- }
- }
-
- // in both the case where the two arguments are the same and when
- // they are different types, the best we can say is "OK", since
- // we really don't know
- return Diagnostic.OK_INSTANCE;
- }
-
- // if choice is not boolean, then can't resolve
- return _diagnosticFactory.
- create_TERNARY_OP_CANNOT_COERCE_CHOICE_TO_BOOLEAN();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/UnaryOperator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/UnaryOperator.java
deleted file mode 100644
index d6a0759..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/UnaryOperator.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.validation.internal.el.operators;
-
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.jst.jsf.common.internal.types.ValueType;
-import org.eclipse.jst.jsf.validation.internal.el.diagnostics.DiagnosticFactory;
-import org.eclipse.jst.jsp.core.internal.java.jspel.JSPELParserConstants;
-import org.eclipse.jst.jsp.core.internal.java.jspel.Token;
-
-/**
- * Encapsulates an EL unary operator
- * @author cbateman
- *
- */
-public abstract class UnaryOperator
-{
- /**
- * The common factory used to construct diagnostics
- */
- protected final DiagnosticFactory _diagnosticFactory;
-
- /**
- * @param token
- * @return true if the token is a unary operator
- */
- public static boolean isUnaryOperator(Token token)
- {
- return (token.kind == JSPELParserConstants.MINUS)
- || (token.kind == JSPELParserConstants.NOT1)
- || (token.kind == JSPELParserConstants.NOT2)
- || (token.kind == JSPELParserConstants.EMPTY);
- }
-
- /**
- * @param token
- * @param diagnosticFactory
- * @return a new UnaryOperator instance matching token
- */
- public static UnaryOperator createUnaryOperator(Token token, DiagnosticFactory diagnosticFactory)
- {
- if (!isUnaryOperator(token))
- {
- throw new IllegalArgumentException("token must be a unary operator");
- }
-
- switch(token.kind)
- {
- case JSPELParserConstants.MINUS:
- return new MinusUnaryOperator(diagnosticFactory);
-
- case JSPELParserConstants.NOT1:
- case JSPELParserConstants.NOT2:
- return new NotUnaryOperator(diagnosticFactory);
-
- case JSPELParserConstants.EMPTY:
- return new EmptyUnaryOperator(diagnosticFactory);
- }
-
- // should never get here because all four ops are covered
- throw new AssertionError();
- }
-
- /**
- * Constructor
- */
- UnaryOperator(DiagnosticFactory diagnosticFactory)
- {
- /* no construction or sub-classing outside package*/
- _diagnosticFactory = diagnosticFactory;
- }
-
- /**
- * If ValueType is a literal and the operation can be performed, then
- * the return must be a new LiteralType transformed using this operator.
- *
- * If ValueType is not a literal and the operaton can be performed, then
- * the return is a new ValueType transformed per the rules of the operator
- * (i.e. if it is a string type and the operator is "!", then the string
- * must be coerced to a boolean and this is what will be returned)
- *
- * If the operation cannot be performed on ValueType, return null
- *
- * @param type
- * @return a new value type after the operation is performed
- */
- public abstract ValueType performOperation(ValueType type);
-
-
- /**
- * @param type
- * @return a Diagnostic interpreting whether it is valid to perform the
- * operation on this type
- */
- public abstract Diagnostic validate(ValueType type);
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/messages.properties b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/messages.properties
deleted file mode 100644
index ae40823..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/el/operators/messages.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2007 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are 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:
-# Oracle Corporation - initial API and implementation
-###############################################################################
-EqualityRelationalBinaryOperator.FirstArgument=first
-EqualsBinaryRelationalOperator.OperationName=equals
-EqualityRelationalBinaryOperator.SecondArgument=second
-GreaterThanEqRelationalBinaryOperator.OperationName=greater than or equal to
-GreaterThanRelationalBinaryOperator.OperationName=greater than
-LessThanEqRelationalBinaryOperator.OperationName=less than or equal to
-LessThanRelationalBinaryOperator.OperationName=less than
-LtGtRelationalBinaryOperator.ConstantName.False=false
-NotEqualsBinaryRelationalOperator.OperationName=not equals
-BracketOperator.Name=bracket
-DotOperator.Name=dot
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/strategy/AttributeValidatingStrategy.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/strategy/AttributeValidatingStrategy.java
deleted file mode 100644
index f65e5e1..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/strategy/AttributeValidatingStrategy.java
+++ /dev/null
@@ -1,659 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.validation.internal.strategy;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.ISafeRunnable;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.SafeRunner;
-import org.eclipse.emf.common.util.BasicDiagnostic;
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jst.jsf.common.dom.AttrDOMAdapter;
-import org.eclipse.jst.jsf.common.dom.AttributeIdentifier;
-import org.eclipse.jst.jsf.common.dom.DOMAdapter;
-import org.eclipse.jst.jsf.common.internal.types.CompositeType;
-import org.eclipse.jst.jsf.common.internal.types.TypeComparator;
-import org.eclipse.jst.jsf.common.internal.types.TypeComparatorDiagnosticFactory;
-import org.eclipse.jst.jsf.common.runtime.internal.model.ViewObject;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentFactory;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ConverterDecorator;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ConverterTypeInfo;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContextFactory;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.core.internal.region.Region2AttrAdapter;
-import org.eclipse.jst.jsf.core.internal.region.Region2ElementAdapter;
-import org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigManager;
-import org.eclipse.jst.jsf.designtime.DTAppManagerUtil;
-import org.eclipse.jst.jsf.designtime.internal.view.DTUIViewRoot;
-import org.eclipse.jst.jsf.designtime.internal.view.IViewRootHandle;
-import org.eclipse.jst.jsf.designtime.internal.view.XMLViewDefnAdapter;
-import org.eclipse.jst.jsf.designtime.internal.view.XMLViewObjectMappingService;
-import org.eclipse.jst.jsf.designtime.internal.view.IDTViewHandler.ViewHandlerException;
-import org.eclipse.jst.jsf.designtime.internal.view.XMLViewDefnAdapter.DTELExpression;
-import org.eclipse.jst.jsf.designtime.internal.view.XMLViewObjectMappingService.ElementData;
-import org.eclipse.jst.jsf.facesconfig.emf.ConverterForClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.ConverterType;
-import org.eclipse.jst.jsf.metadataprocessors.MetaDataEnabledProcessingFactory;
-import org.eclipse.jst.jsf.metadataprocessors.features.ELIsNotValidException;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidationMessage;
-import org.eclipse.jst.jsf.validation.internal.AbstractXMLViewValidationStrategy;
-import org.eclipse.jst.jsf.validation.internal.JSFValidationContext;
-import org.eclipse.jst.jsf.validation.internal.el.ELExpressionValidator;
-import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionCollection;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-/**
- * An XML view validation strategy that validates
- *
- * @author cbateman
- *
- */
-public class AttributeValidatingStrategy extends
-AbstractXMLViewValidationStrategy
-{
- private static final String DISABLE_ALTERATIVE_TYPES_KEY = "jsfCoreDisableConverterValidation"; //$NON-NLS-1$
- static final boolean DEBUG;
- static
- {
- final String value = Platform
- .getDebugOption("org.eclipse.jst.jsf.validation.internal.el/debug/jspsemanticsvalidator"); //$NON-NLS-1$
- DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
- }
-
- /**
- * identifier
- */
- public final static String ID = "org.eclipse.jst.jsf.validation.strategy.AttributeValidatingStrategy"; //$NON-NLS-1$
- private final static String DISPLAY_NAME = "Attribute Validator"; //$NON-NLS-1$
-
- private final JSFValidationContext _validationContext;
- private final TypeComparator _typeComparator;
- private Set<String> _conversionTypes;
-
- /**
- * Default constructor
- *
- * @param validationContext
- */
- public AttributeValidatingStrategy(
- final JSFValidationContext validationContext)
- {
- super(ID, DISPLAY_NAME);
-
- _validationContext = validationContext;
- _typeComparator = new TypeComparator(
- new TypeComparatorDiagnosticFactory(validationContext
- .getPrefs().getTypeComparatorPrefs()));
- }
-
- @Override
- public boolean isInteresting(final DOMAdapter domAdapter)
- {
- return (domAdapter instanceof AttrDOMAdapter);
- }
-
- @Override
- public void validate(final DOMAdapter domAdapter)
- {
- if (domAdapter instanceof AttrDOMAdapter)
- {
- final Region2AttrAdapter attrAdapter = (Region2AttrAdapter) domAdapter;
- // check that this is attribute value region - 221722
- if (attrAdapter.getAttributeValueRegion() != null)
- {
- final IStructuredDocumentContext context = IStructuredDocumentContextFactory.INSTANCE
- .getContext(attrAdapter.getDocumentContext()
- .getStructuredDocument(), attrAdapter
- .getOwningElement().getDocumentContext()
- .getDocumentPosition()
- + attrAdapter.getAttributeValueRegion()
- .getStart());
-
- validateAttributeValue(context, attrAdapter);
- }
- }
- }
-
- /**
- * Validates the attribute value. Reports any problems to the reporter in
- * the JSFValidationContext.
- *
- * @param context
- * @param attrAdapter
- */
- private void validateAttributeValue(
- final IStructuredDocumentContext context,
- final Region2AttrAdapter attrAdapter)
- {
- // so of the code in run calls out into extension code or code
- // dependent on external data (meta-data)
- SafeRunner.run(new ISafeRunnable()
- {
- public void handleException(final Throwable exception)
- {
- JSFCorePlugin.log(String.format(
- "Error validating attribute: %s on element %s", //$NON-NLS-1$
- attrAdapter.getNodeName(), attrAdapter
- .getOwningElement().getNodeName()), exception);
- }
-
- public void run() throws Exception
- {
- final Region2ElementAdapter elementAdapter =
- attrAdapter.getOwningElement();
- // if there's elText then validate it
- // TODO: this approach will fail with mixed expressions
- if (!checkIfELAndValidate(elementAdapter, attrAdapter, context))
- {
- validateNonELAttributeValue(context, attrAdapter);
- }
- }
- });
- }
-
- private boolean checkIfELAndValidate(final Region2ElementAdapter elementAdapter,
- final Region2AttrAdapter attrAdapter,
- final IStructuredDocumentContext context)
- {
- int offsetOfFirstEL = -1;
- final String attrValue = attrAdapter.getValue();
-
- // TODO: should find and validate all
- offsetOfFirstEL = attrValue.indexOf('#');
-
- if (offsetOfFirstEL != -1 && offsetOfFirstEL < attrValue.length() - 1
- && attrValue.charAt(offsetOfFirstEL + 1) == '{')
- {
- offsetOfFirstEL += 2;
- }
- else
- {
- offsetOfFirstEL = -1;
- }
-
- final XMLViewDefnAdapter adapter = DTAppManagerUtil
- .getXMLViewDefnAdapter(context);
-
- boolean isEL = false;
- if (adapter != null && offsetOfFirstEL != -1)
- {
- try
- {
- // use the attribute's context plus the offset into the
- // whole attribute value to find where we think the el
- // expression starts. Add one since the attribute value
- // string returned by attrAdapter will have the value quotes
- // removed, but the region offsets include the quotes.
- IStructuredDocumentContext elContext = IStructuredDocumentContextFactory.INSTANCE
- .getContext(context.getStructuredDocument(), context
- .getDocumentPosition()
- + offsetOfFirstEL + 1);
- final DTELExpression elExpression = adapter
- .getELExpression(elContext);
- if (elExpression != null)
- {
- final String elText = elExpression.getText();
-
- if (DEBUG)
- {
- System.out.println(addDebugSpacer(3) + "EL attrVal= " //$NON-NLS-1$
- + elText);
- }
-
- elContext = elExpression.getDocumentContext();
- // EL validation is user configurable because
- // it can be computationally costly.
- if (_validationContext.shouldValidateEL())
- {
- // also, skip the validation if the expression is empty
- // or only whitespace, since the parser doesn't handle
- // it
- // anyway.
- if ("".equals(elText.trim())) //$NON-NLS-1$
- {
- final int offset = elContext.getDocumentPosition() - 1;
- final int length = elText.length() + 2;
- final Diagnostic diagnostic = _validationContext
- .getDiagnosticFactory()
- .create_EMPTY_EL_EXPRESSION();
- // detected empty EL expression
- if (_validationContext.shouldValidateEL())
- {
- _validationContext.getReporter().report(
- diagnostic, offset, length);
- }
- }
- else
- {
- final List elVals = MetaDataEnabledProcessingFactory
- .getInstance()
- .getAttributeValueRuntimeTypeFeatureProcessors(
- IValidELValues.class,
- elContext,
- attrAdapter
- .getAttributeIdentifier());
- final String safeELText = elText.replaceAll(
- "[\n\r\t]", " "); //$NON-NLS-1$ //$NON-NLS-2$
- validateELExpression(context, elContext, elVals,
- elementAdapter, attrAdapter, safeELText);
- isEL = true;
- }
- }
- }
- }
- catch (final ViewHandlerException e)
- {
- // fall through to return false
- }
- }
-
- // is el if we've already detected it or if the step 2 method
- // finds it. Run the method first to avoid short-circuiting
- final boolean isEL2 = checkIfELAndValidate2(attrAdapter, context);
-
- return isEL || isEL2;
- }
-
- /**
- * Checks the region to see if it contains an EL attribute value. If it
- * does, validates it
- *
- * @return true if validated EL, false otherwise
- */
- private boolean checkIfELAndValidate2(final Region2AttrAdapter attrAdapter,
- final IStructuredDocumentContext sDocContext)
- {
- final ITextRegion attrValueRegion = attrAdapter
- .getAttributeValueRegion();
- if (attrValueRegion instanceof ITextRegionCollection)
- {
- final ITextRegionCollection parentRegion = ((ITextRegionCollection) attrValueRegion);
- if (parentRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)
- {
- final ITextRegionList regionList = parentRegion.getRegions();
-
- if (regionList.size() >= 3)
- {
- final ITextRegion openQuote = regionList.get(0);
- final ITextRegion vblOpen = regionList.get(1);
-
- if ((openQuote.getType() == DOMJSPRegionContexts.XML_TAG_ATTRIBUTE_VALUE_DQUOTE || openQuote
- .getType() == DOMJSPRegionContexts.JSP_VBL_DQUOTE)
- && vblOpen.getType() == DOMJSPRegionContexts.JSP_VBL_OPEN)
- {
- boolean foundClosingQuote = false;
- for (int i = 2; !foundClosingQuote
- && i < regionList.size(); i++)
- {
- final ITextRegion searchRegion = regionList.get(i);
- if (searchRegion.getType() == DOMJSPRegionContexts.JSP_VBL_CLOSE)
- {
- foundClosingQuote = true;
- }
- }
-
- if (!foundClosingQuote
- && _validationContext.shouldValidateEL())
- {
- final int offset = sDocContext
- .getDocumentPosition() + 1;
- final int length = parentRegion.getText().length();
- final Diagnostic diagnostic = _validationContext
- .getDiagnosticFactory()
- .create_MISSING_CLOSING_EXPR_BRACKET();
- _validationContext.getReporter().report(diagnostic,
- offset, length);
- }
- return true;
- }
- }
- }
- }
- return false;
- }
-
- private void validateELExpression(final IStructuredDocumentContext context,
- final IStructuredDocumentContext elContext, final List elVals,
- final Region2ElementAdapter elementAdapter,
- final Region2AttrAdapter attrAdapter, final String elText)
- {
- // Call EL validator which will perform at least the syntactical
- // validation
- final ELExpressionValidator elValidator = new ELExpressionValidator(
- elContext, elText, _validationContext
- .getSymbolResolverFactory(), _validationContext
- .getReporter());
- elValidator.validateXMLNode();
-
- final CompositeType exprType = elValidator.getExpressionType();
- if (exprType != null)
- {
- for (final Iterator it = elVals.iterator(); it.hasNext();)
- {
- final IValidELValues elval = (IValidELValues) it.next();
- final String attributeVal = attrAdapter.getValue();
- CompositeType expectedType;
- Diagnostic status = null;
- try
- {
- expectedType = elval.getExpectedRuntimeType();
-
- if (expectedType != null)
- {
- expectedType = maybeAddAlternativeTypes(
- expectedType, exprType, elementAdapter,
- attrAdapter);
- status = _typeComparator.calculateTypeCompatibility(
- expectedType, exprType);
- if (status.getSeverity() != Diagnostic.OK)
- {
- reportValidationMessage(status, context,
- attributeVal);
- }
- }
- }
- catch (final ELIsNotValidException e)
- {
- reportValidationMessage(createValidationMessage(context,
- attributeVal, IStatus.WARNING, e.getMessage(),
- _validationContext.getFile()), context,
- attributeVal);
- }
- }
- }
- }
-
- private boolean disableAlternativeTypes()
- {
- String res = System.getProperty(DISABLE_ALTERATIVE_TYPES_KEY);
- if (res == null) {
- //check env var also
- res = System.getenv(DISABLE_ALTERATIVE_TYPES_KEY);
- }
- if (res != null)
- {
- return true;
- }
- final IPreferenceStore prefStore = JSFCorePlugin.getDefault().getPreferenceStore();
- return prefStore.getBoolean("org.eclipse.jst.jsf.core."+DISABLE_ALTERATIVE_TYPES_KEY); //$NON-NLS-1$
- }
- /**
- * @return true if alternative type comparison (i.e. post-conversion) passes
- */
- private CompositeType maybeAddAlternativeTypes(
- final CompositeType expectedType,
- final CompositeType exprTypes,
- final Region2ElementAdapter elementAdapter,
- final Region2AttrAdapter attrAdapter)
- {
- if (disableAlternativeTypes())
- {
- return expectedType;
- }
-
- final IStructuredDocumentContext context = elementAdapter
- .getDocumentContext();
- final IViewRootHandle viewRootHandle = DTAppManagerUtil
- .getViewRootHandle(context);
- if (viewRootHandle != null)
- {
- // ok to call update view root here since validation not called
- // on the UI thread.
- final DTUIViewRoot viewRoot = viewRootHandle.updateViewRoot();
- final IAdaptable serviceAdaptable = viewRoot.getServices();
- final XMLViewObjectMappingService mappingService = (XMLViewObjectMappingService) serviceAdaptable
- .getAdapter(XMLViewObjectMappingService.class);
- if (mappingService != null)
- {
- final ElementData elementData = XMLViewObjectMappingService
- .createElementData(elementAdapter.getNamespace(),
- elementAdapter.getLocalName(), context,
- Collections.EMPTY_MAP);
- final ViewObject viewObject = mappingService
- .findViewObject(elementData);
- // if the corresponding view object is a valueholder, then
- // we need to see if you think there a valid conversion
- // available
- if (viewObject instanceof ComponentInfo
- && ((ComponentInfo) viewObject).getComponentTypeInfo() != null
- && ((ComponentInfo) viewObject).getComponentTypeInfo()
- .isInstanceOf(
- ComponentFactory.INTERFACE_VALUEHOLDER))
- {
- final ComponentInfo component = (ComponentInfo) viewObject;
- // get the original elementData
- final ElementData mappedElementData = mappingService
- .findElementData(component);
- final String propName = mappedElementData
- .getPropertyName(attrAdapter.getLocalName());
- if ("value".equals(propName)) //$NON-NLS-1$
- {
- // final List converters =
- // component.getDecorators(ComponentFactory.CONVERTER);
-
- // (ConverterDecorator) it.next();
- return createCompositeType(
- expectedType,
- exprTypes,
- component
- .getDecorators(ComponentFactory.CONVERTER));
- }
- }
- }
- }
- // don't add anything by default
- return expectedType;
- }
-
- private CompositeType createCompositeType(final CompositeType initialTypes,
- final CompositeType testTypes, final List<ConverterDecorator> decorators)
- {
- // indicates unknown converter
- final Set<String> types = new HashSet(Arrays.asList(initialTypes
- .getSignatures()));
- // look for converters. If there's one where we don't know the type,
- // simply copy over the testTypes to force validation to ignore, since
- // we have no idea.
- for (final ConverterDecorator decorator : decorators)
- {
- if (decorator.getTypeInfo() != null)
- {
- final ConverterTypeInfo converterTypeInfo = decorator.getTypeInfo();
- if (converterTypeInfo.getForClass().length == 0)
- {
- types.addAll(Arrays.asList(testTypes.getSignatures()));
- break;
- }
- types.addAll(createSignatures(converterTypeInfo.getForClass()));
- }
- }
- types.addAll(getRegisteredConversionTypesByClass());
- return new CompositeType(types.toArray(new String[0])
- , initialTypes.getAssignmentTypeMask());
- }
-
- private Set<String> getRegisteredConversionTypesByClass()
- {
- if (_conversionTypes == null)
- {
- _conversionTypes = new HashSet<String>();
- final IProject project = _validationContext.getFile().getProject();
- final JSFAppConfigManager appConfig = JSFAppConfigManager.getInstance(project);
- final List converters = appConfig.getConverters();
- for (final Iterator it = converters.iterator(); it.hasNext();)
- {
- final ConverterType converterType = (ConverterType) it.next();
- final ConverterForClassType forClassType = converterType.getConverterForClass();
- if (forClassType != null)
- {
- final String forClass = forClassType.getTextContent();
- if (forClass != null)
- {
- String signature = forClass.trim();
- try
- {
- signature = Signature.createTypeSignature(signature, true);
- _conversionTypes.add(signature);
- }
- catch (final Exception e)
- {
- JSFCorePlugin.log(IStatus.INFO, "Could not use registered converter for-class: "+forClass); //$NON-NLS-1$
- }
- }
- }
- }
- }
- return _conversionTypes;
- }
-
- private List<String> createSignatures(final String[] classNames)
- {
- final List<String> signatures = new ArrayList<String>();
- for (final String className : classNames)
- {
- try
- {
- String signature = Signature.createTypeSignature(className, true);
- signatures.add(signature);
- }
- catch (final Exception e)
- {
- JSFCorePlugin.log(e, "Trying to create signature"); //$NON-NLS-1$
- }
- }
- return signatures;
- }
-
- /**
- * Validates an attribute value in context using the JSF metadata processing
- * framework
- *
- * @param context
- * @param region
- * @param uri
- * @param tagName
- * @param attrName
- * @param attributeVal
- * @param reporter
- * @param file
- */
- private void validateNonELAttributeValue(
- final IStructuredDocumentContext context,
- final Region2AttrAdapter attrAdapter)
- {
- final String attributeValue = attrAdapter.getValue();
- // else validate as static attribute value
- if (DEBUG)
- {
- System.out.println(addDebugSpacer(3) + "attrVal= " //$NON-NLS-1$
- + (attributeValue != null ? attributeValue : "null")); //$NON-NLS-1$
- }
-
- final AttributeIdentifier attributeId = attrAdapter
- .getAttributeIdentifier();
-
- if (attributeId.getTagIdentifier() == null
- || attributeId.getTagIdentifier().getTagName() == null
- || attributeId.getName() == null)
- {
- return;
- }
-
- final List vv = MetaDataEnabledProcessingFactory.getInstance()
- .getAttributeValueRuntimeTypeFeatureProcessors(
- IValidValues.class, context, attributeId);
- if (!vv.isEmpty())
- {
- for (final Iterator it = vv.iterator(); it.hasNext();)
- {
- final IValidValues v = (IValidValues) it.next();
- if (!v.isValidValue(attributeValue.trim()))
- {
- if (DEBUG)
- {
- System.out.println(addDebugSpacer(4) + "NOT VALID "); //$NON-NLS-1$
- }
-
- for (final Iterator msgs = v.getValidationMessages()
- .iterator(); msgs.hasNext();)
- {
- final IValidationMessage msg = (IValidationMessage) msgs
- .next();
- reportValidationMessage(createValidationMessage(
- context, attributeValue, msg.getSeverity(), msg
- .getMessage(), _validationContext
- .getFile()), context, attributeValue);
- }
- }
- else if (DEBUG)
- {
- System.out.println(addDebugSpacer(5) + "VALID "); //$NON-NLS-1$
- }
- }
- }
- else if (DEBUG)
- {
- System.out.println(addDebugSpacer(4) + "NO META DATA "); //$NON-NLS-1$
- }
- }
-
- private void reportValidationMessage(final Diagnostic problem,
- final IStructuredDocumentContext context,
- final String attributeValue)
- {
- final int start = context.getDocumentPosition() + 1;
- final int length = attributeValue.length();
- _validationContext.getReporter().report(problem, start, length);
- }
-
- private Diagnostic createValidationMessage(
- final IStructuredDocumentContext context,
- final String attributeValue, final int severity, final String msg,
- final IFile file)
- {
- // TODO: need factory
- final Diagnostic diagnostic = new BasicDiagnostic(severity, "", -1, //$NON-NLS-1$
- msg, null);
- return diagnostic;
- }
-
- private String addDebugSpacer(final int count)
- {
- final String TAB = "\t"; //$NON-NLS-1$
- final StringBuffer ret = new StringBuffer(""); //$NON-NLS-1$
- for (int i = 0; i <= count; i++)
- {
- ret.append(TAB);
- }
- return ret.toString();
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/strategy/ContainmentValidatingStrategy.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/strategy/ContainmentValidatingStrategy.java
deleted file mode 100644
index 2a70394..0000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/strategy/ContainmentValidatingStrategy.java
+++ /dev/null
@@ -1,228 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.validation.internal.strategy;
-
-import java.text.MessageFormat;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.util.BasicDiagnostic;
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.jst.jsf.common.dom.DOMAdapter;
-import org.eclipse.jst.jsf.common.dom.TagIdentifier;
-import org.eclipse.jst.jsf.common.internal.JSPUtil;
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.query.ITaglibDomainMetaDataModelContext;
-import org.eclipse.jst.jsf.common.metadata.query.TaglibDomainMetaDataQueryHelper;
-import org.eclipse.jst.jsf.common.sets.AxiomaticSet;
-import org.eclipse.jst.jsf.common.sets.ConcreteAxiomaticSet;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IDOMContextResolver;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.core.internal.region.Region2ElementAdapter;
-import org.eclipse.jst.jsf.core.internal.tld.TagIdentifierFactory;
-import org.eclipse.jst.jsf.core.set.constraint.MemberConstraint;
-import org.eclipse.jst.jsf.core.set.mapping.ElementToTagIdentifierMapping;
-import org.eclipse.jst.jsf.core.tagmatcher.EvaluationException;
-import org.eclipse.jst.jsf.core.tagmatcher.InvalidExpressionException;
-import org.eclipse.jst.jsf.core.tagmatcher.XPathMatchingAlgorithm;
-import org.eclipse.jst.jsf.validation.internal.AbstractXMLViewValidationStrategy;
-import org.eclipse.jst.jsf.validation.internal.JSFValidationContext;
-import org.eclipse.jst.jsf.validation.internal.constraints.ContainsTagConstraint;
-import org.eclipse.jst.jsf.validation.internal.constraints.TagId;
-import org.eclipse.jst.jsf.validation.internal.constraints.TagSet;
-import org.w3c.dom.Node;
-
-/**
- * @author cbateman
- *
- */
-public class ContainmentValidatingStrategy extends
- AbstractXMLViewValidationStrategy
-{
- /**
- * identifier
- */
- public final static String ID =
- "org.eclipse.jst.jsf.validation.strategy.ElementValidatingStrategy";
- private final static String DISPLAY_NAME =
- "Tag Containment Validator";
- private final static ElementToTagIdentifierMapping elem2TagIdMapper =
- new ElementToTagIdentifierMapping();
- private int _containmentValidationCount; // = 0;
- private final JSFValidationContext _jsfValidationContext;
-
- /**
- * @param jsfValidationContext
- */
- public ContainmentValidatingStrategy(
- final JSFValidationContext jsfValidationContext)
- {
- super(ID, DISPLAY_NAME);
- _jsfValidationContext = jsfValidationContext;
- }
-
- @Override
- public boolean isInteresting(DOMAdapter domAdapter)
- {
- return domAdapter instanceof Region2ElementAdapter;
- }
-
- @Override
- public void validate(DOMAdapter domAdapter)
- {
- if (domAdapter instanceof Region2ElementAdapter)
- {
- final Region2ElementAdapter elementAdapter =
- (Region2ElementAdapter) domAdapter;
- validateContainment(elementAdapter, _jsfValidationContext);
- }
- }
-
- private void validateContainment(
- final Region2ElementAdapter elementAdapter,
- final JSFValidationContext jsfValidationContext)
- {
- // don't validate JSP fragments since the necessary containment may
- // existing
- // in the JSP files that include them
- // also only validate the first instance of containment violation in a
- // file
- if (JSPUtil.isJSPFragment(jsfValidationContext.getFile())
- || _containmentValidationCount > 0)
- {
- return;
- }
-
- final IStructuredDocumentContext context = elementAdapter
- .getDocumentContext();
- final IDOMContextResolver resolver = IStructuredDocumentContextResolverFactory.INSTANCE
- .getDOMContextResolver(context);
- final Node node = resolver.getNode();
-
- final String uri = elementAdapter.getNamespace();
- final String tagName = elementAdapter.getLocalName();
- // final Element node = elementAdapter.
-
- final ITaglibDomainMetaDataModelContext modelContext = TaglibDomainMetaDataQueryHelper
- .createMetaDataModelContext(jsfValidationContext.getFile()
- .getProject(), uri);
- final Entity entity = TaglibDomainMetaDataQueryHelper.getEntity(
- modelContext, tagName);
- if (entity != null)
- {
- final Trait trait = TaglibDomainMetaDataQueryHelper.getTrait(
- entity, "containment-constraint");
-
- if (trait != null)
- {
- final ContainsTagConstraint tagConstraint = (ContainsTagConstraint) trait
- .getValue();
-
- final String algorithm = tagConstraint.getSetGenerator()
- .getAlgorithm();
-
- // TODO: need generalized factory mechanism for registering and
- // constructing algorithms.
- if (!"xpath".equals(algorithm))
- {
- return;
- }
-
- final String expr = tagConstraint.getSetGenerator()
- .getExpression();
-
- // TODO: optimize on the expression and cache for reuse
- final XPathMatchingAlgorithm xpathAlg = new XPathMatchingAlgorithm(
- expr);
-
- AxiomaticSet set = null;
-
- try
- {
- set = xpathAlg.evaluate(node);
- // map dom nodes to tag identifiers
- set = elem2TagIdMapper.map(set);
- }
- catch (final InvalidExpressionException e)
- {
- JSFCorePlugin.log(e, "Problem with expression: " + expr
- + " on node " + node);
- return;
- }
- catch (final EvaluationException e)
- {
- JSFCorePlugin.log(e, "Problem evaluating expression: "
- + expr + " on node " + node);
- return;
- }
-
- final TagSet constraintData = tagConstraint.getSatisfiesSet();
- final AxiomaticSet constraintSet = new ConcreteAxiomaticSet();
- for (final Iterator it = constraintData.getTags().iterator(); it
- .hasNext();)
- {
- final TagId tagId = (TagId) it.next();
- constraintSet.add(TagIdentifierFactory.createJSPTagWrapper(
- tagId.getUri(), tagId.getName()));
- }
- final MemberConstraint memberConstraint = new MemberConstraint(
- constraintSet);
- final Diagnostic diag = memberConstraint.isSatisfied(set);
-
- if (diag.getSeverity() != Diagnostic.OK)
- {
- _containmentValidationCount++; // found a violation
-
- final List data = diag.getData();
-
- for (final Iterator it = data.iterator(); it.hasNext();)
- {
- final TagIdentifier missingParent = (TagIdentifier) it
- .next();
-
- reportContainmentProblem(context, node.getNodeName(),
- Diagnostic.WARNING,
- missingParent.getTagName(), missingParent
- .getUri());
- }
- }
- }
- }
- }
-
- private static final String MESSAGE_PATTERN =
- "Tag {0} is missing required parent tag \"{1}\" ({2})";
-
- // TODO: need a diagnostic factory
- private void reportContainmentProblem(
- final IStructuredDocumentContext context,
- final String nodeName, final int severity,
- final String tagName, final String uri)
- {
-
- final String msg = MessageFormat.format(
- MESSAGE_PATTERN, new Object[]
- {nodeName, tagName, uri});
-
- final Diagnostic problem =
- new BasicDiagnostic(severity, "", -1, msg, null);
- // add one so that the start offset is at the node name, rather
- // than the opening brace.
- final int start = context.getDocumentPosition()+1;
- final int length = nodeName.length();
-
- _jsfValidationContext.getReporter().report(problem, start, length);
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/.classpath b/jsf/plugins/org.eclipse.jst.pagedesigner/.classpath
deleted file mode 100644
index 472ee29..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/.cvsignore b/jsf/plugins/org.eclipse.jst.pagedesigner/.cvsignore
deleted file mode 100644
index f9eb27a..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-build.xml
-@dot
-javaCompiler...args
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/.project b/jsf/plugins/org.eclipse.jst.pagedesigner/.project
deleted file mode 100644
index 290ca26..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/.project
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.pagedesigner</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.jem.beaninfo.BeanInfoNature</nature>
- </natures>
-</projectDescription>
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/.settings/org.eclipse.core.resources.prefs b/jsf/plugins/org.eclipse.jst.pagedesigner/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index f2dd42a..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 16:04:56 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/.settings/org.eclipse.jdt.core.prefs b/jsf/plugins/org.eclipse.jst.pagedesigner/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index fc050cb..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,81 +0,0 @@
-#Fri Dec 14 11:18:54 PST 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullReference=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=error
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=error
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/.settings/org.eclipse.jdt.ui.prefs b/jsf/plugins/org.eclipse.jst.pagedesigner/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index 82eb6c1..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Fri Apr 06 18:25:15 PDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates/>
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/.settings/org.eclipse.pde.prefs b/jsf/plugins/org.eclipse.jst.pagedesigner/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index 6a74a22..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,22 +0,0 @@
-#Fri May 30 11:58:12 PDT 2008
-compilers.f.unresolved-features=1
-compilers.f.unresolved-plugins=1
-compilers.incompatible-environment=1
-compilers.p.build=1
-compilers.p.deprecated=1
-compilers.p.discouraged-class=1
-compilers.p.internal=1
-compilers.p.missing-packages=0
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=0
-compilers.p.unknown-attribute=1
-compilers.p.unknown-class=1
-compilers.p.unknown-element=1
-compilers.p.unknown-identifier=1
-compilers.p.unknown-resource=1
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.s.create-docs=false
-compilers.s.doc-folder=doc
-compilers.s.open-tags=1
-eclipse.preferences.version=1
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/META-INF/MANIFEST.MF b/jsf/plugins/org.eclipse.jst.pagedesigner/META-INF/MANIFEST.MF
deleted file mode 100644
index e6b7e26..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,125 +0,0 @@
-Manifest-Version: 1.0
-Bundle-SymbolicName: org.eclipse.jst.pagedesigner;singleton:=true
-Bundle-Name: %pluginName
-Bundle-Version: 1.1.0.qualifier
-Bundle-Activator: org.eclipse.jst.pagedesigner.PDPlugin
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.debug.ui;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.emf.ecore;bundle-version="[2.2.0,3.0.0)",
- org.eclipse.gef;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.jface.text;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.ui.workbench.texteditor;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.wst.common.ui;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.common.uriresolver;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.sse.ui;bundle-version="[1.0.101,1.2.0)",
- org.eclipse.jst.j2ee;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.jst.jsp.core;bundle-version="[1.1.0,1.3.0)",
- org.eclipse.jst.jsp.ui;bundle-version="[1.1.0,1.3.0)",
- org.eclipse.jst.j2ee.web;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.jst.pagedesigner.jsp.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jst.jsf.common.ui;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.ui.ide;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.jdt.ui;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.jst.jsf.common;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jst.jsf.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.wst.html.ui;bundle-version="[1.0.100,1.1.0)",
- org.eclipse.wst.css.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.html.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.xml.ui;bundle-version="[1.0.100,1.1.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.0,1.2.0)",
- javax.servlet;bundle-version="[2.4.0,3.0.0)",
- org.apache.commons.el;bundle-version="[1.0.0,2.0.0)",
- javax.servlet.jsp;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.ui.views.properties.tabbed;bundle-version="[3.2.0,4.0.0)"
-Bundle-ActivationPolicy: lazy
-Bundle-ManifestVersion: 2
-Export-Package: org.eclipse.jst.pagedesigner;x-internal:=true,
- org.eclipse.jst.pagedesigner.actions.container;x-internal:=true,
- org.eclipse.jst.pagedesigner.actions.link;x-internal:=true,
- org.eclipse.jst.pagedesigner.actions.menuextension;x-internal:=true,
- org.eclipse.jst.pagedesigner.actions.range;x-internal:=true,
- org.eclipse.jst.pagedesigner.actions.single;x-internal:=true,
- org.eclipse.jst.pagedesigner.actions.table;x-internal:=true,
- org.eclipse.jst.pagedesigner.adapters;x-internal:=true,
- org.eclipse.jst.pagedesigner.adapters.internal;x-internal:=true,
- org.eclipse.jst.pagedesigner.commands;x-internal:=true,
- org.eclipse.jst.pagedesigner.commands.html;x-internal:=true,
- org.eclipse.jst.pagedesigner.commands.nav;x-internal:=true,
- org.eclipse.jst.pagedesigner.commands.range;x-internal:=true,
- org.eclipse.jst.pagedesigner.commands.single;x-internal:=true,
- org.eclipse.jst.pagedesigner.converter,
- org.eclipse.jst.pagedesigner.converter.html;x-internal:=true,
- org.eclipse.jst.pagedesigner.converter.jsp;x-internal:=true,
- org.eclipse.jst.pagedesigner.css2;x-internal:=true,
- org.eclipse.jst.pagedesigner.css2.border;x-internal:=true,
- org.eclipse.jst.pagedesigner.css2.color;x-internal:=true,
- org.eclipse.jst.pagedesigner.css2.font;x-internal:=true,
- org.eclipse.jst.pagedesigner.css2.layout;x-internal:=true,
- org.eclipse.jst.pagedesigner.css2.layout.table;x-internal:=true,
- org.eclipse.jst.pagedesigner.css2.list;x-internal:=true,
- org.eclipse.jst.pagedesigner.css2.marker;x-internal:=true,
- org.eclipse.jst.pagedesigner.css2.property;x-internal:=true,
- org.eclipse.jst.pagedesigner.css2.provider;x-internal:=true,
- org.eclipse.jst.pagedesigner.css2.style;x-internal:=true,
- org.eclipse.jst.pagedesigner.css2.value;x-internal:=true,
- org.eclipse.jst.pagedesigner.css2.widget;x-internal:=true,
- org.eclipse.jst.pagedesigner.dnd;x-internal:=true,
- org.eclipse.jst.pagedesigner.dnd.internal;x-internal:=true,
- org.eclipse.jst.pagedesigner.dom;x-internal:=true,
- org.eclipse.jst.pagedesigner.dom.html;x-internal:=true,
- org.eclipse.jst.pagedesigner.dtmanager,
- org.eclipse.jst.pagedesigner.dtmanager.converter,
- org.eclipse.jst.pagedesigner.dtmanager.converter.internal;x-friends:="org.eclipse.jst.pagedesigner.jsf.ui",
- org.eclipse.jst.pagedesigner.dtmanager.converter.operations,
- org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal;x-friends:="org.eclipse.jst.pagedesigner.tests",
- org.eclipse.jst.pagedesigner.dtmanager.dtinfo,
- org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl;x-internal:=true,
- org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.util;x-internal:=true,
- org.eclipse.jst.pagedesigner.editors;x-internal:=true,
- org.eclipse.jst.pagedesigner.editors.actions;x-internal:=true,
- org.eclipse.jst.pagedesigner.editors.pagedesigner;x-internal:=true,
- org.eclipse.jst.pagedesigner.editors.palette;x-internal:=true,
- org.eclipse.jst.pagedesigner.editors.palette.impl;x-internal:=true,
- org.eclipse.jst.pagedesigner.editors.properties,
- org.eclipse.jst.pagedesigner.editors.properties.internal;x-internal:=true,
- org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections,
- org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.internal.impl;x-internal:=true,
- org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.internal.util;x-internal:=true,
- org.eclipse.jst.pagedesigner.editpolicies;x-internal:=true,
- org.eclipse.jst.pagedesigner.elementedit;x-internal:=true,
- org.eclipse.jst.pagedesigner.elementedit.html;x-internal:=true,
- org.eclipse.jst.pagedesigner.elementedit.jsp;x-internal:=true,
- org.eclipse.jst.pagedesigner.extensionpoint,
- org.eclipse.jst.pagedesigner.figurehandler;x-internal:=true,
- org.eclipse.jst.pagedesigner.itemcreation;x-internal:=true,
- org.eclipse.jst.pagedesigner.itemcreation.command;x-internal:=true,
- org.eclipse.jst.pagedesigner.itemcreation.customizer;x-internal:=true,
- org.eclipse.jst.pagedesigner.itemcreation.internal;x-internal:=true,
- org.eclipse.jst.pagedesigner.meta;x-internal:=true,
- org.eclipse.jst.pagedesigner.meta.internal;x-internal:=true,
- org.eclipse.jst.pagedesigner.parts;x-internal:=true,
- org.eclipse.jst.pagedesigner.preview;x-internal:=true,
- org.eclipse.jst.pagedesigner.properties;x-friends:="org.eclipse.jst.pagedesigner.tests",
- org.eclipse.jst.pagedesigner.properties.attrgroup;x-friends:="org.eclipse.jst.pagedesigner.tests",
- org.eclipse.jst.pagedesigner.properties.celleditors;x-friends:="org.eclipse.jst.pagedesigner.tests",
- org.eclipse.jst.pagedesigner.properties.dialogfields;x-internal:=true,
- org.eclipse.jst.pagedesigner.properties.internal;x-friends:="org.eclipse.jst.pagedesigner.tests",
- org.eclipse.jst.pagedesigner.range;x-internal:=true,
- org.eclipse.jst.pagedesigner.requests;x-internal:=true,
- org.eclipse.jst.pagedesigner.tableedit;x-internal:=true,
- org.eclipse.jst.pagedesigner.tools;x-internal:=true,
- org.eclipse.jst.pagedesigner.ui.common;x-internal:=true,
- org.eclipse.jst.pagedesigner.ui.common.sash;x-internal:=true,
- org.eclipse.jst.pagedesigner.ui.dialogfields;x-internal:=true,
- org.eclipse.jst.pagedesigner.ui.dialogs;x-internal:=true,
- org.eclipse.jst.pagedesigner.utils;x-internal:=true,
- org.eclipse.jst.pagedesigner.validation.caret;x-internal:=true,
- org.eclipse.jst.pagedesigner.viewer;x-internal:=true
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-
-
-
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/about.html b/jsf/plugins/org.eclipse.jst.pagedesigner/about.html
deleted file mode 100644
index 90bd74d..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/about.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June, 2008</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-</body>
-</html>
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/build.properties b/jsf/plugins/org.eclipse.jst.pagedesigner/build.properties
deleted file mode 100644
index a18d5dc..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/build.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2008 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are 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:
-# Oracle Corporation - initial API and implementation
-###############################################################################
-jars.compile.order = .
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- icons/,\
- plugin.properties,\
- plugin.xml,\
- schema/,\
- about.html,\
- default.properties
-javacSource=1.5
-javacTarget=1.5
\ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/default.properties b/jsf/plugins/org.eclipse.jst.pagedesigner/default.properties
deleted file mode 100644
index d6297e4..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/default.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2007 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are 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:
-# Oracle Corporation - initial API and implementation
-###############################################################################
-# This file contains all the Default Preference Settings
-
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/LineBreak.gif b/jsf/plugins/org.eclipse.jst.pagedesigner/icons/LineBreak.gif
deleted file mode 100644
index b468685..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/LineBreak.gif
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/MoveHandle.png b/jsf/plugins/org.eclipse.jst.pagedesigner/icons/MoveHandle.png
deleted file mode 100644
index 679ef99..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/MoveHandle.png
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Binding.gif b/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Binding.gif
deleted file mode 100644
index 6638a99..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Binding.gif
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Binding_disabled.gif b/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Binding_disabled.gif
deleted file mode 100644
index c5064fd..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Binding_disabled.gif
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Plugin.gif b/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Plugin.gif
deleted file mode 100644
index 471b1b5..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Plugin.gif
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_bold.gif b/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_bold.gif
deleted file mode 100644
index f814851..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_bold.gif
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_bold_disabled.gif b/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_bold_disabled.gif
deleted file mode 100644
index 639de46..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_bold_disabled.gif
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_designer.gif b/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_designer.gif
deleted file mode 100644
index fdfcae0..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_designer.gif
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_hsplit.gif b/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_hsplit.gif
deleted file mode 100644
index 4dae95d..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_hsplit.gif
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_italic.gif b/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_italic.gif
deleted file mode 100644
index fb765fe..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_italic.gif
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_italic_disabled.gif b/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_italic_disabled.gif
deleted file mode 100644
index 7475315..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_italic_disabled.gif
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_largefont.gif b/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_largefont.gif
deleted file mode 100644
index 39afd38..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_largefont.gif
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_largefont_disabled.gif b/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_largefont_disabled.gif
deleted file mode 100644
index fe38ccb..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_largefont_disabled.gif
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_paragraph.gif b/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_paragraph.gif
deleted file mode 100644
index b129090..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_paragraph.gif
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_smallfont.gif b/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_smallfont.gif
deleted file mode 100644
index f0b4eba..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_smallfont.gif
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_smallfont_disabled.gif b/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_smallfont_disabled.gif
deleted file mode 100644
index c02528a..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_smallfont_disabled.gif
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_source.gif b/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_source.gif
deleted file mode 100644
index 86986df..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_source.gif
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_underline.gif b/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_underline.gif
deleted file mode 100644
index b8ac977..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_underline.gif
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_underline_disabled.gif b/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_underline_disabled.gif
deleted file mode 100644
index f06517b..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_underline_disabled.gif
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_vsplit.gif b/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_vsplit.gif
deleted file mode 100644
index 6564d07..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_Toolbar_vsplit.gif
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_nopic.jpg b/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_nopic.jpg
deleted file mode 100644
index f98b233..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/PD_nopic.jpg
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/newsuade_wiz.gif b/jsf/plugins/org.eclipse.jst.pagedesigner/icons/newsuade_wiz.gif
deleted file mode 100644
index ecd75f4..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/newsuade_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/palette/GENERIC/large/PD_Palette_Default.gif b/jsf/plugins/org.eclipse.jst.pagedesigner/icons/palette/GENERIC/large/PD_Palette_Default.gif
deleted file mode 100644
index a320fcb..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/palette/GENERIC/large/PD_Palette_Default.gif
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/palette/GENERIC/small/PD_Palette_Default.gif b/jsf/plugins/org.eclipse.jst.pagedesigner/icons/palette/GENERIC/small/PD_Palette_Default.gif
deleted file mode 100644
index 5e7fb33..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/palette/GENERIC/small/PD_Palette_Default.gif
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/palette/GENERIC/small/PD_Palette_Export.gif b/jsf/plugins/org.eclipse.jst.pagedesigner/icons/palette/GENERIC/small/PD_Palette_Export.gif
deleted file mode 100644
index 095beb0..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/palette/GENERIC/small/PD_Palette_Export.gif
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/palette/GENERIC/small/PD_Palette_Export_Disabled.gif b/jsf/plugins/org.eclipse.jst.pagedesigner/icons/palette/GENERIC/small/PD_Palette_Export_Disabled.gif
deleted file mode 100644
index 04800a6..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/palette/GENERIC/small/PD_Palette_Export_Disabled.gif
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/palette/GENERIC/small/PD_Palette_Export_Hover.gif b/jsf/plugins/org.eclipse.jst.pagedesigner/icons/palette/GENERIC/small/PD_Palette_Export_Hover.gif
deleted file mode 100644
index 095beb0..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/palette/GENERIC/small/PD_Palette_Export_Hover.gif
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/palette/GENERIC/small/PD_Palette_Import.gif b/jsf/plugins/org.eclipse.jst.pagedesigner/icons/palette/GENERIC/small/PD_Palette_Import.gif
deleted file mode 100644
index 0af6903..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/palette/GENERIC/small/PD_Palette_Import.gif
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/palette/GENERIC/small/PD_Palette_Import_Disabled.gif b/jsf/plugins/org.eclipse.jst.pagedesigner/icons/palette/GENERIC/small/PD_Palette_Import_Disabled.gif
deleted file mode 100644
index 5c828d4..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/palette/GENERIC/small/PD_Palette_Import_Disabled.gif
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/palette/GENERIC/small/PD_Palette_Import_Hover.gif b/jsf/plugins/org.eclipse.jst.pagedesigner/icons/palette/GENERIC/small/PD_Palette_Import_Hover.gif
deleted file mode 100644
index 0af6903..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/palette/GENERIC/small/PD_Palette_Import_Hover.gif
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/pin_down.gif b/jsf/plugins/org.eclipse.jst.pagedesigner/icons/pin_down.gif
deleted file mode 100644
index e85fa90..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/pin_down.gif
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/pin_up.gif b/jsf/plugins/org.eclipse.jst.pagedesigner/icons/pin_up.gif
deleted file mode 100644
index 5eeef33..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/icons/pin_up.gif
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/model/DTInfo.ecore b/jsf/plugins/org.eclipse.jst.pagedesigner/model/DTInfo.ecore
deleted file mode 100644
index 7343bdf..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/model/DTInfo.ecore
+++ /dev/null
@@ -1,84 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ecore:EPackage xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="dtinfo"
- nsURI="http://org.eclipse.jsf.pagedesigner/dtinfo.ecore" nsPrefix="dti">
- <eClassifiers xsi:type="ecore:EClass" name="DTInfo">
- <eStructuralFeatures xsi:type="ecore:EReference" name="tagConvertInfo" lowerBound="1"
- eType="#//TagConvertInfo" containment="true">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="tag-convert-info"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EReference" name="tagDecorateInfos" upperBound="-1"
- eType="#//TagDecorateInfo" containment="true">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="tag-decorate-info"/>
- </eAnnotations>
- </eStructuralFeatures>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="TagConvertInfo">
- <eStructuralFeatures xsi:type="ecore:EReference" name="operations" upperBound="-1"
- eType="#//Operation" containment="true">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="operation"/>
- </eAnnotations>
- </eStructuralFeatures>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="Operation">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="id" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
- iD="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="parameters" upperBound="-1"
- eType="#//Parameter" containment="true">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="parameter"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EReference" name="operations" upperBound="-1"
- eType="#//Operation" containment="true">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="operation"/>
- </eAnnotations>
- </eStructuralFeatures>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="Parameter">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="value" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="TagDecorateInfo">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="id" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
- iD="true"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="minHeight" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="minWidth" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="multiLevel" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
- defaultValueLiteral="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="needBorderDecorator" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
- defaultValueLiteral="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="needTableDecorator" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
- defaultValueLiteral="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="nonVisual" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
- defaultValueLiteral="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="nonVisualImagePath" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="resolveChildText" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
- defaultValueLiteral="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="resolveAttributeValue"
- eType="#//ResolveAttributeValue" containment="true">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="resolve-attribute-value"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="setNonVisualChildElements"
- eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean" defaultValueLiteral="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="widget" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
- defaultValueLiteral="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="ResolveAttributeValue">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="attributeName" lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- </eClassifiers>
-</ecore:EPackage>
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/model/DTInfo.genmodel b/jsf/plugins/org.eclipse.jst.pagedesigner/model/DTInfo.genmodel
deleted file mode 100644
index a85b144..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/model/DTInfo.genmodel
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<genmodel:GenModel xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" copyrightText="Copyright (c) 2007 Oracle Corporation"
- modelDirectory="/org.eclipse.jst.pagedesigner/src" editDirectory="/org.eclipse.jst.pagedesigner/src"
- editorDirectory="/org.eclipse.jst.pagedesigner/src" modelPluginID="org.eclipse.jst.pagedesigner"
- modelName="DTInfo" editPluginClass="org.eclipse.jst.pagedesigner.PDPlugin" editorPluginClass="org.eclipse.jst.pagedesigner.PDPlugin"
- testsDirectory="/org.eclipse.jst.pagedesigner/src" testSuiteClass="org.eclipse.jst.pagedesigner.PDPlugin"
- importerID="org.eclipse.emf.importer.ecore">
- <foreignModel>DTInfo.ecore</foreignModel>
- <genPackages prefix="DTInfo" basePackage="org.eclipse.jst.pagedesigner.dtmanager"
- disposableProviderFactory="true" classPackageSuffix="internal.impl" utilityPackageSuffix="internal.util"
- providerPackageSuffix="internal.provider" presentationPackageSuffix="internal.presentation"
- testsPackageSuffix="internal.tests" generateExampleClass="false" ecorePackage="DTInfo.ecore#/">
- <genClasses ecoreClass="DTInfo.ecore#//DTInfo">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference DTInfo.ecore#//DTInfo/tagConvertInfo"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference DTInfo.ecore#//DTInfo/tagDecorateInfos"/>
- </genClasses>
- <genClasses ecoreClass="DTInfo.ecore#//TagConvertInfo">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference DTInfo.ecore#//TagConvertInfo/operations"/>
- </genClasses>
- <genClasses image="false" ecoreClass="DTInfo.ecore#//Operation">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute DTInfo.ecore#//Operation/id"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference DTInfo.ecore#//Operation/parameters"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference DTInfo.ecore#//Operation/operations"/>
- </genClasses>
- <genClasses ecoreClass="DTInfo.ecore#//Parameter">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute DTInfo.ecore#//Parameter/value"/>
- </genClasses>
- <genClasses ecoreClass="DTInfo.ecore#//TagDecorateInfo">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute DTInfo.ecore#//TagDecorateInfo/id"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute DTInfo.ecore#//TagDecorateInfo/minHeight"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute DTInfo.ecore#//TagDecorateInfo/minWidth"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute DTInfo.ecore#//TagDecorateInfo/multiLevel"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute DTInfo.ecore#//TagDecorateInfo/needBorderDecorator"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute DTInfo.ecore#//TagDecorateInfo/needTableDecorator"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute DTInfo.ecore#//TagDecorateInfo/nonVisual"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute DTInfo.ecore#//TagDecorateInfo/nonVisualImagePath"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute DTInfo.ecore#//TagDecorateInfo/resolveChildText"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference DTInfo.ecore#//TagDecorateInfo/resolveAttributeValue"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute DTInfo.ecore#//TagDecorateInfo/setNonVisualChildElements"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute DTInfo.ecore#//TagDecorateInfo/widget"/>
- </genClasses>
- <genClasses ecoreClass="DTInfo.ecore#//ResolveAttributeValue">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute DTInfo.ecore#//ResolveAttributeValue/attributeName"/>
- </genClasses>
- </genPackages>
-</genmodel:GenModel>
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/model/QuickEditTabSections.ecore b/jsf/plugins/org.eclipse.jst.pagedesigner/model/QuickEditTabSections.ecore
deleted file mode 100644
index 5b3c237..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/model/QuickEditTabSections.ecore
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ecore:EPackage xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="quickedittabsections"
- nsURI="http://org.eclipse.jsf.pagedesigner/QuickEditTabSections.ecore" nsPrefix="qe">
- <eClassifiers xsi:type="ecore:EClass" name="QuickEditTabSections">
- <eStructuralFeatures xsi:type="ecore:EReference" name="sections" upperBound="-1"
- eType="#//SectionInfo" containment="true">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="section"/>
- </eAnnotations>
- </eStructuralFeatures>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="SectionInfo">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="id" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="type" unique="false" eType="#//SECTION_TYPE"
- defaultValueLiteral="ATTRIBUTE"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="SECTION_TYPE">
- <eLiterals name="ATTRIBUTE"/>
- <eLiterals name="SECTION" value="1"/>
- </eClassifiers>
-</ecore:EPackage>
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/model/QuickEditTabSections.genmodel b/jsf/plugins/org.eclipse.jst.pagedesigner/model/QuickEditTabSections.genmodel
deleted file mode 100644
index 4aed6be..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/model/QuickEditTabSections.genmodel
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<genmodel:GenModel xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" copyrightText="Copyright (c) 2007 Oracle Corporation"
- modelDirectory="/org.eclipse.jst.pagedesigner/src" editDirectory="/org.eclipse.jst.pagedesigner/src"
- editorDirectory="/org.eclipse.jst.pagedesigner/src" modelPluginID="org.eclipse.jst.pagedesigner"
- modelName="QuickEditTabSections" editPluginClass="org.eclipse.jst.pagedesigner.PDPlugin"
- editorPluginClass="/org.eclipse.jst.pagedesigner.PDPlugin" importerID="org.eclipse.emf.importer.ecore"
- complianceLevel="5.0" providerRootExtendsClass="">
- <foreignModel>QuickEditTabSections.ecore</foreignModel>
- <genPackages prefix="QuickEditTabSections" basePackage="org.eclipse.jst.pagedesigner.editors.properties"
- disposableProviderFactory="true" classPackageSuffix="internal.impl" utilityPackageSuffix="internal.util"
- providerPackageSuffix="internal.provider" presentationPackageSuffix="internal.presentation"
- testsPackageSuffix="internal.tests" generateExampleClass="false" multipleEditorPages="false"
- generateModelWizard="false" ecorePackage="QuickEditTabSections.ecore#/">
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="QuickEditTabSections.ecore#//SECTION_TYPE">
- <genEnumLiterals ecoreEnumLiteral="QuickEditTabSections.ecore#//SECTION_TYPE/ATTRIBUTE"/>
- <genEnumLiterals ecoreEnumLiteral="QuickEditTabSections.ecore#//SECTION_TYPE/GROUP"/>
- </genEnums>
- <genClasses ecoreClass="QuickEditTabSections.ecore#//QuickEditTabSections">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QuickEditTabSections.ecore#//QuickEditTabSections/sections"/>
- </genClasses>
- <genClasses image="false" ecoreClass="QuickEditTabSections.ecore#//Section">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute QuickEditTabSections.ecore#//Section/id"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute QuickEditTabSections.ecore#//Section/type"/>
- </genClasses>
- </genPackages>
-</genmodel:GenModel>
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/plugin.properties b/jsf/plugins/org.eclipse.jst.pagedesigner/plugin.properties
deleted file mode 100644
index 89fd6fd..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/plugin.properties
+++ /dev/null
@@ -1,32 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2008 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are 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:
-# Oracle Corporation - initial API and implementation
-###############################################################################
-####################################################
-# Plugin XML information.
-####################################################
-pluginName=JavaServer Faces Tools - Web Page Editor
-providerName=Eclipse.org
-
-editor.binding.context.name=Using Web Page Editor
-editor.binding.context.description=Key binding context when using the web page editor
-# ====================================================================
-
-
-editor.name.0 = Web Page Editor
-category.name.0 = Web Page Editor Layout
-command.name.0 = Vertical Layout
-command.name.1 = Horizontal Layout
-command.name.2 = Graphical Designer
-command.name.3 = Source Code
-
-extension-point.name.0 = Web Page Editor Extension
-extension-point.name.1 = property contributor
-extension-point.name.2 = popupMenu Contributor
-extension-point.name.3 = Content Model Meta Data
\ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/plugin.xml b/jsf/plugins/org.eclipse.jst.pagedesigner/plugin.xml
deleted file mode 100644
index f8907af..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/plugin.xml
+++ /dev/null
@@ -1,205 +0,0 @@
-<?eclipse version="3.0"?>
-<plugin>
- <extension-point id="pageDesignerExtension" name="%extension-point.name.0" schema="schema/pageDesignerExtension.exsd" />
- <extension-point id="propertyContributor" name="%extension-point.name.1" schema="schema/propertyContributor.exsd" />
- <extension-point id="popupMenuContributor" name="%extension-point.name.2" schema="schema/popupMenuContributor.exsd"/>
- <extension-point id="cmRegistry" name="%extension-point.name.3" schema="schema/cmRegistry.exsd"/>
-
- <extension point="org.eclipse.ui.editors">
- <editor class="org.eclipse.jst.pagedesigner.editors.HTMLEditor"
- contributorClass="org.eclipse.jst.pagedesigner.editors.actions.PageDesignerActionBarContributor2"
- default="false"
- extensions="jsp,jspx,jsf,html,htm,xhtml"
- icon="icons/PD_Plugin.gif"
- id="org.eclipse.jst.pagedesigner.PageDesignerEditor"
- name="%editor.name.0">
- </editor>
- </extension>
-
- <extension point="org.eclipse.ui.actionSetPartAssociations">
- <actionSetPartAssociation targetID="org.eclipse.debug.ui.launchActionSet">
- <part id="org.eclipse.jst.pagedesigner.PageDesignerEditor"/>
- </actionSetPartAssociation>
- </extension>
-
- <extension point="org.eclipse.core.runtime.adapters">
- <factory
- class="org.eclipse.jst.pagedesigner.utils.UriAdapterFactory"
- adaptableType="org.eclipse.core.resources.IProject">
- <adapter type="org.eclipse.wst.sse.core.internal.util.URIResolver" />
- </factory>
- </extension>
-
- <extension
- point="org.eclipse.ui.views.properties.tabbed.propertyTabs">
- <propertyTabs
- contributorId="org.eclipse.jst.pagedesigner.tabPropertyContributor">
- <propertyTab label="Quick Edit" category="Quick Edit" id="org.eclipse.jst.pagedesigner.tabQuickEdit" />
- <propertyTab label="Attributes" category="Attributes" id="org.eclipse.jst.pagedesigner.tabAttributes" />
- </propertyTabs>
- </extension>
-
- <extension
- point="org.eclipse.ui.views.properties.tabbed.propertySections">
- <propertySections
- contributorId="org.eclipse.jst.pagedesigner.tabPropertyContributor">
- <propertySection
- afterSection="top"
- class="org.eclipse.jst.pagedesigner.properties.AllPropertySection"
- id="section.allproperty"
- tab="org.eclipse.jst.pagedesigner.tabAttributes">
- </propertySection>
- </propertySections>
- </extension>
-
- <extension point="org.eclipse.jst.pagedesigner.pageDesignerExtension">
- <linkCreator class="org.eclipse.jst.pagedesigner.actions.link.HtmlLinkCreator" linkIdentifier="Html Link"/>
- <tagTransformOperation
- class="org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal.AppendChildElementOperation"
- id="AppendChildElementOperation">
- </tagTransformOperation>
- <tagTransformOperation
- class="org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal.AppendChildTextFromXPathOperation"
- id="AppendChildTextFromXPathOperation">
- </tagTransformOperation>
- <tagTransformOperation
- class="org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal.AppendChildTextOperation"
- id="AppendChildTextOperation">
- </tagTransformOperation>
- <tagTransformOperation
- class="org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal.ConvertAttributeToTextOperation"
- id="ConvertAttributeToTextOperation">
- </tagTransformOperation>
- <tagTransformOperation
- class="org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal.CopyAllAttributesOperation"
- id="CopyAllAttributesOperation">
- </tagTransformOperation>
- <tagTransformOperation
- class="org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal.CopyAttributeOperation"
- id="CopyAttributeOperation">
- </tagTransformOperation>
- <tagTransformOperation
- class="org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal.CopyAttributeWithRenameOperation"
- id="CopyAttributeWithRenameOperation">
- </tagTransformOperation>
- <tagTransformOperation
- class="org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal.CopyChildrenOperation"
- id="CopyChildrenOperation">
- </tagTransformOperation>
- <tagTransformOperation
- class="org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal.CreateAttributeFromXPathOperation"
- id="CreateAttributeFromXPathOperation">
- </tagTransformOperation>
- <tagTransformOperation
- class="org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal.CreateAttributeOperation"
- id="CreateAttributeOperation">
- </tagTransformOperation>
- <tagTransformOperation
- class="org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal.CreateElementOperation"
- id="CreateElementOperation">
- </tagTransformOperation>
- <tagTransformOperation
- class="org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal.IfNotOperation"
- id="IfNotOperation">
- </tagTransformOperation>
- <tagTransformOperation
- class="org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal.IfOperation"
- id="IfOperation">
- </tagTransformOperation>
- <tagTransformOperation
- class="org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal.IterateOverElementsOperation"
- id="IterateOverElementsOperation">
- </tagTransformOperation>
- <tagTransformOperation
- class="org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal.MakeParentElementCurrentOperation"
- id="MakeParentElementCurrentOperation">
- </tagTransformOperation>
- <tagTransformOperation
- class="org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal.RemoveAttributeOperation"
- id="RemoveAttributeOperation">
- </tagTransformOperation>
- <tagTransformOperation
- class="org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal.RenameAttributeOperation"
- id="RenameAttributeOperation">
- </tagTransformOperation>
- </extension>
-
- <extension id="org.eclipse.jst.pagedesigner.commands" point="org.eclipse.ui.commands">
- <category id="org.eclipse.jst.pagedesigner.pagelayout" name="%category.name.0"/>
- <command categoryId="org.eclipse.jst.pagedesigner.pagelayout"
- id="org.eclipse.jst.pagedesigner.vertical"
- name="%command.name.0"/>
- <command categoryId="org.eclipse.jst.pagedesigner.pagelayout"
- id="org.eclipse.jst.pagedesigner.horizotal"
- name="%command.name.1"/>
- <command categoryId="org.eclipse.jst.pagedesigner.pagelayout"
- id="org.eclipse.jst.pagedesigner.design"
- name="%command.name.2"/>
- <command categoryId="org.eclipse.jst.pagedesigner.pagelayout"
- id="org.eclipse.jst.pagedesigner.source"
- name="%command.name.3"/>
- </extension>
-
- <extension point="org.eclipse.ui.bindings">
- <key commandId="org.eclipse.jst.pagedesigner.vertical"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- contextId="org.eclipse.jst.pagedesigner.editorContext"
- sequence="M1+M2+F9"/>
- <key commandId="org.eclipse.jst.pagedesigner.horizotal"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- contextId="org.eclipse.jst.pagedesigner.editorContext"
- sequence="M1+M2+F10"/>
- <key commandId="org.eclipse.jst.pagedesigner.design"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- contextId="org.eclipse.jst.pagedesigner.editorContext"
- sequence="M1+M2+F11"/>
- <key commandId="org.eclipse.jst.pagedesigner.source"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- contextId="org.eclipse.jst.pagedesigner.editorContext"
- sequence="M1+M2+F12"/>
- </extension>
-
- <extension point="org.eclipse.wst.sse.ui.editorConfiguration">
- <contentOutlineConfiguration
- class="org.eclipse.jst.pagedesigner.editors.OutlineConfiguration"
- target="org.eclipse.jst.pagedesigner.editors.DesignerStructuredTextEditorJSP"/>
- </extension>
-
- <extension point="org.eclipse.emf.ecore.generated_package">
- <package
- class="org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoPackage"
- genModel="model/DTInfo.genmodel"
- uri="http://org.eclipse.jsf.pagedesigner/dtinfo.ecore">
- </package>
- <package
- class="org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.QuickEditTabSectionsPackage"
- genModel="model/QuickEditTabSections.genmodel"
- uri="http://org.eclipse.jsf.pagedesigner/QuickEditTabSections.ecore">
- </package>
- </extension>
-
- <extension
- point="org.eclipse.ui.contexts">
- <context
- description="%editor.binding.context.description"
- id="org.eclipse.jst.pagedesigner.editorContext"
- name="%editor.binding.context.name"
- parentId="org.eclipse.ui.textEditorScope">
- </context>
- </extension>
- <extension
- point="org.eclipse.jst.jsf.core.MetaDataEnabledFeatures">
- <MetaDataEnabledFeature
- class="org.eclipse.jst.pagedesigner.editors.properties.internal.PropertyDescriptor"
- typeid="org.eclipse.jst.jsf.core.attributevalues.BaseType">
- </MetaDataEnabledFeature>
- </extension>
- <extension
- point="org.eclipse.ui.views.properties.tabbed.propertyContributor">
- <propertyContributor
- contributorId="org.eclipse.jst.pagedesigner.tabPropertyContributor"
- tabDescriptorProvider="org.eclipse.jst.pagedesigner.properties.internal.WPETabDescriptorProvider">
- <propertyCategory></propertyCategory>
- </propertyContributor>
- </extension>
-</plugin>
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/schema/cmRegistry.exsd b/jsf/plugins/org.eclipse.jst.pagedesigner/schema/cmRegistry.exsd
deleted file mode 100644
index b6662dc..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/schema/cmRegistry.exsd
+++ /dev/null
@@ -1,98 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jst.pagedesigner">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.jst.pagedesigner" id="cmRegistry" name="Content Model Meta Data"/>
- </appInfo>
- <documentation>
- <p><b>This extension point is provisional and subject to change</b></p>
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="registry" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="registry">
- <annotation>
- <documentation>
- User must provide either "configFile" attribute or "class" attribute.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="configFile" type="string">
- <annotation>
- <documentation>
- A path relative to the root of the declaring plugin. Point to a config file that contains the information for the specified tag lib of the uri.
- </documentation>
- <appInfo>
- <meta.attribute kind="resource"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="class" type="string">
- <annotation>
- <documentation>
- A class that implements ICMRegistry. The implemented ICMRegistry must return the same uri as the uri attribute in getSupportedURI() method.
- </documentation>
- <appInfo>
- <meta.attribute kind="java"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="uri" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 2.0
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright 2006 Sybase and others
-All rights reserved. This program and the accompanying materials are 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
- </documentation>
- </annotation>
-
-</schema>
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/schema/pageDesignerExtension.exsd b/jsf/plugins/org.eclipse.jst.pagedesigner/schema/pageDesignerExtension.exsd
deleted file mode 100644
index 25ef001..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/schema/pageDesignerExtension.exsd
+++ /dev/null
@@ -1,209 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jst.pagedesigner">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.jst.pagedesigner" id="pageDesignerExtension" name="Web Page Editor Extension"/>
- </appInfo>
- <documentation>
- <p><b>This extension point is provisional and subject to change</b></p>
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="localDropHandler" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="attributeCellEditorFactory" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="tagConverterFactory" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="elementEditFactory" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="linkCreator" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="tagAttributeCellEditorFactory" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="tagTransformOperation" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="localDropHandler">
- <complexType>
- <attribute name="class" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute kind="java"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="attributeCellEditorFactory">
- <annotation>
- <documentation>
- deprecated - use tagAttributeCellEditorFactory
- </documentation>
- </annotation>
- <complexType>
- <attribute name="class" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute kind="java" deprecated="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="tagAttributeCellEditorFactory">
- <annotation>
- <documentation>
- provides ability for 3rd parties to supply their own cell and dialog field editors for MD enabled tag library attributes in the WPE tabbed property sheets
- </documentation>
- </annotation>
- <complexType>
- <attribute name="class" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.jst.pagedesigner.meta.ITagAttributeCellEditorFactory"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="tagConverterFactory">
- <complexType>
- <attribute name="class" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute kind="java"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="elementEditFactory">
- <complexType>
- <attribute name="class" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute kind="java"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="linkCreator">
- <complexType>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.jst.pagedesigner.actions.link.ILinkCreator"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="linkIdentifier" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="tagTransformOperation">
- <annotation>
- <documentation>
- define a tag transformation operation class
- </documentation>
- </annotation>
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- The transform operation id. Referencers will use plugin-qualified references. i.e if the plugin extending this was <code>org.foo.bar</code>, then the meta data instance that referenced this operation would specify:
- <pre>
- <operation id="org.foo.bar.MyTransformId"/>
- </pre>
-
-The exception to this rule is that if the reference is not plugin-qualified, then the reference is assumed to be a <i>core</i> transformation and uses the <code>org.eclipse.jst.pagedesigner</code> prefix.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- class extending the <code>org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation</code>
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation:"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 2.0
- </documentation>
- </annotation>
-
-
-
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright 2006 Sybase and others
-All rights reserved. This program and the accompanying materials are 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
- </documentation>
- </annotation>
-
-</schema>
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/schema/popupMenuContributor.exsd b/jsf/plugins/org.eclipse.jst.pagedesigner/schema/popupMenuContributor.exsd
deleted file mode 100644
index 27956f4..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/schema/popupMenuContributor.exsd
+++ /dev/null
@@ -1,83 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jst.pagedesigner">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.jst.pagedesigner" id="popupMenuContributor" name="popupMenu Contributor"/>
- </appInfo>
- <documentation>
- <p><b>This extension point is provisional and subject to change</b></p>
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="menuItemContributor" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="menuItemContributor">
- <complexType>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute kind="java"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="URI" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 2.0
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright 2006 Sybase and others
-All rights reserved. This program and the accompanying materials are 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
- </documentation>
- </annotation>
-
-</schema>
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/schema/propertyContributor.exsd b/jsf/plugins/org.eclipse.jst.pagedesigner/schema/propertyContributor.exsd
deleted file mode 100644
index 934161d..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/schema/propertyContributor.exsd
+++ /dev/null
@@ -1,89 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jst.pagedesigner" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.eclipse.jst.pagedesigner" id="propertyContributor" name="property contributor"/>
- </appinfo>
- <documentation>
- <p><b>This extension point is unused and deprecated, and will be removed</b></p>
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appinfo>
- <meta.element deprecated="true"/>
- </appinfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="propertyContributor" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="propertyContributor">
- <annotation>
- <appinfo>
- <meta.element deprecated="true"/>
- </appinfo>
- </annotation>
- <complexType>
- <attribute name="sectionDescriptorProvider" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute kind="java"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appinfo>
- <meta.section type="since"/>
- </appinfo>
- <documentation>
- 2.0
- </documentation>
- </annotation>
-
-
-
-
- <annotation>
- <appinfo>
- <meta.section type="copyright"/>
- </appinfo>
- <documentation>
- Copyright 2006 Sybase and others
-All rights reserved. This program and the accompanying materials are 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
- </documentation>
- </annotation>
-
-</schema>
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/schema/tagProperty.xsd b/jsf/plugins/org.eclipse.jst.pagedesigner/schema/tagProperty.xsd
deleted file mode 100644
index f970c08..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/schema/tagProperty.xsd
+++ /dev/null
@@ -1,154 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<schema xmlns="http://www.w3.org/2001/XMLSchema">
- <element name="taglib">
- <complexType>
- <sequence>
- <element ref="tag" maxOccurs="unbounded"></element>
- <element ref="definition" minOccurs="0" maxOccurs="1"></element>
- </sequence>
- <attribute ref="uri" />
- </complexType>
- </element>
-
- <element name="tag">
- <complexType>
- <sequence>
- <element ref="category" minOccurs="0"
- maxOccurs="unbounded">
- </element>
- <element ref="referedcategory" minOccurs="0"
- maxOccurs="unbounded">
- </element>
- </sequence>
- <attribute ref="name"></attribute>
- </complexType>
- </element>
-
- <element name="category">
- <complexType>
- <sequence>
- <element ref="attribute" minOccurs="0"
- maxOccurs="unbounded">
- </element>
- <element ref="referedattribute" minOccurs="0"
- maxOccurs="unbounded">
- </element>
- </sequence>
- <attribute ref="name"></attribute>
- <attribute ref="displaylabel"></attribute>
- </complexType>
- </element>
-
- <element name="referedcategory">
- <complexType>
- <sequence>
- <element ref="includeattrs" minOccurs="0"
- maxOccurs="1">
- </element>
- <element ref="excludeattrs" minOccurs="0"
- maxOccurs="1">
- </element>
- </sequence>
- <attribute ref="ref"></attribute>
- <attribute ref="displaylabel"></attribute>
- </complexType>
- </element>
-
- <element name="definition">
- <complexType>
- <sequence>
- <element ref="categories" minOccurs="0" maxOccurs="1"></element>
- <element ref="attributes" minOccurs="0" maxOccurs="1"></element>
- </sequence>
- </complexType>
- </element>
-
- <element name="attribute">
- <complexType>
- <sequence>
- <element ref="option" minOccurs="0"
- maxOccurs="unbounded">
- </element>
- </sequence>
- <attribute ref="name"></attribute>
- <attribute ref="displaylabel"></attribute>
- <attribute ref="required"></attribute>
- <attribute ref="type"></attribute>
- <attribute ref="typeparam"></attribute>
- </complexType>
- </element>
-
- <element name="referedattribute">
- <complexType>
- <attribute ref="ref"></attribute>
- <attribute ref="overridename"></attribute>
- <attribute ref="displaylabel"></attribute>
- </complexType>
- </element>
-
- <element name="includeattrs">
- <complexType>
- <sequence>
- <element ref="attribute" minOccurs="0"
- maxOccurs="unbounded">
- </element>
- <element ref="referedattribute" minOccurs="0"
- maxOccurs="unbounded">
- </element>
- </sequence>
- </complexType>
- </element>
-
- <element name="excludeattrs">
- <complexType>
- <attribute ref="refs"></attribute>
- </complexType>
- </element>
-
- <element name="categories">
- <complexType>
- <sequence>
- <element ref="category"></element>
- </sequence>
- </complexType>
- </element>
-
- <element name="attributes">
- <complexType>
- <sequence>
- <element ref="attribute"></element>
- </sequence>
- </complexType>
- </element>
-
- <element name="option">
- <complexType>
- <attribute ref="key"></attribute>
- <attribute ref="value"></attribute>
- <attribute ref="default"></attribute>
- </complexType>
- </element>
-
- <attribute name="name" type="string"></attribute>
-
- <attribute name="displaylabel" type="string"></attribute>
-
- <attribute name="ref" type="string"></attribute>
-
- <attribute name="refs" type="string"></attribute>
-
- <attribute name="uri" type="string"></attribute>
-
- <attribute name="type" type="string"></attribute>
-
- <attribute name="typeparam" type="string"></attribute>
-
- <attribute name="key" type="string"></attribute>
-
- <attribute name="value" type="string"></attribute>
-
- <attribute name="overridename" type="string"></attribute>
- <attribute name="default" type="string" fixed="default"></attribute>
- <attribute name="required" type="string" fixed="required"></attribute>
-
-</schema>
\ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/IHTMLConstants.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/IHTMLConstants.java
deleted file mode 100644
index 30c23e4..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/IHTMLConstants.java
+++ /dev/null
@@ -1,1147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner;
-
-import org.eclipse.jst.jsf.common.dom.TagIdentifier;
-import org.eclipse.jst.jsf.core.internal.tld.TagIdentifierFactory;
-import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMDocType;
-
-/**
- * @author mengbo
- */
-public class IHTMLConstants {
- /**
- * anchor tag name
- */
- public static final String TAG_A = "a";
-
- /**
- * abbreviated form (e.g.,WWW, HTTP, etc.) tag name
- */
- public static final String TAG_ABBR = "abbr"; //
-
- /**
- * acronym tag name
- */
- public static final String TAG_ACRONYM = "acronym";
-
- /**
- * address tag name
- */
- public static final String TAG_ADDRESS = "address";
-
- /**
- * Java applet tag name
- */
- public static final String TAG_APPLET = "applet";
-
- /**
- * client-side image map tag name
- */
- public static final String TAG_AREA = "area";
-
- // area
-
- /**
- * bold text style tag name
- */
- public static final String TAG_B = "b";
-
- /**
- * document base URI tag name
- */
- public static final String TAG_BASE = "base";
-
- /**
- * base font size tag name
- */
- public static final String TAG_BASEFONT = "basefont";
-
- /**
- * I18N BiDi over-ride tag name
- */
- public static final String TAG_BDO = "bdo";
-
- /**
- * large text style tag name
- */
- public static final String TAG_BIG = "big";
-
- /**
- * blockquote tag name
- */
- public static final String TAG_BLOCKQUOTE = "blockquote";
-
- // quotation
-
- /**
- * document body tag name
- */
- public static final String TAG_BODY = "body";
-
- /**
- * forced line break tag name
- */
- public static final String TAG_BR = "br";
-
- /**
- * push button tag name
- */
- public static final String TAG_BUTTON = "button";
-
- /**
- * table caption tag name
- */
- public static final String TAG_CAPTION = "caption";
-
- /**
- * shorthand for DIV align=center tag name
- */
- public static final String TAG_CENTER = "center";
-
- /**
- * citation tag name
- */
- public static final String TAG_CITE = "cite";
-
- /**
- * computer code fragment tag name
- */
- public static final String TAG_CODE = "code";
-
- /**
- * table column tag name
- */
- public static final String TAG_COL = "col";
-
- /**
- * table column group tag name
- */
- public static final String TAG_COLGROUP = "colgroup";
-
- /**
- * definition description tag name
- */
- public static final String TAG_DD = "dd";
-
- /**
- * deleted text tag name
- */
- public static final String TAG_DEL = "del";
-
- /**
- * instance definition tag name
- */
- public static final String TAG_DFN = "dfn";
-
- /**
- * directory list tag name
- */
- public static final String TAG_DIR = "dir";
-
- /**
- * generic language/style container (div) tag name
- */
- public static final String TAG_DIV = "div";
-
- /**
- * definition list tag name
- */
- public static final String TAG_DL = "dl";
-
- /**
- * definition term tag name
- */
- public static final String TAG_DT = "dt";
-
- /**
- * emphasis tag name
- */
- public static final String TAG_EM = "em";
-
- /**
- * fieldset tag name
- */
- public static final String TAG_FIELDSET = "fieldset";
-
- /**
- * local change to font (font) tag name
- */
- public static final String TAG_FONT = "font";
-
- /**
- * form tag name
- */
- public static final String TAG_FORM = "form";
-
- /**
- * frame tag name
- */
- public static final String TAG_FRAME = "frame";
-
- /**
- * frameset tag name
- */
- public static final String TAG_FRAMESET = "frameset";
-
- /**
- * h1 tag name
- */
- public static final String TAG_H1 = "h1";
-
- /**
- * h2 tag name
- */
- public static final String TAG_H2 = "h2";
-
- /**
- * h3 tag name
- */
- public static final String TAG_H3 = "h3";
-
- /**
- * h4 tag name
- */
- public static final String TAG_H4 = "h4";
-
- /**
- * h5 tag name
- */
- public static final String TAG_H5 = "h5";
-
- /**
- * h6 tag name
- */
- public static final String TAG_H6 = "h6";
-
- /**
- * head tag name
- */
- public static final String TAG_HEAD = "head";
-
- /**
- * horizontal rule tag name
- */
- public static final String TAG_HR = "hr";
-
- /**
- * document root element (html) tag name
- */
- public static final String TAG_HTML = "html";
-
- /**
- * italic text style tag name
- */
- public static final String TAG_I = "i";
-
- /**
- * inline subwindow (iframe) tag name
- */
- public static final String TAG_IFRAME = "iframe";
-
- /**
- * Embedded image tag name
- */
- public static final String TAG_IMG = "img";
-
- /**
- * input tag name
- */
- public static final String TAG_INPUT = "input";
-
- /**
- * inserted text tag name
- */
- public static final String TAG_INS = "ins";
-
- /**
- * isindex tag name
- */
- public static final String TAG_ISINDEX = "isindex";
-
- /**
- * text to be entered by the user tag name
- */
- public static final String TAG_KBD = "kbd";
-
- /**
- * form field label text tag name
- */
- public static final String TAG_LABEL = "label";
-
- /**
- * fieldset legend tag name
- */
- public static final String TAG_LEGEND = "legend";
-
- /**
- * list item tag name
- */
- public static final String TAG_LI = "li";
-
- /**
- * media-independent link tag name
- */
- public static final String TAG_LINK = "link";
-
- /**
- * client-side image map tag name
- */
- public static final String TAG_MAP = "map";
-
- /**
- * menu list tag name
- */
- public static final String TAG_MENU = "menu";
-
- /**
- * generic metainformation tag name
- */
- public static final String TAG_META = "meta";
-
- /**
- * noembed tag name
- */
- public static final String TAG_NOEMBED = "noembed";
-
- /**
- * container for non-frame-based
- * rendering (noframes) tag name
- */
- public static final String TAG_NOFRAMES = "noframes";
-
- //
-
- /**
- * container for non-script-based
- * rendering (noscript) tag name
- */
- public static final String TAG_NOSCRIPT = "noscript";
-
- //
-
- /**
- * generic embedded (object) tag name
- */
- public static final String TAG_OBJECT = "object";
-
- /**
- * ordered list tag name
- */
- public static final String TAG_OL = "ol";
-
- /**
- * option group tag name
- */
- public static final String TAG_OPTGROUP = "optgroup";
-
- /**
- * selectable choice tag name
- */
- public static final String TAG_OPTION = "option";
-
- /**
- * paragraph tag name
- */
- public static final String TAG_P = "p";
-
- /**
- * named property value tag name
- */
- public static final String TAG_PARAM = "param";
-
- /**
- * preformatted text tag name
- */
- public static final String TAG_PRE = "pre";
-
- /**
- * short inline quotation tag name
- */
- public static final String TAG_Q = "q";
-
- /**
- * strike-through text style tag name
- */
- public static final String TAG_S = "s";
-
- /**
- * sample program output tag name
- */
- public static final String TAG_SAMP = "samp";
-
- // scripts, etc.
-
- /**
- * script statements tag name
- */
- public static final String TAG_SCRIPT = "script";
-
- /**
- * option selector tag name
- */
- public static final String TAG_SELECT = "select";
-
- /**
- * small text style tag name
- */
- public static final String TAG_SMALL = "small";
-
- /**
- * generic language/style tag name
- */
- public static final String TAG_SPAN = "span";
-
- // container
-
- /**
- * strike-through text tag name
- */
- public static final String TAG_STRIKE = "strike";
-
- /**
- * strong emphasis tag name
- */
- public static final String TAG_STRONG = "strong";
-
- /**
- * style info tag name
- */
- public static final String TAG_STYLE = "style";
-
- /**
- * subscript tag name
- */
- public static final String TAG_SUB = "sub";
-
- /**
- * superscript tag name
- */
- public static final String TAG_SUP = "sup";
-
- /**
- * table tag name
- */
- public static final String TAG_TABLE = "table";
-
- /**
- * table body tag name
- */
- public static final String TAG_TBODY = "tbody";
-
- /**
- * table data cell tag name
- */
- public static final String TAG_TD = "td";
-
- /**
- * multi-line text
- */
- public static final String TAG_TEXTAREA = "textarea";
-
- // field
-
- /**
- * table footer tag name
- */
- public static final String TAG_TFOOT = "tfoot";
-
- /**
- * table header cell tag name
- */
- public static final String TAG_TH = "th";
-
- /**
- * table header tag name
- */
- public static final String TAG_THEAD = "thead";
-
- /**
- * document title tag name
- */
- public static final String TAG_TITLE = "title";
-
- /**
- * table row tag name
- */
- public static final String TAG_TR = "tr";
-
- /**
- * teletype or monospaced text tag name
- */
- public static final String TAG_TT = "tt";
-
- // style
-
- /**
- * underlined text style tag name
- */
- public static final String TAG_U = "u";
-
- /**
- * unordered list tag name
- */
- public static final String TAG_UL = "ul";
-
- /**
- * instance of a variable tag name
- */
- public static final String TAG_VAR = "var";
-
- /**
- * Tag identifier for an HTML form tag
- */
- public static final TagIdentifier TAG_IDENTIFIER_HTML_FORM =
- TagIdentifierFactory.createJSPTagWrapper(CMDocType.HTML_DOC_TYPE, TAG_FORM);
-
- // program argument
-
- /**
- * abbr attribute
- */
- public static final String ATTR_ABBR = "abbr";
-
- /**
- * accept-charset attribute
- */
- public static final String ATTR_ACCEPTCHARSET = "accept-charset";
-
- /**
- * accept attribute
- */
- public static final String ATTR_ACCEPT = "accept";
-
- /**
- * access key attribute
- */
- public static final String ATTR_ACCESSKEY = "accesskey";
-
- /**
- * action attribute
- */
- public static final String ATTR_ACTION = "action";
-
- /**
- * align attribute
- */
- public static final String ATTR_ALIGN = "align";
-
- /**
- * alink attribute
- */
- public static final String ATTR_ALINK = "alink";
-
- /**
- * alt attribute
- */
- public static final String ATTR_ALT = "alt";
-
- /**
- * archive attribute
- */
- public static final String ATTR_ARCHIVE = "archive";
-
- /**
- * axis attribute
- */
- public static final String ATTR_AXIS = "axis";
-
- /**
- * background attribute
- */
- public static final String ATTR_BACKGROUND = "background";
-
- /**
- * bgcolor attribute
- */
- public static final String ATTR_BGCOLOR = "bgcolor";
-
- /**
- * border attribute
- */
- public static final String ATTR_BORDER = "border";
-
- /**
- * cellpadding attribute
- */
- public static final String ATTR_CELLPADDING = "cellpadding";
-
- /**
- * cellspacing attribute
- */
- public static final String ATTR_CELLSPACING = "cellspacing";
-
- /**
- * char attribute
- */
- public static final String ATTR_CHAR = "char";
-
- /**
- * charoff attribute
- */
- public static final String ATTR_CHAROFF = "charoff";
-
- /**
- * charset attribute
- */
- public static final String ATTR_CHARSET = "charset";
-
- /**
- * checked attribute
- */
- public static final String ATTR_CHECKED = "checked";
-
- /**
- * cite attribute
- */
- public static final String ATTR_CITE = "cite";
-
- /**
- * class attribute
- */
- public static final String ATTR_CLASS = "class";
-
- /**
- * classid attribute
- */
- public static final String ATTR_CLASSID = "classid";
-
- /**
- * clear attribute
- */
- public static final String ATTR_CLEAR = "clear";
-
- /**
- * code attribute
- */
- public static final String ATTR_CODE = "code";
-
- /**
- * codebase attribute
- */
- public static final String ATTR_CODEBASE = "codebase";
-
- /**
- * code type attribute
- */
- public static final String ATTR_CODETYPE = "codetype";
-
- /**
- * color attribute
- */
- public static final String ATTR_COLOR = "color";
-
- /**
- * cols attribute
- */
- public static final String ATTR_COLS = "cols";
-
- /**
- * colspan attribute
- */
- public static final String ATTR_COLSPAN = "colspan";
-
- /**
- * compact attribute
- */
- public static final String ATTR_COMPACT = "compact";
-
- /**
- * content attribute
- */
- public static final String ATTR_CONTENT = "content";
-
- /**
- * coords attribute
- */
- public static final String ATTR_COORDS = "coords";
-
- /**
- * data attribute
- */
- public static final String ATTR_DATA = "data";
-
- /**
- * datetime attribute
- */
- public static final String ATTR_DATETIME = "datetime";
-
- /**
- * declare attribute
- */
- public static final String ATTR_DECLARE = "declare";
-
- /**
- * defer attribute
- */
- public static final String ATTR_DEFER = "defer";
-
- /**
- * dir attribute
- */
- public static final String ATTR_DIR = "dir";
-
- /**
- * disabled attribute
- */
- public static final String ATTR_DISABLED = "disabled";
-
- /**
- * enctype attribute
- */
- public static final String ATTR_ENCTYPE = "enctype";
-
- /**
- * face attribute
- */
- public static final String ATTR_FACE = "face";
-
- /**
- * for attribute
- */
- public static final String ATTR_FOR = "for";
-
- /**
- * frame attribute
- */
- public static final String ATTR_FRAME = "frame";
-
- /**
- * frameborder attribute
- */
- public static final String ATTR_FRAMEBORDER = "frameborder";
-
- /**
- * headers attribute
- */
- public static final String ATTR_HEADERS = "headers";
-
- /**
- * height attribute
- */
- public static final String ATTR_HEIGHT = "height";
-
- /**
- * href attribute
- */
- public static final String ATTR_HREF = "href";
-
- /**
- * hreflang attribute
- */
- public static final String ATTR_HREFLANG = "hreflang";
-
- /**
- * hspace attribute
- */
- public static final String ATTR_HSPACE = "hspace";
-
- /**
- * http-equiv attribute
- */
- public static final String ATTR_HTTPEQUIV = "http-equiv";
-
- /**
- * id attribute
- */
- public static final String ATTR_ID = "id";
-
- /**
- * ismap attribute
- */
- public static final String ATTR_ISMAP = "ismap";
-
- /**
- * label attribute
- */
- public static final String ATTR_LABEL = "label";
-
- /**
- * lang attribute
- */
- public static final String ATTR_LANG = "lang";
-
- /**
- * language attribute
- */
- public static final String ATTR_LANGUAGE = "language";
-
- /**
- * link attribute
- */
- public static final String ATTR_LINK = "link";
-
- /**
- * longdesc attribute
- */
- public static final String ATTR_LONGDESC = "longdesc";
-
- /**
- * marginheight attribute
- */
- public static final String ATTR_MARGINHEIGHT = "marginheight";
-
- /**
- * margin width attribute
- */
- public static final String ATTR_MARGINWIDTH = "marginwidth";
-
- /**
- * maxlength attribute
- */
- public static final String ATTR_MAXLENGTH = "maxlength";
-
- /**
- * media attribute
- */
- public static final String ATTR_MEDIA = "media";
-
- /**
- * method attribute
- */
- public static final String ATTR_METHOD = "method";
-
- /**
- * multiple attribute
- */
- public static final String ATTR_MULTIPLE = "multiple";
-
- /**
- * name attribute
- */
- public static final String ATTR_NAME = "name";
-
- /**
- * nohref attribute
- */
- public static final String ATTR_NOHREF = "nohref";
-
- /**
- * noresize attribute
- */
- public static final String ATTR_NORESIZE = "noresize";
-
- /**
- * noshade attribute
- */
- public static final String ATTR_NOSHADE = "noshade";
-
- /**
- * nowrap attribute
- */
- public static final String ATTR_NOWRAP = "nowrap";
-
- /**
- * object attribute
- */
- public static final String ATTR_OBJECT = "object";
-
- /**
- * onblur attribute
- */
- public static final String ATTR_ONBLUR = "onblur";
-
- /**
- * onchange attribute
- */
- public static final String ATTR_ONCHANGE = "onchange";
-
- /**
- * onclick attribute
- */
- public static final String ATTR_ONCLICK = "onclick";
-
- /**
- * ondblclick attribute
- */
- public static final String ATTR_ONDBLCLICK = "ondblclick";
-
- /**
- * onfocus attribute
- */
- public static final String ATTR_ONFOCUS = "onfocus";
-
- /**
- * onkeydown attribute
- */
- public static final String ATTR_ONKEYDOWN = "onkeydown";
-
- /**
- * onkeypress attribute
- */
- public static final String ATTR_ONKEYPRESS = "onkeypress";
-
- /**
- * onkeyup attribute
- */
- public static final String ATTR_ONKEYUP = "onkeyup";
-
- /**
- * onload attribute
- */
- public static final String ATTR_ONLOAD = "onload";
-
- /**
- * onmousedown attribute
- */
- public static final String ATTR_ONMOUSEDOWN = "onmousedown";
-
- /**
- * onmousemove attribute
- */
- public static final String ATTR_ONMOUSEMOVE = "onmousemove";
-
- /**
- * onmouseout attribute
- */
- public static final String ATTR_ONMOUSEOUT = "onmouseout";
-
- /**
- * onmouseover attribute
- */
- public static final String ATTR_ONMOUSEOVER = "onmouseover";
-
- /**
- * onmouseup attribute
- */
- public static final String ATTR_ONMOUSEUP = "onmouseup";
-
- /**
- * onreset attribute
- */
- public static final String ATTR_ONRESET = "onreset";
-
- /**
- * onselect attribute
- */
- public static final String ATTR_ONSELECT = "onselect";
-
- /**
- * onsubmit attribute
- */
- public static final String ATTR_ONSUBMIT = "onsubmit";
-
- /**
- * onunload attribute
- */
- public static final String ATTR_ONUNLOAD = "onunload";
-
- /**
- * profile attribute
- */
- public static final String ATTR_PROFILE = "profile";
-
- /**
- * prompt attribute
- */
- public static final String ATTR_PROMPT = "prompt";
-
- /**
- * readonly attribute
- */
- public static final String ATTR_READONLY = "readonly";
-
- /**
- * rel attribute
- */
- public static final String ATTR_REL = "rel";
-
- /**
- * rev attribute
- */
- public static final String ATTR_REV = "rev";
-
- /**
- * rows attribute
- */
- public static final String ATTR_ROWS = "rows";
-
- /**
- * rowspan attribute
- */
- public static final String ATTR_ROWSPAN = "rowspan";
-
- /**
- * rules attribute
- */
- public static final String ATTR_RULES = "rules";
-
- /**
- * scheme attribute
- */
- public static final String ATTR_SCHEME = "scheme";
-
- /**
- * scope attribute
- */
- public static final String ATTR_SCOPE = "scope";
-
- /**
- * scrolling attribute
- */
- public static final String ATTR_SCROLLING = "scrolling";
-
- /**
- * selected attribute
- */
- public static final String ATTR_SELECTED = "selected";
-
- /**
- * shape attribute
- */
- public static final String ATTR_SHAPE = "shape";
-
- /**
- * size attribute
- */
- public static final String ATTR_SIZE = "size";
-
- /**
- * span attribute
- */
- public static final String ATTR_SPAN = "span";
-
- /**
- * src attribute
- */
- public static final String ATTR_SRC = "src";
-
- /**
- * standby attribute
- */
- public static final String ATTR_STANDBY = "standby";
-
- /**
- * start attribute
- */
- public static final String ATTR_START = "start";
-
- /**
- * style attribute
- */
- public static final String ATTR_STYLE = "style";
-
- /**
- * summary attribute
- */
- public static final String ATTR_SUMMARY = "summary";
-
- /**
- * tabindex attribute
- */
- public static final String ATTR_TABINDEX = "tabindex";
-
- /**
- * target attribute
- */
- public static final String ATTR_TARGET = "target";
-
- /**
- * text attribute
- */
- public static final String ATTR_TEXT = "text";
-
- /**
- * title attribute
- */
- public static final String ATTR_TITLE = "title";
-
- /**
- * type attribute
- */
- public static final String ATTR_TYPE = "type";
-
- /**
- * usemap attribute
- */
- public static final String ATTR_USEMAP = "usemap";
-
- /**
- * valign attribute
- */
- public static final String ATTR_VALIGN = "valign";
-
- /**
- * value attribute
- */
- public static final String ATTR_VALUE = "value";
-
- /**
- * valuetype attribute
- */
- public static final String ATTR_VALUETYPE = "valuetype";
-
- /**
- * version attribute
- */
- public static final String ATTR_VERSION = "version";
-
- /**
- * vlink attribute
- */
- public static final String ATTR_VLINK = "vlink";
-
- /**
- * vspace attribute
- */
- public static final String ATTR_VSPACE = "vspace";
-
- /**
- * width attribute
- */
- public static final String ATTR_WIDTH = "width";
-
- /**
- * submit type
- */
- public static final String TYPE_SUBMIT = "submit";
-
- /**
- * checkbox type
- */
- public static final String TYPE_CHECKBOX = "checkbox";
-
- /**
- * radio type
- */
- public static final String TYPE_RADIO = "radio";
-
- /**
- * image type
- */
- public static final String TYPE_IMAGE = "image";
-
- /**
- * password type
- */
- public static final String TYPE_PASSWORD = "password";
-
- /**
- * text type
- */
- public static final String TYPE_TEXT = "text";
-
- /**
- * hidden type
- */
- public static final String TYPE_HIDDEN = "hidden";
-
- /**
- * submit query label
- */
- public static final String SUBMIT_LABEL = "Submit Query";
-
- /**
- * reset label
- */
- public static final String RESET_LABEL = "Reset";
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/IJMTConstants.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/IJMTConstants.java
deleted file mode 100644
index ef1d758..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/IJMTConstants.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner;
-
-/**
- * JMT constants that would be used through the JMT core plugin.
- *
- * @author mengbo
- */
-public interface IJMTConstants {
- /**
- * bundle file name
- */
- public static final String PAGEDESIGNER_RESOURCE_BUNDLE_FILE = "org.eclipse.jst.pagedesigner.editors.pagedesigner.JSPEditorMessages"; //$NON-NLS-1$
-
- // Properties contains general properties and defaults to preferences.
- /**
- * root resource bundle name
- */
- public static final String ROOT_RESOURCEBUNDLE = "org.eclipse.jst.pagedesigner.JMTResources"; //$NON-NLS-1$
-
- /**
- * default property file name
- */
- public static final String DEFAULT_PROPERTIES = "default.properties"; //$NON-NLS-1$
-
- /**
- * default style sheet
- */
- public static final String USERAGENT = "html4.css"; //$NON-NLS-1$
-
- /**
- * html editor id
- */
- public static final String EDITORID_HTML = "org.eclipse.jst.pagedesigner.PageDesignerEditor"; //$NON-NLS-1$
-
- /**
- * show all action preference id
- */
- public static final String PREF_PALETTE_SHOW_ALL = "pref.palette.showall"; //$NON-NLS-1$
-
- /**
- * local name of page designer extension
- */
- public static final String EXTENSION_POINT_PAGEDESIGNER = "pageDesignerExtension"; //$NON-NLS-1$
-
- /**
- * local name of cm registry extension
- */
- public static final String EXTENSION_POINT_CMREGISTRY = "cmRegistry"; //$NON-NLS-1$
-
- /**
- * local name of local drop handler extension
- */
- public static final String LOCAL_DROP_HANDLER = "localDropHandler"; //$NON-NLS-1$
-
- /**
- * local name of tag converter factory extension
- */
- public static final String TAG_CONVERTER_FACTORY = "tagConverterFactory"; //$NON-NLS-1$
-
- /**
- * local name of attribute cell editor factory extension
- * @deprecated and unused
- */
- public static final String ATTRIBUTE_CELLEDITOR_FACTORY = "attributeCellEditorFactory"; //$NON-NLS-1$
-
- /**
- * local name of tag attribute cell editor factory extension
- */
- public static final String TAG_ATTRIBUTE_CELLEDITOR_FACTORY = "tagAttributeCellEditorFactory"; //$NON-NLS-1$
-
- /**
- * local name of tag transform operation extension
- */
- public static final String TAG_TRANSFORM_OPERATION = "tagTransformOperation"; //$NON-NLS-1$
-
- /**
- *
- * local name of element edit factory extension
- */
- public static final String ELEMENT_EDIT_FACTORY = "elementEditFactory"; //$NON-NLS-1$
-
- /**
- * local name of link creator extension
- */
- public static final String LINK_CREATOR = "linkCreator"; //$NON-NLS-1$
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/JMTResources.properties b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/JMTResources.properties
deleted file mode 100644
index 33b4fef..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/JMTResources.properties
+++ /dev/null
@@ -1,247 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2008 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are 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:
-# Oracle Corporation - initial API and implementation
-###############################################################################
-####################################################
-# Resource message for Logging
-####################################################
-Log.Error.PageDesignerResources.Open=Error occurred getting the source bundle.
-Log.Error.MessageFormater.Format0=Error in message format.
-Log.Error.ExtensionReader.ReadLinkExtension=can't create linkCreator instance
-Log.Error.PreviewResources.ResouceNotFound=resource {0} not found
-
-Error.StringBufferWriter.Write.0=Error in string buffer writing.
-Error.RangeModeCommand.SetSelection=Selection error
-Error.SourceViewerCommand.Execution=Error in command execution
-Error.PDPlugin.Installation.0=Error starting plug-in.
-Error.PDPlugin.Installation.1=Problems starting plug-in Web Application Development.
-Error.PDPlugin.Installation.6=Problems starting plug-in Web Application Development.
-Error.DesignerPropertyTool.NatureQuerying=Error in project Java nature querying.
-Error.PDPlugin.Installation.10=log.PDPlugin.image.error
-Error.PDPlugin.Installation.13=log.PDPlugin.image.error
-Error.PDPlugin.Installation.15=error in installtion query.
-Error.ProjectResolver.GetlocationByURI.0=Error in taglib locating.
-Error.ProjectFileDialogContentProvider.0=Core error, you may need to restart the application.
-Error.EditValidateUtil.Position = Error in position validation.
-Error.EditValidateUtil.Text = Error occurred in text validation.
-Error.EditValidateUtil.Node = Error occurred in node validation.
-Error.EditValidateUtil.Range = Error occurred in range validation.
-Error.EditValidateUtil.StringIndex = Invalid string.
-Error.EditValidateUtil.IndexOffset = Invalid index or offset of string.
-CSSColorConverter.0=Error in color expression:
-CSSColorConverter.1=Error in color expression:
-Error.CSSFigure.0=Error in flowContext setting.
-Error.CSSUtil.0=Could not cast to CSS style
-Error.CSSUtil.1=Could not cast to CSS style
-Error.CSSUtil.2=Could not cast to CSS style
-Error.CSSUtil.3=Could not cast to CSS style
-Error.HTMLEditor.0=
-Error.HTMLEditor.1=Error occurred getting storage contents
-Error.HTMLEditor.2=Error occurred closing content.
-Error.HTMLEditor.3=The core has exception
-Error.HTMLEditor.4=Error occurred closing stream.
-Error.HTMLEditor.5=Error occurred initializing the editor.
-Error.HTMLEditor.6=Error occurred changing the page.
-Error.FontSizeMeta.0=Error occurred in tag font attribute calculating.
-Error.EditModelQuery.0=Error in position creation:
-Error.EditModelQuery.1=Error occurred getting node at indexed position
-Error.CommonResourceDialog.0.1=Error in project memeber querying
-Error.CommonResourceDialog.0.2=Please refer to error log for details
-Error.ImgFileFilter.1=CoreException is thrown, please refer to error log for details
-Error.ImgFileFilter.3=CoreException is thrown, please refer to error log for details
-Error.ImgFileFilter.0=Error in filtering the tree
-Error.ImgFileFilter.2=Error in getting project Nature
-Info.FontWeightMeta.0=Error occurred in integer processing.
-Warn.PolicyHelper.0=cannot get status line manager
-Warn.PolicyHelper.1=viewer is not HTML viewer
-HTMLSpecialCharHelper.3=Exception thrown
-HTMLSpecialCharHelper.2=Truncated & without ;
-HTMLSpecialCharHelper.1=Not an entity and not a &\#XXXX;
-HTMLSpecialCharHelper.0=Error in number expression
-
-####################################################
-# Resource message for RenderingTraverser
-####################################################
-RenderingTraverser.Error.FileNotFound = File Not Found
-RenderingTraverser.Error.UnsupportedEncoding = Unsupport Encoding
-RenderingTraverser.Error.IO = IO exception
-
-PaletteItemManager.error=error in constructor
-PaletteItemManager.initForPluginExtension.error.IOException=IOExcetpion in initForPluginExtension error
-PaletteItemManager.initForPluginExtension.error.MalformedURLException=MalformedURLException in initForPluginExtension
-PaletteItemManager.initForPluginExtension.error.InstantiationException=InstantiationException in initForPluginExtension
-PaletteItemManager.save.error.IOException=IOException when save
-ParagraphSupport.CommandLabel.Preformated=Preformated
-PaletteItemManager.loadPaletteItemState.error.IOException=IOException in loadPaletteItemState
-PaletteItemManager.loadPaletteItemState.error.SAXException=SAXException in loadPaletteItemState
-PaletteItemManager.loadPaletteItemState.error.getDocumentBuilderFail=getDocumentBuilder Failed
-
-PreviewUtil.previewFile.CoreException= CoreException previewing file
-PreviewUtil.previewFile.IOException= IOException previewing file
-
-#context menu
-ActionGroup.Submenu.TextStyle=Text Style
-ActionGroup.Submenu.Align=Align
-ActionGroup.Submenu.ParagraphFormat=Paragraph Format
-ActionGroup.Submenu.StyleClasses=Style Classes
-ActionGroup.Submenu.BorderStyle=Border Style
-ActionGroup.Submenu.Color=Color
-ActionGroup.Submenu.BackgroundColor=Background Color
-ActionGroup.Submenu.Link=Make Link...
-ActionGroup.Submenu.SelectRelative=Select Relative
-
-TableActionGroup.Submenu.SelectTable=Select Table
-TableActionGroup.Submenu.InsertRowBefore=Insert Row Before
-TableActionGroup.Submenu.InsertRowAfter=Insert Row After
-TableActionGroup.Submenu.InsertColumnBefore=Insert Column Before
-TableActionGroup.Submenu.InsertColumnAfter=Insert Column After
-TableActionGroup.Submenu.DeleteRow=Delete Row
-TableActionGroup.Submenu.DeleteColumn=Delete Column
-ElementEdit.Submenu.Table=Table
-ElementEdit.Submenu.SelectTable=Select Table
-ElementEdit.Submenu.InsertRowBefore=Insert Row Before
-ElementEdit.Submenu.InsertRowAfter=Insert Row After
-ElementEdit.Submenu.InsertColumnBefore=Insert Column Before
-ElementEdit.Submenu.InsertColumnAfter=Insert Column After
-ElementEdit.Submenu.DeleteRow=Delete Row
-ElementEdit.Submenu.DeleteColumn=Delete Column
-ElementEdit.Submenu.InsertHeader=Insert Header
-ElementEdit.Submenu.InsertFooter=Insert Footer
-ElementEdit.Submenu.DeleteHeader=Delete Header
-ElementEdit.Submenu.DeleteFooter=Delete Footer
-ElementEdit.Submenu.Taglib=Open Definition File
-TableInsertHeaderFooterCommand.ColumnHeader=Column Header
-TableInsertHeaderFooterCommand.ColumnFooter=Column Footer
-
-Action.Name.Copy=Copy
-Action.Name.Cut=Cut
-Action.Name.Paste=Paste
-
-Message.Warning.Title=Warning
-Taglib.OpenFile.ERROR=The file that the URI refers to does not exist.
-
-MakeLinkAction.Wizard.PageTitle=Please select link type
-CreateLinkWizard.Title=Select Link Type
-LinkWizardPage.GroupTitle=Link Types
-LinkWizardPage.PreviewLabel=Preview
-
-ItemCreationEditPolicy.CommandLabel.CreateItem=Create Item
-MakeLinkCommand.Label.MakeLink=Make Link
-AttributePropertySource.CommandLabel.ChangeAttribute=Change Attribute
-ChangeAttributeAction.CommandLabel.ChangeStyleClass=Change Style Class
-BorderStyleSupport.CommandLabel.Hidden=Hidden
-BorderStyleSupport.CommandLabel.Dotted=Dotted
-BorderStyleSupport.CommandLabel.Dashed=Dashed
-BorderStyleSupport.CommandLabel.Solid=Solid
-BorderStyleSupport.CommandLabel.Double=Double
-BorderStyleSupport.CommandLabel.Groove=Groove
-BorderStyleSupport.CommandLabel.Ridge=Ridge
-BorderStyleSupport.CommandLabel.Inset=Inset
-BorderStyleSupport.CommandLabel.Outset=Outset
-ColorSupport.CommandLabel.Aqua=Aqua
-ColorSupport.CommandLabel.Black=Black
-ColorSupport.CommandLabel.Blue=Blue
-ColorSupport.CommandLabel.Fuchsia=Fuchsia
-ColorSupport.CommandLabel.Gray=Gray
-ColorSupport.CommandLabel.Green=Green
-ColorSupport.CommandLabel.Lime=Lime
-ColorSupport.CommandLabel.Maroon=Maroon
-ColorSupport.CommandLabel.Navy=Navy
-ColorSupport.CommandLabel.Olive=Olive
-ColorSupport.CommandLabel.Orange=Orange
-ColorSupport.CommandLabel.Purple=Purple
-ColorSupport.CommandLabel.Red=Red
-ColorSupport.CommandLabel.Silver=Silver
-ColorSupport.CommandLabel.Teal=Teal
-ColorSupport.CommandLabel.White=White
-ColorSupport.CommandLabel.Yellow=Yellow
-ColorSupport.CommandLabel.Default=Default
-ParagraphSupport.CommandLabel.None=None
-ParagraphSupport.CommandLabel.Paragraph=Paragraph
-ParagraphSupport.CommandLabel.Heading1=Heading 1
-ParagraphSupport.CommandLabel.Heading2=Heading 2
-ParagraphSupport.CommandLabel.Heading3=Heading 3
-ParagraphSupport.CommandLabel.Heading4=Heading 4
-ParagraphSupport.CommandLabel.Heading5=Heading 5
-ParagraphSupport.CommandLabel.Heading6=Heading 6
-ParagraphSupport.CommandLabel.P=P
-ParagraphSupport.CommandLabel.H1=H1
-ParagraphSupport.CommandLabel.H2=H2
-ParagraphSupport.CommandLabel.H3=H3
-ParagraphSupport.CommandLabel.H4=H4
-ParagraphSupport.CommandLabel.H5=H5
-ParagraphSupport.CommandLabel.H6=H6
-ParagraphSupport.CommandLabel.PRE=PRE
-HTagsInsertGroupAction.ActionLabel.Hx=Hx
-RangeStyleSupport.ActionLabel.Bold=Bold
-RangeStyleSupport.ActionLabel.Italic=Italic
-RangeStyleSupport.ActionLabel.Underline=Underline
-ShowAllAction.ActionLabel.ShowAll=Show All
-AlignSupport.ActionLabel.Left=Left
-AlignSupport.ActionLabel.Center=Center
-AlignSupport.ActionLabel.Right=Right
-AlignSupport.ActionLabel.Justify=Justify
-
-Info.ElementDescReader.ReadPropertyFile=The property file:{0} is not found
-Info.ElementDescReader.ReadPropertyFile.Key=The key:{0} is not found in file:{1}
-ChangeStyleAction.Text=Edit Style...
-
-Log.Error.HTMLStringTagConverter.Error=Error
-ConverterUtil.Description= Drag and drop Web page content here
-
-SimpleGraphicalEditor.help.id=org.eclipse.jst.pagedesigner.graphicalEditor
-DesignerTabbedPropertySheetPage.help.id=org.eclipse.jst.pagedesigner.QuickEditor
-MyPropertySheetPage.help.id=org.eclipse.jst.pagedesigner.Attributes
-StyleDialog.help.id=org.eclipse.jst.pagedesigner.styleDialog
-DesignerPaletteViewerProvider.help.id=org.eclipse.jst.pagedesigner.palette_help
-
-StyleClassSupport.Default=Default
-XMLUtil.Error.0=Error in create documentBuilder:
-XMLUtil.Error.2=Error in object persistance:
-PreviewUtil.Error.0=Error occurred processing the resource bundle:
-PreviewUtil.Error.3=Error occurred opening the file:
-PreviewHandlerNew.Error.0=Error in model release:
-PreviewConvertContext.Error.0=Error:
-CellEditorFactoryRegistry.Info.2=Error in fields retrieving:
-CellEditorFactoryRegistry.Info.3=Error in fields retrieving:
-PageExpressionContext.Info.0=Error:
-TextLayoutSupport.Info.1=Error in text painting:
-
-CMRegistry.ReadConfigration=Reading Properties Configurations
-CMRegistry.HTMLConfigration=Reading HTML Configuration ...
-CMRegistry.JSPConfigration=Reading JSP Configuration ...
-CMRegistry.OtherConfigration=Reading Other Configuration ...
-
-HTMLEditor.Design=Design
-HTMLEditor.Source=Source
-
-LocalSelectionDropTargetListener.MessageDialog.Title=Info
-LocalSelectionDropTargetListener.MessageDialog.Message=The page is deleted, save it first.
-
-LoadBundleTagConverter.convertRefresh.MalformedURLException= MalformedURLException in LoadBundleTagConverter
-LoadBundleTagConverter.convertRefresh.IOException= IOException in LoadBundleTagConverter
-
-Warning.TransformOperationFactory.ExtensionNotFound=ITransformOperation id not found in pageDesigner extension registry ("{0}")
-Warning.TransformOperationFactory.CannotLoadOpClass=Unable to load tag transform operation Class for id ("{0}")
-Warning.TransformOperationFactory.ClassNotFound=ITransformOperation class specified by name in metadata not found ("{0}")
-Warning.TransformOperationFactory.IllegalAccess=ITransformOperation class specified by name in metadata could not be legally accessed ("{0}")
-Warning.TransformOperationFactory.Instantiation=ITransformOperation class specified by name in metadata could not be instantiated ("{0}")
-Warning.TransformOperationFactory.NotAbstractTransformOperation=ITransformOperation class specified by name in metadata does not extend AbstractTransformOperation ("{0}")
-Warning.TransformOperationFactory.UnknownOperationID=Unknown operation ID specified in metadata ("{0}")
-Warning.TransformOperationFactory.TooFewParameters=Too few parameters specified in metadata for operation ("{0}")
-Warning.TransformOperationFactory.RegistryError=Unable to read "{0}" extension registry
-
-#Errors relating to ITagCreator et al.
-Error.TagCreatorMustBeOfType=ITagCreator instances must be of type {0}.
-Error.ProblemLoadingExtensionPoint=Problem loading ITagCreatorFactory extension Point
-Error.ProblemLoadingTagCreatorFactory=Problem loading tag creator factory: {0}
-Error.ProblemLoadingExecutingTagCreator=Problem executing tag creator: {0}
-
-#Property Sheet
-QuickEditTab.no_quick_edit_md=No quick edit properties are available for the current selection
\ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/PDPlugin.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/PDPlugin.java
deleted file mode 100644
index 06db1dd..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/PDPlugin.java
+++ /dev/null
@@ -1,456 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.MissingResourceException;
-import java.util.Properties;
-import java.util.ResourceBundle;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.ILog;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.jst.jsf.common.ui.internal.guiutils.Alerts;
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class PDPlugin extends AbstractUIPlugin {
- private static final String ICONS_LIB_PATH = "icons";
-
- //private static final boolean ROOT_PLUGIN = false;
-
- // The shared instance.
- private static PDPlugin _plugin;
-
- private static Logger _log;
-
- private static Alerts _alerts;
-
- private ResourceBundle _resourceBundle;
-
- private Properties _properties;
-
- private URL _pluginBase;
-
- /**
- * The constructor.
- */
- public PDPlugin() {
- super();
- _plugin = this;
- }
-
- /**
- * This method is called upon plug-in activation
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
-
- try {
- // get resource bundle.
- _resourceBundle = ResourceBundle
- .getBundle(IJMTConstants.ROOT_RESOURCEBUNDLE);
- _alerts = new Alerts(this, _resourceBundle);
-
- // get properties.
- _properties = new Properties();
- InputStream input = null;
- _pluginBase = getBundle().getEntry("/");
- try {
- input = (new URL(_pluginBase, IJMTConstants.DEFAULT_PROPERTIES))
- .openStream();
- _properties.load(input);
- } finally {
- try {
- input.close();
- } catch (IOException ee)// NOPMD
- {
- // nothing to do when IOException throwed in closing files.
- }
- }
-
- // set up logging for this plugin and everthing under it.
- _log = new Logger(this.getBundle(), _resourceBundle);
-
- // NOTE: add in any other plugin code statup HERE!!!!
-
- // log.CommonPlugin=Web Application Development Common Plugin
- // initialized on eclipse version {0}.
-
- // log.info("log.CommonPlugin", version);
-
- } catch (Exception ee) {
- // only log if the logger was configured correctly.
- if (_log != null) {
- _log
- .error(
- "log.msg",
- "Problems starting plug-in Web Application Development Common.",
- ee);
- }
-
- throw new CoreException(
- new Status(
- IStatus.ERROR,
- getBundle().getSymbolicName(),
- IStatus.OK,
- "Problems starting plug-in Web Application Development Common",
- ee));
- }
- }
-
- /**
- * Returns the shared instance.
- * @return the default plugin
- */
- public static PDPlugin getDefault() {
- return _plugin;
- }
-
- /**
- * get the alerts objects associated with this plugin for alerting the user.
- *
- * @return the Alerts object
- */
- public static Alerts getAlerts() {
- return _alerts;
- }
-
- /**
- * Returns a logger for the new class using this plugin for reference.
- * @param theClass
- * @return the Logger object associated with theClass
- */
- public static Logger getLogger(Class theClass) {
- if (getDefault() != null && getDefault().getRootLogger() != null) {
- return getDefault().getRootLogger();
- }
- return null;
- }
-
- /**
- * Returns the plugin's root logger
- * @return the root logger
- */
- public Logger getRootLogger() {
- return _log;
- }
-
- /**
- * Returns this plugin's unique identifier
- * @return the plugin id
- */
- public static String getPluginId() {
- return getDefault().getBundle().getSymbolicName();
- }
-
- /**
- * @return the plugin's resource bundle
- */
- public ResourceBundle getResourceBundle() {
- return _resourceBundle;
- }
-
- /**
- * @param key
- * @return the string from the plugin's resource bundle, or 'key' if not
- * found.
- */
- public static String getResourceString(String key) {
- ResourceBundle bundle = PDPlugin.getDefault().getResourceBundle();
- try {
- return (bundle != null) ? bundle.getString(key) : key;
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-
- /**
- * @return the plugin's descriptor's resource bundle,
- */
- public ResourceBundle getPluginDecriptorBundle() {
- return Platform.getResourceBundle(getDefault().getBundle());
- }
-
- /**
- * @return the plugin's default properties. These are normally used for
- * default preferences.
- */
- public Properties getProperties() {
- return _properties;
- }
-
- /**
- * @return the standard display to be used. The method first checks, if the
- * thread calling this method has an associated dispaly. If so, this display
- * is returned. Otherwise the method returns the default display.
- */
- public static Display getStandardDisplay() {
- Display display;
- display = Display.getCurrent();
- if (display == null) {
- display = Display.getDefault();
- }
- return display;
- }
-
- /**
- * @return the workspace instance.
- */
- public static IWorkspace getWorkspace() {
- return ResourcesPlugin.getWorkspace();
- }
-
- /**
- * Returns a shared image for the given name. Image must exist in icons folder of pagedesigner plugin.
- * <p>
- * Note: Images returned from this method will be automitically disposed of
- * when this plug-in shuts down. Callers must not dispose of these images
- * themselves.
- * </p>
- *
- * @param name
- * the image name found in /icons (with extension)
- * @return the image, null on error or not found.
- */
- public Image getImage(String name) {
- if (name == null) {
- return null;
- }
-
- ImageRegistry images = getImageRegistry();
- Image image = images.get(name);
- if (image == null) {
- getImageDescriptor(name);
- image = images.get(name);
- }
- return image;
- }
-
- /**
- * Returns a shared ImageDescriptor for the given name
- * <p>
- * Note: ImageDescriptor returned from this method will be automatically
- * disposed of when this plug-in shuts down. Callers must not dispose of
- * these ImageDescriptor themselves.
- * </p>
- *
- * @param name
- * the ImageDescriptor name found in /icons (with extension)
- * @return the ImageDescriptor, null on error or not found.
- */
- public ImageDescriptor getImageDescriptor(String name) {
- if (name == null) {
- return null;
- }
-
- ImageRegistry images = getImageRegistry();
- ImageDescriptor id = images.getDescriptor(name);
- if (id == null) {
- InputStream stream = null;
- try {//check existance of file
- URL url = new URL(_pluginBase,
- ICONS_LIB_PATH + "/" + name);
-
- //doing the following to check existance... exception will be caught and null descriptor returned
- stream = url.openStream();
- stream.close();
-
- id = ImageDescriptor.createFromURL(url);
- images.put(name, id);
- } catch (IOException e1) {
- _log.info("Unable to create ImageDescriptor for: "+name, e1);
- return null;
- }
- }
- return id;
- }
-
- /**
- * Read a file resource. The file should contain any partial path and the
- * filename from the plugin base. The caller is responsible for closing the
- * file.
- * @param file
- * @return the input stream for the file
- * @throws MalformedURLException
- * @throws IOException
- */
- public InputStream readFile(String file) throws MalformedURLException,
- IOException {
- return (new URL(_pluginBase, file)).openStream();
- }
-
- /**
- * @param file
- * @return the File associate with the name 'file'
- * @throws MalformedURLException
- * @throws IOException
- */
- public File getFile(String file) throws MalformedURLException, IOException {
- return new File((new URL(_pluginBase, file)).getPath());
- }
-
- /**
- * @return the plugin's install location with the leading "/" removed
- * and normalized to the the os string.
- */
- public static Path getInstallLocation() {
- try {
- URL url = getDefault().getBundle().getEntry("/");
- String s1 = FileLocator.resolve(url).getFile();
- if (s1.startsWith("/")) //$NON-NLS-1$
- {
- s1 = s1.substring(1);
- }
- s1 = (new Path(s1)).toOSString();
- String s;
- if (s1.endsWith(File.separator)) {
- s = s1;
- } else {
- s = s1 + File.separator;
- }
- return new Path(s);
- } catch (Exception exception) {
- _log.error("Error.PDPlugin.Installation.15", exception); //$NON-NLS-1$
- return null;
- }
- }
-
- /**
- * Returns the active workbench window.
- *
- * @return the active workbench window. this can be null but I've never seen
- * it.
- */
- public static IWorkbenchWindow getActiveWorkbenchWindow() {
- if (getDefault().getWorkbench() == null) {
- return null;
- }
- return getDefault().getWorkbench().getActiveWorkbenchWindow();
- }
-
- /**
- * Returns the active workbench page. Note that the active page may not be
- * the one that the user perceives as active in some situations so this
- * method of obtaining the activate page should only be used if no other
- * method is available.
- *
- * @return the active workbench page
- */
- public static IWorkbenchPage getActivePage() {
- IWorkbenchWindow window = getActiveWorkbenchWindow();
- if (window == null) {
- return null;
- }
- return window.getActivePage();
- }
-
- /**
- * Initializes the preference controls to the default values. These values
- * are used the first time the preference page is displayed or when the user
- * presses the Defaults button in the preferences page.
- */
- protected void initializeDefaultPreferences(IPreferenceStore store) {
- // initialize any preferences for this plugin.
- }
-
- /**
- * @return the active workbench Shell. Used for some funciton need IShell
- * Parameter.
- */
- public static Shell getActiveWorkbenchShell() {
- IWorkbenchWindow window = getActiveWorkbenchWindow();
- if (window != null) {
- return window.getShell();
- }
- IWorkbenchWindow[] windows = getDefault().getWorkbench()
- .getWorkbenchWindows();
- if (windows.length > 0) {
- return windows[0].getShell();
- }
- return null;
- }
-
- /**
- * @return the active display.
- */
- public static Display getDisplay() {
- Shell shell = getActiveWorkbenchShell();
- if (shell != null) {
- return shell.getDisplay();
- }
- return Display.getDefault();
- }
-
- /**
- * @return current active project.
- */
- public static IProject getCurrentProject() {
- IProject curProject = null;
- IEditorPart editor = PDPlugin.getDefault().getWorkbench()
- .getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- IEditorInput input = editor.getEditorInput();
- IFile inputFile = null;
- if (input instanceof IFileEditorInput) {
- inputFile = ((IFileEditorInput) input).getFile();
- curProject = inputFile.getProject();
- }
- return curProject;
- }
-
- /**
- * Log status using the default plugin logger
- * @param status
- */
- public static void log(IStatus status)
- {
- ILog log = getDefault().getLog();
- log.log(status);
- }
-
- /**
- * @param message
- * @param excp
- */
- public static void log(String message, Throwable excp)
- {
- Status status = new Status(IStatus.ERROR, getPluginId(), message, excp);
- log(status);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/container/ContainerActionGroup.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/container/ContainerActionGroup.java
deleted file mode 100644
index 807cad2..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/container/ContainerActionGroup.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.actions.container;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.pagedesigner.elementedit.IElementEdit;
-import org.eclipse.jst.pagedesigner.parts.ElementEditPart;
-import org.eclipse.jst.pagedesigner.parts.NodeEditPart;
-import org.eclipse.jst.pagedesigner.range.RangeUtil;
-import org.eclipse.jst.pagedesigner.viewer.DesignPosition;
-import org.eclipse.jst.pagedesigner.viewer.DesignRange;
-import org.eclipse.ui.actions.ActionGroup;
-import org.w3c.dom.Text;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class ContainerActionGroup extends ActionGroup {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.actions.ActionGroup#fillContextMenu(org.eclipse.jface.action.IMenuManager)
- */
- public void fillContextMenu(IMenuManager menu) {
- ISelection selection = this.getContext().getSelection();
-
- EditPart part = findCommonAncesterPart(selection);
- if (!(part instanceof NodeEditPart)) {
- return;
- }
-
- NodeEditPart original = (NodeEditPart) part;
- // start from the parent of part
- while (part.getParent() instanceof ElementEditPart) {
- ElementEditPart elementEditPart = (ElementEditPart) part
- .getParent();
-
- IElementEdit elementEdit = elementEditPart.getElementEdit();
- if (elementEdit != null) {
- boolean filled = elementEdit.fillContainerContextMenu(menu,
- elementEditPart, original, selection);
- if (filled) {
- break;
- }
- }
-
- part = part.getParent();
- }
- }
-
- /**
- * Give a selection, find a single common container node as start for table
- * related operations.
- *
- * @param selection
- * @return
- */
- private EditPart findCommonAncesterPart(ISelection selection) {
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection structsel = (IStructuredSelection) selection;
- if (structsel.size() != 1) {
- return null;
- } else if (structsel.getFirstElement() instanceof EditPart) {
- return (EditPart) structsel.getFirstElement();
- } else {
- return null;
- }
- } else if (selection instanceof DesignRange) {
- DesignRange range = (DesignRange) selection;
- if (!range.isValid()) {
- return null;
- }
- if (range.isEmpty()) {
- DesignPosition position = range.getStartPosition();
- if (position.getOffset() == 0
- || position.getContainerNode() instanceof Text) {
- return position.getContainerPart();
- }
- return position.getSiblingEditPart(false);
- }
- return RangeUtil.findCommonAncestor(range);
- } else {
- return null;
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/link/AbstractLinkCreator.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/link/AbstractLinkCreator.java
deleted file mode 100644
index 0e7f371..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/link/AbstractLinkCreator.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.actions.link;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExecutableExtension;
-import org.eclipse.jst.pagedesigner.viewer.DesignRange;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public abstract class AbstractLinkCreator implements ILinkCreator,
- IExecutableExtension {
- private String _identifier;
- /**
- * the link identifier attribute name
- */
- private static final String LINK_IDENTIFIER = "linkIdentifier";
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.actions.link.ILinkCreator#canExcute(org.eclipse.jst.pagedesigner.viewer.DesignRange)
- */
- public boolean canExecute(DesignRange range) {
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.actions.link.ILinkCreator#getLinkIdentifier()
- */
- public String getLinkIdentifier() {
- return this._identifier;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.IExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement,
- * java.lang.String, java.lang.Object)
- */
- public void setInitializationData(IConfigurationElement config,
- String propertyName, Object data) throws CoreException {
- this._identifier = config.getAttribute(LINK_IDENTIFIER);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/link/CreateLinkWizard.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/link/CreateLinkWizard.java
deleted file mode 100644
index b385663..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/link/CreateLinkWizard.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.actions.link;
-
-import java.util.Map;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.viewer.DesignRange;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class CreateLinkWizard extends Wizard {
- private static final String WIZARD_TITLE = PDPlugin
- .getResourceString("CreateLinkWizard.Title");
-
- private static final String INTIAL_DEFAULT_PAGE_IMAGE = "newsuade_wiz.gif";
-
- private static final String PAGE_NAME = "first";
-
- private String _pageTitle;
-
- private EditPart _part;
-
- private DesignRange _range;
-
- private Map<String, ILinkCreator> _linkMap;
-
- private String _linkType;
-
- /**
- * @param part
- * @param range
- * @param linkMap
- */
- public CreateLinkWizard(EditPart part, DesignRange range, Map<String, ILinkCreator> linkMap) {
- this._part = part;
- this._range = range;
- this._linkMap = linkMap;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.wizard.IWizard#addPages()
- */
- public void addPages() {
- addPage(new LinkWizardPage(PAGE_NAME, _pageTitle, this._part,
- this._range, this._linkMap));
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.wizard.IWizard#canFinish()
- */
- public boolean canFinish() {
- return super.canFinish();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.wizard.IWizard#performFinish()
- */
- public boolean performFinish() {
- LinkWizardPage page = (LinkWizardPage) getPage(PAGE_NAME);
- this._linkType = page.getChosenLinkType();
- return true;
- }
-
- /**
- * @param pageTitle
- */
- public void setPageTitle(String pageTitle) {
- _pageTitle = pageTitle;
- initializeDefaultPageImageDescriptor();
- }
-
- /**
- *
- */
- protected void initializeDefaultPageImageDescriptor() {
- ImageDescriptor desc = PDPlugin.getDefault().getImageDescriptor(
- INTIAL_DEFAULT_PAGE_IMAGE);
- setDefaultPageImageDescriptor(desc);
- setWindowTitle(WIZARD_TITLE);
- }
-
- /**
- * @return the link type
- */
- public String getChosenLinkType() {
- return this._linkType;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/link/ExtensionReader.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/link/ExtensionReader.java
deleted file mode 100644
index 6cf3d9f..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/link/ExtensionReader.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.actions.link;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.pagedesigner.IJMTConstants;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class ExtensionReader {
- private static Logger _log = PDPlugin.getLogger(ExtensionReader.class);
-
- private static List<ILinkCreator> _handlers = null;
-
- private static final String ATTR_CLASS = "class";
-
- /**
- * @return the ext-pts for the link handler
- * List is not modifiable
- */
- public static synchronized List<ILinkCreator> getAllLinkHandlers() {
- if (_handlers == null) {
- _handlers = readAllLinkHandlers();
- }
- return Collections.unmodifiableList(_handlers);
-
- }
-
- private static List<ILinkCreator> readAllLinkHandlers() {
- List<ILinkCreator> result = new ArrayList<ILinkCreator>();
- IExtensionPoint extensionPoint = Platform.getExtensionRegistry()
- .getExtensionPoint(PDPlugin.getPluginId(),
- IJMTConstants.EXTENSION_POINT_PAGEDESIGNER);
- IExtension[] extensions = extensionPoint.getExtensions();
-
- for (int i = 0; i < extensions.length; i++) {
- IExtension ext = extensions[i];
- IConfigurationElement[] linkHandlers = ext
- .getConfigurationElements();
-
- for (int j = 0; j < linkHandlers.length; j++) {
- if (linkHandlers[j].getName()
- .equals(IJMTConstants.LINK_CREATOR)) {
- linkHandlers[j].getAttribute(ATTR_CLASS);
- Object obj;
- try {
- obj = linkHandlers[j]
- .createExecutableExtension(ATTR_CLASS);
-
- if (obj instanceof ILinkCreator) {
- result.add((ILinkCreator)obj);
- }
- } catch (CoreException e) {
- _log
- .error("Log.Error.ExtensionReader.ReadLinkExtension");
- }
- }
- }
- }
- return result;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/link/HtmlLinkCreator.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/link/HtmlLinkCreator.java
deleted file mode 100644
index 8e3c6f9..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/link/HtmlLinkCreator.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.actions.link;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.jst.pagedesigner.parts.TextEditPart;
-import org.eclipse.jst.pagedesigner.viewer.DesignRange;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class HtmlLinkCreator extends AbstractLinkCreator {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.actions.link.ILinkCreator#makeLinkElement(org.eclipse.gef.EditPart,
- * org.eclipse.jst.pagedesigner.viewer.DesignRange)
- */
- public Element makeLinkElement(EditPart part, DesignRange range) {
- if (part instanceof TextEditPart) {
- Text middleNode = LinkUtil.splitDomText(part, range);
- EditPart parent = part.getParent();
- Node parentNode = (Node) parent.getModel();
- Document doc = (parentNode instanceof Document) ? (Document) parentNode
- : (parentNode.getOwnerDocument());
-
- Element htmlLink = doc.createElement(IHTMLConstants.TAG_A);
- htmlLink.setAttribute(ICSSPropertyID.ATTR_HREF, "");
- Text text = doc.createTextNode(middleNode.getNodeValue());
- htmlLink.appendChild(text);
- parentNode.replaceChild(htmlLink, middleNode);
- return htmlLink;
- }
-
- return null;
- }
-
- public String getSourcePreview(EditPart part, DesignRange range) {
- if (part instanceof TextEditPart) {
- TextEditPart textPart = (TextEditPart) part;
- int[] offsets = textPart.getSelectedRange();
- String displayData = textPart.getTextData();
-
- String linkExp = displayData.substring(offsets[0], offsets[1]);
- StringBuffer sb = new StringBuffer();
- sb.append("<a href=\"\">");
- sb.append(linkExp);
- sb.append("</a>");
- return sb.toString();
- }
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/link/ILinkCreator.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/link/ILinkCreator.java
deleted file mode 100644
index 0652f37..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/link/ILinkCreator.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.actions.link;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.jst.pagedesigner.viewer.DesignRange;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public interface ILinkCreator {
-
- /**
- * @param part
- * @param range
- * @return the link element
- */
- public Element makeLinkElement(EditPart part, DesignRange range);
-
- /**
- * @return link identifier
- */
- public String getLinkIdentifier();
-
- /**
- * @param range
- * @return true if can call makeLinkElement
- */
- public boolean canExecute(DesignRange range);
-
- /**
- * @param part
- * @param range
- * @return a preview string that approximates the result
- * of makeLinkElement
- */
- public String getSourcePreview(EditPart part, DesignRange range);
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/link/LinkRequest.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/link/LinkRequest.java
deleted file mode 100644
index 1caa1f8..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/link/LinkRequest.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.actions.link;
-
-import org.eclipse.gef.Request;
-import org.eclipse.jst.pagedesigner.viewer.DesignRange;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class LinkRequest extends Request {
- private final String _identifier;
-
- private final DesignRange _range;
-
- /**
- * @param identifier
- * @param range
- */
- public LinkRequest(String identifier, DesignRange range) {
- this._identifier = identifier;
- this._range = range;
- }
-
- /**
- * @return the identifier
- */
- public String getIdentifier() {
- return this._identifier;
- }
-
- /**
- * @return the design range
- */
- public DesignRange getDesignRange() {
- return this._range;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/link/LinkUtil.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/link/LinkUtil.java
deleted file mode 100644
index aeeaf41..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/link/LinkUtil.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.actions.link;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.jst.pagedesigner.dom.DOMRange;
-import org.eclipse.jst.pagedesigner.dom.DOMRangeHelper;
-import org.eclipse.jst.pagedesigner.dom.DOMRefPosition;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.jst.pagedesigner.parts.TextEditPart;
-import org.eclipse.jst.pagedesigner.viewer.DesignRange;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class LinkUtil {
- /**
- * @param part
- * @param range
- * @return the select text if part is a text node or null.
- */
- public static String getSelectedText(EditPart part, DesignRange range) {
- if (part instanceof TextEditPart) {
- TextEditPart textPart = (TextEditPart) part;
- int[] offsets = textPart.getSelectedRange();
- String displayData = textPart.getTextData();
-
- String linkExp = displayData.substring(offsets[0], offsets[1]);
- return linkExp;
- }
- return null;
- }
-
- /**
- * @param part
- * @param range
- * @return the text from part split if it is a text node or null
- */
- public static Text splitDomText(EditPart part, DesignRange range) {
- if (part instanceof TextEditPart) {
- Text textNode = (Text) part.getModel();
-
- DOMRange domRange = DOMRangeHelper.toDOMRange(range);
- IDOMPosition start = domRange.getStartPosition();
- IDOMPosition end = domRange.getEndPosition();
- int domTempStartOffset = computeOffset(start, textNode);
- int domTempEndOffset = computeOffset(end, textNode);
-
- int domStartOffset = Math.min(domTempStartOffset, domTempEndOffset);
- int domEndOffset = Math.max(domTempStartOffset, domTempEndOffset);
-
- Text lastNode = textNode;
- if (domStartOffset > 0) {
- lastNode = textNode.splitText(domStartOffset);
- }
- lastNode = lastNode.splitText(domEndOffset - domStartOffset);
- Text middleNode = (Text) lastNode.getPreviousSibling();
- return middleNode;
- }
- return null;
- }
-
- private static int computeOffset(IDOMPosition pos, Text textNode) {
- int domOffset = 0;
- if (pos instanceof DOMRefPosition) {
- DOMRefPosition rep = (DOMRefPosition) pos;
- boolean forward = rep.isForward();
- Node refNode = rep.getReferenceNode();
-
- if ((refNode != textNode) && forward || (refNode == textNode)
- && !forward) {
- domOffset = 0;
- } else {
- domOffset = textNode.getLength();
- }
- } else {
- domOffset = pos.getOffset();
- }
- return domOffset;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/link/LinkWizardPage.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/link/LinkWizardPage.java
deleted file mode 100644
index 25e120c..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/link/LinkWizardPage.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.actions.link;
-
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.viewer.DesignRange;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-/*package*/ class LinkWizardPage extends WizardPage {
- private static final String GROUP_TITLE = PDPlugin
- .getResourceString("LinkWizardPage.GroupTitle");
-
- private static final String PREVIEW_TAG_LABEL = PDPlugin
- .getResourceString("LinkWizardPage.PreviewLabel");
-
- private StyledText _text = null;
-
- private final Map<String, ILinkCreator> _linkMap;
-
- private String _linkType = null;
-
- private final EditPart _part;
-
- private final DesignRange _range;
-
- /**
- * @param pageName
- * @param title
- * @param editPart
- * @param range
- * @param linkMap
- */
- public LinkWizardPage(String pageName, String title, EditPart editPart,
- DesignRange range, Map<String, ILinkCreator> linkMap) {
- super(pageName, title, null);
- this._part = editPart;
- this._range = range;
- this._linkMap = linkMap;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
- */
- public void createControl(Composite parent) {
- GridLayout layout;
- GridData data;
-
- layout = new GridLayout();
- layout.marginWidth = 20;
- parent.setLayout(layout);
- data = new GridData(GridData.FILL_BOTH | GridData.CENTER);
- parent.setLayoutData(data);
-
- Group group = new Group(parent, SWT.NONE);
- group.setText(GROUP_TITLE);
- layout = new GridLayout();
- group.setLayout(layout);
- data = new GridData(GridData.FILL_HORIZONTAL);
- group.setLayoutData(data);
-
- String defaultLink = "";
- Set<String> set = this._linkMap.keySet();
- int size = set.size();
- String[] keys = new String[size];
- Iterator<String> itr = set.iterator();
- int i = 0;
- while (itr.hasNext()) {
- String key = itr.next();
- keys[i++] = key;
- }
- Arrays.sort(keys);
- for (int j = 0; j < size; j++) {
- Button bt = new Button(group, SWT.RADIO);
- data = new GridData(GridData.FILL_HORIZONTAL);
- bt.setLayoutData(data);
- bt.setText(keys[j]);
- if (j == 0) {
- bt.setSelection(true);
- defaultLink = keys[j];
- }
- bt.addSelectionListener(new SelectLinkListener(keys[j]));
- }
-
- Label label = new Label(parent, SWT.NONE);
- label.setText(PREVIEW_TAG_LABEL);
-
- _text = new StyledText(parent, SWT.WRAP | SWT.V_SCROLL | SWT.BORDER);
- data = new GridData(GridData.FILL_BOTH);
- data.heightHint = 50;
- _text.setLayoutData(data);
-
- ILinkCreator creator = _linkMap.get(defaultLink);
- _linkType = creator.getLinkIdentifier();
- String previewText = creator.getSourcePreview(_part, _range);
- previewText = previewText == null ? "" : previewText;
- _text.setText(previewText);
- _text.setEditable(false);
-
- super.setControl(group);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.wizard.IWizardPage#isPageComplete()
- */
- public boolean isPageComplete() {
- return true;
- }
-
- /**
- * @return the link type
- */
- public String getChosenLinkType() {
- return this._linkType;
- }
-
- class SelectLinkListener extends SelectionAdapter {
- private String _key;
-
- /**
- * @param key
- */
- public SelectLinkListener(String key) {
- this._key = key;
- }
-
- public void widgetSelected(SelectionEvent e) {
- ILinkCreator creator = _linkMap.get(this._key);
- _linkType = creator.getLinkIdentifier();
- String previewText = creator.getSourcePreview(_part, _range);
- previewText = previewText == null ? "" : previewText;
- _text.setText(previewText);
- super.widgetSelected(e);
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/link/MakeLinkAction.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/link/MakeLinkAction.java
deleted file mode 100644
index ee8df16..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/link/MakeLinkAction.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.actions.link;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jst.jsf.common.ui.internal.dialogs.CommonWizardDialog;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.parts.TextEditPart;
-import org.eclipse.jst.pagedesigner.viewer.DesignPosition;
-import org.eclipse.jst.pagedesigner.viewer.DesignRange;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class MakeLinkAction extends Action {
- private final static String MAKE_LINK = PDPlugin
- .getResourceString("ActionGroup.Submenu.Link");
-
- private final static String WIZARD_PAGE_TITLE = PDPlugin
- .getResourceString("MakeLinkAction.Wizard.PageTitle");
-
- private EditPart _editPart;
-
- private DesignRange _range;
-
- private String _linkType;
-
- /**
- * @param range
- */
- public MakeLinkAction(DesignRange range) {
- super(MAKE_LINK);
- _range = range;
- _editPart = convertToEditPart(_range);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run() {
- Map<String, ILinkCreator> map = calAvailableLinkCreator();
- if (map.size() > 1) {
- CreateLinkWizard wizard = new CreateLinkWizard(_editPart, _range,
- map);
- wizard.setPageTitle(WIZARD_PAGE_TITLE);
- CommonWizardDialog wizardDialog = new CommonWizardDialog(
- getShell(), wizard);
- wizardDialog.create();
- if (wizardDialog.open() == Window.OK) {
- _linkType = wizard.getChosenLinkType();
- }
- }
- // else must be html link
- else if (map.size() == 1) {
- Set<Map.Entry<String, ILinkCreator>> set = map.entrySet();
- Iterator<Map.Entry<String,ILinkCreator>> itr = set.iterator();
- while (itr.hasNext()) {
- ILinkCreator creator = itr.next().getValue();
- _linkType = creator.getLinkIdentifier();
- }
- }
-
- if (_linkType != null) {
- Request request = new LinkRequest(_linkType, _range);
- Command cmd = _editPart.getCommand(request);
- if (cmd != null && cmd.canExecute()) {
- cmd.execute();
- }
- }
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#isEnabled()
- */
- public boolean isEnabled() {
- if (_editPart == null) {
- return false;
- }
- return super.isEnabled();
- }
-
- private EditPart convertToEditPart(DesignRange range) {
- DesignPosition startPosition = range.getStartPosition();
- EditPart startPart = startPosition.getContainerPart();
-
- DesignPosition endPosition = range.getEndPosition();
- EditPart endPart = endPosition.getContainerPart();
-
- if (startPosition == endPosition) {
- return null;
- }
-
- if (startPart instanceof TextEditPart
- && endPart instanceof TextEditPart) {
- if ((startPart == endPart)) {
- return startPart;
- }
- } else if (!(startPart instanceof TextEditPart)
- && !(endPart instanceof TextEditPart)) {
- Node[] startNodeOptions = null;
- startNodeOptions = getSideNodes(startPosition);
- Node[] endNodeOptions = null;
- endNodeOptions = getSideNodes(endPosition);
- Node selectedNode = null;
- for (int i = 0; i < 2; i++) {
- for (int j = 0; j < 2; j++) {
- if (startNodeOptions[i] == endNodeOptions[j]) {
- selectedNode = startNodeOptions[i];
- break;
- }
- }
- if (selectedNode != null) {
- break;
- }
- }
- if (selectedNode != null) {
- EditPart part = (EditPart) ((INodeNotifier) selectedNode)
- .getAdapterFor(EditPart.class);
- return part;
- }
- } else {
- if (startPart instanceof TextEditPart) {
- Node[] endNodeOptions = null;
- endNodeOptions = getSideNodes(endPosition);
- if (startPart.getModel() == endNodeOptions[0]
- || startPart.getModel() == endNodeOptions[1]) {
- return startPart;
- }
- }
- if (endPart instanceof TextEditPart) {
- Node[] startNodeOptions = null;
- startNodeOptions = getSideNodes(startPosition);
- if (endPart.getModel() == startNodeOptions[0]
- || endPart.getModel() == startNodeOptions[1]) {
- return endPart;
- }
- }
- }
-
- return null;
- }
-
- private Node[] getSideNodes(DesignPosition pos) {
- Node[] nodes = new Node[2];
-
- EditPart part = pos.getContainerPart();
- Node node = (Node) part.getModel();
- NodeList list = node.getChildNodes();
-
- if (list.getLength() == pos.getOffset()) {
- nodes[0] = list.item(pos.getOffset() - 1);
- nodes[1] = list.item(pos.getOffset() - 1);
- } else if (pos.getOffset() == 0) {
- nodes[0] = list.item(0);
- nodes[1] = list.item(0);
- } else if (pos.getOffset() > 0 && pos.getOffset() < list.getLength()) {
- nodes[0] = list.item(pos.getOffset() - 1);
- nodes[1] = list.item(pos.getOffset());
- }
-
- return nodes;
- }
-
- private Shell getShell() {
- if (_editPart != null) {
- IHTMLGraphicalViewer viewer = (IHTMLGraphicalViewer) _editPart
- .getViewer();
- return viewer.getControl().getShell();
- }
- return null;
- }
-
- private Map<String, ILinkCreator> calAvailableLinkCreator() {
- Map<String, ILinkCreator> map = new HashMap<String, ILinkCreator>();
- List<ILinkCreator> linkCreators = ExtensionReader.getAllLinkHandlers();
- for (ILinkCreator linkCreator : linkCreators) {
- String identifier = linkCreator.getLinkIdentifier();
- boolean canExecute = linkCreator.canExecute(_range);
- if (canExecute) {
- map.put(identifier, linkCreator);
- }
- }
- return map;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/link/MakeLinkCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/link/MakeLinkCommand.java
deleted file mode 100644
index 7c4835f..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/link/MakeLinkCommand.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.actions.link;
-
-import java.util.List;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.commands.DesignerCommand;
-import org.eclipse.jst.pagedesigner.viewer.DesignRange;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class MakeLinkCommand extends DesignerCommand {
- private String _identifier = null;
-
- private EditPart _part = null;
-
- private DesignRange _range = null;
-
- private ILinkCreator _linkcreator = null;
-
- private Element _ele = null;
-
- /**
- * @param identifier
- * @param viewer
- * @param part
- * @param range
- */
- public MakeLinkCommand(String identifier, IHTMLGraphicalViewer viewer,
- EditPart part, DesignRange range) {
- super(identifier, viewer);
- setLabel(PDPlugin.getResourceString("MakeLinkCommand.Label.MakeLink"));//$NON-NLS-1$
- this._identifier = identifier;
- this._part = part;
- this._range = range;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.commands.Command#canExecute()
- */
- public boolean canExecute() {
- List<ILinkCreator> creators = ExtensionReader.getAllLinkHandlers();
- if (creators != null) {
- for (ILinkCreator linkCreator : creators) {
- String identifier = linkCreator.getLinkIdentifier();
- if (this._identifier.equalsIgnoreCase(identifier)) {
- this._linkcreator = linkCreator;
- break;
- }
- }
- }
- if (this._linkcreator != null) {
- return this._linkcreator.canExecute(_range);
- }
-
- return super.canExecute();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.DesignerCommand#doExecute()
- */
- protected void doExecute() {
- if (this._linkcreator != null) {
- Element ele = this._linkcreator.makeLinkElement(this._part,
- this._range);
- Node node = (Node) this._part.getModel();
- Node parent = node.getParentNode();
- formatNode(parent);
-
- this._ele = ele;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.DesignerCommand#getAfterCommandDesignerSelection()
- */
- protected ISelection getAfterCommandDesignerSelection() {
- return toDesignSelection(_ele);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/menuextension/CustomedContextMenuActionGroup.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/menuextension/CustomedContextMenuActionGroup.java
deleted file mode 100644
index b6721fc..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/menuextension/CustomedContextMenuActionGroup.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.actions.menuextension;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jst.pagedesigner.extensionpoint.IContextMenuItemContributor;
-import org.eclipse.jst.pagedesigner.utils.JSPUtil;
-import org.eclipse.jst.pagedesigner.utils.StructuredModelUtil;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.actions.ActionGroup;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class CustomedContextMenuActionGroup extends ActionGroup {
- private final static String POPUPMENU_EXTENSION_ID = "org.eclipse.jst.pagedesigner.popupMenuContributor"; //$NON-NLS-1$
-
- private List _contributedMenuListener;
-
- private Control _parentControl;
-
- private IStructuredModel _model;
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.actions.ActionGroup#fillContextMenu(org.eclipse.jface.action.IMenuManager)
- */
- public void fillContextMenu(IMenuManager menu) {
- populateContributedMenu(menu);
- }
-
- private List getListeners() {
- if (_contributedMenuListener == null) {
- _contributedMenuListener = computeContributedMenuListener();
- }
- return _contributedMenuListener;
- }
-
- private List computeContributedMenuListener() {
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IExtensionPoint extensionPoint = registry
- .getExtensionPoint(POPUPMENU_EXTENSION_ID);
- IExtension[] extensions = extensionPoint.getExtensions();
- List results = new ArrayList();
- for (int i = 0; i < extensions.length; i++) {
- IConfigurationElement[] elements = extensions[i]
- .getConfigurationElements();
- for (int j = 0; j < elements.length; j++) {
- try {
- Object listener = elements[j]
- .createExecutableExtension("class");//$NON-NLS-1$
-
- if (listener instanceof IContextMenuItemContributor) {
- results.add(listener);
- ((IContextMenuItemContributor) listener)
- .setURI(elements[j].getAttribute("URI"));//$NON-NLS-1$
- }
- } catch (CoreException e) {
- // ignore
- }
- }
- }
- return results;
- }
-
- private void populateContributedMenu(IMenuManager menuMgr) {
- List list = getListeners();
- for (int i = 0, n = list.size(); i < n; i++) {
- IContextMenuItemContributor contributor = (IContextMenuItemContributor) list
- .get(i);
- IFile file = StructuredModelUtil.getFileFor(_model);
- if (file != null && contributor.getURI() != null) {
- if (JSPUtil.supportTaglib(contributor.getURI(), file)) {
- contributor.fillContextMenu(menuMgr, getContext()
- .getSelection(), _model, _parentControl);
- }
- }
- }
- }
-
- /**
- * @return Returns the model.
- */
- public IStructuredModel getModel() {
- return _model;
- }
-
- /**
- * @param model
- * The model to set.
- */
- public void setModel(IStructuredModel model) {
- this._model = model;
- }
-
- /**
- * @return Returns the parentControl.
- */
- public Control getParentControl() {
- return _parentControl;
- }
-
- /**
- * @param parentControl
- * The parentControl to set.
- */
- public void setParentControl(Control parentControl) {
- this._parentControl = parentControl;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/menuextension/RunAction.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/menuextension/RunAction.java
deleted file mode 100644
index 4b58c68..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/menuextension/RunAction.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.actions.menuextension;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.ui.part.EditorPart;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class RunAction extends Action {
- /**
- * constant for debug launch mode
- */
- public static final String LAUNCH_MODE_DEBUG = "debug";
-
- /**
- * constant for run launch mode
- */
- public static final String LAUNCH_MODE_RUN = "run";
-
- private final String ID = "org.eclipse.jst.pagedesigner.actions.menuextension.RunAction";
-
- //private EditorPart _editor;
-
- private String _mode;
-
- /**
- * @param editor
- * @param mode
- */
- public RunAction(EditorPart editor, String mode) {
- //_editor = editor;
- _mode = mode;
- }
-
- public void run() {
- PDPlugin.getLogger(getClass()).error("Obsolete. Shouldn't be used", new Throwable());
- // FIXME: we don't support this feature and it seems to depend
- // on debugger internal code anyway...
- // List allShortCuts = DebugUIPlugin.getDefault()
-// .getLaunchConfigurationManager().getLaunchShortcuts();
-// Iterator iter = allShortCuts.iterator();
-// LaunchShortcutExtension ext = null;
-// while (iter.hasNext()) {
-// ext = (LaunchShortcutExtension) iter.next();
-// try {
-// if (ext.getId().equals("org.eclipse.wst.server.launchShortcut")) {
-// break;
-// }
-// } catch (Exception e) {
-// // not supported
-// }
-// }
-// if (ext != null) {
-// ext.launch(getSelection(), _mode);
-// }
- }
-
-// private IStructuredSelection getSelection() {
-// IEditorInput input = ((HTMLEditor) _editor).getEditorInput();
-// List elements = new ArrayList();
-// if (input instanceof FileEditorInput) {
-// elements.add(((FileEditorInput) input).getFile());
-// }
-// return new StructuredSelection(elements);
-// }
-
- public String getId() {
- return ID;
- }
-
- public String getText() {
- return _mode.substring(0, 1).toUpperCase()
- + _mode.substring(1, _mode.length());
- }
-
- private ImageDescriptor getImageDescriptorForModel(String id) {
- IConfigurationElement[] elements = Platform.getExtensionRegistry()
- .getConfigurationElementsFor("org.eclipse.ui.actionSets");
- for (int i = 0; i < elements.length; i++) {
- if ("actionSet".equals(elements[i].getName())) {
- IConfigurationElement[] actions = elements[i]
- .getChildren("action");
- for (int j = 0; j < actions.length; j++) {
- if (id.equals(actions[j].getAttribute("id"))) {
- String iconPath = actions[j].getAttribute("icon");
- if (iconPath != null) {
- return AbstractUIPlugin.imageDescriptorFromPlugin(
- actions[j].getDeclaringExtension()
- .getContributor().getName(), iconPath);
- }
- return null;
- }
- }
- }
- }
- return null;
- }
-
- public ImageDescriptor getImageDescriptor() {
- if (_mode == LAUNCH_MODE_DEBUG) {
- return getImageDescriptorForModel("org.eclipse.debug.internal.ui.actions.DebugDropDownAction");
- } else if (_mode == LAUNCH_MODE_RUN) {
- return getImageDescriptorForModel("org.eclipse.debug.internal.ui.actions.RunDropDownAction");
- } else {
- return super.getImageDescriptor();
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/range/AlignSupport.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/range/AlignSupport.java
deleted file mode 100644
index aaab7e9..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/range/AlignSupport.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.actions.range;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class AlignSupport {
-
- private static final String[] ALIGN_VALUES = new String[] {
- PDPlugin.getResourceString("AlignSupport.ActionLabel.Left"), //$NON-NLS-1$
- PDPlugin.getResourceString("AlignSupport.ActionLabel.Center"), //$NON-NLS-1$
- PDPlugin.getResourceString("AlignSupport.ActionLabel.Right"), //$NON-NLS-1$
- PDPlugin.getResourceString("AlignSupport.ActionLabel.Justify") //$NON-NLS-1$
- };
-
- private static Element[] _nodes = null;
-
- /**
- * @param menu
- * @param viewer
- */
- public static void createAlignActions(IMenuManager menu,
- IHTMLGraphicalViewer viewer) {
- for (int i = 0; i < ALIGN_VALUES.length; i++) {
- ParagraphStyleAction action = new ParagraphStyleAction(
- ALIGN_VALUES[i], _nodes[i], null, IAction.AS_CHECK_BOX);
- action.setViewer(viewer);
- menu.add(action);
- }
- }
-
- /**
- * @param nodes
- */
- public static void setAlignNodes(Element[] nodes) {
- if (_nodes != nodes) {
- _nodes = nodes;
- }
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/range/ChangeStyleAction.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/range/ChangeStyleAction.java
deleted file mode 100644
index d710e3c..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/range/ChangeStyleAction.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.actions.range;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jst.pagedesigner.commands.range.ApplyStyleCommand;
-import org.eclipse.jst.pagedesigner.dom.DOMPositionHelper;
-import org.eclipse.jst.pagedesigner.dom.DOMRange;
-import org.eclipse.jst.pagedesigner.dom.DOMRangeHelper;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.jst.pagedesigner.viewer.DesignPosition;
-import org.eclipse.jst.pagedesigner.viewer.DesignRange;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- */
-public class ChangeStyleAction extends DesignerToolBarAction {
- private final String _expectedTag;
-
- /**
- * @param text
- * @param name
- * @param image
- * @param style
- */
- public ChangeStyleAction(String text, String name, ImageDescriptor image,
- int style) {
- super(text, style);
- _expectedTag = name;
- this.setImageDescriptor(image);
- }
-
- /**
- * @param text
- * @param name
- * @param enabled
- * @param disabled
- * @param style
- */
- public ChangeStyleAction(String text, String name, ImageDescriptor enabled,
- ImageDescriptor disabled, int style) {
- super(text, style);
- _expectedTag = name;
- setImageDescriptor(enabled);
- setDisabledImageDescriptor(disabled);
- }
-
-
- protected boolean isApplied(DOMRange range) {
- if (range == null) {
- return false;
- }
-
- boolean ordered = range.isOrdered();
- IDOMPosition start = ordered ? range.getStartPosition() : range
- .getEndPosition();
- IDOMPosition end = ordered ? range.getEndPosition() : range
- .getStartPosition();
- Node startnode = start.getContainerNode();
- Node endnode = end.getContainerNode();
- if (!EditModelQuery.hasAncestor(startnode, _expectedTag, true)) {
- return false;
- }
- for (Node node = startnode; node != endnode; node = EditModelQuery
- .getInstance().getNextLeafNeighbor(node)) {
- if (!EditModelQuery.hasAncestor(node, _expectedTag, true)) {
- return false;
- }
- }
- if (!EditModelQuery.hasAncestor(endnode, _expectedTag, true)) {
- return false;
- }
- return true;
- }
-
- /**
- * @return the expected tag
- */
- protected String getExpectedTag() {
- return _expectedTag;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.range.DesignerToolBarAction#getCommand()
- */
- protected Command getCommand() {
- DesignRange range = getViewer().getRangeSelection();
- DOMRange dRange = DOMRangeHelper.toDOMRange(range);
- Command command;
- if (isApplied(dRange)) {
- // command = new UnapplyStyleCommand(getViewer(), _expectedTag,
- // null, null);
- // since the un-applystyle is not implemented yet,we do nothing
- // here.
- command = null;
- this.setChecked(true);
- } else {
- command = new ApplyStyleCommand(getViewer(), _expectedTag, null,
- null);
- }
- return command;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.IUpdate#update()
- */
- public void update() {
- if (canRun(getViewer())) {
- setEnabled(true);
- } else {
- setEnabled(false);
- }
- updateStatus();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.actions.range.DesignerToolBarAction#updateStatus()
- */
- public void updateStatus() {
- IHTMLGraphicalViewer viewer = getViewer();
- if (viewer != null && viewer.isInRangeMode()
- && viewer.getModel().getDocument().hasChildNodes()) {
- DesignRange range = getViewer().getRangeSelection();
- if (range != null && range.isValid()) {
- DOMRange domRange = null;
- domRange = new DOMRange(DOMPositionHelper.toDOMPosition(range
- .getStartPosition()), DOMPositionHelper
- .toDOMPosition(range.getEndPosition()));
- if (isApplied(domRange)) {
- this.setChecked(true);
- } else {
- this.setChecked(false);
- }
- return;
- }
- }
- this.setChecked(false);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.actions.range.DesignerToolBarAction#canRun(org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer)
- */
- protected boolean canRun(IHTMLGraphicalViewer viewer) {
- if (viewer != null && viewer.isInRangeMode()
- && viewer.getModel().getDocument().hasChildNodes()) {
- DesignRange range = viewer.getRangeSelection();
- if (range != null && range.isValid()) {
- DesignPosition startPos = range.getStartPosition();
- DesignPosition endPos = range.getEndPosition();
- if (startPos != endPos) {
- return true;
- }
- }
- }
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/range/DesignerToolBarAction.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/range/DesignerToolBarAction.java
deleted file mode 100644
index 3e241e3..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/range/DesignerToolBarAction.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.actions.range;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jst.pagedesigner.dom.DOMPositionHelper;
-import org.eclipse.jst.pagedesigner.dom.DOMRange;
-import org.eclipse.jst.pagedesigner.viewer.DesignRange;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.eclipse.ui.texteditor.IUpdate;
-
-/**
- * @author mengbo
- */
-public abstract class DesignerToolBarAction extends Action implements IUpdate,
- ISelectionChangedListener {
- private IHTMLGraphicalViewer _viewer;
-
- /**
- * @param text
- * @param style
- */
- public DesignerToolBarAction(String text, int style) {
- super(text, style);
- }
-
- /**
- * @param text
- * @param image
- */
- public DesignerToolBarAction(String text, ImageDescriptor image) {
- super(text, image);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
- */
- public void selectionChanged(SelectionChangedEvent event) {
- update();
- }
-
- /**
- *
- */
- public void update() {
- if (canRun(this._viewer)) {
- setEnabled(true);
- updateStatus();
- } else {
- setEnabled(false);
- }
- }
-
- /**
- * Update the status
- */
- protected void updateStatus() {
- DesignRange range = _viewer.getRangeSelection();
- DOMRange domRange = null;
- if (range != null) {
- domRange = new DOMRange(DOMPositionHelper.toDOMPosition(range
- .getStartPosition()), DOMPositionHelper.toDOMPosition(range
- .getEndPosition()));
- if (isApplied(domRange)) {
- this.setChecked(true);
- } else {
- this.setChecked(false);
- }
- }
- }
-
- /**
- * @param range
- * @return ??
- */
- protected abstract boolean isApplied(DOMRange range);
-
- /**
- * @param viewer
- * @return true if this action can run
- */
- protected boolean canRun(IHTMLGraphicalViewer viewer) {
- if (viewer != null && viewer.isInRangeMode()
- && viewer.getModel().getDocument().hasChildNodes()) {
- DesignRange range = viewer.getRangeSelection();
- if (range != null && range.isValid()) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * @param viewer
- */
- public void setViewer(IHTMLGraphicalViewer viewer) {
- if (viewer == _viewer) {
- return;
- }
-
- if (_viewer != null) {
- _viewer.removeSelectionChangedListener(this);
- }
- _viewer = viewer;
- if (_viewer != null) {
- _viewer.addSelectionChangedListener(this);
- }
- update();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- // Assert.isTrue(_viewer != null && _viewer.isInRangeMode());
- DesignRange range = _viewer.getRangeSelection();
- if (range == null || !range.isValid()) {
- return;
- }
- Command command = getCommand();
- if (command != null) {
- command.execute();
- }
- }
-
- /**
- * @return the command for this action or null
- */
- protected abstract Command getCommand();
-
- /**
- * @return Returns the _viewer.
- */
- public IHTMLGraphicalViewer getViewer() {
- return _viewer;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/range/HTagsInsertGroupAction.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/range/HTagsInsertGroupAction.java
deleted file mode 100644
index 28352ca..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/range/HTagsInsertGroupAction.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.actions.range;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.dom.DOMRange;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-
-/**
- * @author mengbo
- */
-public class HTagsInsertGroupAction extends DesignerToolBarAction implements
- IMenuCreator {
- private Menu _menu;
-
- private static Map _actions = new HashMap();
-
- /**
- * @param image
- * @param style
- */
- public HTagsInsertGroupAction(ImageDescriptor image, int style) {
- super(
- PDPlugin
- .getResourceString("HTagsInsertGroupAction.ActionLabel.Hx"), IAction.AS_DROP_DOWN_MENU); //$NON-NLS-1$
- this.setImageDescriptor(image);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Control)
- */
- public Menu getMenu(Control parent) {
- if (_menu != null) {
- _menu.dispose();
- }
- _menu = new Menu(parent);
- addActionToMenu(_menu, IHTMLConstants.TAG_H1);
- addActionToMenu(_menu, IHTMLConstants.TAG_H2);
- addActionToMenu(_menu, IHTMLConstants.TAG_H3);
- addActionToMenu(_menu, IHTMLConstants.TAG_H4);
- addActionToMenu(_menu, IHTMLConstants.TAG_H5);
- addActionToMenu(_menu, IHTMLConstants.TAG_H6);
-
- return _menu;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Menu)
- */
- public Menu getMenu(Menu parent) {
- return null;
- }
-
- /**
- * @param parent
- * @param name
- */
- protected void addActionToMenu(Menu parent, String name) {
- DesignerToolBarAction action;
- if (_actions.get(name) == null) {
- action = new ParagraphStyleAction(name, name, null,
- IAction.AS_CHECK_BOX);
- _actions.put(name, action);
- } else {
- action = (ParagraphStyleAction) _actions.get(name);
- }
- action.setViewer(getViewer());
- action.update();
- ActionContributionItem item = new ActionContributionItem(action);
- item.fill(parent, -1);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IMenuCreator#dispose()
- */
- public void dispose() {
- if (_menu != null) {
- _menu.dispose();
- _menu = null;
- _actions.clear();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#getMenuCreator()
- */
- public IMenuCreator getMenuCreator() {
- return this;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.editors.actions.DesignerToolBarAction#canRun(org.eclipse.jst.pagedesigner.dom.DOMRange)
- */
- protected boolean isApplied(DOMRange range) {
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- return;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.range.DesignerToolBarAction#getCommand()
- */
- protected Command getCommand() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.range.DesignerToolBarAction#setViewer(org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer)
- */
- public void setViewer(IHTMLGraphicalViewer viewer) {
- if (_actions != null && _actions.size() > 0) {
- Collection values = _actions.values();
- Iterator iterator = values.iterator();
- while (iterator.hasNext()) {
- DesignerToolBarAction action = (DesignerToolBarAction) iterator
- .next();
- action.setViewer(viewer);
- }
- }
- super.setViewer(viewer);
- }
-
- /*
- * The group will delegate update to its children.
- */
- public void updateStatus() {
- if (_actions != null && _actions.size() > 0) {
- Collection values = _actions.values();
- Iterator iterator = values.iterator();
- while (iterator.hasNext()) {
- DesignerToolBarAction action = (DesignerToolBarAction) iterator
- .next();
- action.updateStatus();
- }
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/range/InsertTagChangeStyleAction.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/range/InsertTagChangeStyleAction.java
deleted file mode 100644
index 7624a2b..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/range/InsertTagChangeStyleAction.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.actions.range;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jst.pagedesigner.dom.DOMPositionHelper;
-import org.eclipse.jst.pagedesigner.dom.DOMRange;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.jst.pagedesigner.editors.actions.ChangeStyleAction;
-import org.eclipse.jst.pagedesigner.viewer.DesignRange;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- */
-public class InsertTagChangeStyleAction extends ChangeStyleAction {
- /**
- * @param text
- * @param tag
- * @param image
- * @param style
- */
- public InsertTagChangeStyleAction(String text, String tag,
- ImageDescriptor image, int style) {
- super(text, tag, image, style);
- }
-
- protected String getExpectedCSSProperty() {
- // TODO Auto-generated method stub
- return null;
- }
-
- protected String getExpectedCSSPropertyValue() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- protected void updateState()
- {
- setEnabled(getDesignRange());
- }
-
- /**
- * @param range
- */
- public void setEnabled(DesignRange range) {
- DOMRange domRange = null;
- // We didn't deal with undo, so only enable is set.
- domRange = new DOMRange(DOMPositionHelper.toDOMPosition(range
- .getStartPosition()), DOMPositionHelper.toDOMPosition(range
- .getEndPosition()));
- if (canRun(domRange)) {
- this.setEnabled(true);
- } else {
- this.setEnabled(false);
- }
- }
-
- private boolean canRun(DOMRange range) {
- if (range != null) {
- if (EditModelQuery.isSame(range)) {
- return false;
- }
- boolean ordered = range.isOrdered();
- IDOMPosition start = ordered ? range.getStartPosition() : range
- .getEndPosition();
- IDOMPosition end = ordered ? range.getEndPosition() : range
- .getStartPosition();
- Node common = null;
- common = EditModelQuery.getInstance().getCommonAncestor(start, end);
- if (getExpectedTag() == null
- || EditModelQuery.hasAncestor(common, getExpectedTag(),
- true)) {
- return false;
- }
- return true;
- }
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/range/NoneParagraphStyleAction.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/range/NoneParagraphStyleAction.java
deleted file mode 100644
index 6ca6c0b..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/range/NoneParagraphStyleAction.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.actions.range;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jst.pagedesigner.commands.range.Paragraph;
-import org.eclipse.jst.pagedesigner.commands.range.ParagraphFinder;
-import org.eclipse.jst.pagedesigner.commands.range.ParagraphUnapplyStyleCommand;
-import org.eclipse.jst.pagedesigner.dom.DOMRange;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- */
-public class NoneParagraphStyleAction extends ParagraphStyleAction {
-
- private String[] _applyingTags;
-
- /**
- * @param text
- * @param tags
- * @param image
- * @param style
- */
- public NoneParagraphStyleAction(String text, String[] tags,
- ImageDescriptor image, int style) {
- super(text, "", image, style);
- _applyingTags = tags;
- }
-
- /**
- * @param text
- * @param node
- * @param image
- * @param style
- */
- public NoneParagraphStyleAction(String text, Node node,
- ImageDescriptor image, int style) {
- super(text, node, image, style);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.editors.actions.DesignerToolBarAction#isApplied(org.eclipse.jst.pagedesigner.dom.DOMRange)
- */
- protected boolean isApplied(DOMRange range) {
- if (range != null) {
- boolean ordered = range.isOrdered();
- IDOMPosition start = ordered ? range.getStartPosition() : range
- .getEndPosition();
- IDOMPosition end = ordered ? range.getEndPosition() : range
- .getStartPosition();
- Node common = null;
- if (EditModelQuery.isSame(range)) {
- ParagraphFinder finder = new ParagraphFinder(start);
- Paragraph p = finder.getParagraph(start);
- common = p.getLowestContainer();
- } else {
- common = EditModelQuery.getInstance().getCommonAncestor(start,
- end);
- }
- // the lowest common block parent is the container to apply style.
- if (EditModelQuery.hasAncestor(common, _applyingTags, true)) {
- return false;
- }
- return true;
- }
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.range.DesignerToolBarAction#getCommand()
- */
- protected Command getCommand() {
- ParagraphUnapplyStyleCommand command = new ParagraphUnapplyStyleCommand(
- getViewer(), _applyingTags, null, null);
- return command;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/range/NoneStyleAction.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/range/NoneStyleAction.java
deleted file mode 100644
index ce5e97e..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/range/NoneStyleAction.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.actions.range;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jst.pagedesigner.commands.range.UnapplyStyleCommand;
-import org.eclipse.jst.pagedesigner.dom.DOMRange;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- */
-public class NoneStyleAction extends ChangeStyleAction {
- private String[] _applyingStyleTags;
-
- /**
- * @param text
- * @param names
- * @param image
- * @param style
- */
- public NoneStyleAction(String text, String[] names, ImageDescriptor image,
- int style) {
- super(text, "", image, style);
- _applyingStyleTags = names;
- }
-
- protected boolean isApplied(DOMRange range) {
- if (range != null) {
- boolean ordered = range.isOrdered();
- IDOMPosition start = ordered ? range.getStartPosition() : range
- .getEndPosition();
- IDOMPosition end = ordered ? range.getEndPosition() : range
- .getStartPosition();
- Node common = null;
- common = EditModelQuery.getInstance().getCommonAncestor(start, end);
- if (EditModelQuery.hasAncestor(common, _applyingStyleTags, true)) {
- return false;
- }
- return true;
- }
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.range.DesignerToolBarAction#getCommand()
- */
- protected Command getCommand() {
- UnapplyStyleCommand command = new UnapplyStyleCommand(getViewer(),
- getExpectedTag(), null, null);
- return command;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/range/ParagraphAction.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/range/ParagraphAction.java
deleted file mode 100644
index d2f13d0..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/range/ParagraphAction.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.actions.range;
-
-import org.eclipse.jface.action.Action;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class ParagraphAction extends Action {
- /**
- * @param text
- * @param htmlTag
- */
- public ParagraphAction(String text, String htmlTag) {
- super(text);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/range/ParagraphStyleAction.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/range/ParagraphStyleAction.java
deleted file mode 100644
index 5cefa47..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/range/ParagraphStyleAction.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.actions.range;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jst.pagedesigner.commands.range.Paragraph;
-import org.eclipse.jst.pagedesigner.commands.range.ParagraphApplyStyleCommand;
-import org.eclipse.jst.pagedesigner.commands.range.ParagraphFinder;
-import org.eclipse.jst.pagedesigner.dom.DOMRange;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- */
-public class ParagraphStyleAction extends DesignerToolBarAction {
- private String _tagName;
-
- private Node _applyingNode;
-
- /**
- * @param text
- * @param name
- * @param image
- * @param style
- */
- public ParagraphStyleAction(String text, String name,
- ImageDescriptor image, int style) {
- super(text, style);
- _tagName = name;
- setImageDescriptor(image);
- }
-
- /**
- * @param text
- * @param node
- * @param image
- * @param style
- */
- public ParagraphStyleAction(String text, Node node, ImageDescriptor image,
- int style) {
- super(text, style);
- _applyingNode = node;
- setImageDescriptor(image);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.editors.actions.DesignerToolBarAction#isApplied(org.eclipse.jst.pagedesigner.dom.DOMRange)
- */
- protected boolean isApplied(DOMRange range) {
- Assert.isTrue(getExpectedTag() != null);
- if (range != null) {
- boolean ordered = range.isOrdered();
- IDOMPosition start = ordered ? range.getStartPosition() : range
- .getEndPosition();
- IDOMPosition end = ordered ? range.getEndPosition() : range
- .getStartPosition();
- Node common = null;
- if (EditModelQuery.isSame(range)) {
- ParagraphFinder finder = new ParagraphFinder(start);
- Paragraph p = finder.getParagraph(start);
- common = p.getLowestContainer();
- } else {
- common = EditModelQuery.getInstance().getCommonAncestor(start,
- end);
- }
- // the lowest common block parent is the container to apply style.
- if (containsTag(common)) {
- return true;
- }
- return false;
- }
- return false;
- }
-
- /**
- * @param common
- * @return ???
- */
- protected boolean containsTag(Node common) {
- // the lowest common block parent is the container to apply style.
- if (_applyingNode == null) {
- return common.getNodeName() != null
- && getExpectedTag().equalsIgnoreCase(
- common.getNodeName().toLowerCase());
- }
-
- String align = ((Element) _applyingNode).getAttribute("align");
- if (!(common instanceof Element)) {
- return false;
- }
- String cAlign = ((Element) common).getAttribute("align");
- if (align == null || cAlign == null) {
- return false;
- }
- if (align.equals(cAlign)) {
- return true;
- }
- return false;
- }
-
- /**
- * @return Returns the _expectedTag.
- */
- public String getExpectedTag() {
- if (_tagName == null) {
- return _applyingNode.getNodeName().toLowerCase();
- }
- return _tagName.toLowerCase();
- }
-
- /**
- * @return Returns the _applyingNode.
- */
- public Element getApplyingNode() {
- if (_applyingNode != null) {
- return (Element) _applyingNode;
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.range.DesignerToolBarAction#getCommand()
- */
- protected Command getCommand() {
- ParagraphApplyStyleCommand command = null;
- if (getApplyingNode() != null) {
- command = new ParagraphApplyStyleCommand(getViewer(),
- getApplyingNode(), null, null);
- } else {
- command = new ParagraphApplyStyleCommand(getViewer(),
- getExpectedTag(), null, null);
- }
- return command;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/range/ParagraphSupport.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/range/ParagraphSupport.java
deleted file mode 100644
index 2d03548..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/range/ParagraphSupport.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.actions.range;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.viewer.DesignRange;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class ParagraphSupport {
- static final String[] labels = new String[] {
- PDPlugin.getResourceString("ParagraphSupport.CommandLabel.None"), //$NON-NLS-1$
- PDPlugin
- .getResourceString("ParagraphSupport.CommandLabel.Paragraph"), //$NON-NLS-1$
- PDPlugin
- .getResourceString("ParagraphSupport.CommandLabel.Heading1"), //$NON-NLS-1$
- PDPlugin
- .getResourceString("ParagraphSupport.CommandLabel.Heading2"), //$NON-NLS-1$
- PDPlugin
- .getResourceString("ParagraphSupport.CommandLabel.Heading3"), //$NON-NLS-1$
- PDPlugin
- .getResourceString("ParagraphSupport.CommandLabel.Heading4"),//$NON-NLS-1$
- PDPlugin
- .getResourceString("ParagraphSupport.CommandLabel.Heading5"), //$NON-NLS-1$
- PDPlugin
- .getResourceString("ParagraphSupport.CommandLabel.Heading6"), //$NON-NLS-1$
- PDPlugin
- .getResourceString("ParagraphSupport.CommandLabel.Preformated") //$NON-NLS-1$
- };
-
- static final String[] tags = new String[] {
- null,
- PDPlugin.getResourceString("ParagraphSupport.CommandLabel.P"), PDPlugin.getResourceString("ParagraphSupport.CommandLabel.H1"), PDPlugin.getResourceString("ParagraphSupport.CommandLabel.H2"), PDPlugin.getResourceString("ParagraphSupport.CommandLabel.H3"), PDPlugin.getResourceString("ParagraphSupport.CommandLabel.H4"), PDPlugin.getResourceString("ParagraphSupport.CommandLabel.H5"), PDPlugin.getResourceString("ParagraphSupport.CommandLabel.H6"), PDPlugin.getResourceString("ParagraphSupport.CommandLabel.PRE") //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$
- };
-
- /**
- * @param man
- * @param range
- * @param viewer
- */
- public static void createParagraphActions(IMenuManager man,
- DesignRange range, IHTMLGraphicalViewer viewer) {
- ParagraphStyleAction action = new NoneParagraphStyleAction(
- PDPlugin
- .getResourceString("ParagraphSupport.CommandLabel.None"), tags, null, IAction.AS_CHECK_BOX); //$NON-NLS-1$
- action.setViewer(viewer);
- action.update();
- man.add(action);
- for (int i = 1; i < labels.length; i++) {
- action = new ParagraphStyleAction(labels[i], tags[i], null,
- IAction.AS_CHECK_BOX);
- action.setViewer(viewer);
- action.update();
- man.add(action);
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/range/RangeActionGroup.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/range/RangeActionGroup.java
deleted file mode 100644
index ac453f9..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/range/RangeActionGroup.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.actions.range;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.actions.link.MakeLinkAction;
-import org.eclipse.jst.pagedesigner.editors.PageDesignerActionConstants;
-import org.eclipse.jst.pagedesigner.editors.actions.DesignActionBarFactory;
-import org.eclipse.jst.pagedesigner.viewer.DesignRange;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.eclipse.ui.actions.ActionGroup;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class RangeActionGroup extends ActionGroup {
- // TODO: what is this? a separator?
- private static final Action action = new Action() {
- // Action is abstract but has no abstract methods
- // so create a default empty action that does nothing
- };
-
- /**
- *
- */
- public RangeActionGroup() {
- super();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.actions.ActionGroup#fillContextMenu(org.eclipse.jface.action.IMenuManager)
- */
- public void fillContextMenu(IMenuManager contextMenu)
- {
- DesignRange selection = fixUpSelection(getContext().getSelection());
- if (selection == null) {
- return;
- }
- IContributionItem styleSubMenuItem =
- contextMenu.find(PageDesignerActionConstants.STYLE_SUBMENU_ID);
-
- if (styleSubMenuItem instanceof IMenuManager)
- {
- final IMenuManager subMenu = (IMenuManager) styleSubMenuItem;
- if (getContext().getInput() instanceof IHTMLGraphicalViewer) {
- addParagraphFormatMenu(subMenu, selection,
- (IHTMLGraphicalViewer) getContext().getInput());
- addHorizontalAlignMenu(subMenu, selection,
- (IHTMLGraphicalViewer) getContext().getInput());
- addTextStyleMenu(subMenu, (IHTMLGraphicalViewer) getContext()
- .getInput());
- }
- // TODO: the (commented out) copy of this method does nothing
- //addListModeMenu(menu, selection);
-
- // TODO: the (commented out) copy of this method does nothing
- //addTextFontMenu(menu, selection);
-
- addLinkMenu(subMenu, selection);
- }
- }
-
- /**
- * @param selection
- * @return
- */
- private DesignRange fixUpSelection(ISelection selection) {
- if (selection instanceof DesignRange) {
- return (DesignRange) selection;
- }
- return null;
- }
-
- private void addLinkMenu(IMenuManager menu, final DesignRange selection) {
- Action action1 = new MakeLinkAction(selection);
- menu.appendToGroup(PageDesignerActionConstants.GROUP_STYLE, action1);
- }
-
- private void addTextStyleMenu(IMenuManager menu,
- final IHTMLGraphicalViewer viewer) {
- final IMenuManager submenu = new MenuManager(PDPlugin
- .getResourceString("ActionGroup.Submenu.TextStyle"));//$NON-NLS-1$
- submenu.add(action);
-
- submenu.setRemoveAllWhenShown(true);
- submenu.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager manager) {
- DesignerToolBarAction action1 = null;
- action1 = DesignActionBarFactory.getInstance().getStyleAction(
- IHTMLConstants.TAG_U);
- action1.setViewer(viewer);
- submenu.add(action1);
-
- action1 = DesignActionBarFactory.getInstance().getStyleAction(
- IHTMLConstants.TAG_B);
- action1.setViewer(viewer);
- submenu.add(action1);
-
- action1 = DesignActionBarFactory.getInstance().getStyleAction(
- IHTMLConstants.TAG_I);
- action1.setViewer(viewer);
- submenu.add(action1);
-
- action1 = DesignActionBarFactory.getInstance().getStyleAction(
- IHTMLConstants.TAG_SMALL);
- action1.setViewer(viewer);
- submenu.add(action1);
-
- action1 = DesignActionBarFactory.getInstance().getStyleAction(
- IHTMLConstants.TAG_BIG);
- action1.setViewer(viewer);
- submenu.add(action1);
-
- }
- });
- menu.appendToGroup(PageDesignerActionConstants.GROUP_STYLE, submenu);
- }
-
- /**
- * @param menu
- * @param selection
- */
-// private void addTextFontMenu(IMenuManager menu, DesignRange selection) {
-// //
-// }
-
- /**
- * @param menu
- * @param selection
- */
- private void addHorizontalAlignMenu(IMenuManager menu,
- final DesignRange selection, final IHTMLGraphicalViewer viewer) {
- // we have to initialize align nodes here for some refresh problem
- Element[] alignNodes = new Element[4];
- final String[] alignValues = new String[] { "left", "center", "right",
- "justify" };
- Document document = viewer.getModel().getDocument();
- for (int i = 0; i < 4; i++) {
- Element node = document.createElement(IHTMLConstants.TAG_P);
- node.setAttribute(IHTMLConstants.ATTR_ALIGN, alignValues[i]);
- alignNodes[i] = node;
- }
- AlignSupport.setAlignNodes(alignNodes);
-
- final IMenuManager submenu = new MenuManager(PDPlugin
- .getResourceString("ActionGroup.Submenu.Align"));//$NON-NLS-1$
- submenu.add(action);
- submenu.setRemoveAllWhenShown(true);
- submenu.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager manager) {
- AlignSupport.createAlignActions(submenu, viewer);
- }
- });
- menu.appendToGroup(PageDesignerActionConstants.GROUP_STYLE, submenu);
-
- }
-
- /**
- * @param menu
- * @param selection
- */
-// private void addListModeMenu(IMenuManager menu, DesignRange selection) {
-// }
-
- /**
- * @param menu
- * @param selection
- */
- private void addParagraphFormatMenu(IMenuManager menu,
- final DesignRange selection, final IHTMLGraphicalViewer viewer) {
- final IMenuManager submenu = new MenuManager(PDPlugin
- .getResourceString("ActionGroup.Submenu.ParagraphFormat"));//$NON-NLS-1$
- submenu.add(action);
- // Add the submenu.
-
- submenu.addMenuListener(new IMenuListener() {
-
- public void menuAboutToShow(IMenuManager manager) {
- submenu.removeAll();
- ParagraphSupport.createParagraphActions(submenu, selection,
- viewer);
- }
- });
- menu.appendToGroup(PageDesignerActionConstants.GROUP_STYLE, submenu);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/range/RangeStyleAction.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/range/RangeStyleAction.java
deleted file mode 100644
index 2346403..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/range/RangeStyleAction.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.actions.range;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jst.pagedesigner.viewer.DesignRange;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class RangeStyleAction extends Action {
- /**
- * @param text
- * @param range
- * @param htmlTag
- * @param cssProperty
- * @param cssValue
- */
- public RangeStyleAction(String text, DesignRange range, String htmlTag,
- String cssProperty, String cssValue) {
- super(text);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run() {
- if (isChecked()) {
- // un-apply the style here
- } else {
- // apply the style here.
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/range/RangeStyleSupport.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/range/RangeStyleSupport.java
deleted file mode 100644
index 60f2364..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/range/RangeStyleSupport.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.actions.range;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.viewer.DesignRange;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class RangeStyleSupport {
- private static final String[] ActionLabel = new String[] {
- PDPlugin.getResourceString("RangeStyleSupport.ActionLabel.Bold"),//$NON-NLS-1$
- PDPlugin.getResourceString("RangeStyleSupport.ActionLabel.Italic"),//$NON-NLS-1$
- PDPlugin
- .getResourceString("RangeStyleSupport.ActionLabel.Underline"), }; //$NON-NLS-1$
-
- private static final String[] HtmlTag = new String[] { "STRONG", "I", "U", }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- private static final String[] CSSProperty = new String[] {
- "font-weight", "font-style", "text-decoration", }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- private static final String[] CSSValue = new String[] { "bolder", "italic",
- "underline", };
-
- /**
- * @param menu
- * @param range
- */
- public static void createRangeStyleActions(IMenuManager menu,
- DesignRange range) {
- for (int i = 0; i < ActionLabel.length; i++) {
- RangeStyleAction action = new RangeStyleAction(ActionLabel[i],
- range, HtmlTag[i], CSSProperty[i], CSSValue[i]);
-
- menu.add(action);
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/single/BorderStyleAction.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/single/BorderStyleAction.java
deleted file mode 100644
index 1723662..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/single/BorderStyleAction.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.actions.single;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class BorderStyleAction extends Action {
-
- /**
- * @param stylevalue
- * @param ele
- * @param text
- *
- */
- public BorderStyleAction(String text, IDOMElement ele, String stylevalue) {
- super(text);
- // TODO Auto-generated constructor stub
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/single/ChangeAttributeAction.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/single/ChangeAttributeAction.java
deleted file mode 100644
index 7595da6..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/single/ChangeAttributeAction.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.actions.single;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.commands.single.ChangeAttributeCommand;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class ChangeAttributeAction extends Action {
- IDOMElement _ele;
-
- String _attrValue;
-
- private String _attrName;
-
- /**
- * @param label
- * @param ele
- * @param attrName
- * @param attrValue
- */
- public ChangeAttributeAction(String label, IDOMElement ele,
- String attrName, String attrValue) {
- super(label);
- this._ele = ele;
- this._attrName = attrName;
- this._attrValue = attrValue;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run() {
- if (this.isChecked()) {
- return;
- }
-
- ChangeAttributeCommand c = new ChangeAttributeCommand(
- PDPlugin
- .getResourceString("ChangeAttributeAction.CommandLabel.ChangeStyleClass"), _ele, _attrName, _attrValue); //$NON-NLS-1$
- c.execute();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/single/ChangeStyleAction.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/single/ChangeStyleAction.java
deleted file mode 100644
index dd2fe69..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/single/ChangeStyleAction.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.actions.single;
-
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.preference.PreferenceManager;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.commands.single.ChangeStyleCommand;
-import org.eclipse.jst.pagedesigner.parts.ElementEditPart;
-import org.eclipse.jst.pagedesigner.ui.dialogs.StyleDialog;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclaration;
-import org.eclipse.wst.css.core.internal.util.declaration.CSSPropertyContext;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.w3c.dom.css.ElementCSSInlineStyle;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class ChangeStyleAction extends Action {
- private static final String MY_TEXT = PDPlugin
- .getResourceString("ChangeStyleAction.Text");
-
- private ElementEditPart _editPart;
-
- private IDOMElement _element;
-
- /**
- * @param part
- * @param ele
- */
- public ChangeStyleAction(ElementEditPart part, IDOMElement ele) {
- super(MY_TEXT);
- this._editPart = part;
- this._element = ele;
- }
-
- public void run() {
- ICSSStyleDeclaration styleDeclaration = (ICSSStyleDeclaration) ((ElementCSSInlineStyle) this._element)
- .getStyle();
- PreferenceManager manager = new PreferenceManager();
- EditPartViewer viewer = this._editPart.getViewer();
- Shell shell = viewer.getControl().getShell();
-
- CSSPropertyContext context = new CSSPropertyContext(styleDeclaration);
- StyleDialog dialog = new StyleDialog(shell, manager, _element, context);
- if (dialog.open() == Window.OK) {
- if (context.isModified()) {
- ChangeStyleCommand c = new ChangeStyleCommand(_element, context);
- c.execute();
- }
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/single/ChangeStylePropertyAction.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/single/ChangeStylePropertyAction.java
deleted file mode 100644
index 1fef76f..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/single/ChangeStylePropertyAction.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.actions.single;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jst.pagedesigner.commands.single.ChangeStyleCommand;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class ChangeStylePropertyAction extends Action {
- private IDOMElement _ele;
-
- private String _cssProperty;
-
- private String _cssValue;
-
- /**
- * @param text
- * @param ele
- * @param cssProperty
- * @param cssValue
- */
- public ChangeStylePropertyAction(String text, IDOMElement ele,
- String cssProperty, String cssValue) {
- super(text);
- this._ele = ele;
- this._cssProperty = cssProperty;
- this._cssValue = cssValue;
- }
-
- public void run() {
- if (isChecked()) {
- return;
- }
-
- Map map = new HashMap();
- map.put(_cssProperty, _cssValue);
- ChangeStyleCommand command = new ChangeStyleCommand(_ele, map);
- command.execute();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/single/ColorSupport.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/single/ColorSupport.java
deleted file mode 100644
index d253dd1..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/single/ColorSupport.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.actions.single;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.dom.DOMStyleUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-/*package*/ class ColorSupport {
- static final String[] COLOR_VALUES = new String[] {
- PDPlugin.getResourceString("ColorSupport.CommandLabel.Aqua"), //$NON-NLS-1$
- PDPlugin.getResourceString("ColorSupport.CommandLabel.Black"), //$NON-NLS-1$
- PDPlugin.getResourceString("ColorSupport.CommandLabel.Blue"), //$NON-NLS-1$
- PDPlugin.getResourceString("ColorSupport.CommandLabel.Fuchsia"), //$NON-NLS-1$
- PDPlugin.getResourceString("ColorSupport.CommandLabel.Gray"), //$NON-NLS-1$
- PDPlugin.getResourceString("ColorSupport.CommandLabel.Green"), //$NON-NLS-1$
- PDPlugin.getResourceString("ColorSupport.CommandLabel.Lime"), //$NON-NLS-1$
- PDPlugin.getResourceString("ColorSupport.CommandLabel.Maroon"), //$NON-NLS-1$
- PDPlugin.getResourceString("ColorSupport.CommandLabel.Navy"), //$NON-NLS-1$
- PDPlugin.getResourceString("ColorSupport.CommandLabel.Olive"), //$NON-NLS-1$
- PDPlugin.getResourceString("ColorSupport.CommandLabel.Orange"), //$NON-NLS-1$
- PDPlugin.getResourceString("ColorSupport.CommandLabel.Purple"), //$NON-NLS-1$
- PDPlugin.getResourceString("ColorSupport.CommandLabel.Red"), //$NON-NLS-1$
- PDPlugin.getResourceString("ColorSupport.CommandLabel.Silver"), //$NON-NLS-1$
- PDPlugin.getResourceString("ColorSupport.CommandLabel.Teal"), //$NON-NLS-1$
- PDPlugin.getResourceString("ColorSupport.CommandLabel.White"), //$NON-NLS-1$
- PDPlugin.getResourceString("ColorSupport.CommandLabel.Yellow") //$NON-NLS-1$
- };
-
- /**
- *
- * @param menu
- * @param ele
- * @param cssProperty
- * will be "color" or "background-color"
- */
- static void createColorActions(IMenuManager menu, IDOMElement ele,
- String cssProperty) {
- boolean needAdditional = true;
- String currentValue = DOMStyleUtil.getInlineStyleProperty(ele,
- cssProperty);
- ChangeStylePropertyAction defaultAction = new ChangeStylePropertyAction(
- PDPlugin.getResourceString("ColorSupport.CommandLabel.Default"), ele, cssProperty, null); //$NON-NLS-1$
- if (currentValue == null || currentValue.length() == 0) {
- defaultAction.setChecked(true);
- needAdditional = false;
- }
- menu.add(defaultAction);
- menu.add(new Separator());
- for (int i = 0; i < COLOR_VALUES.length; i++) {
- ChangeStylePropertyAction action = new ChangeStylePropertyAction(
- COLOR_VALUES[i], ele, cssProperty, COLOR_VALUES[i]);
- if (COLOR_VALUES[i].equalsIgnoreCase(currentValue)) {
- action.setChecked(true);
- needAdditional = false;
- }
- menu.add(action);
- }
-
- if (needAdditional) {
- ChangeStylePropertyAction action = new ChangeStylePropertyAction(
- currentValue, ele, cssProperty, currentValue);
- action.setChecked(true);
- menu.add(action);
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/single/SelectEditPartAction.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/single/SelectEditPartAction.java
deleted file mode 100644
index 2cb2299..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/single/SelectEditPartAction.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.actions.single;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.StructuredSelection;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public abstract class SelectEditPartAction extends Action {
-
- /**
- * @param text
- * @param forThisPart
- * @return a convience object when the edit part that needs selection
- * is already known when the action is constructed
- */
- public static SelectEditPartAction create(final String text, final EditPart forThisPart)
- {
- return new SelectEditPartAction(text)
- {
- protected EditPart getNewSelection() {
- return forThisPart;
- }
- };
- }
-
- /**
- * @param text
- */
- protected SelectEditPartAction(String text) {
- super(text);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run() {
- final EditPart newSelection = getNewSelection();
- newSelection.getViewer().setSelection(new StructuredSelection(newSelection));
- }
-
- /**
- * @return the EditPart onto which selection should be applied.
- */
- protected abstract EditPart getNewSelection();
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/single/SelectNodeAction.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/single/SelectNodeAction.java
deleted file mode 100644
index 5724e31..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/single/SelectNodeAction.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.actions.single;
-
-import org.w3c.dom.Node;
-
-/**
- * An edit part selection action that corresponds to a Node selection
- */
-public abstract class SelectNodeAction extends SelectEditPartAction
-{
- private final Node _node;
-
- /**
- * @param text
- * @param curNode
- */
- protected SelectNodeAction(String text, Node curNode) {
- super(text);
- _node = curNode;
- }
-
- /**
- * @return the current node
- */
- protected Node getNode() {
- return _node;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/single/SelectParentAction.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/single/SelectParentAction.java
deleted file mode 100644
index 33d053e..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/single/SelectParentAction.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.actions.single;
-
-import org.eclipse.gef.EditPart;
-import org.w3c.dom.Node;
-
-/**
- * Given a target node/edit part change selection to its parent
- *
- * @author cbateman
- *
- */
-public class SelectParentAction extends SelectNodeAction {
-
- private final EditPart _editPart;
-
- /**
- * @param node
- * @param editPart
- * @return an action that will change focus selection to the parent
- * part of node/editPart or a disabled one if there is no parent
- */
- public static SelectParentAction create(Node node, EditPart editPart)
- {
- Node parent = node.getParentNode();
-
- if (parent != null)
- {
- final String text = "Parent ("+parent.getNodeName()+")";
- return new SelectParentAction(text, node, editPart);
- }
- SelectParentAction action = new SelectParentAction("Parent", node, editPart);
- action.setEnabled(false);
- return action;
- }
-
- private SelectParentAction(String text, Node node, EditPart editPart)
- {
- super(text, node);
- _editPart = editPart;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.actions.single.SelectEditPartAction#getNewSelection()
- */
- protected EditPart getNewSelection()
- {
- return _editPart.getParent();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/single/SingleElementActionGroup.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/single/SingleElementActionGroup.java
deleted file mode 100644
index 9bf37dd..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/single/SingleElementActionGroup.java
+++ /dev/null
@@ -1,241 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.actions.single;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.jst.pagedesigner.dom.DOMStyleUtil;
-import org.eclipse.jst.pagedesigner.editors.PageDesignerActionConstants;
-import org.eclipse.jst.pagedesigner.elementedit.IElementEdit;
-import org.eclipse.jst.pagedesigner.parts.ElementEditPart;
-import org.eclipse.ui.actions.ActionGroup;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.w3c.dom.Element;
-
-/**
- * Group that constructs context menu items for a single selected element.
- *
- * @author mengbo
- * @version 1.5
- */
-public class SingleElementActionGroup extends ActionGroup {
- // TODO: why?
- private static final Action action = new Action() {
- // create a default instance that does nothing
- // Action is abstract but has no abstract methods
- // run() on this object is a NOOP
- };
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.actions.ActionGroup#fillContextMenu(org.eclipse.jface.action.IMenuManager)
- */
- public void fillContextMenu(IMenuManager menu) {
- ElementEditPart part = fixUpSelection(getContext().getSelection());
- if (part == null) {
- return;
- }
- IDOMElement ele = (IDOMElement) part.getIDOMNode();
- addPositionRelativeMenu(menu, part, ele);
- addStylelMenu(menu, part, ele);
-
- // next add element special actions
- IElementEdit elementEdit = part.getElementEdit();
- if (elementEdit != null) {
- elementEdit.fillContextMenu(menu, ele);
- }
- }
-
- /**
- * @param selection
- * @return
- */
- private ElementEditPart fixUpSelection(ISelection selection) {
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection sel = (IStructuredSelection) selection;
- if (sel.size() != 1) {
- return null;
- }
- if (sel.getFirstElement() instanceof ElementEditPart) {
- return (ElementEditPart) sel.getFirstElement();
- }
- }
- return null;
- }
-
- /**
- * Add menu actions that select relative to the current position
- *
- * @param menu
- * @param part
- * @param ele
- */
- private void addPositionRelativeMenu(IMenuManager menu, ElementEditPart part, IDOMElement ele)
- {
- IContributionItem subMenuItem = menu.find(PageDesignerActionConstants.SELECT_SUBMENU_ID);
-
- if (subMenuItem instanceof IMenuManager)
- {
- final IMenuManager subMenu = (IMenuManager) subMenuItem;
- // final IMenuManager selectMenu = new MenuManager(PDPlugin
- // .getResourceString("ActionGroup.Submenu.SelectRelative"));//$NON-NLS-1$
- SelectParentAction selectParentAction = SelectParentAction.create(ele, part);
- // Eclipse UI guideline: 6.13
- // even if there is no parent, a disabled action will be returned by
- // create and this should be added to the menu
- subMenu.add(selectParentAction);
-
- List children = new ArrayList();
- for (Iterator it = part.getChildren().iterator(); it.hasNext();)
- {
- EditPart childPart = (EditPart) it.next();
-
- // only include selectable element edit part that are modelling
- // XML elements in the source doc
- if (childPart instanceof ElementEditPart
- && ((ElementEditPart)childPart).isSelectable()
- && ((ElementEditPart)childPart).getModel() instanceof Element)
- {
- children.add(SelectNodeAction
- .create(((Element)((ElementEditPart)childPart).getModel()).getNodeName(), childPart));
- }
- }
-
-
- // don't add the select Children menu unless there are actually children
- if (children.size() > 0)
- {
- MenuManager selectChildMenu = new MenuManager("Children"/*PDPlugin
- .getResourceString("ActionGroup.Submenu.StyleClasses")*/);
- subMenu.add(selectChildMenu);
-
- for (final Iterator it = children.iterator(); it.hasNext();)
- {
- selectChildMenu.add((Action)it.next());
- }
- }
- else
- { // Eclipse UI guideline 6.13
- // create the child actions even if no children but make it
- // a disabled option if no children
- Action childrenAction = new Action("Children"){/* do nothing*/};
- childrenAction.setEnabled(false);
- subMenu.add(childrenAction);
- }
- }
- }
-
- /**
- * @param menu
- * @param part
- */
- private void addStylelMenu(IMenuManager menu, ElementEditPart part,
- IDOMElement ele) {
- IContributionItem subMenu =
- menu.find(PageDesignerActionConstants.STYLE_SUBMENU_ID);
-
- if (subMenu instanceof IMenuManager)
- {
- final IMenuManager subMenuManager =
- (IMenuManager) subMenu;
- addStyle(subMenuManager, part, ele);
- addStyleClassesMenu(subMenuManager, part, ele);
-
- if (DOMStyleUtil.supportStyleAttribute(ele)) {
- // addBorderStyleMenu(stylesub, part, ele);
- addColorMenu(subMenuManager, part, ele);
- addBackgroundMenu(subMenuManager, part, ele);
- }
- }
- }
-
- /**
- *
- * @param menu
- * @param part
- * @param ele
- */
- private void addStyle(IMenuManager subMenu, ElementEditPart part,
- IDOMElement ele) {
- StyleSupport.createStyleAction(subMenu, part, ele);
- }
-
- /**
- * @param stylesub
- * @param part
- */
- private void addStyleClassesMenu(IMenuManager subMenu,
- ElementEditPart part, final IDOMElement ele) {
- final IMenuManager classmenu = new MenuManager(PDPlugin
- .getResourceString("ActionGroup.Submenu.StyleClasses"));//$NON-NLS-1$
- StyleClassSupport.createStyleClassActions(classmenu, ele);
-
- subMenu.appendToGroup(PageDesignerActionConstants.GROUP_STYLE,
- classmenu);
- }
-
- /**
- * @param stylesub
- * @param part
- */
- private void addColorMenu(IMenuManager subMenu, ElementEditPart part,
- final IDOMElement ele) {
- final IMenuManager colorSub = new MenuManager(PDPlugin
- .getResourceString("ActionGroup.Submenu.Color"));//$NON-NLS-1$
- colorSub.add(action);
- colorSub.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager manager) {
- colorSub.removeAll();
- ColorSupport.createColorActions(colorSub, ele,
- ICSSPropertyID.ATTR_COLOR);
- }
- });
- subMenu.appendToGroup(PageDesignerActionConstants.GROUP_STYLE,
- colorSub);
-
- }
-
- /**
- * @param stylesub
- * @param part
- */
- private void addBackgroundMenu(IMenuManager subMenu, ElementEditPart part,
- final IDOMElement ele) {
- final IMenuManager colorSub = new MenuManager(PDPlugin
- .getResourceString("ActionGroup.Submenu.BackgroundColor"));//$NON-NLS-1$
- colorSub.add(action);
- colorSub.addMenuListener(new IMenuListener() {
-
- public void menuAboutToShow(IMenuManager manager) {
- colorSub.removeAll();
- ColorSupport.createColorActions(colorSub, ele,
- ICSSPropertyID.ATTR_BACKGROUND_COLOR);
- }
- });
-
- subMenu.appendToGroup(PageDesignerActionConstants.GROUP_STYLE,
- colorSub);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/single/StyleClassSupport.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/single/StyleClassSupport.java
deleted file mode 100644
index da13637..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/single/StyleClassSupport.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.actions.single;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jst.jsf.core.internal.tld.CMUtil;
-import org.eclipse.jst.jsf.core.internal.tld.ITLDConstants;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.css2.CSSUtil;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class StyleClassSupport {
- private final static String DEFAULT = PDPlugin
- .getResourceString("StyleClassSupport.Default");
-
- /**
- * @param classmenu
- * @param ele
- */
- public static void createStyleClassActions(IMenuManager classmenu,
- IDOMElement ele) {
- String styleClassAttr = getStyleClassAttributeName(ele);
- if (styleClassAttr == null) {
- return; // don't support style class
- }
- String styleClass = getStyleClass(ele);
-
- boolean needAdditional = true;
- ChangeAttributeAction action = new ChangeAttributeAction(DEFAULT, ele,
- styleClassAttr, null);
- if (styleClass == null || styleClass.length() == 0) {
- action.setChecked(true);
- needAdditional = false;
- }
- classmenu.add(action);
- String[] classes = CSSUtil.getCSSClasses(ele.getOwnerDocument());
- if (classes.length > 0) {
- classmenu.add(new Separator());
- }
- for (int i = 0; i < classes.length; i++) {
- ChangeAttributeAction action2 = new ChangeAttributeAction(
- classes[i], ele, styleClassAttr, classes[i]);
- if (classes[i].equalsIgnoreCase(styleClass)) {
- action2.setChecked(true);
- needAdditional = false;
- }
- classmenu.add(action2);
- }
- if (needAdditional) {
- ChangeAttributeAction action2 = new ChangeAttributeAction(
- styleClass, ele, styleClassAttr, styleClass);
- action2.setChecked(true);
- classmenu.add(action2);
- }
- }
-
- /**
- * @param ele
- * @return the style class for ele or null if none
- */
- public static String getStyleClass(IDOMElement ele) {
- String styleClassAttr = getStyleClassAttributeName(ele);
- if (styleClassAttr != null) {
- return ele.getAttribute(styleClassAttr);
- }
- return null;
- }
-
- /**
- * FIXME: This is a temparary impelementation, with everything hard coded.
- * In the future, should have some INodeAdapter mechanism for each node to
- * tell the style class attribute name.
- *
- * @param ele
- * @return the style class attribute name or null if none applies
- */
- public static String getStyleClassAttributeName(IDOMElement ele) {
- CMElementDeclaration decl = CMUtil.getElementDeclaration(ele);
- if (decl == null) {
- return null;
- }
- String taguri = CMUtil.getTagURI(decl);
- if (taguri == null || ITLDConstants.URI_HTML.equals(taguri)) {
- if (decl.getAttributes().getNamedItem("class") != null) {
- return "class";
- }
- return null;
- } else if (decl.getAttributes().getNamedItem("styleClass") != null) {
- return "styleClass";
- } else if (decl.getAttributes().getNamedItem("class") != null) {
- return "class";
- } else {
- return null;
- }
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/single/StyleSupport.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/single/StyleSupport.java
deleted file mode 100644
index d580d6e..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/single/StyleSupport.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.actions.single;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jst.jsf.core.internal.tld.CMUtil;
-import org.eclipse.jst.pagedesigner.editors.PageDesignerActionConstants;
-import org.eclipse.jst.pagedesigner.parts.ElementEditPart;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public final class StyleSupport {
- /**
- * @param menu
- * @param part
- * @param ele
- */
- public static void createStyleAction(IMenuManager menu,
- ElementEditPart part, IDOMElement ele) {
- if (part == null) {
- return;
- }
- if (hasStyleAttribute(ele)) {
- IAction action = new ChangeStyleAction(part, ele);
- menu.appendToGroup(PageDesignerActionConstants.GROUP_STYLE, action);
- }
- }
-
- private static boolean hasStyleAttribute(IDOMElement ele) {
- CMElementDeclaration decl = CMUtil.getElementDeclaration(ele);
- if (decl == null) {
- return false;
- }
- if (decl.getAttributes().getNamedItem("style") != null) {
- return true;
- }
- return false;
- }
-
- private StyleSupport()
- {
- // util class; no instantiation
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/table/TableActionGroup.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/table/TableActionGroup.java
deleted file mode 100644
index f076978..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/table/TableActionGroup.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.actions.table;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.actions.single.SelectEditPartAction;
-import org.eclipse.jst.pagedesigner.editors.PageDesignerActionConstants;
-import org.eclipse.jst.pagedesigner.parts.ElementEditPart;
-import org.eclipse.jst.pagedesigner.range.RangeUtil;
-import org.eclipse.jst.pagedesigner.tableedit.DeleteRowColumnAction;
-import org.eclipse.jst.pagedesigner.tableedit.InsertRowColumnAction;
-import org.eclipse.jst.pagedesigner.viewer.DesignPosition;
-import org.eclipse.jst.pagedesigner.viewer.DesignRange;
-import org.eclipse.ui.actions.ActionGroup;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- *
- * @author mengbo
- * @version 1.5
- */
-/*package*/ class TableActionGroup extends ActionGroup {
- // TODO: I think there's a pattern emerging...
- private final static Action action = new Action() {
- // create an empty no-op
- };
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.actions.ActionGroup#fillContextMenu(org.eclipse.jface.action.IMenuManager)
- */
- public void fillContextMenu(IMenuManager menu) {
- ISelection selection = this.getContext().getSelection();
-
- EditPart part = findCommonAncesterPart(selection);
- if (part == null) {
- return;
- }
-
- TableOperationContext context = TableOperationContext
- .getTableOperationContext(part);
- if (context == null) {
- return;
- }
-
- final ElementEditPart tablePart = context.getTablePart();
-
- if (tablePart == null || !supportTableActions(tablePart)) {
- return;
- }
-
- final int cellRow = context.getRowIndex();
- final int cellColumn = context.getColumnIndex();
-
- String tag = ((IDOMElement) tablePart.getIDOMNode()).getLocalName();
- final IMenuManager tableMenu = new MenuManager(tag);
-
- // ok, we passed the checking, now let's create the actions.
- tableMenu.add(action);
- tableMenu.addMenuListener(new IMenuListener() {
-
- public void menuAboutToShow(IMenuManager manager) {
- tableMenu.removeAll();
- fillTableMenu(tablePart, cellRow, cellColumn, tableMenu);
- }
- });
- menu.appendToGroup(PageDesignerActionConstants.GROUP_CONTAINER,
- tableMenu);
- }
-
- /**
- * @param tablePart
- * @param cellRow
- * @param cellColumn
- * @param tableMenu
- */
- private void fillTableMenu(ElementEditPart tablePart, int cellRow,
- int cellColumn, IMenuManager tableMenu) {
- SelectEditPartAction action1 = SelectEditPartAction.create(
- PDPlugin
- .getResourceString("TableActionGroup.Submenu.SelectTable"), tablePart);//$NON-NLS-1$
- tableMenu.add(action1);
-
- tableMenu.add(new Separator());
-
- {
- InsertRowColumnAction insertRowBeforeAction = new InsertRowColumnAction(
- PDPlugin
- .getResourceString("TableActionGroup.Submenu.InsertRowBefore"),//$NON-NLS-1$
- tablePart, cellRow, true, true);
- tableMenu.add(insertRowBeforeAction);
-
- InsertRowColumnAction insertRowAfterAction = new InsertRowColumnAction(
- PDPlugin
- .getResourceString("TableActionGroup.Submenu.InsertRowAfter"),//$NON-NLS-1$
- tablePart, cellRow, true, false);
- tableMenu.add(insertRowAfterAction);
-
- tableMenu.add(new Separator());
- }
-
- {
- InsertRowColumnAction insertColumnBeforeAction = new InsertRowColumnAction(
- PDPlugin
- .getResourceString("TableActionGroup.Submenu.InsertColumnBefore"),//$NON-NLS-1$
- tablePart, cellColumn, true, true);
- tableMenu.add(insertColumnBeforeAction);
-
- InsertRowColumnAction insertColumnAfterAction = new InsertRowColumnAction(
- PDPlugin
- .getResourceString("TableActionGroup.Submenu.InsertColumnAfter"),//$NON-NLS-1$
- tablePart, cellColumn, true, false);
- tableMenu.add(insertColumnAfterAction);
-
- tableMenu.add(new Separator());
- }
-
- {
- DeleteRowColumnAction deleteRowAction = new DeleteRowColumnAction(
- PDPlugin
- .getResourceString("TableActionGroup.Submenu.DeleteRow"),//$NON-NLS-1$
- tablePart, cellRow, true);
- tableMenu.add(deleteRowAction);
-
- DeleteRowColumnAction deleteColumnAction = new DeleteRowColumnAction(
- PDPlugin
- .getResourceString("TableActionGroup.Submenu.DeleteColumn"),//$NON-NLS-1$
- tablePart, cellColumn, false);
- tableMenu.add(deleteColumnAction);
- }
- }
-
- /**
- * @param tablePart
- * @return
- */
- private boolean supportTableActions(ElementEditPart tablePart) {
- // TODO: what's the point of this method?
- // it's only used in one place and always resolves to the same value..
- return true;
- }
-
- /**
- * Give a selection, find a single common container node as start for table
- * related operations.
- *
- * @param selection
- * @return
- */
- private EditPart findCommonAncesterPart(ISelection selection) {
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection structsel = (IStructuredSelection) selection;
- if (structsel.size() != 1) {
- return null;
- } else if (structsel.getFirstElement() instanceof EditPart) {
- return (EditPart) structsel.getFirstElement();
- } else {
- return null;
- }
- } else if (selection instanceof DesignRange) {
- DesignRange range = (DesignRange) selection;
- if (!range.isValid()) {
- return null;
- }
- if (range.isEmpty()) {
- DesignPosition position = range.getStartPosition();
- if (position.getOffset() == 0) {
- return position.getContainerPart();
- }
- return position.getSiblingEditPart(true);
- }
- return RangeUtil.findCommonAncestor(range);
- } else {
- return null;
- }
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/table/TableOperationContext.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/table/TableOperationContext.java
deleted file mode 100644
index 0981ed3..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/table/TableOperationContext.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.actions.table;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.jst.pagedesigner.css2.layout.CSSFigure;
-import org.eclipse.jst.pagedesigner.css2.layout.table.CSSTableCellLayout;
-import org.eclipse.jst.pagedesigner.css2.layout.table.CSSTableLayout2;
-import org.eclipse.jst.pagedesigner.css2.layout.table.TableCellInfo;
-import org.eclipse.jst.pagedesigner.parts.ElementEditPart;
-
-/**
- *
- * @author mengbo
- * @version 1.5
- */
-/*package*/ class TableOperationContext {
- private ElementEditPart _tablePart;
-
- private int _rowIndex;
-
- private int _columnIndex;
-
- /**
- * @param part
- * @return the operation context for part
- */
- public static TableOperationContext getTableOperationContext(EditPart part) {
- EditPart originalPart = part;
- ElementEditPart tablePart = null;
- CSSTableLayout2 tableLayout = null;
-
- while (part.getParent() instanceof ElementEditPart) {
- part = part.getParent();
- IFigure figure = ((GraphicalEditPart) part).getFigure();
-
- if (figure.getLayoutManager() instanceof CSSTableLayout2) {
- tableLayout = (CSSTableLayout2) figure.getLayoutManager();
- tablePart = ((ElementEditPart) part);
- break;
- }
- }
- if (tablePart == null) {
- return null;
- }
-
- part = originalPart;
-
- IFigure figure = ((GraphicalEditPart) originalPart).getFigure();
- while (figure instanceof CSSFigure) {
- if (figure.getLayoutManager() instanceof CSSTableCellLayout) {
- CSSTableCellLayout cellLayout = (CSSTableCellLayout) figure
- .getLayoutManager();
- if (cellLayout.getTableLayout() == tableLayout) {
- // ok, we found.
- TableCellInfo cellInfo = cellLayout.getTableCellInfo();
- if (cellInfo == null) {
- return null;
- }
- TableOperationContext context = new TableOperationContext();
- context._tablePart = tablePart;
- context._rowIndex = cellInfo.getRowIndex();
- context._columnIndex = cellInfo.getColumnIndex();
- return context;
- }
- return null;
- }
- figure = figure.getParent();
- }
- return null;
- }
-
- ElementEditPart getTablePart() {
- return _tablePart;
- }
-
- int getRowIndex() {
- return _rowIndex;
- }
-
- int getColumnIndex() {
- return _columnIndex;
- }
-
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/adapters/IBodyInfo.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/adapters/IBodyInfo.java
deleted file mode 100644
index 34dfb61..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/adapters/IBodyInfo.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.adapters;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-
-/**
- * This is an adapter interface. Will be adapted to all the node in the
- * document. It provides additional information to support designer.
- *
- * Basicaly it tells the correspoinding node's body related information.
- *
- * @author mengbo
- */
-// XXX: in the future will use adapter mechanism to support dynamic information
-public interface IBodyInfo // extends INodeAdapter
-{
- // /**
- // * whether this node is runtime visible.
- // *
- // * @return
- // */
- // public boolean isRuntimeVisible(INodeNotifier node);
- //
- // /**
- // * whether this node is design time visible.
- // * @return
- // */
- // public boolean isDesignTimeVisible(INodeNotifier node);
-
- // /**
- // * whether is HTML tag.
- // * @param node
- // * @return
- // */
- // public boolean isHTML(IDOMNode node);
- //
- // /**
- // * whether is JSP tag.
- // * @param node
- // * @return
- // */
- // public boolean isJSP(IDOMNode node);
- //
- // /**
- // * whether is custom tag.
- // * @param node
- // * @return
- // */
- // public boolean isCustomTag(IDOMNode node);
- //
- // /**
- // * for custom tag, there may have a corresponding HTML tag name.
- // * This can be used for content model validation.
- // *
- // * @param node
- // * @return
- // */
- // public String getCorrespondingHTMLTag(IDOMNode node);
-
- /**
- * whether this node is body node. We treat the document node and certain
- * element node like "HTML", "BODY", "f:view", "f:subview" as body node. At
- * design time we may want to move those visual node into the body.
- *
- * @param node
- * @return true if node is a body container
- */
- public boolean isBodyContainer(IDOMNode node);
-
- /**
- * this method should only be called isBodyContainer return true; It checks
- * whether the uri/localname should belong to the head part of this body
- * container.
- *
- * @param node
- * @param uri
- * @param localname
- * @return true if node is a header
- */
- public boolean isBodyHeader(IDOMNode node, String uri, String localname);
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/adapters/internal/BodyInfo.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/adapters/internal/BodyInfo.java
deleted file mode 100644
index 5d9c498..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/adapters/internal/BodyInfo.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.adapters.internal;
-
-import org.eclipse.jst.jsf.core.internal.tld.CMUtil;
-import org.eclipse.jst.jsf.core.internal.tld.IJSFConstants;
-import org.eclipse.jst.jsf.core.internal.tld.ITLDConstants;
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.adapters.IBodyInfo;
-import org.eclipse.jst.pagedesigner.jsp.core.IJSPCoreConstants;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- */
-// XXX: currently hardcoded as sigleton implementation,
-// it is believed in the future will not use singleton, because we want to
-// dynamically
-// support other taglibs.
-public class BodyInfo implements IBodyInfo {
- private static final BodyInfo _instance = new BodyInfo();
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.adapters.IDesignInfo#isBodyContainer(org.eclipse.wst.sse.core.internal.provisional.INodeNotifier)
- */
- public boolean isBodyContainer(IDOMNode node) {
- switch (node.getNodeType()) {
- case Node.DOCUMENT_FRAGMENT_NODE:
- case Node.DOCUMENT_NODE:
- return true;
- case Node.ELEMENT_NODE:
- return isBodyContainerElement((Element) node);
- default:
- return false;
- }
- }
-
- /**
- * @param element
- * @return
- */
- private boolean isBodyContainerElement(Element element) {
- String localname = element.getLocalName();
- /*
- * String namespaceURI = CMUtil.getElementNamespaceURI(element); if
- * (IJMTConstants.URI_HTML.equals(namespaceURI)) { return
- * "html".equalsIgnoreCase(localname) ||
- * "body".equalsIgnoreCase(localname); } if
- * (IJMTConstants.URI_JSF_CORE.equals(namespaceURI)) { return
- * "view".equals(localname) || "subview".equals(localname); }
- */
- return IHTMLConstants.TAG_HTML.equalsIgnoreCase(localname)
- || IHTMLConstants.TAG_BODY.equalsIgnoreCase(localname)
- || IJSFConstants.TAG_VIEW.equals(localname)
- || IJSFConstants.TAG_SUBVIEW.equals(localname);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.adapters.IDesignInfo#isBodyHeader(org.eclipse.wst.sse.core.internal.provisional.INodeNotifier,
- * java.lang.String, java.lang.String)
- */
- public boolean isBodyHeader(IDOMNode node, String uri, String localname) {
- switch (node.getNodeType()) {
- case Node.DOCUMENT_FRAGMENT_NODE:
- case Node.DOCUMENT_NODE:
- return isDocumentHeader(uri, localname);
- case Node.ELEMENT_NODE:
- return isElementHeader((Element) node, uri, localname);
- default:
- return false;
- }
- }
-
- /**
- * @param element
- * @param uri
- * @param localname
- * @return
- */
- private boolean isElementHeader(Element element, String uri,
- String localname) {
- String elelocalname = element.getLocalName();
- String namespaceURI = CMUtil.getElementNamespaceURI(element);
- if (ITLDConstants.URI_HTML.equals(namespaceURI)
- && IHTMLConstants.TAG_HTML.equalsIgnoreCase(elelocalname)) {
- return IHTMLConstants.TAG_HEAD.equalsIgnoreCase(localname);
- }
- if (ITLDConstants.URI_JSF_CORE.equals(namespaceURI)
- && IJSFConstants.TAG_VIEW.equalsIgnoreCase(elelocalname)) {
- return IJSFConstants.TAG_LOADBUNDLE.equalsIgnoreCase(localname);
- }
- return false;
- }
-
- /**
- * @param uri
- * @param localname
- * @return
- */
- private boolean isDocumentHeader(String uri, String localname) {
- // FIXME: temparary commented out, since the dragged node do not have
- // uri information for now.
- // if (IJMTConstants.URI_JSP.equals(uri))
- return IJSPCoreConstants.TAG_DIRECTIVE_PAGE.equals(localname)
- || IJSPCoreConstants.TAG_DIRECTIVE_TAGLIB.equals(localname);
-
- }
-
- /**
- * @return the singleton
- */
- public static IBodyInfo getInstance() {
- return _instance;
- }
-
- private BodyInfo()
- {
- // no external instantiation
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/CloneNodeCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/CloneNodeCommand.java
deleted file mode 100644
index c618210..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/CloneNodeCommand.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jst.pagedesigner.dom.DOMUtil;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.w3c.dom.Node;
-
-/**
- * This is when user control+mouse drag. Can also be used in other places.
- *
- * @author mengbo
- * @version 1.5
- */
-public class CloneNodeCommand extends DesignerCommand {
- IDOMPosition _insertPosition;
-
- Node _originalNode;
-
- Node _resultNode;
-
- /**
- * @param viewer
- * @param insertionPoint
- * @param originalNode
- */
- public CloneNodeCommand(IHTMLGraphicalViewer viewer,
- IDOMPosition insertionPoint, Node originalNode) {
- super(
- CommandResources.getString("CloneNodeCommand.Label.CloneNode"), viewer); //$NON-NLS-1$
- this._insertPosition = insertionPoint;
- this._originalNode = originalNode;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.DesignerCommand#doExecute()
- */
- protected void doExecute() {
- Node newNode = DOMUtil.cloneNodeDeep(this.getDocument(), _originalNode);
- DOMUtil.insertNode(_insertPosition, newNode);
- _resultNode = newNode;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.DesignerCommand#getAfterCommandDesignerSelection()
- */
- protected ISelection getAfterCommandDesignerSelection() {
- return toDesignSelection(_resultNode);
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/CommandResources.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/CommandResources.java
deleted file mode 100644
index c18db16..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/CommandResources.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class CommandResources {
- private static final String BUNDLE_NAME = "org.eclipse.jst.pagedesigner.commands.CommandResources"; //$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
- .getBundle(BUNDLE_NAME);
-
- private CommandResources() {
- // no local instantiation
- }
-
- /**
- * @param key
- * @return the resource value for key or !key! if not foudnd
- */
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/CommandResources.properties b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/CommandResources.properties
deleted file mode 100644
index c7a62a4..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/CommandResources.properties
+++ /dev/null
@@ -1,32 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2007 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are 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:
-# Oracle Corporation - initial API and implementation
-###############################################################################
-PasteNodeCommand.Label.DeleteNode=Delete Node
-CutNodeCommand.Label.CutNode=Cut Node
-DeleteNodeCommand.Label.DeleteNode=Delete Node
-DeleteAction.CommandLabel.Delete=Delete
-TableDeleteColumnCommand.Label.DeleteColumn=Delete Column
-TableInsertColumnCommand.Label.InsertColumn=Insert Column
-TableResizeColumnCommand.Label.ResizeColumn=Resize Column
-TableResizeRowCommand.Label.ResizeColumn=Resize Column
-TableDeleteRowCommand.Label.DeleteRow=Delete Row
-TableInsertRowCommand.Label.InsertRow=Insert Row
-TableDeleteHeaderFooterCommand.Label.DeleteHeader=Delete Header
-TableDeleteHeaderFooterCommand.Label.DeleteFooter=Delete Footer
-TableInsertHeaderFooterCommand.Label.InsertHeader=Insert Header
-TableInsertHeaderFooterCommand.Label.InsertFooter=Insert Footer
-PasteCommand.Label.Paste=Paste
-DeleteCommand.Label.Delete=Delete
-CutCommand.Label.Cut=Cut
-CopyCommand.Label.Copy=Copy
-ApplyStyleCommand.Label.ApplyStyle=Apply Style
-ChangeStyleCommand.Label.ChangeStyle=Change Style
-MoveNodeCommand.Label.MoveNode=Move Node
-CloneNodeCommand.Label.CloneNode=Copy Node
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/CopyAction.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/CopyAction.java
deleted file mode 100644
index 2502ac3..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/CopyAction.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.ui.actions.UpdateAction;
-import org.eclipse.gef.ui.parts.GraphicalEditor;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.commands.range.CopyCommand;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-
-/**
- * @author mengbo
- */
-public class CopyAction extends DesignAction implements UpdateAction {
- /**
- * @param editor
- */
- public CopyAction(GraphicalEditor editor) {
- super(editor, PDPlugin.getResourceString("Action.Name.Copy"));//$NON-NLS-1$
- // this.setAccelerator(SWT.CTRL | SWT.INSERT);
- // this.setActionDefinitionId(ITextEditorActionDefinitionIds.CUT);
- }
-
- public void perform() {
- DesignerCommand command = null;
- IHTMLGraphicalViewer viewer = getViewer();
- if (viewer.isInRangeMode()) {
- command = new CopyCommand(viewer);
- command.execute();
- } else {
- Command nodeCopy = new CopyNodeCommand(viewer);
- nodeCopy.execute();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#isEnabled()
- */
- public boolean isEnabled() {
- IHTMLGraphicalViewer viewer = getViewer();
- if (viewer != null) {
- if (viewer.isInRangeMode()
- && !EditModelQuery.isSame(viewer.getRangeSelection())) {
- return true;
- } else if (!viewer.isInRangeMode()
- && viewer.getSelectedEditParts().size() > 0) {
- return true;
- }
- }
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.ui.actions.UpdateAction#update()
- */
- public void update() {
- this.setEnabled(isEnabled());
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/CopyNodeCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/CopyNodeCommand.java
deleted file mode 100644
index dd9900c..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/CopyNodeCommand.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.dnd.TemplateTransfer;
-import org.eclipse.jst.pagedesigner.dom.EditValidateUtil;
-import org.eclipse.jst.pagedesigner.utils.DOMUtil;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.w3c.dom.Node;
-
-/**
- * As copy operation won't change anything in the current document, so it is not
- * extending from DesignerCommand.
- *
- * @author mengbo
- */
-public class CopyNodeCommand extends Command {
- private IHTMLGraphicalViewer _viewer;
-
- /**
- * @param viewer
- */
- public CopyNodeCommand(IHTMLGraphicalViewer viewer) {
- super("");
- this._viewer = viewer;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.DesignerCommand#doExecute()
- */
- public void execute() {
- List parts = _viewer.getSelectedEditParts();
- Vector result = new Vector();
- if (parts.size() > 0) {
- for (int i = 0, n = parts.size(); i < n; i++) {
- EditPart part = (EditPart) parts.get(i);
- Object model = part.getModel();
- if (model instanceof Node) {
- EditValidateUtil.validNode((Node) model);
- result.add(((Node) model).cloneNode(true));
- }
- }
- setClipboard(result);
- }
- }
-
- private void setClipboard(Vector result) {
- Node[] nodes = (Node[]) result.toArray(new Node[result.size()]);
- StringBuffer sb = new StringBuffer();
- for (int i = 0, size = nodes.length; i < size; i++) {
- DOMUtil.nodeToString(nodes[i], sb);
- }
- // TemplateTransfer.getInstance().setObject(result);
- Clipboard board = new Clipboard(_viewer.getControl().getDisplay());
- board.setContents(new Object[] { result, sb.toString() },
- new Transfer[] { TemplateTransfer.getInstance(),
- TextTransfer.getInstance() });
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/CreateItemCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/CreateItemCommand.java
deleted file mode 100644
index 62da037..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/CreateItemCommand.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.jst.pagedesigner.editors.palette.TagToolPaletteEntry;
-import org.eclipse.jst.pagedesigner.utils.CommandUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- */
-public class CreateItemCommand extends DesignerCommand {
- private final IDOMPosition _position;
-
- private final TagToolPaletteEntry _tagItem;
- private Element _ele;
- private IAdaptable _customizationData;
-
- /**
- * @param label
- * @param model
- * @param position
- * @param tagItem
- */
- public CreateItemCommand(String label, IDOMModel model,
- IDOMPosition position, TagToolPaletteEntry tagItem) {
- super(label, model.getDocument());
- this._position = position;
- this._tagItem = tagItem;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.DesignerCommand#doExecute()
- */
- protected void doExecute() {
- Element element = CommandUtil.excuteInsertion(this._tagItem,
- getModel(), this._position, this._customizationData);
- if (element != null) {
- formatNode(element);
- }
- this._ele = element;
- }
-
- @Override
- protected void postPostExecute()
- {
- // during JUnit testing, we may not have viewer.
- // this will cause us not to have undo support,
- // but should not effect testing for this command
- if (getViewer() != null)
- {
- super.postPostExecute();
- }
- }
-
- @Override
- protected boolean prePreExecute()
- {
- // during JUnit testing, we may not have viewer.
- // this will cause us not to have undo support,
- // but should not effect testing for this command
- if (getViewer() != null)
- {
- return super.prePreExecute();
- }
-
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.DesignerCommand#getAfterCommandDesignerSelection()
- */
- protected ISelection getAfterCommandDesignerSelection() {
- return toDesignSelection(_ele);
- }
-
- /**
- * @param customizationData
- */
- public void setCustomizationData(IAdaptable customizationData)
- {
- _customizationData = customizationData;
- }
-
- /**
- * This method is for test purposes and should generally not be
- * used by clients.
- *
- * @return the customization data
- */
- protected final IAdaptable getCustomizationData()
- {
- return _customizationData;
- }
-
- /**
- * @return the result of the command execution
- * TODO: add Object getResult() method to DesignerCommand
- */
- protected Element getResult()
- {
- return this._ele;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/CutAction.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/CutAction.java
deleted file mode 100644
index 3617aec..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/CutAction.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands;
-
-import org.eclipse.gef.ui.actions.UpdateAction;
-import org.eclipse.gef.ui.parts.GraphicalEditor;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.commands.range.CutCommand;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-
-/**
- * @author mengbo
- */
-public class CutAction extends DesignAction implements UpdateAction {
- /**
- * @param editor
- */
- public CutAction(GraphicalEditor editor) {
- super(editor, PDPlugin.getResourceString("Action.Name.Cut"));//$NON-NLS-1$
- }
-
- public void perform() {
- DesignerCommand command = null;
- IHTMLGraphicalViewer viewer = getViewer();
- if (viewer.isInRangeMode()) {
- command = new CutCommand(viewer);
- command.execute();
- } else {
- command = new CutNodeCommand(viewer);
- command.execute();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#isEnabled()
- */
- public boolean isEnabled() {
- IHTMLGraphicalViewer viewer = getViewer();
- if (viewer != null) {
- if (viewer.isInRangeMode()
- && !EditModelQuery.isSame(viewer.getRangeSelection())) {
- return true;
- } else if (!viewer.isInRangeMode()
- && viewer.getSelectedEditParts().size() > 0) {
- return true;
- }
- }
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.ui.actions.UpdateAction#update()
- */
- public void update() {
- setEnabled(isEnabled());
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/CutNodeCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/CutNodeCommand.java
deleted file mode 100644
index 006629a..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/CutNodeCommand.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.dnd.TemplateTransfer;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jst.pagedesigner.dom.EditValidateUtil;
-import org.eclipse.jst.pagedesigner.utils.DOMUtil;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- */
-public class CutNodeCommand extends DesignerCommand {
- private static final String COMMAND_LABEL = CommandResources
- .getString("CutNodeCommand.Label.CutNode"); //$NON-NLS-1$
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.DesignerCommand#doExecute()
- */
- protected void doExecute() {
- List parts = getViewer().getSelectedEditParts();
- Vector result = new Vector();
- if (parts.size() > 0) {
- for (int i = 0, n = parts.size(); i < n; i++) {
- EditPart part = (EditPart) parts.get(i);
- Object model = part.getModel();
- if (model instanceof Node) {
- EditValidateUtil.validNode((Node) model);
- Node parent = ((Node) model).getParentNode();
- model = parent.removeChild((Node) model);
- result.add(model);
- }
- }
- setClipboard(result);
- }
- }
-
- protected ISelection getAfterCommandDesignerSelection() {
- return null;
- }
-
- /**
- * @param viewer
- */
- public CutNodeCommand(IHTMLGraphicalViewer viewer) {
- super(COMMAND_LABEL, viewer);
- }
-
- private void setClipboard(Vector result) {
- Node[] nodes = (Node[]) result.toArray(new Node[result.size()]);
- StringBuffer sb = new StringBuffer();
- for (int i = 0, size = nodes.length; i < size; i++) {
- DOMUtil.nodeToString(nodes[i], sb);
- }
- // TemplateTransfer.getInstance().setObject(result);
- Clipboard board = new Clipboard(_viewer.getControl().getDisplay());
- board.setContents(new Object[] { result, sb.toString() },
- new Transfer[] { TemplateTransfer.getInstance(),
- TextTransfer.getInstance() });
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/DeleteAction.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/DeleteAction.java
deleted file mode 100644
index 3c89651..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/DeleteAction.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands;
-
-import org.eclipse.gef.ui.parts.GraphicalEditor;
-import org.eclipse.jst.pagedesigner.commands.range.DeleteCommand;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.eclipse.jst.pagedesigner.parts.DocumentEditPart;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-
-/**
- * @author mengbo
- */
-public class DeleteAction extends DesignAction {
- /**
- * @param editor
- */
- public DeleteAction(GraphicalEditor editor) {
- super(editor, CommandResources
- .getString("DeleteAction.CommandLabel.Delete")); //$NON-NLS-1$
- }
-
- public void perform() {
- DesignerCommand command = null;
- IHTMLGraphicalViewer viewer = getViewer();
- if (viewer.isInRangeMode()) {
- command = new DeleteCommand(true, viewer);
- command.execute();
- } else {
- command = new DeleteNodeCommand(viewer);
- command.execute();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#isEnabled()
- */
- public boolean isEnabled() {
- IHTMLGraphicalViewer viewer = getViewer();
- if (viewer != null) {
- if (viewer.isInRangeMode()
- && !EditModelQuery.isSame(viewer.getRangeSelection())) {
- return true;
- } else if (!viewer.isInRangeMode()) {
- int size = viewer.getSelectedEditParts().size();
- if (size > 1) {
- return true;
- } else if (size == 1
- && !(viewer.getSelectedEditParts().get(0) instanceof DocumentEditPart)) {
- return true;
- }
- }
- }
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/DeleteNodeCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/DeleteNodeCommand.java
deleted file mode 100644
index 71e529a..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/DeleteNodeCommand.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands;
-
-import java.util.List;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jst.pagedesigner.dom.DOMPositionHelper;
-import org.eclipse.jst.pagedesigner.dom.EditHelper;
-import org.eclipse.jst.pagedesigner.dom.EditValidateUtil;
-import org.eclipse.jst.pagedesigner.parts.SubNodeEditPart;
-import org.eclipse.jst.pagedesigner.validation.caret.ActionData;
-import org.eclipse.jst.pagedesigner.validation.caret.IMovementMediator;
-import org.eclipse.jst.pagedesigner.validation.caret.InlineEditingNavigationMediator;
-import org.eclipse.jst.pagedesigner.viewer.DesignPosition;
-import org.eclipse.jst.pagedesigner.viewer.DesignRange;
-import org.eclipse.jst.pagedesigner.viewer.DesignRefPosition;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- */
-public class DeleteNodeCommand extends DesignerCommand {
- private static final String COMMAND_LABEL = CommandResources
- .getString("DeleteNodeCommand.Label.DeleteNode"); //$NON-NLS-1$
-
- private DesignRange _prevRange;
-
- /**
- * @param viewer
- */
- public DeleteNodeCommand(IHTMLGraphicalViewer viewer) {
- super(COMMAND_LABEL, viewer);
- }
-
- protected void preExecute() {
- _prevRange = _viewer.getRangeSelection();
- DesignPosition position = findObjectModePosition();
- _prevRange = new DesignRange(position, position);
- super.preExecute();
- }
-
- private DesignPosition findObjectModePosition() {
- DesignPosition result = null;
- IMovementMediator validator = new InlineEditingNavigationMediator(
- new ActionData(ActionData.KEYBOARD_NAVAGATION, null));
- DesignPosition position = getCurrentObjectPosition();
- if (position != null) {
- if (!validator.isValidPosition(position)) {
- result = null;
- } else {
- result = position;
- }
- }
- return result;
- }
-
- private DesignPosition getCurrentObjectPosition() {
- DesignRange result = null;
- if (_viewer.isInRangeMode()) {
- result = _viewer.getRangeSelection();
- } else {
- List parts = _viewer.getSelectedEditParts();
- if (parts.size() > 0) {
- EditPart selection = (EditPart) parts.get(0);
- if (selection instanceof SubNodeEditPart) {
- DesignPosition position = new DesignRefPosition(selection,
- false);
- position = DOMPositionHelper.toDesignPosition(EditHelper
- .ensureDOMPosition(DOMPositionHelper
- .toDOMPosition(position)));
- result = new DesignRange(position, position);
- }
- }
- }
- return result != null && result.isValid() ? result.getEndPosition()
- : null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.DesignerCommand#doExecute()
- */
- protected void doExecute() {
- List parts = getViewer().getSelectedEditParts();
- for (int i = 0, n = parts.size(); i < n; i++) {
- EditPart part = (EditPart) parts.get(i);
- Object model = part.getModel();
- if (model instanceof Node) {
- EditValidateUtil.validNode((Node) model);
- Node parent = ((Node) model).getParentNode();
- model = parent.removeChild((Node) model);
- }
- }
- }
-
- protected ISelection getAfterCommandDesignerSelection() {
- if (_prevRange.isValid()) {
- return _prevRange;
- }
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/DesignAction.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/DesignAction.java
deleted file mode 100644
index a92e225..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/DesignAction.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands;
-
-import org.eclipse.gef.ui.actions.UpdateAction;
-import org.eclipse.gef.ui.parts.GraphicalEditor;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jst.pagedesigner.editors.IDesignViewer;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-
-/**
- * @author mengbo
- */
-public abstract class DesignAction extends Action implements UpdateAction {
- private GraphicalEditor _editor;
-
- /**
- * @param editor
- * @param text
- */
- public DesignAction(GraphicalEditor editor, String text) {
- super(text);
- _editor = editor;
- }
-
- /**
- * @return Returns the _editor.
- */
- protected GraphicalEditor getEditor() {
- return _editor;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- perform();
- // Since the parameters don't affect, so they could be null, may change
- // in the future
- _editor.selectionChanged(null, null);
- }
-
- abstract void perform();
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.ui.actions.UpdateAction#update()
- */
- public void update() {
- setEnabled(isEnabled());
- }
-
- /**
- * @return the viewer
- */
- protected IHTMLGraphicalViewer getViewer() {
- return ((IDesignViewer) _editor).getGraphicViewer();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/DesignResizeComponentCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/DesignResizeComponentCommand.java
deleted file mode 100644
index 2124d94..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/DesignResizeComponentCommand.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands;
-
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.DefaultEditDomain;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editparts.ScalableRootEditPart;
-import org.eclipse.jface.text.ITextOperationTarget;
-import org.eclipse.jface.text.source.SourceViewer;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.jst.pagedesigner.editors.HTMLEditor;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- */
-public class DesignResizeComponentCommand extends Command {
- private EditPart _part;
-
- private Object _constraint;
-
- private SourceViewer _viewer;
-
- /**
- * @param child
- * @param constraint
- */
- public DesignResizeComponentCommand(EditPart child, Object constraint) {
- this._part = child;
- this._constraint = constraint;
- EditPart part = child;
- if (part instanceof ScalableRootEditPart) {
- // TODO: eh?
- // do nothing I guess...
- } else {
- while (part != null
- && !(part.getParent() instanceof ScalableRootEditPart)) {
- part = part.getParent();
- }
- }
- if (part != null) {
- EditPartViewer viewer = ((ScalableRootEditPart) part.getParent())
- .getViewer();
- HTMLEditor editor = ((HTMLEditor) ((DefaultEditDomain) ((IHTMLGraphicalViewer) viewer)
- .getEditDomain()).getEditorPart());
- _viewer = editor.getTextEditor().getTextViewer();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.commands.Command#execute()
- */
- public void execute() {
- Element element = ((Element) _part.getModel());
- String width = element.getAttribute(ICSSPropertyID.ATTR_WIDTH);
- // String height = element.getAttribute(ICSSPropertyID.ATTR_HEIGHT);
- String originalStyle = element.getAttribute(ICSSPropertyID.ATTR_STYLE);
- StringBuffer style;
- if (originalStyle != null) {
- originalStyle = this.removeOthers(originalStyle,
- ICSSPropertyID.ATTR_WIDTH);
- originalStyle = this.removeOthers(originalStyle,
- ICSSPropertyID.ATTR_HEIGHT);
- style = new StringBuffer(originalStyle);
- } else {
- style = new StringBuffer(50);
- }
- if (null == width) {
- style.append(";").append(ICSSPropertyID.ATTR_WIDTH).append(":")
- .append(((Rectangle) _constraint).width).append(";");
- style.append(ICSSPropertyID.ATTR_HEIGHT).append(":").append(
- ((Rectangle) _constraint).height).append("");
- }
- element.setAttribute(ICSSPropertyID.ATTR_STYLE, style.toString());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.commands.Command#redo()
- */
- public void redo() {
- _viewer.doOperation(ITextOperationTarget.REDO);
- }
-
- /**
- * @param style
- * @param item
- * @return ?
- */
- public String removeOthers(String style, String item) {
- String result = null;
- int pos = style.indexOf(item);
- if (pos < 0) {
- return style;
- }
- int pos1 = pos;
- if (pos > 0) {
- if (style.charAt(pos - 1) == ';') {
- pos--;
- }
- }
- char ch = style.charAt(pos1);
- while (!(ch == ';' || ch == '"' || ch == '\'')) {
- pos1++;
- if (pos1 >= style.length()) {
- break;
- }
- ch = style.charAt(pos1);
- }
- if (pos1 < style.length()) {
- result = style.substring(0, pos)
- + style.substring(pos1 + 1, style.length());
- } else {
- result = style.substring(0, pos);
- }
- if (result.indexOf(item) >= 0) {
- return removeOthers(result, item);
- }
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.commands.Command#undo()
- */
- public void undo() {
- _viewer.doOperation(ITextOperationTarget.UNDO);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/DesignerCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/DesignerCommand.java
deleted file mode 100644
index 10d6c60..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/DesignerCommand.java
+++ /dev/null
@@ -1,376 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.dom.DOMPositionHelper;
-import org.eclipse.jst.pagedesigner.dom.DOMRange;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.eclipse.jst.pagedesigner.dom.EditValidateUtil;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.jst.pagedesigner.parts.ElementEditPart;
-import org.eclipse.jst.pagedesigner.utils.SelectionHelper;
-import org.eclipse.jst.pagedesigner.viewer.DesignPosition;
-import org.eclipse.jst.pagedesigner.viewer.DesignRange;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.eclipse.wst.html.core.internal.format.HTMLFormatProcessorImpl;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * This class is intended to be the base class for all designer GEF commands.
- * Basically, it will wrap the real command with common actions like handle
- * undo/redo, etc.
- *
- * @author mengbo
- */
-public abstract class DesignerCommand extends Command {
- private final IDOMModel _model;
-
- /**
- * the graphical viewer
- */
- protected IHTMLGraphicalViewer _viewer;
-
- private static final Logger _log = PDPlugin
- .getLogger(DesignerCommand.class);
-
- /**
- * @param label
- * @param viewer
- */
- public DesignerCommand(String label, IHTMLGraphicalViewer viewer) {
- super(label);
- this._viewer = viewer;
- this._model = viewer.getModel();
- }
-
- /**
- * @param label
- * @param node
- * the node must be a node in the IHTMLGraphicalViewer.
- */
- public DesignerCommand(String label, IDOMNode node) {
- this(label, (IDOMDocument) node.getOwnerDocument());
- }
-
- /**
- * @param label
- * @param document
- */
- public DesignerCommand(String label, IDOMDocument document)
- {
- super(label);
- this._model = document.getModel();
- EditPart part = (EditPart) document.getAdapterFor(EditPart.class);
- if (part != null) {
- this._viewer = (IHTMLGraphicalViewer) part.getViewer();
- }
- }
- /**
- * @return the GEF viewer this command is targeted for
- *
- */
- public IHTMLGraphicalViewer getViewer() {
- return _viewer;
- }
-
- /**
- * @return the DOM model that this command will effect
- */
- public IDOMModel getModel() {
- return _model;
- }
-
- /**
- * @return the dom document for the model this command will effect
- */
- public IDOMDocument getDocument() {
- return getModel().getDocument();
- }
-
- /**
- * executes the Command. This method should not be called if the Command is
- * not executable.
- */
- public final void execute() {
- boolean ok = prePreExecute();
- if (ok) {
- try {
- preExecute();
- doExecute();
- postExecute();
- } catch (Exception ex) {
- handleException(ex);
- } finally {
- postPostExecute();
- }
- }
- }
-
- /**
- * child class can override.
- *
- * @param ex
- */
- protected void handleException(Exception ex) {
- ex.printStackTrace();
- }
-
- /**
- * prePreExecute and postPostExecute is a pair. prePreExecute() SHOULD NOT
- * throw any exception, if it throw any exception, it should catch itself
- * and return false to indicate not continue.
- * @return true if execution should continue, false if should not
- */
- protected boolean prePreExecute() {
- int position = -1;
- int length = -1;
- ISelection selection = getViewer().getSelection();
- if (selection != null) {
- if (getViewer().isInRangeMode()) {
- DesignRange range = (DesignRange) selection;
- if (range.isValid()) {
- IDOMPosition domPos = DOMPositionHelper.toDOMPosition(range
- .getStartPosition());
- IDOMPosition domEnd = DOMPositionHelper.toDOMPosition(range
- .getEndPosition());
- if (EditValidateUtil.validPosition(domPos)
- && EditValidateUtil.validPosition(domEnd)) {
- position = EditModelQuery
- .getIndexedRegionLocation(domPos);
- int end = EditModelQuery
- .getIndexedRegionLocation(domEnd);
- if (end < position) {
- length = position - end;
- position = end;
- } else {
- length = end - position;
- }
- }
- }
- } else {
- Object object = ((IStructuredSelection) selection)
- .getFirstElement();
- if (object instanceof ElementEditPart) {
- Node node = ((ElementEditPart) object).getIDOMNode();
- position = EditModelQuery.getNodeStartIndex(node);
- length = EditModelQuery.getNodeLenth(node);
- }
- }
- }
- if (position >= 0 && length >= 0) {
- getModel().beginRecording(this, getLabel(), position, length);
- } else {
- getModel().beginRecording(this, getLabel());
- }
- getViewer().startSelectionChange();
- getModel().aboutToChangeModel();
- return true;
- }
-
- /**
- * child class can override this method for any pre action.
- */
- protected void preExecute() {
- // does nothing; children may wish to implement
- }
-
- /**
- * child class should override this method for the real action.
- */
- protected abstract void doExecute();
-
- /**
- * child class can override this method for any post action. NOTE: if
- * preExecute() or doExecute() throw exception, then this method will NOT be
- * called.
- */
- protected void postExecute() {
- // does nothing; child may wish to implement
- }
-
- /**
- * if prePreExecute() return true, then this method will always be called
- * even preExecute()/doExecute() and postExecute() fail.
- */
- protected void postPostExecute() {
- getModel().changedModel();
-
- // after "changedModel()" is called, model will fire out batched events
- // about model change
- // and EditPart will be refreshed. Only at this time, could we use
- // EditPart to construct the
- // result selection.
-
- // enforce a validate, so things get layed out, thus all the figures
- // will be valid.
- this.getViewer().getViewport().validate();
-
- ISelection sel = getAfterCommandDesignerSelection();
- if (sel != null) {
- ITextSelection textSel = SelectionHelper
- .convertFromDesignSelectionToTextSelection(sel);
- if (textSel != null) {
- getModel().endRecording(this, textSel.getOffset(),
- textSel.getLength());
- } else {
- getModel().endRecording(this);
- }
- } else {
- getModel().endRecording(this);
- }
-
- if (sel != null) {
- getViewer().setSelection(sel);
- } else {
- getViewer().deselectAll();
- }
- if (getViewer() != null) {
- getViewer().selectionChanged();
- }
- }
-
- /**
- * child class should override this method to provide the selection after
- * command. This method is called after model changed. So at time of this
- * call, the editpart should be valid. Default implementation.
- *
- * @return the selection
- */
- protected abstract ISelection getAfterCommandDesignerSelection();
-
- /**
- * @param range
- * @return a selection that contains the dom range or null if one doesn't exist
- */
- protected ISelection toDesignRange(DOMRange range) {
- try {
- if (range == null) {
- return null;
- }
- IDOMPosition startPos = range.getStartPosition();
- DesignPosition start = DOMPositionHelper.toDesignPosition(startPos);
- if (range.isEmpty()) {
- return new DesignRange(start, start);
- }
- IDOMPosition endPos = range.getEndPosition();
- return new DesignRange(start, DOMPositionHelper
- .toDesignPosition(endPos));
- } catch (Exception e) {
- // "Selection error"
- _log.error("Error.RangeModeCommand.SetSelection"); //$NON-NLS-1$
- return null;
- }
-
- }
-
- /**
- * @param node
- * @return a selection for the node
- */
- protected IStructuredSelection toDesignSelection(Node node) {
- if (node instanceof INodeNotifier) {
- EditPart part = (EditPart) ((INodeNotifier) node)
- .getAdapterFor(EditPart.class);
- if (part != null) {
- return new StructuredSelection(part);
- }
- }
- return null;
- }
-
- //
- // /**
- // * set selection to the specified node. Normally called by child class in
- // <code>setSelection()</code> implementation.
- // *
- // * @param node
- // */
- // protected final void setSelection(Node node)
- // {
- // EditPart part = (EditPart) ((INodeNotifier)
- // node).getAdapterFor(EditPart.class);
- //
- // StructuredSelection sel = new StructuredSelection(part);
- // getViewer().setSelection(sel);
- // }
-
- /**
- * format the specified node in source code. Utility method that can be
- * called by child classes
- *
- * @param node
- */
- public void formatNode(Node node) {
- // XXX: there should have some other way to get the FormatProcessor.
- // currently hardcoded to HTMLFormatProcessorImpl().
- new HTMLFormatProcessorImpl().formatNode(node);
- }
-
- /**
- * Re-executes the Command. This method should only be called after
- * <code>undo()</code> has been called.
- */
- public void redo() {
- // this method should in fact never be called, because we have already
- // delegate undo
- // operations to source view.
- getModel().getUndoManager().redo();
- }
-
- /**
- * Undoes the changes performed during <code>execute()</code>. This
- * method should only be called after <code>execute</code> has been
- * called, and only when <code>canUndo()</code> returns <code>true</code>.
- *
- * @see #canUndo()
- */
- public void undo() {
- // this method should in fact never be called, because we have already
- // delegate undo
- // operations to source view.
- getModel().getUndoManager().undo();
- }
-
- /**
- * a utility method. NOTE: this method can ONLY be called BEFORE you change
- * anything in the model.
- *
- * @param ele
- * @return the figure info for the element
- */
- public IFigure getFigureInfo(Element ele) {
- if (ele instanceof IDOMElement) {
- EditPart part = (EditPart) ((IDOMElement) ele)
- .getAdapterFor(EditPart.class);
- if (part instanceof GraphicalEditPart) {
- return ((GraphicalEditPart) part).getFigure();
- }
- }
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/MoveNodeCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/MoveNodeCommand.java
deleted file mode 100644
index 327a2c7..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/MoveNodeCommand.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jst.pagedesigner.dom.DOMPosition;
-import org.eclipse.jst.pagedesigner.dom.DOMUtil;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * Move a node from one place to another place.
- *
- * @author mengbo
- * @version 1.5
- */
-public class MoveNodeCommand extends DesignerCommand {
- private IDOMPosition insertPosition;
-
- private Node originalNode;
-
- /**
- * @param viewer
- * @param insertionPoint
- * @param originalNode
- */
- public MoveNodeCommand(IHTMLGraphicalViewer viewer,
- IDOMPosition insertionPoint, Node originalNode) {
- super(
- CommandResources.getString("MoveNodeCommand.Label.MoveNode"), viewer); //$NON-NLS-1$
- this.insertPosition = insertionPoint;
- this.originalNode = originalNode;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.DesignerCommand#doExecute()
- */
- protected void doExecute() {
- getModel().beginRecording(this);
- try {
- Node originalParent = originalNode.getParentNode();
- if (originalParent == null) {
- return;
- }
- // when remove the _originalNode, may affect the insertionPosition.
- if (originalParent == insertPosition.getContainerNode()) {
- // under same parent, may affect it.
- int insertIndex = insertPosition.getOffset();
- int nodeIndex = -1;
- NodeList list = originalParent.getChildNodes();
- for (int i = 0, length = list.getLength(); i < length; i++) {
- if (originalNode == list.item(i)) {
- nodeIndex = i;
- }
- }
- if (nodeIndex == -1) {
- return; // should not happen.
- }
- if (insertIndex < nodeIndex) {
- insertPosition = new DOMPosition(originalParent,
- insertIndex);
- } else if (insertIndex == nodeIndex
- || insertIndex == nodeIndex + 1) {
- // move to same position, do nothing.
- return;
- } else {
- insertPosition = new DOMPosition(originalParent,
- insertIndex - 1);
- }
- }
- originalParent.removeChild(originalNode);
- DOMUtil.insertNode(insertPosition, originalNode);
- } finally {
- getModel().endRecording(this);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.DesignerCommand#getAfterCommandDesignerSelection()
- */
- protected ISelection getAfterCommandDesignerSelection() {
- return toDesignSelection(originalNode);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/PDDropRequest.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/PDDropRequest.java
deleted file mode 100644
index 75c1fcf..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/PDDropRequest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands;
-
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DropRequest;
-import org.eclipse.swt.dnd.DropTargetEvent;
-
-/**
- * @author mengbo
- */
-public class PDDropRequest extends Request implements DropRequest {
- private Point _location;
-
- private DropTargetEvent _currentEvent;
-
- /**
- *
- */
- public PDDropRequest() {
- setType(PDRequestConstants.REQ_DROP);
- }
-
- /**
- * Returns the location of the object to be created.
- *
- * @return the location
- */
- public Point getLocation() {
- return _location;
- }
-
- /**
- * Sets the location where the new object will be placed.
- *
- * @param location
- * the location
- */
- public void setLocation(Point location) {
- this._location = location;
- }
-
- /**
- * @param ev
- */
- public void setCurrentEvent(DropTargetEvent ev) {
- _currentEvent = ev;
- }
-
- /**
- * @return the current drop target event
- */
- public DropTargetEvent getCurrentEvent() {
- return _currentEvent;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/PDRequestConstants.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/PDRequestConstants.java
deleted file mode 100644
index ca4aa70..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/PDRequestConstants.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands;
-
-/**
- * @author mengbo
- */
-public interface PDRequestConstants {
-
- /**
- * TODO: purpose?
- */
- String REQ_DROP = "pd drop";
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/PaletteDropInsertCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/PaletteDropInsertCommand.java
deleted file mode 100644
index 95f1c82..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/PaletteDropInsertCommand.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jst.jsf.common.dom.TagIdentifier;
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.jsf.core.internal.tld.TagIdentifierFactory;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.dnd.internal.SourceViewerDragDropHelper;
-import org.eclipse.jst.pagedesigner.dom.DOMPosition;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.jst.pagedesigner.editors.palette.TagToolPaletteEntry;
-import org.eclipse.jst.pagedesigner.elementedit.ElementEditFactoryRegistry;
-import org.eclipse.jst.pagedesigner.elementedit.IElementEdit;
-import org.eclipse.jst.pagedesigner.itemcreation.customizer.IDropCustomizer;
-import org.eclipse.jst.pagedesigner.utils.CommandUtil;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * Handles tag creation when dropped onto the WPE source view
- *
- * @author mengbo
- */
-public class PaletteDropInsertCommand extends SourceViewerCommand {
-
- private final Logger _log = PDPlugin
- .getLogger(PaletteDropInsertCommand.class);
-
- private TagToolPaletteEntry _tagItem;
-
- private int _location;
-
- private Element _element;
-
- private IAdaptable _customizationData;
-
- /**
- * @param label
- * @param editor
- * @param tagItem
- * @param location
- */
- public PaletteDropInsertCommand(String label, StructuredTextEditor editor,
- TagToolPaletteEntry tagItem, int location) {
- super(label, editor);
- _tagItem = tagItem;
- _location = location;
- }
-
- public void doExecute() {
- Node node;
- try {
- node = getSourceEditingTextTools().getNode(_location);
- } catch (Exception e) {
- _log.error("Bad text insertion location", e);
- return;
- }
- IDOMPosition position = null;
- if (node != null) {
- position = SourceViewerDragDropHelper.getInstance()
- .findPosition(_location, node);
- } else {
- if (getModel().getDocument().getFirstChild() != null) {
- //Fix for 224541 - When palette item is dropped to end of file in source view of Web Page Editor, the item is inserted at the top of file
- //add inside at end of necessary container
- position = SourceViewerDragDropHelper.getInstance()
- .findPosition(getModel().getDocument().getEndOffset(), getModel().getDocument().getFirstChild());
- }
- else {
- // empty file
- position = new DOMPosition(getModel().getDocument(), 0);
- }
- }
-
- //essentially copied from ItemCreationTool so that DesignView drop and SourceViewDrop are same.
- // Note that SourceView does NO drop validation checking. This is handled by ItemCreationPolicy in DesignView
- IStatus status = performCustomization();
- if (status.getSeverity() == IStatus.OK) {
- Element element = CommandUtil.excuteInsertion(this._tagItem,
- getModel(), position, getCustomizationData());
- if (element != null) {
- formatNode(element);
- }
- this._element = element;
- }
- }
-
- /**
- * @return status
- */
- protected IStatus performCustomization() {
- // essentially a copy from ItemCreationTool
- IStatus status = Status.OK_STATUS;
- TagIdentifier tagId = TagIdentifierFactory.createJSPTagWrapper(_tagItem
- .getURI(), _tagItem.getTagName());
-
- IElementEdit elementEdit = ElementEditFactoryRegistry.getInstance()
- .createElementEdit(tagId);
-
- if (elementEdit != null) {
- IDropCustomizer customizer = elementEdit.getDropCustomizer(tagId);
-
- if (customizer != null) {
- status = customizer.runCustomizer();
-
- if (status.getSeverity() == IStatus.OK) {
- setCustomizationData(customizer.getDropCustomizationData());
- }
- }
-
- }
- return status;
- }
-
- /**
- * @param customizationData
- */
- public void setCustomizationData(IAdaptable customizationData) {
- _customizationData = customizationData;
- }
-
- /**
- * This method is for test purposes and should generally not be
- * used by clients.
- *
- * @return the customization data
- */
- protected final IAdaptable getCustomizationData() {
- return _customizationData;
- }
-
- public void setSelection() {
- if (_element != null) {
- int offset = EditModelQuery.getNodeStartIndex(_element);
- int length = EditModelQuery.getNodeEndIndex(_element) - offset;
- _editor.getTextViewer().setSelectedRange(offset, length);
- }
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/PasteAction.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/PasteAction.java
deleted file mode 100644
index 46c2050..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/PasteAction.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands;
-
-import org.eclipse.gef.dnd.TemplateTransfer;
-import org.eclipse.gef.ui.parts.GraphicalEditor;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.commands.range.PasteCommand;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.dnd.TextTransfer;
-
-/**
- * @author mengbo
- */
-public class PasteAction extends DesignAction {
-
- /**
- * @param editor
- */
- public PasteAction(GraphicalEditor editor) {
- super(editor, PDPlugin.getResourceString("Action.Name.Paste"));//$NON-NLS-1$
- }
-
- public void perform() {
- DesignerCommand command = null;
- IHTMLGraphicalViewer viewer = getViewer();
- if (viewer.isInRangeMode()) {
- command = new PasteCommand(viewer);
- command.execute();
- } else {
- return;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#isEnabled()
- */
- public boolean isEnabled() {
- IHTMLGraphicalViewer viewer = getViewer();
- if (viewer != null && viewer.isInRangeMode()
- && viewer.getRangeSelection().isValid()) {
- Clipboard clipboard = new Clipboard(viewer.getControl()
- .getDisplay());
- return clipboard.getContents(TemplateTransfer.getInstance()) != null
- || clipboard.getContents(TextTransfer.getInstance()) != null;
- }
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/PasteNodeCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/PasteNodeCommand.java
deleted file mode 100644
index 81b25a0..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/PasteNodeCommand.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.text.ITextOperationTarget;
-import org.eclipse.jface.text.source.SourceViewer;
-import org.eclipse.jst.pagedesigner.commands.nav.ICaretPositionMover;
-import org.eclipse.wst.html.core.internal.document.ElementStyleImpl;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- */
-public class PasteNodeCommand extends Command implements ICaretPositionMover {
- private static final String COMMAND_LABEL = CommandResources
- .getString("PasteNodeCommand.Label.DeleteNode"); //$NON-NLS-1$
-
- private Node child;
-
- private SourceViewer _sourceViewer;
-
- /**
- * @param viewer
- */
- public PasteNodeCommand(SourceViewer viewer) {
- super(COMMAND_LABEL);
- this._sourceViewer = viewer;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.commands.Command#execute()
- */
- public void execute() {
- _sourceViewer.getTextWidget().setSelection(
- ((ElementStyleImpl) child).getStartOffset(),
- ((ElementStyleImpl) child).getStartOffset());
- _sourceViewer.doOperation(ITextOperationTarget.PASTE);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.commands.Command#redo()
- */
- public void redo() {
- _sourceViewer.doOperation(ITextOperationTarget.REDO);
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.commands.Command#undo()
- */
- public void undo() {
- _sourceViewer.doOperation(ITextOperationTarget.UNDO);
-
- }
-
- /**
- * @param child
- * The child to set.
- */
- public void setChild(Node child) {
- this.child = child;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/SourceViewerCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/SourceViewerCommand.java
deleted file mode 100644
index 2974929..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/SourceViewerCommand.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.wst.html.core.internal.format.HTMLFormatProcessorImpl;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.ISourceEditingTextTools;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.ui.internal.provisional.IDOMSourceEditingTextTools;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- */
-public abstract class SourceViewerCommand extends Command {
- /**
- * the structured text editor containing the viewer
- */
- protected final StructuredTextEditor _editor;
-
- private Document _document;
-
- private Logger _log = PDPlugin.getLogger(SourceViewerCommand.class);
-
- /**
- * @param label
- * @param editor
- */
- public SourceViewerCommand(String label, StructuredTextEditor editor) {
- super();
- _editor = editor;
- IDOMSourceEditingTextTools tools = getSourceEditingTextTools();
- _document = tools.getDOMDocument();
- }
-
- /**
- * @return the text tools
- */
- protected IDOMSourceEditingTextTools getSourceEditingTextTools() {
- IDOMSourceEditingTextTools tools = (IDOMSourceEditingTextTools) _editor
- .getAdapter(ISourceEditingTextTools.class);
- return tools;
- }
-
- /**
- * preExecute and postExecute is a pair. () SHOULD NOT throw any exception,
- * if it throw any exception, it should catch itself and return false to
- * indicate not continue.
- * @return true if preExec succeeded
- */
- protected final boolean preExecute() {
- int position = 0;
- int length = 0;
- ISelection selection = _editor.getTextViewer().getSelection();
- if (selection instanceof TextSelection) {
- position = ((TextSelection) selection).getOffset();
- length = ((TextSelection) selection).getLength();
- }
- getModel().beginRecording(this, getLabel(), position, length);
- getModel().aboutToChangeModel();
- return true;
- }
-
- /**
- * if preExecute() return true, then this method will always be called even
- * preExecute()/doExecute() and postExecute() fail.
- */
- protected final void postExecute() {
- getModel().changedModel();
- getModel().endRecording(this);
- setSelection();
- }
-
- /**
- * format the specified node in source code. Utility method that can be
- * called by child classes
- *
- * @param node
- */
- public final void formatNode(Node node) {
- new HTMLFormatProcessorImpl().formatNode(node);
- }
-
- /**
- * @return the dom model
- */
- protected IDOMModel getModel() {
- Assert.isTrue(_document != null && _document instanceof IDOMNode);
- return ((IDOMNode) _document).getModel();
- }
-
- public final void execute() {
- boolean ok = preExecute();
- if (ok) {
- try {
- doExecute();
- } catch (Exception ex) {
- // "Error in command execution"
- _log.error("Error.SourceViewerCommand.Execution", ex); //$NON-NLS-1$
- } finally {
- postExecute();
- }
- }
- }
-
- /**
- * execute
- */
- public abstract void doExecute();
-
- /**
- * set the selection
- */
- public abstract void setSelection();
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/SwitchSelectionCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/SwitchSelectionCommand.java
deleted file mode 100644
index 6092c52..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/SwitchSelectionCommand.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands;
-
-import java.util.List;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.eclipse.jst.pagedesigner.dom.EditValidateUtil;
-import org.eclipse.jst.pagedesigner.parts.DocumentEditPart;
-import org.eclipse.jst.pagedesigner.parts.SubNodeEditPart;
-import org.eclipse.jst.pagedesigner.validation.caret.Target;
-import org.eclipse.jst.pagedesigner.viewer.DesignPosition;
-import org.eclipse.jst.pagedesigner.viewer.DesignRange;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-/**
- * A command to switch the selection
- *
- */
-public class SwitchSelectionCommand extends Command {
- IHTMLGraphicalViewer _viewer;
-
- /**
- * @param viewer
- */
- public SwitchSelectionCommand(IHTMLGraphicalViewer viewer) {
- _viewer = viewer;
- }
-
- public void execute() {
- if (_viewer.isInRangeMode()) {
- ISelection selection = _viewer.getSelection();
- if (selection instanceof DesignRange) {
- DesignPosition posStart = ((DesignRange) selection)
- .getStartPosition();
- DesignPosition posEnd = ((DesignRange) selection)
- .getEndPosition();
- if (EditValidateUtil.validPosition(posStart)
- && EditValidateUtil.validPosition(posEnd)) {
- Node ancestor = EditModelQuery.getInstance()
- .getCommonAncestor(posStart.getContainerNode(),
- posEnd.getContainerNode());
- if (ancestor instanceof Text) {
- ancestor = ancestor.getParentNode();
- }
- if (ancestor instanceof Element) {
- EditPart part = Target.resolvePart(ancestor);
- if (part instanceof SubNodeEditPart) {
- _viewer.select(part);
- }
- }
- }
- }
- } else {
- List parts = _viewer.getSelectedEditParts();
- if (parts.size() > 0) {
- EditPart parent = ((EditPart) parts.get(0)).getParent();
- if (!(parent instanceof DocumentEditPart)) {
- _viewer.select(parent);
- }
- }
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/html/TableDeleteColumnCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/html/TableDeleteColumnCommand.java
deleted file mode 100644
index d9ba50d..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/html/TableDeleteColumnCommand.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.html;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jst.pagedesigner.commands.CommandResources;
-import org.eclipse.jst.pagedesigner.commands.DesignerCommand;
-import org.eclipse.jst.pagedesigner.dom.html.TableUtil;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class TableDeleteColumnCommand extends DesignerCommand {
- private Element _tableEle;
-
- private int _columnIndex;
-
- private TableUtil _tableUtil;
-
- /**
- * @param viewer
- * @param dataTable
- * @param index
- */
- public TableDeleteColumnCommand(IHTMLGraphicalViewer viewer,
- Element dataTable, int index) {
- super(
- CommandResources
- .getString("TableDeleteColumnCommand.Label.DeleteColumn"), viewer); //$NON-NLS-1$
- this._tableEle = dataTable;
- this._columnIndex = index;
- this._tableUtil = new TableUtil(this._tableEle);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.commands.Command#canExecute()
- */
- public boolean canExecute() {
- if (this._columnIndex < 0) {
- return false;
- }
- boolean hasColSpan = _tableUtil.hasColumnSpanElement(this._columnIndex);
- boolean isAffectedByColSpan = _tableUtil
- .isAffectedByColSpan(this._columnIndex);
- if (hasColSpan || isAffectedByColSpan) {
- return false;
- }
-
- return super.canExecute();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.DesignerCommand#getAfterCommandDesignerSelection()
- */
- protected ISelection getAfterCommandDesignerSelection() {
- return toDesignSelection(_tableEle);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.DesignerCommand#doExecute()
- */
- protected void doExecute() {
- List trList = new ArrayList();
- TableUtil.getTrElements(this._tableEle, trList);
-
- List[] lists = _tableUtil.getTrCellLists();
-
- for (int i = 0, size = trList.size(); i < size; i++) {
- Element tr = (Element) trList.get(i);
- List cells = lists[i];
- if (cells.size() <= this._columnIndex) {
- continue;
- }
- Element cell = (Element) cells.get(this._columnIndex);
- if (!cell.getTagName().equalsIgnoreCase("fake")) //$NON-NLS-1$
- {
- tr.removeChild(cell);
- }
- }
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/html/TableDeleteHeaderFooterCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/html/TableDeleteHeaderFooterCommand.java
deleted file mode 100644
index 432e204..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/html/TableDeleteHeaderFooterCommand.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.html;
-
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.commands.CommandResources;
-import org.eclipse.jst.pagedesigner.commands.DesignerCommand;
-import org.eclipse.jst.pagedesigner.dom.html.TableUtil;
-import org.eclipse.jst.pagedesigner.utils.DOMUtil;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class TableDeleteHeaderFooterCommand extends DesignerCommand {
- private Element _table;
-
- private boolean _isHeader;
-
- /**
- * @param viewer
- * @param table
- * @param isHeader
- */
- public TableDeleteHeaderFooterCommand(IHTMLGraphicalViewer viewer,
- Element table, boolean isHeader) {
- super(
- isHeader ? CommandResources
- .getString("TableDeleteHeaderFooterCommand.Label.DeleteHeader") : CommandResources.getString("TableDeleteHeaderFooterCommand.Label.DeleteFooter"), viewer); //$NON-NLS-1$ //$NON-NLS-2$
- this._table = table;
- this._isHeader = isHeader;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.commands.Command#canExecute()
- */
- public boolean canExecute() {
- String sectionName = this._isHeader ? IHTMLConstants.TAG_THEAD
- : IHTMLConstants.TAG_TFOOT;
- int rows = TableUtil.countSectionRows(this._table, sectionName);
- if (rows == 0) {
- return false;
- }
- return super.canExecute();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.DesignerCommand#doExecute()
- */
- protected void doExecute() {
- String sectionName = this._isHeader ? IHTMLConstants.TAG_THEAD
- : IHTMLConstants.TAG_TFOOT;
- List list = DOMUtil.getChildElementsByTagIgnoreCase(this._table,
- sectionName);
- Node delNode = (Node) list.get(0);
- this._table.removeChild(delNode);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.DesignerCommand#getAfterCommandDesignerSelection()
- */
- protected ISelection getAfterCommandDesignerSelection() {
- return this.toDesignSelection(this._table);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/html/TableDeleteRowCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/html/TableDeleteRowCommand.java
deleted file mode 100644
index 3ee5ea7..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/html/TableDeleteRowCommand.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.html;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jst.pagedesigner.commands.CommandResources;
-import org.eclipse.jst.pagedesigner.commands.DesignerCommand;
-import org.eclipse.jst.pagedesigner.dom.html.TableUtil;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class TableDeleteRowCommand extends DesignerCommand {
- Element _tableEle;
-
- int _rowIndex;
-
- /**
- * @param viewer
- * @param table
- * @param index
- */
- public TableDeleteRowCommand(IHTMLGraphicalViewer viewer, Element table,
- int index) {
- super(CommandResources
- .getString("TableDeleteRowCommand.Label.DeleteRow"), viewer); //$NON-NLS-1$
- this._tableEle = table;
- this._rowIndex = index;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.commands.Command#canExecute()
- */
- public boolean canExecute() {
- if (this._rowIndex < 0) {
- return false;
- }
- List list = new ArrayList();
- TableUtil.getTrElements(this._tableEle, list);
- // int index = TableUtil.countRowIndexInDOMTree(this._tableEle,
- // this._rowIndex);
- int index = this._rowIndex;
- Element tr = (Element) list.get(index);
- boolean hasRowSpan = TableUtil.hasRowSpanElement(tr);
- boolean isAffectedByRowSpan = TableUtil.isAffectedByRowSpan(list, tr,
- index);
- if (hasRowSpan || isAffectedByRowSpan) {
- return false;
- }
-
- return super.canExecute();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.DesignerCommand#getAfterCommandDesignerSelection()
- */
- protected ISelection getAfterCommandDesignerSelection() {
- return toDesignSelection(_tableEle);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.DesignerCommand#doExecute()
- */
- protected void doExecute() {
- List list = new ArrayList();
- TableUtil.getTrElements(this._tableEle, list);
- // int index = TableUtil.countRowIndexInDOMTree(this._tableEle,
- // this._rowIndex);
- int index = this._rowIndex;
- Element tr = (Element) list.get(index);
- tr.getParentNode().removeChild(tr);
- formatNode(this._tableEle);
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/html/TableInsertColumnCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/html/TableInsertColumnCommand.java
deleted file mode 100644
index 4db65c8..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/html/TableInsertColumnCommand.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.html;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.commands.CommandResources;
-import org.eclipse.jst.pagedesigner.commands.DesignerCommand;
-import org.eclipse.jst.pagedesigner.dom.html.TableUtil;
-import org.eclipse.jst.pagedesigner.utils.DOMUtil;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class TableInsertColumnCommand extends DesignerCommand {
- private Element _tableEle;
-
- private int _columnIndex;
-
- private TableUtil _tableUtil;
-
- /**
- * @param viewer
- * @param dataTable
- * @param index
- */
- public TableInsertColumnCommand(IHTMLGraphicalViewer viewer,
- Element dataTable, int index) {
- super(
- CommandResources
- .getString("TableInsertColumnCommand.Label.InsertColumn"), viewer); //$NON-NLS-1$
- this._tableEle = dataTable;
- this._columnIndex = index;
- this._tableUtil = new TableUtil(this._tableEle);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.commands.Command#canExecute()
- */
- public boolean canExecute() {
- if (this._columnIndex < 0) {
- return false;
- }
- boolean isAffectedByColSpan = _tableUtil
- .isAffectedByColSpan(this._columnIndex);
- if (isAffectedByColSpan) {
- return false;
- }
-
- return super.canExecute();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.DesignerCommand#getAfterCommandDesignerSelection()
- */
- protected ISelection getAfterCommandDesignerSelection() {
- return toDesignSelection(_tableEle);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.DesignerCommand#doExecute()
- */
- protected void doExecute() {
- List trList = new ArrayList();
- TableUtil.getTrElements(this._tableEle, trList);
-
- List[] lists = _tableUtil.getTrCellLists();
- int maxColumn = _tableUtil.getColumnCount();
-
- boolean isAtLastColumn = false;
- if (this._columnIndex >= maxColumn) {
- isAtLastColumn = true;
- }
-
- for (int i = 0, size = trList.size(); i < size; i++) {
- Element tr = (Element) trList.get(i);
- boolean hasTH = (DOMUtil.getChildElementsByTagIgnoreCase(tr,
- IHTMLConstants.TAG_TH).size() > 0);
-
- List cells = lists[i];
- if (isAtLastColumn || (cells.size() <= this._columnIndex)) {
- int index = this._columnIndex + 1;
- for (int k = cells.size(); k < index; k++) {
- tr.appendChild(createDefaultElement(hasTH));
- }
- } else {
- Element cell = (Element) cells.get(this._columnIndex);
- if (!cell.getTagName().equalsIgnoreCase("fake")) //$NON-NLS-1$
- {
- tr.insertBefore(createDefaultElement(hasTH), cell);
- } else {
- boolean hasRealElement = false;
- for (int k = _columnIndex + 1; k < cells.size(); k++) {
- Element td = (Element) cells.get(k);
- if (!td.getTagName().equalsIgnoreCase("fake")) //$NON-NLS-1$
- {
- hasRealElement = true;
- tr.insertBefore(createDefaultElement(hasTH), td);
- break;
- }
- }
- if (!hasRealElement) {
- tr.appendChild(createDefaultElement(hasTH));
- }
- }
- }
-
- }
- formatNode(this._tableEle);
- }
-
- private Element createDefaultElement(boolean createTH) {
- Document doc = this._tableEle.getOwnerDocument();
- Element td = null;
- if (createTH) {
- td = doc.createElement(IHTMLConstants.TAG_TH);
- } else {
- td = doc.createElement(IHTMLConstants.TAG_TD);
- }
-
- Node node = doc.createTextNode(""); //$NON-NLS-1$
- td.appendChild(node);
- return td;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/html/TableInsertHeaderFooterCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/html/TableInsertHeaderFooterCommand.java
deleted file mode 100644
index c3cc31e..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/html/TableInsertHeaderFooterCommand.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.html;
-
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.commands.CommandResources;
-import org.eclipse.jst.pagedesigner.commands.DesignerCommand;
-import org.eclipse.jst.pagedesigner.dom.html.TableUtil;
-import org.eclipse.jst.pagedesigner.utils.DOMUtil;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class TableInsertHeaderFooterCommand extends DesignerCommand {
- private Element _table;
-
- private Element _headerOrFooter;
-
- private boolean _isHeader;
-
- private TableUtil _tableUtil;
-
- /**
- * @param viewer
- * @param table
- * @param isHeader
- */
- public TableInsertHeaderFooterCommand(IHTMLGraphicalViewer viewer,
- Element table, boolean isHeader) {
- super(
- isHeader ? CommandResources
- .getString("TableInsertHeaderFooterCommand.Label.InsertHeader") : CommandResources.getString("TableInsertHeaderFooterCommand.Label.InsertFooter"), viewer); //$NON-NLS-1$ //$NON-NLS-2$
- this._table = table;
- this._isHeader = isHeader;
- this._tableUtil = new TableUtil(this._table);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.commands.Command#canExecute()
- */
- public boolean canExecute() {
- String sectionName = this._isHeader ? IHTMLConstants.TAG_THEAD
- : IHTMLConstants.TAG_TFOOT;
- int rows = TableUtil.countSectionRows(this._table, sectionName);
- if (rows > 0) {
- return false;
- }
- return super.canExecute();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.DesignerCommand#doExecute()
- */
- protected void doExecute() {
- String sectionName = this._isHeader ? IHTMLConstants.TAG_THEAD
- : IHTMLConstants.TAG_TFOOT;
- this._headerOrFooter = this._table.getOwnerDocument().createElement(
- sectionName);
- Element tr = createDefaultElement();
- this._headerOrFooter.appendChild(tr);
- if (this._isHeader) {
- Node child = this._table.getFirstChild();
- this._table.insertBefore(this._headerOrFooter, child);
- } else {
- int headRows = TableUtil.countSectionRows(this._table,
- IHTMLConstants.TAG_THEAD);
- Node refNode = null;
- if (headRows > 0) {
- List list = DOMUtil.getChildElementsByTagIgnoreCase(
- this._table, IHTMLConstants.TAG_THEAD);
- Node header = (Node) list.get(0);
- refNode = header.getNextSibling();
- } else {
- refNode = this._table.getFirstChild();
- }
- this._table.insertBefore(this._headerOrFooter, refNode);
- }
- formatNode(this._headerOrFooter);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.DesignerCommand#getAfterCommandDesignerSelection()
- */
- protected ISelection getAfterCommandDesignerSelection() {
- return this.toDesignSelection(this._headerOrFooter);
- }
-
- private Element createDefaultElement() {
- String key = this._isHeader ? "TableInsertHeaderFooterCommand.ColumnHeader" //$NON-NLS-1$
- : "TableInsertHeaderFooterCommand.ColumnFooter"; //$NON-NLS-1$
- String name = PDPlugin.getResourceString(key);
- Document doc = this._table.getOwnerDocument();
- Element ele = doc.createElement(IHTMLConstants.TAG_TR);
- int columnCount = _tableUtil.getColumnCount();
- for (int i = 0; i < columnCount; i++) {
- Element td = null;
- if (this._isHeader) {
- td = doc.createElement(IHTMLConstants.TAG_TH);
- } else {
- td = doc.createElement(IHTMLConstants.TAG_TD);
- }
- Node node = doc.createTextNode(name);
- td.appendChild(node);
- ele.appendChild(td);
- }
- return ele;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/html/TableInsertRowCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/html/TableInsertRowCommand.java
deleted file mode 100644
index e9acb53..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/html/TableInsertRowCommand.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.html;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.commands.CommandResources;
-import org.eclipse.jst.pagedesigner.commands.DesignerCommand;
-import org.eclipse.jst.pagedesigner.dom.html.TableUtil;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class TableInsertRowCommand extends DesignerCommand {
- private Element _tableEle;
-
- private int _rowIndex;
-
- private boolean _isBefore;
-
- private TableUtil _tableUtil;
-
- /**
- * @param viewer
- * @param table
- * @param index
- * @param isBefore
- */
- public TableInsertRowCommand(IHTMLGraphicalViewer viewer, Element table,
- int index, boolean isBefore) {
- super(CommandResources
- .getString("TableInsertRowCommand.Label.InsertRow"), viewer); //$NON-NLS-1$
- this._tableEle = table;
- this._rowIndex = index;
- this._isBefore = isBefore;
- this._tableUtil = new TableUtil(this._tableEle);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.commands.Command#canExecute()
- */
- public boolean canExecute() {
- if (this._rowIndex < 0) {
- return false;
- }
- List list = new ArrayList();
- TableUtil.getTrElements(this._tableEle, list);
- // if the row neither at the beginning nor the end then count
- if (_rowIndex > 0 && _rowIndex < list.size()) {
- // int index = TableUtil.countRowIndexInDOMTree(this._tableEle,
- // this._rowIndex);
- int index = this._rowIndex;
- Element tr = (Element) list.get(index);
- boolean isAffectedByRowSpan = TableUtil.isAffectedByRowSpan(list,
- tr, index);
- if (isAffectedByRowSpan) {
- return false;
- }
-
- }
-
- return super.canExecute();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.DesignerCommand#getAfterCommandDesignerSelection()
- */
- protected ISelection getAfterCommandDesignerSelection() {
- return toDesignSelection(_tableEle);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.DesignerCommand#doExecute()
- */
- protected void doExecute() {
- List list = new ArrayList();
- TableUtil.getTrElements(this._tableEle, list);
- Element insertElement = createDefaultElement();
-
- if (this._rowIndex < list.size()) {
- // int index = TableUtil.countRowIndexInDOMTree(this._tableEle,
- // this._rowIndex);
- int index = this._rowIndex;
- Element tr = (Element) list.get(index);
- Element nextTr = tr;
-
- // int headRows = TableUtil.countSectionRows(this._tableEle,
- // IHTMLConstants.TAG_THEAD);
- // int footRows = TableUtil.countSectionRows(this._tableEle,
- // IHTMLConstants.TAG_TFOOT);
- if (!_isBefore) {
- int parentIndex = index - 1;
- /**
- * doesn't need any more,since the row index is from model now
- * int bodyRows = list.size() - headRows - footRows; boolean
- * hasBodyRow = false; boolean hasFootRow = false; if (bodyRows >
- * 0) { hasBodyRow = true; } if (footRows > 0) { hasFootRow =
- * true; } //last row in THEAD excute insert row after command
- * if ((this._rowIndex == headRows) && hasBodyRow && hasFootRow) {
- * parentIndex = index - footRows - 1; } //last row in TBODY
- * excute insert row after command if ((this._rowIndex ==
- * (list.size() - footRows)) && hasBodyRow && hasFootRow) {
- * parentIndex = list.size() - 1; }
- */
-
- tr = (Element) list.get(parentIndex);
- }
-
- if (tr.getParentNode() == nextTr.getParentNode()) {
- tr.getParentNode().insertBefore(insertElement, nextTr);
- } else {
- tr.getParentNode().appendChild(insertElement);
- }
- } else {
- // int index = TableUtil.countRowIndexInDOMTree(this._tableEle,
- // this._rowIndex - 1);
- int index = this._rowIndex - 1;
- Element tr = (Element) list.get(index);
- tr.getParentNode().insertBefore(insertElement, null);
- }
- formatNode(this._tableEle);
-
- }
-
- private Element createDefaultElement() {
- Document doc = this._tableEle.getOwnerDocument();
- Element ele = doc.createElement(IHTMLConstants.TAG_TR);
- int columnCount = _tableUtil.getColumnCount();
- for (int i = 0; i < columnCount; i++) {
- Element td = doc.createElement(IHTMLConstants.TAG_TD);
- Node node = doc.createTextNode(""); //$NON-NLS-1$
- td.appendChild(node);
- ele.appendChild(td);
- }
- return ele;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/html/TableResizeColumnCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/html/TableResizeColumnCommand.java
deleted file mode 100644
index d11ef19..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/html/TableResizeColumnCommand.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.html;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.commands.CommandResources;
-import org.eclipse.jst.pagedesigner.commands.DesignerCommand;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.jst.pagedesigner.dom.DOMStyleUtil;
-import org.eclipse.jst.pagedesigner.dom.html.TableUtil;
-import org.eclipse.jst.pagedesigner.utils.DOMUtil;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class TableResizeColumnCommand extends DesignerCommand {
- private Element _table;
-
- private TableUtil _tableUtil;
-
- private int _columnIndex;
-
- private int _delta;
-
- /**
- * @param viewer
- * @param table
- * @param columnIndex
- * @param delta
- */
- public TableResizeColumnCommand(IHTMLGraphicalViewer viewer, Element table,
- int columnIndex, int delta) {
- super(
- CommandResources
- .getString("TableResizeColumnCommand.Label.ResizeColumn"), viewer); //$NON-NLS-1$
- this._table = table;
- this._columnIndex = columnIndex;
- this._delta = delta;
- _tableUtil = new TableUtil(this._table);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.DesignerCommand#getAfterCommandDesignerSelection()
- */
- protected ISelection getAfterCommandDesignerSelection() {
- return toDesignSelection(_table);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.DesignerCommand#doExecute()
- */
- protected void doExecute() {
- int index = this._columnIndex - 1;
- if (index < 0) {
- index = 0;
- }
- List list = _tableUtil.getColumnCells(index);
- Iterator itr = list.iterator();
- Element cell = null;
- while (itr.hasNext()) {
- Element ele = (Element) itr.next();
- if (ele.getTagName().equalsIgnoreCase("fake") || DOMUtil.getIntAttributeIgnoreCase(ele, IHTMLConstants.ATTR_COLSPAN, 1) > 1) //$NON-NLS-1$
- {
- continue;
- }
- cell = ele;
- break;
- }
-
- IFigure cellFigure = getFigureInfo(cell);
- int oldColumnWidth = cellFigure.getBounds().width;
- int cellPadding = cellFigure.getInsets().getWidth();
- int newWidth = oldColumnWidth + this._delta - cellPadding;
- if (this._columnIndex - 1 < 0) {
- newWidth = oldColumnWidth - this._delta - cellPadding;
- }
- Map map = new HashMap();
- if (newWidth > 0) {
- map.put(ICSSPropertyID.ATTR_WIDTH, newWidth + "px"); //$NON-NLS-1$
- DOMStyleUtil.insertStyle(cell, map);
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/html/TableResizeRowCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/html/TableResizeRowCommand.java
deleted file mode 100644
index cdd1002..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/html/TableResizeRowCommand.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.html;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jst.pagedesigner.commands.CommandResources;
-import org.eclipse.jst.pagedesigner.commands.DesignerCommand;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.jst.pagedesigner.dom.DOMStyleUtil;
-import org.eclipse.jst.pagedesigner.dom.html.TableUtil;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class TableResizeRowCommand extends DesignerCommand {
- private Element _table;
-
- private int _rowIndex;
-
- private int _delta;
-
- /**
- * @param viewer
- * @param table
- * @param rowIndex
- * @param delta
- */
- public TableResizeRowCommand(IHTMLGraphicalViewer viewer, Element table,
- int rowIndex, int delta) {
- super(CommandResources
- .getString("TableResizeRowCommand.Label.ResizeColumn"), viewer); //$NON-NLS-1$
- this._table = table;
- this._rowIndex = rowIndex;
- this._delta = delta;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.DesignerCommand#getAfterCommandDesignerSelection()
- */
- protected ISelection getAfterCommandDesignerSelection() {
- return toDesignSelection(this._table);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.DesignerCommand#doExecute()
- */
- protected void doExecute() {
- int index = this._rowIndex - 1;
- if (index < 0) {
- index = 0;
- }
- // int domIndex = TableUtil.countRowIndexInDOMTree(this._table, index);
- int domIndex = index;
-
- List list = new ArrayList();
- TableUtil.getTrElements(this._table, list);
- Element tr = (Element) list.get(domIndex);
-
- IFigure cellFigure = getFigureInfo(tr);
- int oldRowHeight = cellFigure.getBounds().height;
- int cellPadding = cellFigure.getInsets().getHeight();
- int newHeight = oldRowHeight + this._delta - cellPadding;
- if (this._rowIndex - 1 < 0) {
- newHeight = oldRowHeight - this._delta - cellPadding;
- }
- Map map = new HashMap();
- if (newHeight > 0) {
- map.put(ICSSPropertyID.ATTR_HEIGHT, newHeight + "px"); //$NON-NLS-1$ //$NON-NLS-2$
- DOMStyleUtil.insertStyle(tr, map);
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/nav/CaretPositionTracker.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/nav/CaretPositionTracker.java
deleted file mode 100644
index 7295210..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/nav/CaretPositionTracker.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.nav;
-
-/**
- * @author mengbo
- */
-public interface CaretPositionTracker {
- /**
- * @return Returns the xoffset.
- */
- public int getXoffset();
-
- /**
- * @param xoffset
- * The xoffset to set.
- */
- public void setXoffset(int xoffset);
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/nav/HorizontalMoveCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/nav/HorizontalMoveCommand.java
deleted file mode 100644
index 044ab8e..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/nav/HorizontalMoveCommand.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.nav;
-
-import java.util.List;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.dom.EditHelper;
-import org.eclipse.jst.pagedesigner.parts.SubNodeEditPart;
-import org.eclipse.jst.pagedesigner.parts.TextEditPart;
-import org.eclipse.jst.pagedesigner.validation.caret.ActionData;
-import org.eclipse.jst.pagedesigner.validation.caret.IMovementMediator;
-import org.eclipse.jst.pagedesigner.validation.caret.InlineEditingNavigationMediator;
-import org.eclipse.jst.pagedesigner.viewer.DesignPosition;
-import org.eclipse.jst.pagedesigner.viewer.DesignRange;
-import org.eclipse.jst.pagedesigner.viewer.DesignRefPosition;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-
-/**
- * @author mengbo
- */
-public class HorizontalMoveCommand extends Command implements
- ICaretPositionMover {
- private static Logger _log = PDPlugin
- .getLogger(HorizontalMoveCommand.class);
-
- IHTMLGraphicalViewer _viewer;
-
- boolean _forward;
-
- boolean _onlyMoveEnd;
-
- /**
- * @param viewer
- * @param b
- * @param c
- */
- public HorizontalMoveCommand(IHTMLGraphicalViewer viewer, boolean b,
- boolean c) {
- _viewer = viewer;
- _forward = b;
- _onlyMoveEnd = c;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.commands.Command#execute()
- */
- public void execute() {
- DesignPosition position = null;
- if (_viewer.isInRangeMode()) {
- if (_viewer.getRangeSelection() != null
- && _viewer.getRangeSelection().isValid()) {
- position = _viewer.getRangeSelection().getEndPosition();
- position = performInlineMode(_forward);
- }
- } else {
- position = performObjectMode();
- }
- setRange(position);
- }
-
- private DesignPosition performObjectMode() {
- DesignPosition result = null;
- IMovementMediator validator = new InlineEditingNavigationMediator(
- new ActionData(ActionData.KEYBOARD_NAVAGATION, null));
- DesignPosition position = getCurrentObjectPosition();
- if (position != null) {
- _viewer.setRange(position, position);
- if (!validator.isValidPosition(position)) {
- position = performInlineMode(_forward);
- if (validator.isValidPosition(position)) {
- result = position;
- } else {
- result = performInlineMode(!_forward);
- }
- } else {
- result = position;
- }
- }
- return result;
- }
-
- private DesignPosition performInlineMode(boolean forward) {
- DesignRange range = _viewer.getRangeSelection();
-
- if (range == null || !range.isValid()) {
- _log.error("invalud range");
- return null;
- }
-
- DesignPosition position = range.getEndPosition();
- if (position.getContainerPart() instanceof TextEditPart) {
- int length = ((TextEditPart) position.getContainerPart())
- .getTextData().length();
- int newoffset = position.getOffset() + (_forward ? 1 : -1);
- if (newoffset >= 0 && newoffset <= length) {
- DesignPosition newposi = new DesignPosition(position
- .getContainerPart(), newoffset);
- return newposi;
- }
- }
- DesignPosition newpos = EditHelper.moveToNextEditPosition(
- ActionData.KEYBOARD_NAVAGATION, position, forward);
- return newpos;
- }
-
- private void setRange(DesignPosition newpos) {
- if (_onlyMoveEnd) {
- _viewer.setRangeEndPosition(newpos);
- } else {
- _viewer.setRange(newpos, newpos);
- }
- }
-
- private DesignPosition getCurrentObjectPosition() {
- DesignRange result = null;
- if (_viewer.isInRangeMode()) {
- result = _viewer.getRangeSelection();
- } else {
- List parts = _viewer.getSelectedEditParts();
- if (parts.size() > 0) {
- EditPart selection = (EditPart) parts.get(0);
- if (selection instanceof SubNodeEditPart) {
- DesignPosition position = new DesignRefPosition(selection,
- _forward);
- result = new DesignRange(position, position);
- }
- }
- }
- return result != null && result.isValid() ? result.getEndPosition()
- : null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/nav/ICaretPositionMover.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/nav/ICaretPositionMover.java
deleted file mode 100644
index ca75659..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/nav/ICaretPositionMover.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.nav;
-
-/**
- * Tags commands that care about caret position
- * TODO: does presently appear to have a purpose
- *
- * @author mengbo
- *
- */
-public interface ICaretPositionMover {
- // empty; tagging interface
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/nav/VerticalMoveCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/nav/VerticalMoveCommand.java
deleted file mode 100644
index 492b495..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/nav/VerticalMoveCommand.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.nav;
-
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.eclipse.jst.pagedesigner.validation.caret.ActionData;
-import org.eclipse.jst.pagedesigner.validation.caret.IMovementMediator;
-import org.eclipse.jst.pagedesigner.validation.caret.InlineEditingNavigationMediator;
-import org.eclipse.jst.pagedesigner.validation.caret.Target;
-import org.eclipse.jst.pagedesigner.viewer.DesignPosition;
-import org.eclipse.jst.pagedesigner.viewer.DesignRange;
-import org.eclipse.jst.pagedesigner.viewer.EditPartPositionHelper;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.eclipse.swt.widgets.Caret;
-
-/**
- * @author mengbo
- */
-public class VerticalMoveCommand extends Command {
- private static Logger _log = PDPlugin
- .getLogger(HorizontalMoveCommand.class);
-
- IHTMLGraphicalViewer _viewer;
-
- boolean _up;
-
- boolean _onlyMoveEnd;
-
- /**
- * @param viewer
- * @param up
- * @param c
- */
- public VerticalMoveCommand(IHTMLGraphicalViewer viewer, boolean up,
- boolean c) {
- _viewer = viewer;
- _up = up;
- _onlyMoveEnd = c;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.commands.Command#execute()
- */
- public void execute() {
- int OFFSET = 2;
- DesignRange range = _viewer.getRangeSelection();
- if (range == null || !range.isValid()) {
- _log.error("invalud range");
- return;
- }
- IMovementMediator moveMediator = new InlineEditingNavigationMediator(
- new ActionData(ActionData.KEYBOARD_NAVAGATION, null));
- DesignPosition position = range.getEndPosition();
- Caret caret = _viewer.getCaret();
- Point point = null;
- DesignPosition newPos = position;
- EditPart containerpart = null, rootpart1;
- if (_up) {
- point = new Point(((CaretPositionTracker) _viewer).getXoffset(),
- caret.getBounds().y);
- } else {
- point = new Point(((CaretPositionTracker) _viewer).getXoffset(),
- caret.getBounds().y + caret.getBounds().height);
-
- }
- rootpart1 = getRootEditablePart(position.getContainerPart(),
- moveMediator);// position.getContainerPart();
- if (rootpart1 == null) {
- return;
- }
-
- point = adjustLocation(rootpart1, point);
- Rectangle bound = EditPartPositionHelper.getAbsoluteBounds(rootpart1);
- // get current according to the point.
- // FlowBoxLine line =
- // getCurrentLine(moveMediator.getEditableContainer(new
- // Target(rootpart)), point, moveMediator);
- while (true) {
- // try to change offset and then to search for new point.
- if (_up) {
- point.y -= OFFSET;
- if (point.y <= bound.y) {
- newPos = position;
- break;
- }
- } else {
- point.y += OFFSET;
- if (point.y >= bound.y + bound.height) {
- newPos = position;
- break;
- }
- }
- containerpart = ((InlineEditingNavigationMediator) moveMediator)
- .getConstainedEditableContainer(position, point, _viewer);
- if (containerpart != null) {
- if (!EditModelQuery.isChild(Target.resolveNode(rootpart1),
- Target.resolveNode(containerpart))) {
- containerpart = rootpart1;
- }
- bound = EditPartPositionHelper.getAbsoluteBounds(rootpart1);
- newPos = EditPartPositionHelper
- .findEditPartPositionConstrained(containerpart, point,
- moveMediator);
- } else {
- newPos = position;
- break;
- }
- if (newPos != null) {
- if (found(newPos, position)) {
- break;
- }
- }
- }
- setRange(position, newPos);
- }
-
- private void setRange(DesignPosition position, DesignPosition newPos) {
- if (!EditModelQuery.isSame(position, newPos)) {
- {
- if (_onlyMoveEnd) {
- _viewer.setRangeEndPosition(newPos);
- } else {
- _viewer.setRange(newPos, newPos);
- }
- }
- }
- }
-
- /*
- * We should change this, it is too tricky to do in this way.
- */
- private Point adjustLocation(EditPart rootPart, Point point) {
- Point result = point.getCopy();
- Rectangle bounds = EditPartPositionHelper.getAbsoluteBounds(rootPart);
- if (!bounds.contains(point)) {
- if (bounds.getLeft().x > point.x) {
- result.x = bounds.getLeft().x;
- } else if (bounds.getRight().x < point.x) {
- result.x = bounds.getRight().x;
- }
- }
- return result;
- }
-
- private EditPart getRootEditablePart(EditPart part,
- IMovementMediator moveMediator) {
- EditPart rootpart = null;
- if ((rootpart = ((InlineEditingNavigationMediator) moveMediator)
- .getRootConstainedEditableContainer(new Target(part))) == null) {
- rootpart = moveMediator.getEditableContainer(new Target(part));
- }
- return rootpart;
- }
-
- private boolean found(DesignPosition newPos, DesignPosition prevPos) {
- Rectangle newRec = EditPartPositionHelper
- .convertToAbsoluteCaretRect(newPos);
- Rectangle prevRec = EditPartPositionHelper
- .convertToAbsoluteCaretRect(prevPos);
- if (_up) {
- return getYDistance(newRec, prevRec, _up) < 0;
- }
- return getYDistance(newRec, prevRec, _up) > 0;
- }
-
- /**
- * Distance from rec1 to rec2 at y coordination, if top, compare top,
- * otherwise compare bottom.
- *
- * @param rec1
- * @param rec2
- * @param up
- * @return
- */
- private int getYDistance(Rectangle rec1, Rectangle rec2, boolean top) {
- if (rec1.getCopy().intersect(rec2).height > 0) {
- return 0;
- }
- if (top) {
- return rec1.getTop().y - rec2.getTop().y;
- }
- return rec1.getBottom().y - rec2.getBottom().y;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/ApplyStyleCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/ApplyStyleCommand.java
deleted file mode 100644
index 2f087a6..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/ApplyStyleCommand.java
+++ /dev/null
@@ -1,509 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.range;
-
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.commands.CommandResources;
-import org.eclipse.jst.pagedesigner.dom.DOMRange;
-import org.eclipse.jst.pagedesigner.dom.DOMRefPosition;
-import org.eclipse.jst.pagedesigner.dom.DOMUtil;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-/**
- * @author mengbo
- */
-public class ApplyStyleCommand extends RangeModeCommand {
- private String _tag;
-
- private String _cssProperty;
-
- private String _cssPropertyValue;
-
- private final Element _applyingNode;
-
- /**
- * @param viewer
- * @param tag
- * @param property
- * @param value
- */
- public ApplyStyleCommand(IHTMLGraphicalViewer viewer, String tag,
- String property, String value) {
- super(
- CommandResources
- .getString("ApplyStyleCommand.Label.ApplyStyle"), viewer); //$NON-NLS-1$
- this._tag = tag;
- this._cssProperty = property;
- this._cssPropertyValue = value;
- this._applyingNode = null;
- }
-
- /**
- * @param viewer
- * @param node
- * @param property
- * @param value
- */
- public ApplyStyleCommand(IHTMLGraphicalViewer viewer, Element node,
- String property, String value) {
- super(
- CommandResources
- .getString("ApplyStyleCommand.Label.ApplyStyle"), viewer); //$NON-NLS-1$
- this._applyingNode = node;
- }
-
- /**
- * @return the applying node (may be null)
- */
- protected final Element getApplyingNode() {
- return _applyingNode;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.DesignerCommand#doExecute()
- */
- protected DOMRange doRangeExecute(DOMRange range) {
- if (range == null || range.isEmpty()) {
- return null;
- }
-
- boolean ordered = range.isOrdered();
- IDOMPosition start = ordered ? range.getStartPosition() : range
- .getEndPosition();
- IDOMPosition end = ordered ? range.getEndPosition() : range
- .getStartPosition();
-
- Node startContainer = start.getContainerNode();
- Node endContainer = end.getContainerNode();
-
- Node common = DOMUtil.findCommonAncester(start.getContainerNode(), end
- .getContainerNode());
- if (common == null) {
- // should not happen.
- return null;
- }
-
- if (common instanceof Text) {
- // under the same Text scope
- range = doTextNodeStyleApply((Text) common, start.getOffset(), end
- .getOffset());
-
- return range;
- }
-
- if (startContainer instanceof Text) {
- // if the start offset is 0,then skip split the Text
- if (start.getOffset() > 0) {
- startContainer = ((Text) startContainer).splitText(start
- .getOffset());
- start = new DOMRefPosition(startContainer, false);
- }
- } else {
- startContainer = start.getNextSiblingNode();
- }
- if (endContainer instanceof Text) {
- if (end.getOffset() > 0) {
- endContainer = ((Text) endContainer).splitText(end
- .getOffset());
- endContainer = endContainer.getPreviousSibling();
- } else {
- endContainer = endContainer.getPreviousSibling();
- }
- } else {
- endContainer = end.getPreviousSiblingNode();
- }
-
- for (Node node = startContainer; node != endContainer; node = EditModelQuery
- .getInstance().getNextLeafNeighbor(node)) {
- if (EditModelQuery.hasAncestor(node, getTag(), true)) {
- continue;
- }
- Element newnode = createStyleElement();
- node.getParentNode().insertBefore(newnode, node);
- newnode.appendChild(node);
- }
- if (!EditModelQuery.hasAncestor(endContainer, getTag(), true)) {
- Element newnode = createStyleElement();
- endContainer.getParentNode()
- .insertBefore(newnode, endContainer);
- newnode.appendChild(endContainer);
- }
-
- // merge the style tags
-
- for (Node node = startContainer; node != endContainer; node = EditModelQuery
- .getInstance().getNextLeafNeighbor(node)) {
- Node stylenode = node;
- while (stylenode != null
- && !stylenode.getNodeName().equalsIgnoreCase(getTag())) {
- stylenode = stylenode.getParentNode();
- }
- if (stylenode == null) {
- continue;
- }
- if (stylenode.getNextSibling() != null
- && stylenode.getNextSibling().getNodeName()
- .equalsIgnoreCase(getTag())) {
- Node sibling = stylenode.getNextSibling();
- while (sibling.getFirstChild() != null) {
- stylenode.appendChild(sibling.getFirstChild());
- }
- stylenode.getParentNode().removeChild(sibling);
- node = startContainer;
- }
- }
-
- return new DOMRange(start, end);
-
- /*
- * boolean ordered = range.isOrdered(); IDOMPosition start = ordered ?
- * range.getStartPosition() : range.getEndPosition(); IDOMPosition end =
- * ordered ? range.getEndPosition() : range.getStartPosition();
- *
- * Node common = DOMUtil.findCommonAncester(start.getContainerNode(),
- * end.getContainerNode()); if (common == null) { // should not happen.
- * return null; }
- *
- * DOMRange result = null; if (common instanceof Text) { result =
- * doTextNodeStyleApply((Text) common, start.getOffset(),
- * end.getOffset()); } else { IDOMPosition startPosition = start;
- * IDOMPosition endPosition = end; Node ancester = common; DOMRange[]
- * leftRange = new DOMRange[1]; DOMRange[] rightRange = new DOMRange[1];
- *
- * startPosition = partialApply(startPosition, ancester, true,
- * leftRange); endPosition = partialApply(endPosition, ancester, false,
- * rightRange); DOMRange middle = middleApply(ancester, startPosition,
- * endPosition);
- *
- * IDOMPosition startref = null; if (leftRange[0] != null &&
- * leftRange[0].getStartPosition() != null) { startref =
- * leftRange[0].getStartPosition(); } else if (middle != null &&
- * middle.getStartPosition() != null) { startref =
- * middle.getStartPosition(); } else if (rightRange[0] != null &&
- * rightRange[0].getStartPosition() != null) { startref =
- * rightRange[0].getStartPosition(); }
- *
- * IDOMPosition endref = null; if (rightRange[0] != null &&
- * rightRange[0].getEndPosition() != null) { endref =
- * rightRange[0].getEndPosition(); } else if (middle != null &&
- * middle.getEndPosition() != null) { endref = middle.getEndPosition(); }
- * else if (leftRange[0] != null && leftRange[0].getEndPosition() !=
- * null) { endref = leftRange[0].getEndPosition(); }
- *
- * if (startref == null) { result = null; } else { startref = new
- * DOMPosition(EditModelQuery.getInstance().getNextLeafNeighbor(startref.getContainerNode()),
- * 0); System.out.println(startref.toString()); endref = new
- * DOMPosition(endref.getContainerNode(), 0); result = new
- * DOMRange(startref, endref); } }
- *
- * if (result == null) { return null; }
- *
- * if (ordered) { return result; } else { return new
- * DOMRange(result.getEndPosition(), result.getStartPosition()); }
- */
- }
-
- // TODO: unused code. Dead?
-// private DOMRange middleApply(Node ancester, IDOMPosition startPosition,
-// IDOMPosition endPosition) {
-// startPosition = skip(startPosition, true);
-// if (startPosition.getNextSiblingNode() == null
-// || startPosition.getOffset() >= endPosition.getOffset()) {
-// return null;
-// } else {
-// List needMove = new ArrayList();
-// Node startNext = startPosition.getNextSiblingNode();
-// Node endNext = endPosition.getNextSiblingNode();
-// while (startNext != null && startNext != endNext) {
-// needMove.add(startNext);
-// startNext = startNext.getNextSibling();
-// }
-// Element newEle = createStyleElement();
-// ancester.insertBefore(newEle, startPosition.getNextSiblingNode());
-// for (int i = 0, n = needMove.size(); i < n; i++) {
-// newEle.appendChild((Node) needMove.get(i));
-// }
-// return new DOMRange(new DOMRefPosition(newEle, false),
-// new DOMRefPosition(newEle, true));
-// }
-// }
-
- // TODO: unused code. Dead?
-// private IDOMPosition partialApply(IDOMPosition position, Node ancester,
-// boolean forward, DOMRange[] result) {
-// IDOMPosition startRef = null, endRef = null;
-//
-// while (position != null && position.getContainerNode() != ancester) {
-// Node container = position.getContainerNode();
-// if (container instanceof Text) {
-// // splitText will move the position up one level
-// position = splitText(position);
-// } else {
-// // skip those nodes that can't have the style applied.
-// position = skip(position, forward);
-// Node sibling = position.getSibling(forward);
-// if (sibling != null) {
-// List needMove = new ArrayList();
-// while (sibling != null) {
-// needMove.add(sibling);
-// sibling = forward ? sibling.getNextSibling() : sibling
-// .getPreviousSibling();
-// }
-//
-// // ok, there is nodes that need the style
-// Element newEle = createStyleElement();
-// container.insertBefore(newEle, position
-// .getNextSiblingNode());
-// for (int i = 0, size = needMove.size(); i < size; i++) {
-// newEle.appendChild((Node) needMove.get(i));
-// }
-// if (startRef == null) {
-// startRef = new DOMRefPosition(newEle, !forward);
-// }
-// endRef = new DOMRefPosition(newEle, forward);
-// }
-// // move the position up one level
-// position = new DOMRefPosition(container, forward);
-// }
-// }
-// if (startRef == null) {
-// result[0] = null;
-// } else {
-// result[0] = forward ? new DOMRange(startRef, endRef)
-// : new DOMRange(endRef, startRef);
-// }
-// return position;
-// }
-
- /**
- * @param position
- * @return
- */
- // TODO: dead?
-// private IDOMPosition splitText(IDOMPosition position) {
-// Text text = (Text) position.getContainerNode();
-// int offset = position.getOffset();
-// if (offset <= 0) {
-// return new DOMRefPosition(text, false);
-// } else if (offset >= text.getData().length()) {
-// return new DOMRefPosition(text, true);
-// } else {
-// text.splitText(offset);
-// return new DOMRefPosition(text, true);
-// }
-// }
-
- /**
- * @param start
- * @param end
- * @param common
- */
- private DOMRange doTextNodeStyleApply(Text textNode, int startOffset,
- int endOffset) {
- String data = textNode.getData();
- String before = data.substring(0, startOffset);
- String middle = data.substring(startOffset, endOffset);
- String tail = data.substring(endOffset);
-
- Text middleText = getModel().getDocument().createTextNode(middle);
-
- // case 1: normal one
- if (!isEmptyString(before) && !isEmptyString(tail)) {
- Node parent = textNode.getParentNode();
- parent.insertBefore(
- getModel().getDocument().createTextNode(before), textNode);
- Element bnode = createStyleElement();
- bnode.appendChild(middleText);
- parent.insertBefore(bnode, textNode);
- textNode.setNodeValue(tail);
- }
-
- if (isEmptyString(before) && !isEmptyString(tail)) {
- Node sibling = textNode.getPreviousSibling();
- if (sibling != null
- && sibling.getNodeName().equalsIgnoreCase(getTag())) {
- sibling.appendChild(middleText);
- } else {
- Node parent = textNode.getParentNode();
- parent.insertBefore(getModel().getDocument().createTextNode(
- before), textNode);
- Element bnode = createStyleElement();
- bnode.appendChild(middleText);
- parent.insertBefore(bnode, textNode);
- }
- textNode.setNodeValue(tail);
- }
-
- if (!isEmptyString(before) && isEmptyString(tail)) {
- Node sibling = textNode.getNextSibling();
- textNode.setNodeValue(before);
- if (sibling != null
- && sibling.getNodeName().equalsIgnoreCase(getTag())) {
- sibling.insertBefore(middleText, sibling.getFirstChild());
- } else {
- Element bnode = createStyleElement();
- bnode.appendChild(middleText);
- textNode.getParentNode().insertBefore(bnode, sibling);
- }
- }
-
- if (isEmptyString(before) && isEmptyString(tail)) {
-
- Node previousSibling = textNode.getPreviousSibling();
- Node nextSibling = textNode.getNextSibling();
- //
- if (getTag().equalsIgnoreCase(IHTMLConstants.TAG_P)) {
- Element bnode = createStyleElement();
- bnode.appendChild(middleText);
- textNode.getParentNode().insertBefore(bnode, textNode);
- textNode.getParentNode().removeChild(textNode);
- }
- //
- else {
- if (previousSibling != null
- && previousSibling.getNodeName().equalsIgnoreCase(
- getTag()) && nextSibling != null
- && nextSibling.getNodeName().equalsIgnoreCase(getTag())) {
- previousSibling.appendChild(middleText);
- while (nextSibling.getFirstChild() != null) {
- previousSibling
- .appendChild(nextSibling.getFirstChild());
- }
- nextSibling.getParentNode().removeChild(nextSibling);
- } else if (previousSibling != null
- && previousSibling.getNodeName().equalsIgnoreCase(
- getTag())) {
- previousSibling.appendChild(middleText);
- } else if (nextSibling != null
- && nextSibling.getNodeName().equalsIgnoreCase(getTag())) {
- nextSibling.insertBefore(middleText, nextSibling
- .getFirstChild());
- } else {
- Element bnode = createStyleElement();
- bnode.appendChild(middleText);
- textNode.getParentNode().insertBefore(bnode, textNode);
- }
- textNode.getParentNode().removeChild(textNode);
- }
- }
-
- return new DOMRange(new DOMRefPosition(middleText, false),
- new DOMRefPosition(middleText, true));
- }
-
- private boolean isEmptyString(String str) {
- if (str == null || str.length() == 0) {
- return true;
- }
- return false;
- }
-
- /**
- * @return a style element (cached on create)
- */
- protected Element createStyleElement() {
- if (_applyingNode != null) {
- return _applyingNode;
- }
- Element element = getModel().getDocument().createElement(getTag());
- if (_cssProperty != null && _cssPropertyValue != null) {
- element.setAttribute(_cssProperty, _cssPropertyValue);
- }
- return element;
- }
-
- /**
- * @param position
- * @param b
- * @return
- */
- // TODO: dead?
-// private IDOMPosition skip(IDOMPosition position, boolean forward) {
-// Node node = position.getSibling(forward);
-//
-// if (node == null) {
-// return position;
-// }
-// boolean canSkip = false;
-// if (node instanceof Text) {
-// canSkip = ((IDOMText) node).isElementContentWhitespace();
-// } else if (node instanceof Element) {
-// if (getTag().equalsIgnoreCase(((Element) node).getTagName())) {
-// canSkip = true;
-// } else {
-// canSkip = false;
-// }
-// } else {
-// canSkip = true;
-// }
-// if (canSkip) {
-// return new DOMRefPosition(node, forward);
-// } else {
-// return position;
-// }
-// }
-
- /**
- * @return Returns the _cssProperty.
- */
- public final String getCssProperty() {
- return _cssProperty;
- }
-
- /**
- * @param property
- * The _cssProperty to set.
- */
- public final void setCssProperty(String property) {
- _cssProperty = property;
- }
-
- /**
- * @return Returns the _cssPropertyValue.
- */
- public final String getCssPropertyValue() {
- return _cssPropertyValue;
- }
-
- /**
- * @param propertyValue
- * The _cssPropertyValue to set.
- */
- public final void setCssPropertyValue(String propertyValue) {
- _cssPropertyValue = propertyValue;
- }
-
- /**
- * @return Returns the _tag.
- */
- public final String getTag() {
- if (_tag != null) {
- return _tag;
- }
- return _applyingNode.getNodeName();
- }
-
- /**
- * @param _tag
- * The _tag to set.
- */
- public final void setTag(String _tag) {
- this._tag = _tag;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/BlockNodeFinder.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/BlockNodeFinder.java
deleted file mode 100644
index 5f1bbc4..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/BlockNodeFinder.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.range;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.jst.jsf.core.internal.tld.IJSFConstants;
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.dom.DOMPosition;
-import org.eclipse.jst.pagedesigner.dom.DOMRefPosition;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- */
-public class BlockNodeFinder {
- private String[] _additionalTags;
-
- private IDOMPosition _position;
-
- /**
- * @param position
- * @param additionalTags
- */
- public BlockNodeFinder(IDOMPosition position, String[] additionalTags) {
- _position = position;
- _additionalTags = additionalTags;
- }
-
- private Node findInlineSiblings(IDOMPosition position, List result,
- boolean forward) {
- Node container = EditModelQuery.getInstance().getSibling(position,
- forward);
- if (!forward) {
- while (container != null) {
- if (EditModelQuery.isInline(container)) {
- result.add(container);
- } else {
- return container;
- }
- container = container.getPreviousSibling();
- }
- } else {
- while (container != null) {
- if (EditModelQuery.isInline(container)) {
- result.add(container);
- } else {
- return container;
- }
- container = container.getNextSibling();
- }
- }
- // the result will be non-zero length.
- return null;
- }
-
- private Node getParagraphNodes(IDOMPosition position, List result,
- boolean forward) {
- Node sResult = findInlineSiblings(position, result, forward);
- Node container = position.getContainerNode();
- container = position.isText() ? container.getParentNode() : container;
- while (sResult == null) {
- // stop at block, special container and H style nodes.
- if (EditModelQuery.isBlockNode(container)
- || EditModelQuery.isDocument(container)
- || (container.getLocalName() != null && (container
- .getLocalName().equals(IJSFConstants.TAG_VIEW) || container
- .getLocalName().equalsIgnoreCase(
- IHTMLConstants.TAG_HTML))) || //
- (_additionalTags != null
- && Arrays.asList(_additionalTags).contains(
- getTagName()) && Arrays.asList(
- _additionalTags).contains(container))) {
- return container;
- }
- position = new DOMRefPosition(container, forward);
- sResult = findInlineSiblings(position, result, forward);
- container = container.getParentNode();
- }
- return sResult;
- }
-
- /**
- * Search for an area between two block nodes or within a block node, search
- * will stop before or under a node which has block display-type, or
- * particular container like "html", jsf "view", .etc, two positions (left
- * and right) are returned in result.
- *
- * The searcher will search parent's directly children, if no block node is
- * found, then go up the node tree to search again.
- *
- * @param position
- * @param result
- */
- public void getParagraphNodes(IDOMPosition position, List result) {
- List tempResult = new ArrayList();
- Node r1 = getParagraphNodes(position, tempResult, true);
- if (EditModelQuery.isChild(r1, position.getContainerNode())) {
- result.add(new DOMPosition(r1, r1.getChildNodes().getLength()));
- } else {
- result.add(new DOMRefPosition(r1, false));
- }
-
- Node r2 = getParagraphNodes(position, tempResult, false);
- if (EditModelQuery.isChild(r2, position.getContainerNode())) {
- result.add(new DOMPosition(r2, 0));
- } else {
- result.add(new DOMRefPosition(r2, true));
- }
- }
-
- private String getTagName() {
- String name = _position.getContainerNode().getNodeName();
- name = name == null ? "" : name.toLowerCase();
- return name;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/ClipboardData.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/ClipboardData.java
deleted file mode 100644
index 8900ab4..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/ClipboardData.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.range;
-
-import java.util.Vector;
-
-import org.eclipse.gef.dnd.TemplateTransfer;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.widgets.Control;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- */
-public class ClipboardData implements IInputSourceProvider {
-
- private Control _control;
-
- /**
- * @param control
- */
- public ClipboardData(Control control) {
- super();
- _control = control;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.range.IInputSourceProvider#getNodes()
- */
- public Node[] getNodes() {
- Object data = getClipboardData();
- if (data instanceof Vector && ((Vector) data).size() > 0) {
- return (Node[]) ((Vector) data).toArray(new Node[] {});
- } else if (data instanceof Node[]) {
- return (Node[]) data;
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.range.IInputSourceProvider#getStringData()
- */
- public String getStringData() {
- Object data = getClipboardData();
- if (data instanceof String) {
- return (String) data;
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.range.IInputSourceProvider#getCharacterData()
- */
- public Character getCharacterData() {
- return null;
- }
-
- /**
- * @return the clip board data
- */
- public Object getClipboardData() {
- Clipboard clipboard = new Clipboard(_control.getDisplay());
-
- final Object cuted = clipboard.getContents(TemplateTransfer.getInstance());
- if (cuted instanceof Node[] || cuted instanceof Vector) {
- return cuted;
- }
- return clipboard.getContents(TextTransfer.getInstance());
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/ContentCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/ContentCommand.java
deleted file mode 100644
index c612aac..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/ContentCommand.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.range;
-
-import org.eclipse.jst.pagedesigner.dom.DOMPosition;
-import org.eclipse.jst.pagedesigner.dom.DOMPositionHelper;
-import org.eclipse.jst.pagedesigner.dom.DOMRange;
-import org.eclipse.jst.pagedesigner.dom.DOMRefPosition;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.w3c.dom.Text;
-
-/**
- * This command can used to handle things like "paste". Or keyboard printable
- * ascii key. Note: ENTER key is not handled here.
- *
- * @author mengbo
- */
-// FIXME: \r \n in the content string is not handled.
-public class ContentCommand extends RangeModeCommand {
-
- private String _content;
-
- /**
- * @param viewer
- * @param content
- */
- public ContentCommand(IHTMLGraphicalViewer viewer, String content) {
- super("", viewer);
- _content = content;
- }
-
- /**
- * @param viewer
- * @param c
- */
- public ContentCommand(IHTMLGraphicalViewer viewer, char c) {
- super("", viewer);
- _content = String.valueOf(c);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.DesignerCommand#doExecute()
- */
- protected DOMRange doRangeExecute(DOMRange range) {
- if (range == null)
- return null;
-
- IDOMPosition position = DOMPositionHelper.removeRange(range);
- position = doContent(position);
- return new DOMRange(position, position);
-
- }
-
- /**
- * @param position
- * @return ??
- */
- protected IDOMPosition doContent(IDOMPosition position) {
- position = DOMPositionHelper.mergeIntoText(position);
-
- if (position.getContainerNode() instanceof Text) {
- Text text = (Text) position.getContainerNode();
- String data = text.getData();
- int offset = position.getOffset();
- String newData = data.substring(0, offset) + _content
- + data.substring(offset);
- text.setData(newData);
- return new DOMPosition(text, offset + _content.length());
- }
- // we need to create a text node.
- Text text = getDocument().createTextNode(_content);
- position.getContainerNode().insertBefore(text,
- position.getNextSiblingNode());
- return new DOMRefPosition(text, true);
- }
-
- // protected DesignPosition doContent()
- // {
- // // DesignPosition position = removeRange();
- // DesignPosition position = this.getSelectionRange().getEndPosition();
- // if ('\r' == _content || '\n' == _content)
- // {
- // Element br = getModel().getDocument().createElement("BR");
- // Node node = RangeUtil.insertElement(position, br);
- //
- // // we need set the new range to the node.
- // // FIXME: temp code, need to reconsider how to do refresh, when those
- // editpart
- // // are recreated.
- // IDOMNode parent = (IDOMNode) node.getParentNode();
- // EditPart parentPart = (EditPart) parent.getAdapterFor(EditPart.class);
- // List childParts = parentPart.getChildren();
- // for (int i=0; i<childParts.size(); i++)
- // {
- // if (node == ((EditPart)childParts.get(i)).getModel())
- // {
- // return new DesignPosition(parentPart, i+1);
- // }
- // }
- // return new DesignPosition(parentPart, childParts.size());
- // }
- // else
- // {
- // TextPosition textPosition = RangeUtil.insertText(position,
- // String.valueOf(_content));
- // IDOMText text = textPosition.getTextNode();
- // EditPart part = (EditPart) text.getAdapterFor(EditPart.class);
- // return new DesignPosition(part, textPosition.getOffset());
- // }
- // }
- //
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/CopyCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/CopyCommand.java
deleted file mode 100644
index 594cf62..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/CopyCommand.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.range;
-
-import org.eclipse.jst.pagedesigner.commands.CommandResources;
-import org.eclipse.jst.pagedesigner.dom.DOMRange;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-
-/**
- * @author mengbo
- */
-public class CopyCommand extends RangeModeCommand {
-
- /**
- * @param viewer
- */
- public CopyCommand(IHTMLGraphicalViewer viewer) {
- super(CommandResources.getString("CopyCommand.Label.Copy"), viewer); //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.range.RangeModeCommand#doRangeExecute(org.eclipse.jst.pagedesigner.dom.DOMRange)
- */
- protected DOMRange doRangeExecute(DOMRange selection) {
- DesignEdit edit = new CopyEdit(selection, getViewer());
- edit.operate();
- return selection;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/CopyEdit.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/CopyEdit.java
deleted file mode 100644
index a94540e..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/CopyEdit.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.range;
-
-import java.util.Stack;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.dom.DOMRange;
-import org.eclipse.jst.pagedesigner.dom.EditHelper;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-/**
- * @author mengbo
- */
-public class CopyEdit extends DesignEdit {
- private static Logger _log = PDPlugin.getLogger(CopyEdit.class);
-
- private Stack result = new Stack();
-
- /**
- * @param range
- * @param viewer
- */
- public CopyEdit(DOMRange range, GraphicalViewer viewer) {
- super(range, viewer);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.range.DesignEdit#operate()
- */
- protected boolean operate() {
- WorkNode root = getRootWorkNode();
- Node rootNode = root.getNode();
- result = getProcessedResult();
- collectOtherStyles(rootNode, result);
- setClipboard(result);
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.range.DesignEdit#processContainer(org.eclipse.jst.pagedesigner.commands.range.WorkNode)
- */
- protected Node processContainer(WorkNode node) {
- return node.getNode().cloneNode(false);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.range.AbstractCopyEdit#processNode(org.w3c.dom.Node,
- * int[], java.util.Stack)
- */
- protected Node processNode(WorkNode node) {
- int pos[] = node.getPosOffsets();
- // the text could be tranparent, or 0 length.
- Assert.isTrue(pos[0] <= pos[1]);
- if (pos[0] == pos[1]) {
- return null;
- }
- return node.getNode().cloneNode(true);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.range.AbstractCopyEdit#processText(org.w3c.dom.Text,
- * int[], java.util.Stack)
- */
- protected Text processText(WorkNode node) {
- Text currentNode = (Text) node.getNode();
- int left = EditModelQuery.getNodeStartIndex(currentNode);
- int right = EditModelQuery.getNodeEndIndex(currentNode);
- int location1 = EditHelper.getInstance().getLocation(currentNode,
- node.getPosOffsets()[0], true);
- int location2 = EditHelper.getInstance().getLocation(currentNode,
- node.getPosOffsets()[1], true);
- int start = 0;
- int end = right - left;
- // left index
- if (location1 > EditHelper.IN_MIDDLE
- || location2 < EditHelper.IN_MIDDLE) {
- return null;
- }
- if (location1 <= EditHelper.IN_MIDDLE) {
- start = node.getQualifiedOffsets()[0];
- }
- if (location2 >= EditHelper.IN_MIDDLE) {
- end = node.getQualifiedOffsets()[1];
- }
- if (start == end) {
- return null;
- }
-
- try {
- String text = currentNode.getData().substring(start, end);
- return EditModelQuery.getDocumentNode(currentNode)
- .createTextNode(text);
- } catch (DOMException e) {
- // TODO: changed this from catching Exception
- // DOMException is the only exception that
- // anything in the try is threatening to throw
- // and even that is Runtime
- _log.error("Exception", e);
- return null;
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/CutCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/CutCommand.java
deleted file mode 100644
index 985967b..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/CutCommand.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.range;
-
-import org.eclipse.jst.pagedesigner.commands.CommandResources;
-import org.eclipse.jst.pagedesigner.dom.DOMRange;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-
-/**
- * @author mengbo
- */
-public class CutCommand extends RangeModeCommand {
- /**
- * @param viewer
- */
- public CutCommand(IHTMLGraphicalViewer viewer) {
- super(CommandResources.getString("CutCommand.Label.Cut"), viewer); //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.range.RangeModeCommand#doRangeExecute(org.eclipse.jst.pagedesigner.dom.DOMRange)
- */
- protected DOMRange doRangeExecute(DOMRange selection) {
- DesignEdit edit = new CutEdit(selection, getViewer());
- if (EditModelQuery.isSame(selection)) {
- return null;
- }
- if (edit.perform()) {
- return new DOMRange(edit.getOperationPosition(), edit
- .getOperationPosition());
- }
- return selection;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/CutEdit.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/CutEdit.java
deleted file mode 100644
index c0a8104..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/CutEdit.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.range;
-
-import java.util.Stack;
-
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.jst.pagedesigner.dom.DOMRange;
-
-/**
- * @author mengbo
- */
-public class CutEdit extends DeleteEdit {
- /**
- * @param range
- * @param viewer
- */
- public CutEdit(DOMRange range, GraphicalViewer viewer) {
- super(range, viewer);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.range.DesignEdit#operate()
- */
- protected boolean operate() {
- Stack result = deleteRange();
- setClipboard(result);
- return true;
- }
-
- /*
- * private Text cutText(Text text, int start, int end) {
- * EditValidateUtil.validStringIndexOffset(text, start, end - start); String
- * content = text.substringData(start, end - start); if (content == null ||
- * content.length() == 0) { return null; } text.deleteData(start, end -
- * start); return _document.createTextNode(content); }
- */
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/DeleteCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/DeleteCommand.java
deleted file mode 100644
index 26ea1d9..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/DeleteCommand.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.range;
-
-import org.eclipse.jst.pagedesigner.commands.CommandResources;
-import org.eclipse.jst.pagedesigner.commands.nav.ICaretPositionMover;
-import org.eclipse.jst.pagedesigner.dom.DOMRange;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-
-/**
- * @author mengbo
- */
-public class DeleteCommand extends RangeModeCommand implements
- ICaretPositionMover {
- private boolean _forward;
-
- /**
- * @param forward
- * @param viewer
- */
- public DeleteCommand(boolean forward, IHTMLGraphicalViewer viewer) {
- super(CommandResources.getString("DeleteCommand.Label.Delete"), viewer); //$NON-NLS-1$
- _forward = forward;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.DesignerCommand#doExecute()
- */
- protected DOMRange doRangeExecute(DOMRange selection) {
- if (selection == null) {
- return null;
- }
-
- DesignEdit edit = new DeleteEdit(selection, getViewer(), _forward);
- Listener listener = new Listener() {
- public void handleEvent(Event event) {
- event.type = SWT.NONE;
- }
- };
- getViewer().getControl().getDisplay()
- .addFilter(SWT.Selection, listener);
- boolean status = edit.perform();
- getViewer().getControl().getDisplay().removeFilter(SWT.Selection,
- listener);
- if (status) {
- return new DOMRange(edit.getOperationPosition(), edit
- .getOperationPosition());
- }
- return selection;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/DeleteEdit.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/DeleteEdit.java
deleted file mode 100644
index d7b48ba..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/DeleteEdit.java
+++ /dev/null
@@ -1,291 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.range;
-
-import java.util.Stack;
-import java.util.Vector;
-
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.jsf.core.internal.tld.IJSFConstants;
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.dom.DOMPosition;
-import org.eclipse.jst.pagedesigner.dom.DOMPositionHelper;
-import org.eclipse.jst.pagedesigner.dom.DOMRange;
-import org.eclipse.jst.pagedesigner.dom.DOMRefPosition;
-import org.eclipse.jst.pagedesigner.dom.EditHelper;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.jst.pagedesigner.validation.caret.ActionData;
-import org.eclipse.jst.pagedesigner.validation.caret.IETablePositionRule;
-import org.eclipse.jst.pagedesigner.validation.caret.InlineEditingNavigationMediator;
-import org.eclipse.jst.pagedesigner.viewer.LayoutPart;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-/**
- * @author mengbo
- */
-public class DeleteEdit extends DesignEdit {
- private static final Logger _log = PDPlugin.getLogger(DeleteEdit.class);
-
- private static final boolean INNER_DEBUG = false;
-
- private boolean _forward;
-
- Vector deleted = new Vector();
-
- /**
- * @param range
- * @param viewer
- * @param forward
- */
- public DeleteEdit(DOMRange range, GraphicalViewer viewer, boolean forward) {
- super(range, viewer);
- _forward = forward;
- }
-
- /**
- * @param range
- * @param viewer
- */
- public DeleteEdit(DOMRange range, GraphicalViewer viewer) {
- super(range, viewer);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.range.DesignEdit#operate()
- */
- protected boolean operate() {
- try {
- boolean result = true;
- if (EditModelQuery.isSame(getRange())) {
- deleteSingle();
- } else {
- deleteRange();
- }
- return result;
- } catch (Exception e) {
- _log.error("Exception", e);
- return false;
- }
- }
-
- /**
- * Delete one node or char at operation position.
- */
- private void deleteSingle() {
- IDOMPosition opPosition = getOperationPosition();
- opPosition = EditHelper.moveToNextEditPosition(getOperationPosition(),
- _forward, new InlineEditingNavigationMediator(new ActionData(
- ActionData.INLINE_EDIT, null)));
- // for inner debug
- if (INNER_DEBUG) {
- _log.info("EditHelper, now we are at:" + opPosition);
- }
- if (EditModelQuery.isSame(opPosition, getOperationPosition())) {
- return;
- }
- setRange(new DOMRange(opPosition, getOperationPosition()));
- deleteRange();
- }
-
- /**
- * @return the stack
- */
- protected Stack deleteRange() {
- WorkNode root = getRootWorkNode();
- Node rootNode = root.getNode();
- Stack result = getProcessedResult();
- collectOtherStyles(rootNode, result);
- return result;
- }
-
- private boolean isTableComponents(WorkNode node) {
- String name = node.getNode().getNodeName();
- return (IHTMLConstants.TAG_TD.equalsIgnoreCase(name) || //
- IHTMLConstants.TAG_TH.equalsIgnoreCase(name) || //
- IHTMLConstants.TAG_TR.equalsIgnoreCase(name) || //
- IHTMLConstants.TAG_THEAD.equalsIgnoreCase(name) || //
- IHTMLConstants.TAG_TBODY.equalsIgnoreCase(name) || //
- IHTMLConstants.TAG_TFOOT.equalsIgnoreCase(name));
- }
-
- private Node processContainerTable(WorkNode node) {
- Node result = null;
- if ((isTableComponents(node) || IHTMLConstants.TAG_TABLE
- .equalsIgnoreCase(node.getNode().getNodeName())) //
- && new IETablePositionRule(null).isInValidTable(node
- .getNode())) {
- result = node.getNode().cloneNode(false);
- }
- return result;
- }
-
- private Node processContainerStyleNodes(WorkNode node) {
- String name = node.getNode().getNodeName();
- Node result = null;
- if (IHTMLConstants.TAG_LI.equalsIgnoreCase(name) || //
- EditModelQuery.HTML_STYLE_NODES.contains(node.getNode()
- .getLocalName())) {
- if (node.getNode().hasChildNodes()) {
- result = node.getNode().cloneNode(false);
- }
- }
- return result;
- }
-
- private Node processContainerView(WorkNode node) {
- Node result = null;
- if (IJSFConstants.TAG_VIEW.equalsIgnoreCase(node.getNode()
- .getLocalName())) {
- result = EditModelQuery.getDocumentNode(node.getNode())
- .createElement(IJSFConstants.TAG_SUBVIEW);
- result.setPrefix(node.getNode().getPrefix());
- } else if (IHTMLConstants.TAG_BODY.equalsIgnoreCase(node.getNode()
- .getNodeName())
- || IHTMLConstants.TAG_HTML.equalsIgnoreCase(node.getNode()
- .getNodeName())) {
- result = EditModelQuery.getDocumentNode(node.getNode())
- .createElement(node.getNode().getNodeName());
- }
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.range.AbstractCopyEdit#processContainer(org.eclipse.jst.pagedesigner.commands.range.WorkNode)
- */
- protected Node processContainer(WorkNode node) {
- Node result = processContainerView(node);
- if (result == null) {
- result = processContainerTable(node);
- }
- if (result == null) {
- result = processContainerStyleNodes(node);
- }
- if (result == null) {
- // strip out container
- if (LayoutPart.getConcreteNode(node.getNode()) != null) {
- Node parent = node.getNode().getParentNode();
- Node refNode = node.getNode();
- Node child = node.getNode().getFirstChild();
- Node first = null, last = null;
- int index = 0;
- NodeList children = node.getNode().getChildNodes();
- int size = children.getLength();
- while (child != null) {
- Node next = child.getNextSibling();
- Node n = EditHelper.deleteNode(child);
- parent.insertBefore(n, refNode);
- if (index == 0) {
- if (refNode != null) {
- first = refNode.getPreviousSibling();
- } else {
- first = parent.getLastChild();
- }
- }
- if (index == size - 1) {
- if (refNode != null) {
- last = refNode.getPreviousSibling();
- } else {
- last = parent.getLastChild();
- }
- }
- index++;
- child = next;
- }
- if (node.getPosOffsets()[0] <= 0) {
- setOperationPosition(new DOMRefPosition(first, false));
- } else {
- setOperationPosition(new DOMRefPosition(last, true));
- }
- } else {
- setOperationPosition(new DOMRefPosition(node.getNode(), false));
- }
- result = EditHelper.deleteNode(node.getNode());
- }
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.range.AbstractCopyEdit#processNode(org.w3c.dom.Node,
- * int[])
- */
- protected Node processNode(WorkNode node) {
- Node result = null;
- if (!isTableComponents(node)
- || !new IETablePositionRule(null).isInValidTable(node
- .getNode())) {
- // it's not table components.
- setOperationPosition(new DOMRefPosition(node.getNode(), false));
- result = EditHelper.deleteNode(node.getNode());
- }
- return result;
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.range.AbstractCopyEdit#processText(org.w3c.dom.Text,
- * int[])
- */
- protected Text processText(WorkNode node) {
- Text currentNode = (Text) node.getNode();
- int[] offsets = node.getPosOffsets();
- Node second = null;
- int location1 = EditHelper.getInstance().getLocation(currentNode,
- node.getPosOffsets()[0], true);
- int location2 = EditHelper.getInstance().getLocation(currentNode,
- node.getPosOffsets()[1], true);
- // left index
- if (currentNode.getData().length() > 0) {
- if (location1 == EditHelper.IN_MIDDLE) {
- IDOMPosition position = new DOMPosition(currentNode, node
- .getPosOffsets()[0]);
- setOperationPosition(position);
- position = DOMPositionHelper.splitText(position);
- Node nnode = position.getNextSiblingNode();
- if (nnode instanceof Text) {
- currentNode = (Text) nnode;
- offsets[1] -= offsets[0] > 0 ? offsets[0] : 0;
- }
- } else {
- // setOperationPosition(new DOMRefPosition(currentNode, false));
- if (currentNode.getPreviousSibling() != null) {
- setOperationPosition(new DOMRefPosition(currentNode
- .getPreviousSibling(), true));
- } else {
- setOperationPosition(new DOMPosition(currentNode
- .getParentNode(), 0));
- }
- }
- // right index
- if (location2 >= EditHelper.IN_MIDDLE) {
- IDOMPosition position = new DOMPosition(currentNode, offsets[1]);
- position = DOMPositionHelper.splitText(position);
- second = position.getPreviousSiblingNode();
- }
- return second != null ? (Text) EditHelper.deleteNode(second) : null;
- }
- setOperationPosition(new DOMRefPosition(currentNode, false));
- return (Text) EditHelper.deleteNode(currentNode);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/DesignEdit.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/DesignEdit.java
deleted file mode 100644
index cba2d46..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/DesignEdit.java
+++ /dev/null
@@ -1,480 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.range;
-
-import java.util.Stack;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.gef.dnd.TemplateTransfer;
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.css2.CSSUtil;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.dom.DOMRange;
-import org.eclipse.jst.pagedesigner.dom.EditHelper;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.eclipse.jst.pagedesigner.dom.EditValidateUtil;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.jst.pagedesigner.utils.DOMUtil;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-/**
- * @author mengbo
- */
-public abstract class DesignEdit {
-
- private Stack _selections;
-
- private DOMRange _range;
-
- private GraphicalViewer _viewer;
-
- private IDOMPosition _operationPosition;
-
- private final Document _document;
-
- private Stack _processedResult;
-
- /**
- * @param range
- * @param viewer
- */
- public DesignEdit(DOMRange range, GraphicalViewer viewer) {
- setRange(range);
- _viewer = viewer;
- _operationPosition = getRange().getStartPosition();
- _document = ((IDOMNode) _operationPosition.getContainerNode())
- .getModel().getDocument();
- }
-
-
- /**
- * @return the target document
- */
- protected final Document getDocument() {
- return _document;
- }
-
- /**
- * @return the result
- */
- protected abstract boolean operate();
-
- /**
- * @param node
- * @return the text
- */
- protected abstract Text processText(WorkNode node);
-
- /**
- * @param node
- * @return the node
- */
- protected abstract Node processNode(WorkNode node);
-
- /**
- * @param node
- * @return the node
- */
- protected abstract Node processContainer(WorkNode node);
-
- /**
- * @return the dom range
- */
- public DOMRange getRange() {
- return _range;
- }
-
- void setRange(DOMRange range) {
- range = EditHelper.normal(range);
- IDOMPosition start = EditHelper.ensureDOMPosition(range
- .getStartPosition());
- IDOMPosition end = EditHelper.ensureDOMPosition(range.getEndPosition());
- _range = new DOMRange(start, end);
- EditValidateUtil.validRange(range);
- }
-
- /**
- * @return the clipboard
- */
- protected Clipboard getClipboard() {
- return new Clipboard(_viewer.getControl().getDisplay());
- }
-
- /**
- * @return the position
- */
- public IDOMPosition getOperationPosition() {
- // try
- // {
- // Assert.isTrue(_operationPosition != null &&
- // _operationPosition.getContainerNode() != null &&
- // _operationPosition.getOffset() > -1);
- // if (_operationPosition.isText())
- // {
- // int length = ((Text)
- // _operationPosition.getContainerNode()).getLength();
- // Assert.isTrue(_operationPosition.getOffset() >= 0 &&
- // _operationPosition.getOffset() <= length);
- // }
- // }
- // catch (Exception e)
- // {
- // // "Error", "Error in operation location move"
- // PDPlugin.getAlerts().confirm("Alert.DesignEdit.opLocationValidTitle",
- // "Alert.DesignEdit.opLocationValidMessage"); //$NON-NLS-1$
- // //$NON-NLS-2$
- // }
-
- return _operationPosition;
- }
-
- /**
- * @param position
- */
- protected void setOperationPosition(IDOMPosition position) {
- if (!EditValidateUtil.validPosition(position)) {
- return;
- }
- position = EditHelper.ensureDOMPosition(position);
- _operationPosition = position;
- }
-
- /**
- * @return the result of performing the edit
- */
- public boolean perform() {
- boolean result = false;
-
- result = operate();
- return result;
- }
-
- /**
- * @return Returns the _viewer.
- */
- public GraphicalViewer getViewer() {
- return _viewer;
- }
-
- private Stack collectNodes() {
- Node node;
- Stack result = new Stack();
- IDOMPosition start = getRange().getStartPosition(), end = getRange()
- .getEndPosition();
- int pos[] = new int[] { EditModelQuery.getIndexedRegionLocation(start),
- EditModelQuery.getIndexedRegionLocation(end), };
- if (!EditModelQuery.isSame(start, end)) {
- Node ancestor = EditModelQuery.getInstance().getCommonAncestor(
- start, end);
- WorkNode rootWorkNode = new WorkNode(ancestor, pos[0], pos[1]);
- rootWorkNode.setRoot(true);
- result.push(rootWorkNode);
- try {
- // Loop all the children of the ancestor, and and the result
- // will be collected
- if (EditModelQuery.isText(ancestor)) {
- Stack temp = new Stack();
- EditHelper.getInstance().collectNodes(ancestor, pos[0],
- pos[1], ancestor, temp);
- WorkNode wNode = (WorkNode) temp.remove(0);
- wNode.setParent(rootWorkNode);
- result.push(wNode);
- } else {
- node = ancestor.getFirstChild();
- Stack temp = new Stack();
- while (node != null) {
- EditHelper.getInstance().collectNodes(node, pos[0],
- pos[1], ancestor, temp);
- while (temp.size() > 0) {
- WorkNode wNode = (WorkNode) temp.remove(0);
- if (wNode.getNode().getParentNode() == ancestor) {
- wNode.setParent(rootWorkNode);
- }
- result.push(wNode);
- }
- node = node.getNextSibling();
- }
- }
- } catch (Exception e) {
- result.clear();
- }
- }
- return result;
- }
-
- /**
- * @return Returns the result.
- */
- public Stack getSelections() {
- if (_selections == null) {
- _selections = collectNodes();
- }
- return _selections;
- }
-
- /**
- * @return the result stack
- */
- public Stack getProcessedResult() {
- if (_processedResult == null) {
- _processedResult = new Stack();
- WorkNode rootNode = getRootWorkNode();
- if (rootNode != null) {
- processNodes(rootNode, _processedResult);
- }
- }
- return _processedResult;
- }
-
- /**
- * @return the root work node
- */
- protected final WorkNode getRootWorkNode() {
- WorkNode result = null;
- if (getSelections().size() > 0) {
- WorkNode node = (WorkNode) getSelections().get(0);
- while (node.getParent() != null) {
- node = node.getParent();
- }
- result = node;
- Assert.isTrue(node.isRoot());
- }
- return result;
- }
-
- /**
- * @param node
- * @param result
- * @return true if node
- */
- private final boolean processText(WorkNode node, Stack result) {
- boolean done = false;
- if (EditModelQuery.isText(node.getNode())) {
- Node text = processText(node);
- if (text != null) {
- result.add(text);
- }
- getSelections().remove(node);
- done = true;
- }
- return done;
- }
-
- /**
- * @param node
- * @param result
- */
- private final void processContainer(WorkNode node, Stack result) {
- processContainer(node);
- getSelections().remove(node);
- }
-
- /**
- * @param node
- * @param result
- * @return true if done
- */
- private final boolean processChildren(WorkNode node, Stack result) {
- boolean done = false;
- if (getFirstSelectedChild(node) != null) {
- Stack myResult = new Stack();
- {
- WorkNode child = null;
- while ((child = getFirstSelectedChild(node)) != null) {
- {
- processNodes(child, myResult);
- }
- }
- Node newParent = processContainer(node);
- newParent = toBeParent(newParent, myResult);
- result.push(newParent);
- }
- getSelections().remove(node);
- done = true;
- }
- return done;
- }
-
- /**
- * @param node
- * @param result
- * @return true if done
- */
- private final boolean processChildren1(WorkNode node, Stack result) {
- boolean done = false;
- if (node.getNode().hasChildNodes()) {
- Stack myResult = new Stack();
- {
- Node childNode = node.getNode().getFirstChild();
- Node next = null;
- while (childNode != null) {
- next = childNode.getNextSibling();
- int x1 = EditModelQuery.getNodeStartIndex(childNode) - 1;
- int x2 = EditModelQuery.getNodeEndIndex(childNode) + 1;
- processNodes(new WorkNode(childNode, x1, x2), myResult);
- childNode = next;
- }
- Node newParent = processContainer(node);
- newParent = toBeParent(newParent, myResult);
- result.push(newParent);
- }
- getSelections().remove(node);
- done = true;
- }
- return done;
- }
-
- /**
- * Process the nodes that are selected, the result is a collection of nodes
- * that either are clones or the nodes cuted.
- *
- * @param node
- * @param result
- */
- protected final void processNodes(WorkNode node, Stack result) {
- WorkNode child = null;
- if (node.isRoot()) {
- while ((child = getFirstSelectedChild(node)) != null) {
- processNodes(child, result);
- }
- } else {
- if (node.isWholeSelected()
- || //
- (!EditModelQuery.isText(node.getNode()) && EditModelQuery
- .getInstance().isSingleRegionNode(node.getNode()))
- || //
- EditModelQuery.isWidget(node.getNode())) {
- Node temp = processNode(node);
- if (temp != null) {
- result.push(temp);
- getSelections().remove(node);
- } else {
- if (!processText(node, result)) {
- if (!processChildren1(node, result)) {
- processContainer(node, result);
- }
- }
- }
- } else {
- if (!processText(node, result)) {
- if (!processChildren(node, result)) {
- processContainer(node, result);
- }
- }
- }
- }
- }
-
- /**
- * @param result
- */
- protected void setClipboard(Stack result) {
- Node[] nodes = (Node[]) result.toArray(new Node[result.size()]);
- StringBuffer sb = new StringBuffer();
- for (int i = 0, size = nodes.length; i < size; i++) {
- DOMUtil.nodeToString(nodes[i], sb);
- }
- getClipboard().setContents(
- new Object[] { result, sb.toString() },
- new Transfer[] { TemplateTransfer.getInstance(),
- TextTransfer.getInstance() });
- }
-
- private Node toBeParent(Node parent, Stack children) {
- while (children.size() > 0) {
- parent.appendChild((Node) children.remove(0));
- }
- return parent;
- }
-
- private WorkNode getFirstSelectedChild(WorkNode node) {
- for (int i = 0, n = getSelections().size(); i < n; i++) {
- WorkNode wNode = (WorkNode) getSelections().get(i);
- if (wNode.getParent() == node) {
- return wNode;
- }
- }
- return null;
- }
-
- /**
- * @param rootNode
- * @param result
- * @return the node
- */
- Node collectStyleNodes(Node rootNode, Vector result) {
- Element element = null;
- if (rootNode instanceof Element) {
- element = (Element) rootNode;
- } else if (rootNode.getParentNode() != null) {
- element = (Element) rootNode.getParentNode();
- }
- ICSSStyle style = CSSUtil.getCSSStyle(element);
-
- Node node = EditModelQuery.getDocumentNode(rootNode).createElement(
- "span");
- for (int i = 0, n = result.size(); i < n; i++) {
- node.appendChild((Node) result.elementAt(i));
- }
- ((Element) node).setAttribute(IHTMLConstants.ATTR_STYLE, CSSUtil
- .resolveCSSStyle(style));
- result.removeAllElements();
- result.add(node);
- return node;
- }
-
- /**
- * @param rootNode
- * @param result
- * @return the node
- */
- protected final Node collectOtherStyles(Node rootNode, Vector result) {
- Node cur = rootNode, prev = null, appendPoint = null;
- if (EditValidateUtil.validNode(rootNode)) {
- while (!EditModelQuery.isDocument(cur)) {
- if (!EditValidateUtil.validNode(cur)) {
- return null;
- }
- String name = cur.getNodeName() != null ? cur.getNodeName()
- .toLowerCase() : "";
- if (EditModelQuery.HTML_STYLE_NODES.contains(name)) {
- if (prev != null) {
- Node newone = cur.cloneNode(false);
- newone.appendChild(prev);
- prev = newone;
- } else {
- prev = cur.cloneNode(false);
- appendPoint = prev;
- }
- }
- cur = cur.getParentNode();
- }
- if (appendPoint != null) {
- for (int i = 0, n = result.size(); i < n; i++) {
- appendPoint.appendChild((Node) result.elementAt(i));
- }
- result.removeAllElements();
- result.add(prev);
- }
- }
- return prev;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/IInputSourceProvider.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/IInputSourceProvider.java
deleted file mode 100644
index 9922329..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/IInputSourceProvider.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.range;
-
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- */
-public interface IInputSourceProvider {
- /**
- * @return Returns the _data.
- */
- public Node[] getNodes();
-
- /**
- * @return the string data
- */
- public String getStringData();
-
- /**
- * @return the character data
- */
- public Character getCharacterData();
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/InsertCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/InsertCommand.java
deleted file mode 100644
index 0723268..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/InsertCommand.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.range;
-
-import org.eclipse.jst.pagedesigner.commands.nav.ICaretPositionMover;
-import org.eclipse.jst.pagedesigner.dom.DOMRange;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-
-/**
- * @author mengbo
- */
-public class InsertCommand extends RangeModeCommand implements
- ICaretPositionMover {
-
- private IInputSourceProvider _data;
-
- /**
- * @param label
- * @param viewer
- * @param data
- */
- public InsertCommand(String label, IHTMLGraphicalViewer viewer,
- IInputSourceProvider data) {
- super(label, viewer);
- _data = data;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.range.RangeModeCommand#doRangeExecute(org.eclipse.jst.pagedesigner.dom.DOMRange)
- */
- protected DOMRange doRangeExecute(DOMRange selection) {
- DesignEdit edit = null;
- edit = new InsertEdit(selection, getViewer(), _data);
- edit.perform();
- selection = new DOMRange(edit.getOperationPosition(), edit
- .getOperationPosition());
- return selection;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/InsertEdit.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/InsertEdit.java
deleted file mode 100644
index bcf96eb..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/InsertEdit.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.range;
-
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.jst.jsf.core.internal.tld.ITLDConstants;
-import org.eclipse.jst.pagedesigner.dom.DOMPosition;
-import org.eclipse.jst.pagedesigner.dom.DOMPositionHelper;
-import org.eclipse.jst.pagedesigner.dom.DOMRange;
-import org.eclipse.jst.pagedesigner.dom.DOMRefPosition;
-import org.eclipse.jst.pagedesigner.dom.DOMUtil;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.jst.pagedesigner.jsp.core.IJSPCoreConstants;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-/**
- * InsertEdit will perform action at a single location, the data souce could be
- * clipboard or keyboard.
- *
- * @author mengbo
- */
-public class InsertEdit extends DeleteEdit {
- private IInputSourceProvider _data;
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.range.DesignEdit#operate()
- */
- public boolean operate() {
- DOMRange range = getRange();
- if (!EditModelQuery.isSame(range.getStartPosition(), range
- .getEndPosition())) {
- deleteRange();
- range = new DOMRange(getOperationPosition(), getOperationPosition());
- setRange(range);
- }
- if (insertNodes()) {
- return true;
- } else if (insertString()) {
- return true;
- } else {
- return insertChar();
- }
- }
-
- /**
- * @param range
- * @param viewer
- * @param data
- */
- public InsertEdit(DOMRange range, GraphicalViewer viewer,
- IInputSourceProvider data) {
- super(range, viewer);
- _data = data;
- }
-
- /**
- * @param position
- * @param viewer
- * @param data
- */
- public InsertEdit(IDOMPosition position, GraphicalViewer viewer,
- IInputSourceProvider data) {
- super(new DOMRange(position, position), viewer);
- setOperationPosition(position);
- _data = data;
- }
-
- /**
- * @return ??
- */
- public boolean insertChar() {
- if (_data.getStringData() == null) {
- return false;
- }
- IDOMPosition position = getOperationPosition();
- if (position.isText()) {
- Text text = EditModelQuery.getInstance().getText(position);
- text.insertData(getOperationPosition().getOffset(), _data
- .getCharacterData().toString());
- setOperationPosition(new DOMPosition(text, position.getOffset() + 1));
- } else {
- Node refNode = position.getNextSiblingNode();
- Text text = getDocument().createTextNode(_data.getCharacterData()
- .toString());
- position.getContainerNode().insertBefore(text, refNode);
- setOperationPosition(new DOMPosition(text, text.getLength()));
- }
- return true;
- }
-
- /**
- * @return ????
- */
- public boolean insertString() {
- String content = _data.getStringData();
- if (content != null) {
- IDOMPosition position = getOperationPosition();
- if (position.isText()) {
- Text text = EditModelQuery.getInstance().getText(position);
- text.insertData(getOperationPosition().getOffset(), content);
- setOperationPosition(new DOMPosition(text, position.getOffset()
- + content.length()));
- } else {
- Node refNode = position.getNextSiblingNode();
- Text text = getDocument().createTextNode(content);
- position.getContainerNode().insertBefore(text, refNode);
- setOperationPosition(new DOMPosition(text, text.getLength()));
- }
- return true;
- }
- return false;
- }
-
- private boolean insertNodes() {
- Node[] nodes = _data.getNodes();
- if (nodes == null) {
- return false;
- }
- IDOMPosition position = getOperationPosition();
- if (position == null) {
- return false;
- }
- Node refNode = null;
- if (position.isText()) {
- position = DOMPositionHelper.splitText(position);
- }
- refNode = position.getNextSiblingNode();
- Node parent = position.getContainerNode();
- Node node = null;
- for (int i = 0; i < nodes.length; i++) {
- node = DOMUtil.cloneNodeDeep(getDocument(), nodes[i]);
- String prefix = node.getPrefix();
- String name = node.getLocalName();
- if (name != null
- && ITLDConstants.URI_JSP.equals(prefix)
- && (node.getLocalName().startsWith(
- IJSPCoreConstants.TAG_LEADING_DIRECTIVE)
- || IJSPCoreConstants.TAG_DECLARATION.equals(name)
- || IJSPCoreConstants.TAG_EXPRESSION.equals(name) || IJSPCoreConstants.TAG_SCRIPTLET
- .equals(name))) {
- // it is a jsp tag
- ((IDOMElement) node).setJSPTag(true);
- }
- node = parent.insertBefore(node, refNode);
- }
-
- if (node != null) {
- setOperationPosition(new DOMRefPosition(node, true));
- } else if (refNode != null) {
- setOperationPosition(new DOMRefPosition(refNode, false));
- } else {
- setOperationPosition(new DOMRefPosition(parent.getLastChild(), true));
- }
- return true;
- }
-
- // TODO: dead?
-// private boolean splitNode() {
-// if ((getViewer()).getSelection() instanceof DesignRange
-// && _data.getCharacterData() != null
-// && _data.getCharacterData().charValue() == '\r') {
-// DesignRange range = (DesignRange) (getViewer()).getSelection();
-// Node node = range.getStartPosition().getContainerNode();
-// if (EditModelQuery.isText(node)) {
-// node = node.getParentNode();
-// }
-// if (EditModelQuery.isListItem(node)) {
-// IDOMPosition position = DOMPositionHelper.toDOMPosition(range
-// .getStartPosition());
-// // split text and it's parent.
-// position = EditHelper.splitNode(position);
-// position = EditHelper.splitNode(position);
-// position = EditHelper.moveInto(position.getNextSiblingNode(),
-// new InlineEditingNavigationMediator(new ActionData(
-// ActionData.INLINE_EDIT, null)), true);
-// setOperationPosition(position);
-// return true;
-// }
-// }
-// return false;
-// }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/KeyboardData.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/KeyboardData.java
deleted file mode 100644
index 7f194bc..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/KeyboardData.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.range;
-
-import org.eclipse.gef.DefaultEditDomain;
-import org.eclipse.gef.EditDomain;
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.eclipse.jst.pagedesigner.editors.HTMLEditor;
-import org.eclipse.swt.SWT;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- */
-public class KeyboardData implements IInputSourceProvider {
- private Character _keyCode;
-
- private int _stateMask;
-
- private GraphicalViewer _viewer;
-
- /**
- * @param code
- * @param mask
- * @param viewer
- */
- public KeyboardData(char code, int mask, GraphicalViewer viewer) {
- if ((mask & SWT.SHIFT) != 0) {
- _keyCode = new Character(Character.toUpperCase(code));
- } else {
- _keyCode = new Character(code);
- }
- _stateMask = mask;
- _viewer = viewer;
- }
-
- /**
- * @return Returns the keyCode.
- */
- public int getKeyCode() {
- return _keyCode.charValue();
- }
-
- /**
- * @param keyCode
- * The keyCode to set.
- */
- public void setKeyCode(char keyCode) {
- this._keyCode = new Character(keyCode);
- }
-
- /**
- * @return Returns the stateMask.
- */
- public int getStateMask() {
- return _stateMask;
- }
-
- /**
- * @param stateMask
- * The stateMask to set.
- */
- public void setStateMask(int stateMask) {
- this._stateMask = stateMask;
- }
-
- /**
- * @param keyCode
- * @return the node or null
- */
- public Node getSpecialNode(KeyboardData keyCode) {
- Object name;
- EditDomain domain = _viewer.getEditDomain();
- Document document = null;
- if (domain instanceof DefaultEditDomain) {
- document = ((HTMLEditor) (((DefaultEditDomain) domain)
- .getEditorPart())).getDOMDocument();
- }
- // if ((keyCode.getStateMask() & SWT.SHIFT) != 0)
- {
- if ((name = EditModelQuery.CHAR_NODE_MAP.get(keyCode
- .getCharacterData())) != null) {
- return document.createElement((String) name);
- }
- }
- return null;
- }
-
- /**
- * @return Returns the _data.
- */
- public Node[] getNodes() {
- Node node = getSpecialNode(this);
- if (node != null) {
- return new Node[] { node };
- }
- return null;
- }
-
- public String getStringData() {
- return _keyCode.toString();
- }
-
- // public Key
- public Character getCharacterData() {
- return _keyCode;
- }
-
- /**
- * @return the char value of the key code
- */
- public char getChar() {
- return _keyCode.charValue();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/Paragraph.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/Paragraph.java
deleted file mode 100644
index c3757d0..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/Paragraph.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.range;
-
-import org.eclipse.jst.pagedesigner.dom.DOMRange;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- */
-public class Paragraph {
- private DOMRange _range;
-
- /**
- * @param start
- * @param end
- */
- public Paragraph(IDOMPosition start, IDOMPosition end) {
- _range = new DOMRange(start, end);
- }
-
- /**
- * @return the lowest container node
- */
- public Node getLowestContainer() {
- return EditModelQuery.getInstance().getCommonAncestor(
- _range.getStartPosition(), _range.getEndPosition());
- }
-
- /**
- * @return Returns the _end.
- */
- public final IDOMPosition getStart() {
- return _range.isOrdered() ? _range.getStartPosition() : _range
- .getEndPosition();
- }
-
- /**
- * @return Returns the _start.
- */
- public final IDOMPosition getEnd() {
- return _range.isOrdered() ? _range.getEndPosition() : _range
- .getStartPosition();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/ParagraphApplyStyleCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/ParagraphApplyStyleCommand.java
deleted file mode 100644
index 16a0d05..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/ParagraphApplyStyleCommand.java
+++ /dev/null
@@ -1,408 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.range;
-
-import java.util.Arrays;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.gef.EditPart;
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.dom.DOMPosition;
-import org.eclipse.jst.pagedesigner.dom.DOMPositionHelper;
-import org.eclipse.jst.pagedesigner.dom.DOMRange;
-import org.eclipse.jst.pagedesigner.dom.DOMRefPosition;
-import org.eclipse.jst.pagedesigner.dom.DOMUtil;
-import org.eclipse.jst.pagedesigner.dom.EditHelper;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.jst.pagedesigner.dom.IDOMRefPosition;
-import org.eclipse.jst.pagedesigner.parts.TextEditPart;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-/**
- * @author mengbo
- */
-public class ParagraphApplyStyleCommand extends ApplyStyleCommand {
-
- /**
- * the list of possible html heading tags
- */
- private static final String[] HH = { "h1", "h2", "h3", "h4", "h5", "h6" };
-
- /**
- * @param viewer
- * @param tag
- * @param property
- * @param value
- */
- public ParagraphApplyStyleCommand(IHTMLGraphicalViewer viewer, String tag,
- String property, String value) {
- super(viewer, tag, property, value);
- }
-
- /**
- * @param viewer
- * @param node
- * @param property
- * @param value
- */
- public ParagraphApplyStyleCommand(IHTMLGraphicalViewer viewer,
- Element node, String property, String value) {
- super(viewer, node, property, value);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.range.RangeModeCommand#doRangeExecute(org.eclipse.jst.pagedesigner.dom.DOMRange)
- */
- protected DOMRange doRangeExecute(DOMRange range) {
- if (range != null) {
- boolean ordered = range.isOrdered();
- IDOMPosition start = ordered ? range.getStartPosition() : range
- .getEndPosition();
- IDOMPosition end = ordered ? range.getEndPosition() : range
- .getStartPosition();
- Node common = null;
- Node container = null;
- if (EditModelQuery.isSame(range)) {
- container = start.getContainerNode();
- ParagraphFinder finder = new ParagraphFinder(start);
- Paragraph p = finder.getParagraph(start);
- start = p.getStart();
- end = p.getEnd();
- common = p.getLowestContainer();
- } else {
- common = EditModelQuery.getInstance().getCommonAncestor(start,
- end);
- }
- DOMRange rt;
- // This code is for h1-h6 only, it may need to be replaced.
- if ((rt = replaceExistingH(start, end)) != null) {
- return rt;
- }
- // replace existing p
- if (getTag().equalsIgnoreCase(IHTMLConstants.TAG_P)) {
- rt = replaceExistingP(start, end);
- if (rt != null) {
- return rt;
- }
- }
- if (start.getContainerNode() == end.getContainerNode()) {
- int offset1 = start.getOffset();
- int offset2 = end.getOffset();
- IDOMPosition old = start;
- start = split(start);
- // parent is splited
- if (start != old) {
- container = start.getNextSiblingNode();
- offset2 -= offset1;
- end = new DOMPosition(container, offset2);
- }
- end = split(end);
- } else {
- start = split(common, start);
- end = split(common, end);
- }
- range = InsertStyleTag(new DOMRange(start, end));
- }
- return range;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.commands.Command#canExecute()
- */
- public boolean canExecute() {
- return true;
- }
-
- /*
- * Try to split the node so that we can avoid wrap its children directly.
- * Begining from 'position' the split can reach as high as the level of
- * 'common'.
- */
- private IDOMPosition split(Node common, IDOMPosition position) {
- Assert.isTrue(EditModelQuery.isChild(common, position
- .getContainerNode()));
- Node container = position.getContainerNode();
- String[] styleNodes = new String[EditModelQuery.HTML_STYLE_NODES.size()];
- EditModelQuery.HTML_STYLE_NODES.toArray(styleNodes);
- while (EditModelQuery.isText(container) || (container != common && //
- EditModelQuery.containItem(styleNodes, container, true))) {
- IDOMPosition old = position;
- position = EditHelper.splitNode(position);
- if (old == position) {
- int pos = EditHelper.getLocation(position);
- switch (pos) {
- case -1:
- position = new DOMRefPosition(position.getContainerNode(),
- false);
- break;
- case 1:
- position = new DOMRefPosition(position.getContainerNode(),
- true);
- }
- }
- Node containerBackup = container;
- container = container.getParentNode();
- if (containerBackup.getNodeName().equalsIgnoreCase(
- IHTMLConstants.TAG_P)) {
- container.removeChild(containerBackup);
- }
- }
- return position;
- }
-
- /*
- * Split the position's container node only.
- */
- private IDOMPosition split(IDOMPosition position) {
- Node container = position.getContainerNode();
- String[] styleNodes = new String[EditModelQuery.HTML_STYLE_NODES.size()];
- EditModelQuery.HTML_STYLE_NODES.toArray(styleNodes);
- if (EditModelQuery.isText(container)
- || EditModelQuery.containItem(styleNodes, container, true)) {
- return EditHelper.splitNode(position);
- }
- return position;
- }
-
- private DOMRange replaceExistingH(IDOMPosition start, IDOMPosition end) {
- Node common = EditModelQuery.getInstance()
- .getCommonAncestor(start, end);
- // Here we insert some code to avoid creating tags duplicated. but these
- // are not the entire cases.
- if (Arrays.asList(HH).contains(
- getAName(getTag()).toLowerCase())
- && Arrays.asList(HH).contains(
- getAName(common.getNodeName()).toLowerCase())) {
- // uncheck action menu
- if (getAName(getTag()).toLowerCase().equalsIgnoreCase(
- getAName(common.getNodeName()).toLowerCase())) {
- NodeList nodes = common.getChildNodes();
-
- for (int i = 0, size = nodes.getLength(); i < size; i++) {
- common.getParentNode().insertBefore(nodes.item(i), common);
- }
- common.getParentNode().removeChild(common);
- return new DOMRange(start, end);
- }
- start = DOMPositionHelper.toDOMRefPosition(start);
- end = DOMPositionHelper.toDOMRefPosition(end);
- Node newHNode = EditModelQuery.getDocumentNode(common)
- .createElement(getTag());
- EditModelQuery.copyChildren(common, newHNode);
- common.getParentNode().replaceChild(newHNode, common);
- return new DOMRange(start, end);
- }
- return null;
- }
-
- private DOMRange replaceExistingP(IDOMPosition start, IDOMPosition end) {
- // find the selected startNode,endNode and start node's parent node
- Node startNode = start instanceof IDOMRefPosition ? start
- .getNextSiblingNode() : start.getContainerNode();
- Node endNode = end instanceof IDOMRefPosition ? end
- .getPreviousSiblingNode() : end.getContainerNode();
- Node parentNode = startNode.getParentNode();
-
- if (!(start.isText()) && start instanceof DOMPosition) {
- startNode = startNode.getChildNodes().item(start.getOffset());
- parentNode = start.getContainerNode();
- }
- if (!(end.isText()) && end instanceof DOMPosition) {
- // because the offset is based on the position between nodes,so we
- // need to reduce one from the offset
- // in order to get the correct end node.
- endNode = endNode.getChildNodes().item(end.getOffset() - 1);
- }
-
- // compute selected character number in the text or selected element
- // number under a node
- int len = 0;
-// if (start instanceof DOMPosition && end instanceof DOMPosition
-// || start instanceof IDOMPosition && end instanceof IDOMPosition) {
- // TODO: as written, this will be the only statement run, since
- // both start and end are instanceof IDOMPosition by defn.
- len = end.getOffset() - start.getOffset();
-// } else {
-// IDOMRefPosition startRef = null;
-// IDOMRefPosition endRef = null;
-// if (!(start.isText()) && start instanceof DOMPosition) {
-// startRef = new DOMRefPosition(startNode, false);
-// } else if (!(end.isText()) && end instanceof DOMPosition) {
-// endRef = new DOMRefPosition(endNode, true);
-// }
-// len = (endRef != null ? endRef.getOffset() : end.getOffset())
-// - (startRef != null ? startRef.getOffset() : start
-// .getOffset());
-// }
-
- // if a full Text node is selected,and the Text node is the only child
- // of its parent
- if ((startNode == endNode) && (startNode instanceof Text)) {
- TextEditPart part = (TextEditPart) ((INodeNotifier) startNode)
- .getAdapterFor(EditPart.class);
- boolean condition = false;
- if (start instanceof IDOMRefPosition
- || (start instanceof DOMPosition && !start.isText())) {
- condition = parentNode.getNodeName().equalsIgnoreCase(
- IHTMLConstants.TAG_P)
- && parentNode.getChildNodes().getLength() == 1;
- } else {
- condition = parentNode.getNodeName().equalsIgnoreCase(
- IHTMLConstants.TAG_P)
- && parentNode.getChildNodes().getLength() == 1
- && part.getTextData().length() == len;
- }
- if (condition) {
- // if uncheck the align action
- if (this.getApplyingNode()
- .getAttribute(IHTMLConstants.ATTR_ALIGN)
- .equals(
- ((Element) parentNode)
- .getAttribute(IHTMLConstants.ATTR_ALIGN))) {
- ((Element) parentNode)
- .removeAttribute(IHTMLConstants.ATTR_ALIGN);
- IDOMPosition startPos = new DOMPosition(parentNode, 0);
- IDOMPosition endPos = new DOMRefPosition(endNode, true);
- return new DOMRange(startPos, endPos);
- }
- // else replace the align attribute
- /**
- * this._applyingNode.appendChild(startNode);
- * parentNode.getParentNode().replaceChild(this._applyingNode,
- * parentNode);
- */
- String align = this.getApplyingNode()
- .getAttribute(IHTMLConstants.ATTR_ALIGN);
- ((Element) parentNode).setAttribute(IHTMLConstants.ATTR_ALIGN,
- align);
-
- IDOMPosition startPos = new DOMPosition(parentNode, 0);
- IDOMPosition endPos = new DOMRefPosition(endNode, true);
- return new DOMRange(startPos, endPos);
- }
- } else {
- if (parentNode != null
- && parentNode.getNodeName().equalsIgnoreCase(
- IHTMLConstants.TAG_P)
- && parentNode.getChildNodes().getLength() == len) {
- if (this.getApplyingNode()
- .getAttribute(IHTMLConstants.ATTR_ALIGN)
- .equals(
- ((Element) parentNode)
- .getAttribute(IHTMLConstants.ATTR_ALIGN))) {
- ((Element) parentNode)
- .removeAttribute(IHTMLConstants.ATTR_ALIGN);
- IDOMPosition startPos = new DOMPosition(parentNode, 0);
- IDOMPosition endPos = new DOMRefPosition(endNode, true);
- return new DOMRange(startPos, endPos);
- }
-
- /**
- * Node sibling = startNode.getNextSibling();
- * this._applyingNode.appendChild(startNode); Node
- * endNodeSibling = endNode.getNextSibling(); while (sibling !=
- * null && startNode != endNode && sibling != endNodeSibling) {
- * Node tempNode = sibling.getNextSibling();
- * this._applyingNode.appendChild(sibling); sibling = tempNode; }
- * parentNode.getParentNode().replaceChild(this._applyingNode,
- * parentNode);
- */
- String align = this.getApplyingNode()
- .getAttribute(IHTMLConstants.ATTR_ALIGN);
- ((Element) parentNode).setAttribute(IHTMLConstants.ATTR_ALIGN,
- align);
-
- IDOMPosition startPos = new DOMPosition(parentNode, 0);
- IDOMPosition endPos = new DOMRefPosition(endNode, true);
- return new DOMRange(startPos, endPos);
- }
- }
- return null;
- }
-
- private DOMRange InsertStyleTag(DOMRange range) {
- if (range == null || range.isEmpty()) {
- return null;
- }
-
- boolean ordered = range.isOrdered();
- IDOMPosition start = ordered ? range.getStartPosition() : range
- .getEndPosition();
- IDOMPosition end = ordered ? range.getEndPosition() : range
- .getStartPosition();
-
- Node startContainer = start.getContainerNode();
- Node endContainer = end.getContainerNode();
-
- Node common = DOMUtil.findCommonAncester(start.getContainerNode(), end
- .getContainerNode());
- if (common == null) {
- // should not happen.
- return null;
- }
- if (startContainer instanceof Text) {
- // if the start offset is 0,then skip split the Text
- if (start.getOffset() > 0) {
- startContainer = ((Text) startContainer).splitText(start
- .getOffset());
- start = new DOMRefPosition(startContainer, false);
- }
- } else {
- startContainer = start.getNextSiblingNode();
- }
- if (endContainer instanceof Text) {
- if (end.getOffset() > 0) {
- endContainer = ((Text) endContainer).splitText(end
- .getOffset());
- endContainer = endContainer.getPreviousSibling();
- } else {
- endContainer = endContainer.getPreviousSibling();
- }
- } else {
- endContainer = end.getPreviousSiblingNode();
- }
-
- // now the startContainer and the endContainer should share the same
- // parent
- Element newNode = createStyleElement();
- startContainer.getParentNode()
- .insertBefore(newNode, startContainer);
-
- Node sibling = startContainer.getNextSibling();
- newNode.appendChild(startContainer);
- Node endNodeSibling = endContainer.getNextSibling();
- while (sibling != null && startContainer != endContainer
- && sibling != endNodeSibling) {
- Node tempNode = sibling.getNextSibling();
- newNode.appendChild(sibling);
- sibling = tempNode;
- }
-
- IDOMPosition startPos = new DOMPosition(newNode, 0);
- IDOMPosition endPos = new DOMRefPosition(endContainer, true);
- return new DOMRange(startPos, endPos);
- }
-
- private static String getAName(String name) {
- return name == null ? "" : name;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/ParagraphFinder.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/ParagraphFinder.java
deleted file mode 100644
index 1dfda9d..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/ParagraphFinder.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.range;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jst.jsf.core.internal.tld.IJSFConstants;
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.dom.DOMPosition;
-import org.eclipse.jst.pagedesigner.dom.DOMRefPosition;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- */
-public class ParagraphFinder {
- private final IDOMPosition _position;
-
- /**
- * @param position
- */
- public ParagraphFinder(IDOMPosition position) {
- _position = position;
- }
-
- /**
- * @return the dom position
- */
- public IDOMPosition getPosition() {
- return _position;
- }
-
- private Node findInlineSiblings(IDOMPosition position, List result,
- boolean forward) {
- Node container = EditModelQuery.getInstance().getSibling(position,
- forward);
- if (!forward) {
- while (container != null) {
- if (EditModelQuery.isInline(container)) {
- result.add(container);
- } else {
- return container;
- }
- container = container.getPreviousSibling();
- }
- } else {
- while (container != null) {
- if (EditModelQuery.isInline(container)) {
- result.add(container);
- } else {
- return container;
- }
- container = container.getNextSibling();
- }
- }
- // the result will be non-zero length.
- return null;
- }
-
- private Node getParagraphNodes(IDOMPosition position, List result,
- boolean forward) {
- Node sResult = findInlineSiblings(position, result, forward);
- Node container = position.getContainerNode();
- container = position.isText() ? container.getParentNode() : container;
- while (sResult == null) {
- // stop at block, special container and H style nodes.
- if (EditModelQuery.isBlockNode(container)
- || EditModelQuery.isDocument(container)
- || (container.getLocalName() != null && (container
- .getLocalName().equals(IJSFConstants.TAG_VIEW) || container
- .getLocalName().equalsIgnoreCase(
- IHTMLConstants.TAG_HTML)))) {
- return container;
- }
- position = new DOMRefPosition(container, forward);
- sResult = findInlineSiblings(position, result, forward);
- container = container.getParentNode();
- }
- return sResult;
- }
-
- /**
- * Search for an area between two block nodes or within a block node, search
- * will stop before or under a node which has block display-type, or
- * particular container like "html", jsf "view", .etc, two positions (left
- * and right) are returned in result.
- *
- * The searcher will search parent's directly children, if no block node is
- * found, then go up the node tree to search again.
- *
- * @param position
- * @return the paragraph
- */
- public Paragraph getParagraph(IDOMPosition position) {
- List tempResult = new ArrayList();
- IDOMPosition p1, p2;
- Node r1 = getParagraphNodes(position, tempResult, true);
- if (EditModelQuery.isChild(r1, position.getContainerNode())) {
- p1 = new DOMPosition(r1, r1.getChildNodes().getLength());
- } else {
- p1 = new DOMRefPosition(r1, false);
- }
-
- Node r2 = getParagraphNodes(position, tempResult, false);
- if (EditModelQuery.isChild(r2, position.getContainerNode())) {
- p2 = new DOMPosition(r2, 0);
- } else {
- p2 = new DOMRefPosition(r2, true);
- }
- return new Paragraph(p1, p2);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/ParagraphUnapplyStyleCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/ParagraphUnapplyStyleCommand.java
deleted file mode 100644
index c0611c6..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/ParagraphUnapplyStyleCommand.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.range;
-
-import org.eclipse.jst.pagedesigner.dom.DOMPositionHelper;
-import org.eclipse.jst.pagedesigner.dom.DOMRange;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- */
-public class ParagraphUnapplyStyleCommand extends ApplyStyleCommand {
- private String _groupTags[];
-
- /**
- * @param viewer
- * @param tags
- * @param property
- * @param value
- */
- public ParagraphUnapplyStyleCommand(IHTMLGraphicalViewer viewer,
- String[] tags, String property, String value) {
- super(viewer, "", property, value);
- _groupTags = tags;
- }
-
- /**
- * @param viewer
- * @param node
- * @param property
- * @param value
- */
- public ParagraphUnapplyStyleCommand(IHTMLGraphicalViewer viewer,
- Element node, String property, String value) {
- super(viewer, node, property, value);
- }
-
- private DOMRange removeExistingStyles(IDOMPosition start, IDOMPosition end) {
- Node common = null;
- if (EditModelQuery.isSame(start, end)) {
- ParagraphFinder finder = new ParagraphFinder(start);
- Paragraph p = finder.getParagraph(start);
- start = p.getStart();
- end = p.getEnd();
- common = p.getLowestContainer();
- } else {
- common = EditModelQuery.getInstance().getCommonAncestor(start, end);
- }
- // Here we insert some code to avoid creating tags duplicated. but these
- // are not the entire cases.
- // if (Arrays.asList(_groupTags).contains(common.getNodeName()))
- if (EditModelQuery.containItem(_groupTags, common, true)) {
- start = DOMPositionHelper.toDOMRefPosition(start);
- end = DOMPositionHelper.toDOMRefPosition(end);
- Node parent = common.getParentNode();
- EditModelQuery.copyChildren(common, parent);
- common.getParentNode().removeChild(common);
- return new DOMRange(start, end);
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.range.RangeModeCommand#doRangeExecute(org.eclipse.jst.pagedesigner.dom.DOMRange)
- */
- protected DOMRange doRangeExecute(DOMRange range) {
- return removeExistingStyles(range.getStartPosition(), range
- .getEndPosition());
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/PasteCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/PasteCommand.java
deleted file mode 100644
index 5ec0958..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/PasteCommand.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.range;
-
-import org.eclipse.jst.pagedesigner.commands.CommandResources;
-import org.eclipse.jst.pagedesigner.dom.DOMRange;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-
-/**
- * @author mengbo
- */
-public class PasteCommand extends RangeModeCommand {
-
- /**
- * @param viewer
- */
- public PasteCommand(IHTMLGraphicalViewer viewer) {
- super(CommandResources.getString("PasteCommand.Label.Paste"), viewer); //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.range.RangeModeCommand#doRangeExecute(org.eclipse.jst.pagedesigner.dom.DOMRange)
- */
- protected DOMRange doRangeExecute(DOMRange selection) {
- InsertEdit edit = new InsertEdit(selection, getViewer(),
- new ClipboardData(getViewer().getControl()));
- if (edit.operate()) {
- return new DOMRange(edit.getOperationPosition(), edit
- .getOperationPosition());
- }
- return selection;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/RangeModeCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/RangeModeCommand.java
deleted file mode 100644
index 07ce127..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/RangeModeCommand.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.range;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.pagedesigner.commands.DesignerCommand;
-import org.eclipse.jst.pagedesigner.dom.DOMPositionHelper;
-import org.eclipse.jst.pagedesigner.dom.DOMRange;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.eclipse.jst.pagedesigner.dom.EditValidateUtil;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.jst.pagedesigner.parts.ElementEditPart;
-import org.eclipse.jst.pagedesigner.viewer.DesignPosition;
-import org.eclipse.jst.pagedesigner.viewer.DesignRange;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- */
-public abstract class RangeModeCommand extends DesignerCommand {
-// private static final Logger _log = PDPlugin
-// .getLogger(RangeModeCommand.class);
-
- DOMRange _resultRange = null;
-
- /**
- * @param label
- * @param viewer
- */
- public RangeModeCommand(String label, IHTMLGraphicalViewer viewer) {
- super(label, viewer);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.DesignerCommand#prePreExecute()
- */
- protected boolean prePreExecute() {
- int position = -1;
- int length = -1;
- ISelection selection = getViewer().getSelection();
- if (selection != null) {
- if (getViewer().isInRangeMode()) {
- DesignRange range = (DesignRange) selection;
- if (range.isValid()) {
- IDOMPosition domPos = DOMPositionHelper.toDOMPosition(range
- .getStartPosition());
- IDOMPosition domEnd = DOMPositionHelper.toDOMPosition(range
- .getEndPosition());
- if (!EditValidateUtil.validPosition(domPos)
- || !EditValidateUtil.validPosition(domEnd)) {
- return false;
- }
- position = EditModelQuery.getIndexedRegionLocation(domPos);
- int end = EditModelQuery.getIndexedRegionLocation(domEnd);
- if (end < position) {
- length = position - end;
- position = end;
- } else {
- length = end - position;
- }
- }
- } else {
- Object object = ((IStructuredSelection) selection)
- .getFirstElement();
- if (object instanceof ElementEditPart) {
- Node node = ((ElementEditPart) object).getIDOMNode();
- position = EditModelQuery.getNodeStartIndex(node);
- length = EditModelQuery.getNodeLenth(node);
- } else {
- return false;
- }
- }
- if (position >= 0 && length >= 0) {
- getModel().beginRecording(this, getLabel(), position, length);
- } else {
- getModel().beginRecording(this, getLabel());
- }
- getViewer().startSelectionChange();
- getModel().aboutToChangeModel();
- return true;
- }
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.DesignerCommand#doExecute()
- */
- protected final void doExecute() {
- DesignRange range = getViewer().getRangeSelection();
- if (range != null && range.isValid()) {
- DOMRange domrange = (range == null || !range.isValid()) ? null
- : toDOMRange(range);
- _resultRange = doRangeExecute(domrange);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.DesignerCommand#getAfterCommandDesignerSelection()
- */
- protected final ISelection getAfterCommandDesignerSelection() {
-// try {
- if (_resultRange == null) {
- return null;
- }
- IDOMPosition startPos = _resultRange.getStartPosition();
- DesignPosition start = DOMPositionHelper.toDesignPosition(startPos);
- if (_resultRange.isEmpty()) {
- return new DesignRange(start, start);
- }
- IDOMPosition endPos = _resultRange.getEndPosition();
- return new DesignRange(start, DOMPositionHelper
- .toDesignPosition(endPos));
- // TODO: don't know what this exception catch is for
-// } catch (Exception e) {
-// // "Selection error"
-// _log.error("Error.RangeModeCommand.SetSelection"); //$NON-NLS-1$
-// return null;
-// }
- }
-
- /**
- * @param range
- * @return
- */
- private DOMRange toDOMRange(DesignRange range) {
- return new DOMRange(DOMPositionHelper.toDOMPosition(range
- .getStartPosition()), DOMPositionHelper.toDOMPosition(range
- .getEndPosition()));
- }
-
- /**
- * In the implementation of this method, should not do anything relating to
- * EditPart. (maybe even not ICSSStyle, since not style information not
- * refreshed yet)
- * @param selection
- *
- * @return null means no change have been done to the model. In this case,
- * system may choose to cancel undo recorrding, etc.
- */
- protected abstract DOMRange doRangeExecute(DOMRange selection);
-
- /**
- * @param parent
- * @param ref
- * @param child
- */
- protected static void appendChild(Node parent, Node ref, Node child) {
- Node next = ref.getNextSibling();
- if (next == null)
- parent.appendChild(child);
- else
- parent.insertBefore(child, next);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/SelectAllCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/SelectAllCommand.java
deleted file mode 100644
index 4118016..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/SelectAllCommand.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.range;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jst.pagedesigner.dom.DOMPosition;
-import org.eclipse.jst.pagedesigner.dom.DOMPositionHelper;
-import org.eclipse.jst.pagedesigner.dom.EditHelper;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.eclipse.jst.pagedesigner.dom.EditValidateUtil;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.jst.pagedesigner.validation.caret.ActionData;
-import org.eclipse.jst.pagedesigner.validation.caret.IMovementMediator;
-import org.eclipse.jst.pagedesigner.validation.caret.InlineEditingNavigationMediator;
-import org.eclipse.jst.pagedesigner.validation.caret.JSFRootContainerPositionRule;
-import org.eclipse.jst.pagedesigner.validation.caret.RootContainerPositionRule;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- * Called in response to a Ctrl-A-style select all action
- *
- */
-public class SelectAllCommand extends Command {
- private IHTMLGraphicalViewer _viewer;
-
- /**
- * @param label
- * @param viewer
- */
- public SelectAllCommand(String label, IHTMLGraphicalViewer viewer) {
- super(label);
- _viewer = viewer;
- }
-
- public void execute() {
- Node document = _viewer.getModel().getDocument();
- IMovementMediator validator = new InlineEditingNavigationMediator(
- new ActionData(ActionData.KEYBOARD_NAVAGATION, null));
- Node htmlRoot = RootContainerPositionRule
- .getBasicContainer((Document) document);
- Node jsfRoot = JSFRootContainerPositionRule
- .getBasicContainer((Document) document, 3);
- Node root;
- if (htmlRoot != null && jsfRoot != null) {
- if (EditModelQuery.isChild(htmlRoot, jsfRoot)) {
- root = htmlRoot;
- } else if (EditModelQuery.isChild(jsfRoot, htmlRoot)) {
- root = jsfRoot;
- } else {
- root = htmlRoot;
- }
- } else {
- if (htmlRoot != null) {
- root = htmlRoot;
- } else if (jsfRoot != null) {
- root = jsfRoot;
- } else {
- root = document;
- }
- }
- IDOMPosition position1, position2;
- // if (root.hasChildNodes())
- // {
- // Node first = root.getFirstChild();
- // position1 = new DOMRefPosition(first, false);
- // Node last = root.getLastChild();
- // position2 = new DOMRefPosition(last, true);
- // }
- // else
- // {
- position1 = new DOMPosition(root, 0);
- position2 = new DOMPosition(root, root.getChildNodes().getLength());
- // }
- if (!validator.isValidPosition(position1)) {
- position1 = EditHelper.moveToNextEditPosition(position1, true,
- validator);
- }
- if (!validator.isValidPosition(position2)) {
- position2 = EditHelper.moveToNextEditPosition(position2, false,
- validator);
- }
- if (EditValidateUtil.validPosition(position1)
- && EditValidateUtil.validPosition(position2)) {
- _viewer.setRange(DOMPositionHelper.toDesignPosition(position1),
- DOMPositionHelper.toDesignPosition(position2));
- }
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/UnapplyStyleCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/UnapplyStyleCommand.java
deleted file mode 100644
index b2c05e4..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/UnapplyStyleCommand.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.range;
-
-import org.eclipse.jst.pagedesigner.dom.DOMRange;
-import org.eclipse.jst.pagedesigner.dom.DOMUtil;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-/**
- * @author mengbo
- */
-public class UnapplyStyleCommand extends ApplyStyleCommand {
- /**
- * @param viewer
- * @param tag
- * @param property
- * @param value
- */
- public UnapplyStyleCommand(IHTMLGraphicalViewer viewer, String tag,
- String property, String value) {
- super(viewer, tag, property, value);
- }
-
- /**
- * @param viewer
- * @param node
- * @param property
- * @param value
- */
- public UnapplyStyleCommand(IHTMLGraphicalViewer viewer, Element node,
- String property, String value) {
- super(viewer, node, property, value);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.range.RangeModeCommand#doRangeExecute(org.eclipse.jst.pagedesigner.dom.DOMRange)
- */
- protected DOMRange doRangeExecute(DOMRange range) {
- if (range == null || range.isEmpty()) {
- return null;
- }
-
- boolean ordered = range.isOrdered();
- IDOMPosition start = ordered ? range.getStartPosition() : range
- .getEndPosition();
- IDOMPosition end = ordered ? range.getEndPosition() : range
- .getStartPosition();
-
- Node common = DOMUtil.findCommonAncester(start.getContainerNode(), end
- .getContainerNode());
- if (common == null) {
- // should not happen.
- return null;
- }
-
- if (common instanceof Text) {
- doTextNodeStyleApply((Text) common, start.getOffset(), end
- .getOffset());
- }
-
- return null;
- }
-
- /**
- * @param start
- * @param end
- * @param common
- */
- private DOMRange doTextNodeStyleApply(Text textNode, int startOffset,
- int endOffset) {
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/WorkNode.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/WorkNode.java
deleted file mode 100644
index 3a04f24..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/range/WorkNode.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.range;
-
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- */
-public final class WorkNode {
- private WorkNode parent;
-
- private WorkNode previous;
-
- private WorkNode next;
-
- private Node node;
-
- private final int pos[];
-
- private boolean isRoot;
-
- /**
- * @param node
- * @param pos1
- * @param pos2
- */
- public WorkNode(Node node, final int pos1, final int pos2) {
- this.pos = resoveOffsets(node, pos1, pos2);
- this.node = node;
- }
-
- /**
- * @return Returns the node.
- */
- public Node getNode() {
- return node;
- }
-
- /**
- * @param node
- * The node to set.
- */
- public void setNode(Node node) {
- this.node = node;
- }
-
- /**
- * @return the offsets
- */
- int[] getQualifiedOffsets() {
- int result[] = new int[] { getPosOffsets()[0], getPosOffsets()[1] };
- result[0] = result[0] < 0 ? 0 : result[0];
- int length = EditModelQuery.getNodeLenth(node);
- result[0] = result[0] > length ? length : result[0];
- result[1] = result[1] < 0 ? 0 : result[1];
- result[1] = result[1] > length ? length : result[1];
- return result;
- }
-
- /**
- * @return Returns the pos.
- */
- public int[] getPosOffsets() {
- return pos;
- }
-
- /**
- * @return Returns the isRoot.
- */
- public boolean isRoot() {
- return isRoot;
- }
-
- /**
- * @param isRoot
- * The isRoot to set.
- */
- public void setRoot(boolean isRoot) {
- this.isRoot = isRoot;
- }
-
- /**
- * @return Returns the next.
- */
- public WorkNode getNext() {
- return next;
- }
-
- /**
- * @param next
- * The next to set.
- */
- public void setNext(WorkNode next) {
- this.next = next;
- }
-
- /**
- * @return Returns the parent.
- */
- public WorkNode getParent() {
- return parent;
- }
-
- /**
- * @param parent
- * The parent to set.
- */
- public void setParent(WorkNode parent) {
- this.parent = parent;
- }
-
- /**
- * @return Returns the previous.
- */
- public WorkNode getPrevious() {
- return previous;
- }
-
- /**
- * @param previous
- * The previous to set.
- */
- public void setPrevious(WorkNode previous) {
- this.previous = previous;
- }
-
- private int[] resoveOffsets(Node node1, int pos1, int pos2) {
- int left = EditModelQuery.getNodeStartIndex(node1);
- return new int[] { pos1 - left, pos2 - left };
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer sb = new StringBuffer();
- sb.append("Node:").append(node).append(" pos[]:").append(pos);
- return sb.toString();
- }
-
- boolean isWholeSelected() {
- int start = EditModelQuery.getNodeStartIndex(node);
- int end = EditModelQuery.getNodeEndIndex(node);
- return getQualifiedOffsets()[0] <= 0
- && getQualifiedOffsets()[1] >= end - start;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/single/AddSubNodeCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/single/AddSubNodeCommand.java
deleted file mode 100644
index 7df9a32..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/single/AddSubNodeCommand.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.single;
-
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.jst.pagedesigner.utils.JSPUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class AddSubNodeCommand extends SingleNodeCommand {
- private final IDOMElement _parent;
- private IDOMElement _child;
-
- private final String _tagName;
-
- private final String _url;
-
- private final Map _attributes;
-
- /**
- * @param label
- * @param node
- * @param name
- * @param url
- * @param attributs
- */
- public AddSubNodeCommand(String label, IDOMElement node, String name,
- String url, Map attributs) {
- super(label, node);
- this._parent = node;
- this._tagName = name;
- this._url = url;
- this._attributes = attributs;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.DesignerCommand#doExecute()
- */
- protected void doExecute() {
- String prefix = JSPUtil.getOrCreatePrefix(_parent.getModel(), _url,
- null);
- _child = (IDOMElement) _parent.getOwnerDocument().createElement(
- prefix + ":" + _tagName);
- for (Iterator iterator = _attributes.keySet().iterator(); iterator
- .hasNext();) {
- String key = (String) iterator.next();
- String value = (String) _attributes.get(key);
- _child.setAttribute(key, value);
- }
- _parent.appendChild(_child);
- }
-
- /**
- * @return the child node
- */
- public IDOMElement getChildNode() {
- return _child;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/single/ChangeAttributeCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/single/ChangeAttributeCommand.java
deleted file mode 100644
index bd31fc6..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/single/ChangeAttributeCommand.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.single;
-
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- * This command is for change an single attribute of an IDOMElement. Normally
- * used by the properties view.
- *
- * @author mengbo
- */
-public class ChangeAttributeCommand extends SingleNodeCommand {
- private IDOMElement _element;
-
- private String _attrValue;
-
- private String _attrName;
-
- private Map _attributes;
-
- private boolean _keepEmptyAttribute = false;
-
- /**
- *
- * @param label
- * @param node
- * @param attrName
- * @param attrValue
- * if null means remove the specified attribute
- */
- public ChangeAttributeCommand(String label, IDOMElement node,
- String attrName, String attrValue) {
- super(label, node);
- _element = node;
- _attrName = attrName;
- _attrValue = attrValue;
- _attributes = null;
- }
-
- /** TODO: can these two constructors be merged?
- * @param label
- * @param node
- * @param attributes
- */
- public ChangeAttributeCommand(String label, IDOMElement node, Map attributes) {
- super(label, node);
- _element = node;
- _attributes = attributes;
- _attrName = null;
- _attrValue = null;
- }
-
- protected void doExecute() {
- if (_attrName != null) {
- updateElement(_attrName, _attrValue);
- } else if (_attributes != null) {
- for (Iterator iterator = _attributes.keySet().iterator(); iterator
- .hasNext();) {
- String name = (String) iterator.next();
- String value = (String) _attributes.get(name);
- if (isSameValue(value, _element.getAttribute(name))) {
- continue;
- }
- updateElement(name, value);
- }
- }
- }
-
- private void updateElement(String name, String value) {
- if (_element.hasAttribute(name) && isEmptyString(value)
- && !_keepEmptyAttribute) {
- _element.removeAttribute(name);
- }
- if (!isEmptyString(value) || _keepEmptyAttribute) {
- _element.setAttribute(name, value);
- }
- }
-
- private boolean isSameValue(String value1, String value2) {
- value1 = value1 == null ? "" : value1;
- value2 = value2 == null ? "" : value2;
- return value1.equals(value2);
- }
-
- private boolean isEmptyString(String str) {
- if (str == null || str.equals("")) {
- return true;
- }
- return false;
- }
-
- /**
- * @return Returns the keepEmptyAttribute.
- */
- public boolean isKeepEmptyAttribute() {
- return _keepEmptyAttribute;
- }
-
- /**
- * @param keepEmptyAttribute
- * The keepEmptyAttribute to set.
- */
- public void setKeepEmptyAttribute(boolean keepEmptyAttribute) {
- this._keepEmptyAttribute = keepEmptyAttribute;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/single/ChangeStyleCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/single/ChangeStyleCommand.java
deleted file mode 100644
index 4a88c34..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/single/ChangeStyleCommand.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.single;
-
-import java.util.Map;
-
-import org.eclipse.jst.jsf.core.internal.tld.IJSFConstants;
-import org.eclipse.jst.pagedesigner.commands.CommandResources;
-import org.eclipse.jst.pagedesigner.dom.DOMStyleUtil;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclaration;
-import org.eclipse.wst.css.core.internal.util.declaration.CSSPropertyContext;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.w3c.dom.css.ElementCSSInlineStyle;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class ChangeStyleCommand extends SingleNodeCommand {
- private Map _styleProperties = null;
-
- private CSSPropertyContext _context = null;
-
- /**
- * @param node
- * @param map
- */
- public ChangeStyleCommand(IDOMElement node, Map map) {
- super(CommandResources
- .getString("ChangeStyleCommand.Label.ChangeStyle"), node); //$NON-NLS-1$
- _styleProperties = map;
- }
-
- /**
- * @param node
- * @param context
- */
- public ChangeStyleCommand(IDOMElement node, CSSPropertyContext context) {
- super(CommandResources
- .getString("ChangeStyleCommand.Label.ChangeStyle"), node); //$NON-NLS-1$
- _context = context;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.DesignerCommand#doExecute()
- */
- protected void doExecute() {
- getOriginalElement().getModel().beginRecording(this);
- try {
- if (_styleProperties != null) {
- IDOMElement original = this.getOriginalElement();
- DOMStyleUtil.insertStyle(original, _styleProperties);
- } else if (_context != null) {
- ICSSStyleDeclaration styleDeclaration = (ICSSStyleDeclaration) ((ElementCSSInlineStyle) getOriginalElement())
- .getStyle();
-
- if (styleDeclaration == null) {
- getOriginalElement().setAttribute(IJSFConstants.ATTR_STYLE,
- ""); //$NON-NLS-1$
- styleDeclaration = (ICSSStyleDeclaration) ((ElementCSSInlineStyle) getOriginalElement())
- .getStyle();
- }
- _context.applyModified(styleDeclaration);
- }
- } finally {
- getOriginalElement().getModel().endRecording(this);
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/single/ChangeTagCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/single/ChangeTagCommand.java
deleted file mode 100644
index 2de5d4c..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/single/ChangeTagCommand.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.single;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.jst.jsf.core.internal.tld.ITLDConstants;
-import org.eclipse.jst.pagedesigner.utils.JSPUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.w3c.dom.Attr;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * This is for command that changes an element's tagname and some attributes.
- *
- * @author mengbo
- */
-public class ChangeTagCommand extends SingleNodeCommand {
- private final IDOMElement _element;
-
- private final Map _attributes;
-
- private final boolean _moveContent;
-
- private String _uri;
-
- private String _localTag;
-
- private String _totalTag;
-
- /**
- * @param label
- * @param node
- * @param totaltag
- * @param attributes
- * @param movecontent
- */
- public ChangeTagCommand(String label, IDOMElement node, String totaltag,
- Map attributes, boolean movecontent) {
- super(label, node);
- this._element = node;
- this._totalTag = totaltag;
- this._attributes = attributes;
- this._moveContent = movecontent;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.DesignerCommand#doExecute()
- */
- protected void doExecute() {
- String tag = null;
-
- if (_totalTag != null) {
- tag = _totalTag;
- } else {
- if (ITLDConstants.URI_HTML.equals(_uri)) {
- tag = _localTag;
- } else if (ITLDConstants.URI_JSP.equals(_uri)) {
- tag = "jsp:" + _localTag;
- } else {
- tag = JSPUtil.getOrCreatePrefix(getModel(), _uri, null)
- + _localTag;
- }
- }
- // we need to remove the old element and create a new one with the new
- // tag.
- IDOMElement replacement = (IDOMElement) _element.getOwnerDocument()
- .createElement(tag);
- NamedNodeMap attrs = _element.getAttributes();
- for (int i = 0, n = attrs.getLength(); i < n; i++) {
- Attr a = (Attr) attrs.item(i);
- replacement.setAttribute(a.getName(), a.getValue());
- }
- if (_attributes != null) {
- for (Iterator iter = _attributes.keySet().iterator(); iter
- .hasNext();) {
- String name = (String) iter.next();
- String value = (String) _attributes.get(name);
- replacement.setAttribute(name, value);
- }
- }
- if (_moveContent) {
- NodeList nl = _element.getChildNodes();
- ArrayList list = new ArrayList();
- for (int i = 0, n = nl.getLength(); i < n; i++) {
- list.add(nl.item(i));
-
- }
- for (int i = 0, n = list.size(); i < n; i++) {
- replacement.appendChild((Node) list.get(i));
- }
- }
- _element.getParentNode().replaceChild(replacement, _element);
- setReplacedElement(replacement);
- }
-
- /**
- * @return the replacemd element
- */
- public IDOMElement getNewElement() {
- return getReplacedElment();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/single/InsertSubNodeCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/single/InsertSubNodeCommand.java
deleted file mode 100644
index 7790c17..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/single/InsertSubNodeCommand.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.single;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class InsertSubNodeCommand extends SingleNodeCommand {
- private IDOMElement _parent, _child, _refchild;
-
- /**
- * @param label
- * @param parent
- * @param child
- * @param refchild
- */
- public InsertSubNodeCommand(String label, IDOMElement parent,
- IDOMElement child, IDOMElement refchild) {
- super(label, parent);
- this._parent = parent;
- this._child = child;
- this._refchild = refchild;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.DesignerCommand#doExecute()
- */
- protected void doExecute() {
- _parent.insertBefore(_child, _refchild);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/single/RemoveSubNodeCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/single/RemoveSubNodeCommand.java
deleted file mode 100644
index 8ec630c..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/single/RemoveSubNodeCommand.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.single;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class RemoveSubNodeCommand extends SingleNodeCommand {
- private IDOMElement _parent, _child;
-
- /**
- * @param label
- * @param parent
- * @param child
- */
- public RemoveSubNodeCommand(String label, IDOMElement parent,
- IDOMElement child) {
- super(label, parent);
- _parent = parent;
- _child = child;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.DesignerCommand#doExecute()
- */
- protected void doExecute() {
- _parent.removeChild(_child);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/single/SingleNodeCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/single/SingleNodeCommand.java
deleted file mode 100644
index 68f5db4..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/single/SingleNodeCommand.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.commands.single;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jst.pagedesigner.commands.DesignerCommand;
-import org.eclipse.jst.pagedesigner.dom.DOMRange;
-import org.eclipse.jst.pagedesigner.dom.DOMRangeHelper;
-import org.eclipse.jst.pagedesigner.viewer.DesignRange;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- * This is the super class for those commands that change attribute or tag name
- * of a single element.
- *
- * This base class helps handles selection. As after the command, the editpart
- * may totally change, so it tried to remember the selection before command and
- * then restore it after the command.
- *
- * So the limitation to child class of this command is that: the command should
- * only change a single element node. It could remove the node and replace with
- * a new one, but should not touch other nodes.
- *
- * @author mengbo
- */
-public abstract class SingleNodeCommand extends DesignerCommand {
- List _structuredSelectedNodes = null;
-
- DOMRange _rangeSelection = null;
-
- IDOMElement _originalElement;
-
- IDOMElement _replacement;
-
- /**
- * @param label
- * @param node
- */
- public SingleNodeCommand(String label, IDOMElement node) {
- super(label, node);
- _originalElement = node;
- }
-
- protected void preExecute() {
- super.preExecute();
- // remember current selection
- ISelection selection = getViewer().getSelection();
- if (selection instanceof IStructuredSelection) {
- Object[] array = ((IStructuredSelection) selection).toArray();
- _structuredSelectedNodes = new ArrayList();
- if (array != null) {
- for (int i = 0; i < array.length; i++) {
- EditPart part = (EditPart) array[i];
- _structuredSelectedNodes.add(part.getModel());
- }
- }
- } else if (selection instanceof DesignRange) {
- DesignRange range = (DesignRange) selection;
- _rangeSelection = DOMRangeHelper.toDOMRange(range);
- }
- }
-
- /**
- * this method is to be called by child class in the doExecute() method.
- * Telling the super class that the original element will be replaced by the
- * specified element.
- *
- * @param ele
- */
- protected void setReplacedElement(IDOMElement ele) {
- _replacement = ele;
- }
-
- /**
- * @return the replacement element
- */
- protected IDOMElement getReplacedElment() {
- return _replacement;
- }
-
- /**
- * @return the original element
- */
- protected IDOMElement getOriginalElement() {
- return _originalElement;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.DesignerCommand#getAfterCommandDesignerSelection()
- */
- protected final ISelection getAfterCommandDesignerSelection() {
- if (_structuredSelectedNodes != null) {
- // handle replacement fire.
- if (_replacement != null && _replacement != _originalElement) {
- int index = _structuredSelectedNodes.indexOf(_originalElement);
- if (index >= 0) {
- _structuredSelectedNodes.set(index, _replacement);
- }
- }
-
- // as the editpart may have been refreshed, so recreated the
- // selection
- List parts = new ArrayList();
- for (int i = 0, size = _structuredSelectedNodes.size(); i < size; i++) {
- Object obj = _structuredSelectedNodes.get(i);
- if (obj instanceof INodeNotifier) {
- EditPart part = (EditPart) ((INodeNotifier) obj)
- .getAdapterFor(EditPart.class);
- if (part != null)
- parts.add(part);
- }
- }
- StructuredSelection sel = new StructuredSelection(parts);
- return sel;
- } else if (_rangeSelection != null) {
- DOMRange newrange = handleReplacement(_rangeSelection,
- _originalElement, _replacement);
- return DOMRangeHelper.toDesignRange(newrange);
- } else {
- return null;
- }
- }
-
- private DOMRange handleReplacement(DOMRange selection,
- IDOMElement original, IDOMElement replacement) {
- if (replacement == null || replacement == original)
- return selection;
- return DOMRangeHelper.handleReplacement(selection, original,
- replacement);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/AbstractTagConverter.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/AbstractTagConverter.java
deleted file mode 100644
index 8c9054c..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/AbstractTagConverter.java
+++ /dev/null
@@ -1,497 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.converter;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.jst.pagedesigner.css2.style.ITagEditInfo;
-import org.eclipse.jst.pagedesigner.dom.DOMUtil;
-import org.eclipse.jst.pagedesigner.preview.PageExpressionContext;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-/**
- * This is base class for all non-hidden tag converters.
- *
- * @author mengbo
- * @version 1.5
- */
-public abstract class AbstractTagConverter implements ITagConverter,
- ITagEditInfo, INodeAdapter, IDOMFactory {
- private IDOMDocument _targetDocument;
-
- private Element _hostElement;
-
- private Element _resultElement;
-
- private List _childNodes = Collections.EMPTY_LIST;
-
- private Map _childNodePositions = Collections.EMPTY_MAP;
-
- private int _mode;
-
- private int _minWidth;
-
- private int _minHeight;
-
- private boolean _needBorderDecorator;
-
- /**
- * @param host
- *
- */
- public AbstractTagConverter(Element host) {
- _hostElement = host;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.converter.ITagConverter#setTargetDocument(org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument)
- */
- public void setDestDocument(IDOMDocument document) {
- _targetDocument = document;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.visualtag.ITagConverter#convertRefresh(java.lang.Object)
- */
- public final void convertRefresh(Object context) {
- _resultElement = null;
- _childNodes = new ArrayList();
- _childNodePositions = new HashMap();
-
- _resultElement = doConvertRefresh();
- if (_resultElement instanceof INodeNotifier) {
- ((INodeNotifier) _resultElement).addAdapter(this);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.internal.provisional.INodeAdapter#notifyChanged(org.eclipse.wst.sse.core.internal.provisional.INodeNotifier,
- * int, java.lang.Object, java.lang.Object, java.lang.Object, int)
- */
- public void notifyChanged(INodeNotifier notifier, int eventType,
- Object changedFeature, Object oldValue, Object newValue, int pos) {
- // do nothing.
- }
-
- /**
- * Child class should override this method. The child class should NEVER
- * change the host DOM structure.
- *
- * @return the convert result. Should be an HTML element.
- */
- protected abstract Element doConvertRefresh();
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.visualtag.ITagConverter#getHostElement()
- */
- public final Element getHostElement() {
- return _hostElement;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.visualtag.ITagConverter#getResultElement()
- */
- public final Element getResultElement() {
- return _resultElement;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.visualtag.ITagConverter#getChildModeList()
- */
- public final List getChildModeList() {
- return _childNodes;
- }
-
-
- public List getNonVisualChildren()
- {
- // by default, no non-visual children
- return Collections.EMPTY_LIST;
- }
-
- /**
- * child class should call this method.
- *
- * @param childNode
- * the childNode of the hostElement that should be futher
- * converted.
- * @param position
- *
- */
- protected void addChild(Node childNode, ConvertPosition position) {
- _childNodes.add(childNode);
- _childNodePositions.put(childNode, position);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.visualtag.ITagConverter#getChildVisualPosition(org.w3c.dom.Node)
- */
- public final ConvertPosition getChildVisualPosition(Node childModel) {
- return (ConvertPosition) _childNodePositions.get(childModel);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.visualtag.ITagConverter#isVisualByHTML()
- */
- public boolean isVisualByHTML() {
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.visualtag.ITagConverter#getVisualImage()
- */
- public Image getVisualImage() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.visualtag.ITagConverter#dispose()
- */
- public void dispose() {
- // do nothing; children may wish to sub-class
- // TODO: null shared references?
- // this doesn't seem to be called by anybody..
- // need to review this
- }
-
- /**
- * @param node
- * @return true if the node should be ignored for conversion purposes
- */
- protected boolean shouldIgnore(Node node) {
- int nodeType = node.getNodeType();
- switch (nodeType) {
- case Node.TEXT_NODE:
- case Node.CDATA_SECTION_NODE:
- case Node.ELEMENT_NODE:
- return false;
- default:
- return true;
- }
-
- }
-
- /**
- * utility method for those converter that only converts the host tag's name
- * and directly copy children.
- * @param src
- * @param dest
- *
- */
- protected void copyChildren(Element src, Element dest) {
- Node node = src.getFirstChild();
- int index = 0;
- for (; node != null; node = node.getNextSibling()) {
- if (!shouldIgnore(node)) {
- addChild(node, new ConvertPosition(dest, index++));
- }
- }
- }
-
- /**
- * utility method for those converter that directly copy children.
- * @param src
- * @param dest
- *
- */
- protected void dumCopyChildren(Element src, Element dest) {
- Node node = src.getFirstChild();
- Document destDoc = dest.getOwnerDocument();
- for (; node != null; node = node.getNextSibling()) {
- if (!shouldIgnore(node)) {
- Node n = DOMUtil.cloneNodeDeepIgnoreError(destDoc, node);
- dest.appendChild(n);
- }
- }
- }
-
- /**
- * In the future, the conversion result HTML DOM tree could be in another
- * document.
- *
- * @return the destination document
- */
- public IDOMDocument getDestDocument() {
- if (this._targetDocument != null) {
- return this._targetDocument;
- }
- return (IDOMDocument) _hostElement.getOwnerDocument();
- }
-
- /**
- * shortcut method. Child class should always use this method to create a
- * result element.
- *
- * @param tagName
- * @return a new element named tagName
- */
- public Element createElement(String tagName) {
- return getDestDocument().createElement(tagName);
- }
-
- /**
- * shortcut method. Child class should always use this method to create a
- * text node.
- *
- * @param text
- * @return a new text node using text as the value
- */
- public Text createText(String text) {
- return getDestDocument().createTextNode(text);
- }
-
- /**
- * @param original
- * @return the mapped String TODO: currently does nothing
- */
- protected String mapURL(String original) {
- // TODO: how to map URL? such as original url look like:
- // getContext().getPath()+...
- return original;
- }
-
- // TODO: FIXME: XXX:
- // if the value is expression, we may want to do something here!!!
- /**
- * @param value
- * @return value mapped based on EL expression
- */
- protected String mapValue(String value) {
- if (value == null) {
- return null;
- }
- if (isDesignerMode()) {
- // if there has jsf binding expressions
- int checkPos = value.indexOf("#{");
- if (checkPos != -1) {
- String mapValue = "";
- int preferType = PreferenceReader.getMapValueType();
- switch (preferType) {
- case PreferenceReader.FULL_EXPRESSION_TYPE:
- mapValue = value;
- break;
- case PreferenceReader.LAST_EXPRESSION_TYPE:
- String strBackup = value;
- StringBuffer sb = new StringBuffer();
- while (strBackup.indexOf("#{") != -1) {
- int pos = strBackup.indexOf("#{");
- int endBracketPos = strBackup.indexOf("}", pos + 1);
- if (endBracketPos != -1) {
- sb.append(strBackup.substring(0, pos + 2));
- String exp = strBackup.substring(pos + 2,
- endBracketPos);
- if (allowTrim(exp)) {
- int lastDotPos = exp.lastIndexOf(".");
- if (lastDotPos != -1) {
- String convertedExp = exp
- .substring(lastDotPos + 1);
- sb.append(convertedExp);
- } else {
- sb.append(exp);
- }
-
- } else {
- sb.append(exp);
- }
- sb.append("}");
- } else {
- break;
- }
- if (strBackup.length() > endBracketPos + 1) {
- strBackup = strBackup.substring(endBracketPos + 1);
- } else {
- strBackup = "";
- break;
- }
-
- }
- sb.append(strBackup);
- mapValue = sb.toString();
- break;
- case PreferenceReader.REAL_VALUE_TYPE:
- // TODO calculate the expression value
- default:
- mapValue = value;
- break;
- }
-
- return mapValue;
- }
- } else {
- // preview mode. let's try to display the value.
- try {
- return (String) PageExpressionContext.getCurrent()
- .evaluateExpression(value, String.class, null);
- } catch (Exception ex) {
- // can't calculate the result. ignore.
- // ex.printStackTrace();
- }
- }
- return value;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.style.ITagEditInfo#needBorderDecorator()
- */
- public boolean needBorderDecorator() {
- return this._needBorderDecorator;
- }
-
- /**
- * @param b
- */
- public void setNeedBorderDecorator(boolean b) {
- this._needBorderDecorator = b;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.style.ITagEditInfo#needTableDecorator()
- */
- public boolean needTableDecorator() {
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.internal.provisional.INodeAdapter#isAdapterForType(java.lang.Object)
- */
- public boolean isAdapterForType(Object type) {
- if (type == ITagEditInfo.class) {
- return true;
- }
- return false;
- }
-
- /**
- * @param mode
- */
- public final void setMode(int mode) {
- this._mode = mode;
- }
-
- /**
- * @return true if the converter mode is preview
- */
- public final boolean isPreviewMode() {
- return this._mode == IConverterFactory.MODE_PREVIEW;
- }
-
- /**
- * @return true if the converter mode is designer
- */
- public final boolean isDesignerMode() {
- return this._mode == IConverterFactory.MODE_DESIGNER;
- }
-
- /**
- * @return the converter mode
- */
- public final int getMode() {
- return this._mode;
- }
-
- /**
- * The method is used to judge whether the value binding and method binding
- * expression is allowed to be trimmed.Currently only expression contains
- * only letter,digit,and '.' is allowed to be trimmed.
- *
- * @param expression
- * value binding or method binding expression
- * @return
- */
- private boolean allowTrim(String expression) {
- for (int i = 0, size = expression.length(); i < size; i++) {
- char ch = expression.charAt(i);
- if (!Character.isLetterOrDigit(ch) && (ch != '.') && (ch != '_')) {
- return false;
- }
- }
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.converter.AbstractTagConverter#getMinWidth()
- */
- public int getMinWidth() {
- return this._minWidth;
- }
-
- /**
- * @param minWidth
- */
- public void setMinWidth(int minWidth) {
- this._minWidth = minWidth;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.converter.AbstractTagConverter#getMinHeight()
- */
- public int getMinHeight() {
- return this._minHeight;
- }
-
- /**
- * @param minHeight
- */
- public void setMinHeight(int minHeight) {
- this._minHeight = minHeight;
- }
-
- /**
- * @param element
- * @param attrname
- * @return the attribute on element with the name attrname
- */
- public static boolean hasAttribute(Element element, String attrname) {
- return element.hasAttribute(attrname);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/ConvertPosition.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/ConvertPosition.java
deleted file mode 100644
index 130ec40..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/ConvertPosition.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.converter;
-
-import org.w3c.dom.Node;
-
-/**
- * This class is used to locate a position for child model nodes.
- *
- * @author mengbo
- * @version 1.5
- */
-public class ConvertPosition {
- private final Node _parentNode;
-
- private final int _index;
-
- /**
- * @param parent \
- * @param index
- *
- */
- public ConvertPosition(Node parent, int index) {
- this._parentNode = parent;
- this._index = index;
- }
-
- /**
- * @return the parent node
- */
- public Node getParentNode() {
- return _parentNode;
- }
-
- /**
- * @return the index
- */
- public int getIndex() {
- return _index;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/ConverterFacRegistryReader.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/ConverterFacRegistryReader.java
deleted file mode 100644
index 147850e..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/ConverterFacRegistryReader.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.converter;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jst.pagedesigner.IJMTConstants;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class ConverterFacRegistryReader {
- private static List<IConverterFactory> _handlers = null;
-
- /**
- * @return the list of handlers. The list is not modifiable and will
- * throw exceptions if it is attempted.
- */
- public static synchronized List<IConverterFactory> getAllHandlers() {
- if (_handlers == null) {
- _handlers = readAllHandlers();
- }
- return Collections.unmodifiableList(_handlers);
-
- }
-
- private static List<IConverterFactory> readAllHandlers() {
- List result = new ArrayList<IConverterFactory>();
- IExtensionPoint extensionPoint = Platform.getExtensionRegistry()
- .getExtensionPoint(PDPlugin.getPluginId(),
- IJMTConstants.EXTENSION_POINT_PAGEDESIGNER);
- IExtension[] extensions = extensionPoint.getExtensions();
-
- for (int i = 0; i < extensions.length; i++) {
- IExtension ext = extensions[i];
- IConfigurationElement[] dropHandlers = ext
- .getConfigurationElements();
-
- for (int j = 0; j < dropHandlers.length; j++) {
- if (dropHandlers[j].getName().equals(
- IJMTConstants.TAG_CONVERTER_FACTORY)) {
- dropHandlers[j].getAttribute("class");
- Object obj;
- try {
- obj = dropHandlers[j]
- .createExecutableExtension("class");
-
- if (obj instanceof IConverterFactory) {
- result.add(obj);
- }
- } catch (CoreException e) {
- // ignore the exception
- e.printStackTrace();
- }
- }
- }
- }
- return result;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/ConverterFactoryRegistry.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/ConverterFactoryRegistry.java
deleted file mode 100644
index bcbaa37..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/ConverterFactoryRegistry.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.converter;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jst.jsf.common.ui.JSFUICommonPlugin;
-import org.eclipse.jst.jsf.common.ui.internal.utils.JSFSharedImages;
-import org.eclipse.jst.jsf.core.internal.tld.CMUtil;
-import org.eclipse.jst.jsf.core.internal.tld.ITLDConstants;
-import org.eclipse.jst.pagedesigner.converter.html.HTMLConverterFactory;
-import org.eclipse.jst.pagedesigner.converter.jsp.JSPConverterFactory;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class ConverterFactoryRegistry {
- List _factories = new ArrayList();
-
- private static ConverterFactoryRegistry _instance;
-
- /**
- *
- */
- private ConverterFactoryRegistry() {
- _factories.add(new JSPConverterFactory());
- _factories.add(new HTMLConverterFactory());
-
- List<IConverterFactory> facs = ConverterFacRegistryReader.getAllHandlers();
- if (facs != null) {
- for (IConverterFactory fac : facs) {
- addFactory(fac);
- }
- }
- }
-
- /**
- * @param fac
- */
- public void addFactory(IConverterFactory fac) {
- _factories.add(fac);
- }
-
- /**
- * @param ele
- * @param mode
- * @param targetDocument
- * @return the new btag converter
- */
- public ITagConverter createTagConverter(Element ele, int mode,
- IDOMDocument targetDocument) {
- ITagConverter converter = internalCreateTagConverter(ele, mode);
- if (converter != null) {
- converter.setDestDocument(targetDocument);
- }
- return converter;
- }
-
- /**
- * @param ele
- * @param mode
- * @return the new tag converter
- */
- protected final ITagConverter internalCreateTagConverter(Element ele, int mode) {
- String uri = CMUtil.getElementNamespaceURI(ele);
- // first round, match uri
- for (int i = 0, size = _factories.size(); i < size; i++) {
- IConverterFactory fac = (IConverterFactory) _factories.get(i);
- String facuri = fac.getSupportedURI();
- if (facuri != null && facuri.equals(uri)) {
- ITagConverter converter = fac.createConverter(ele, mode);
- if (converter != null) {
- return converter;
- }
- }
- }
- // second round
- for (int i = 0, size = _factories.size(); i < size; i++) {
- IConverterFactory fac = (IConverterFactory) _factories.get(i);
- String facuri = fac.getSupportedURI();
- if (facuri == null) {
- ITagConverter converter = fac.createConverter(ele, mode);
- if (converter != null) {
- return converter;
- }
- }
- }
-
- // can't find. We need some default tag converter for it.
- // if the tag is empty, show it as icon.
- if (uri == null || ITLDConstants.URI_HTML.equals(uri)) {
- // basically, for HTML or non JSP tag, directly renders it.
- return new DumTagConverter(ele);
- }
- CMElementDeclaration decl = CMUtil.getElementDeclaration(ele);
- if (decl == null) {
- return new DumTagConverter(ele);
- }
- int contentType = decl.getContentType();
- if (contentType == CMElementDeclaration.EMPTY) {
- // if the tag is empty, show it as icon.
- return new HiddenTagConverter(ele,
- new LabelProvider()
- {
- public Image getImage(Object element) {
- return getUnknownImage();
- }
- }
- );
- }
- return new DefaultUnknownTagConverter(ele, mode);
-
- }
-
- Image getUnknownImage() {
- return JSFUICommonPlugin.getDefault().getImage(
- JSFSharedImages.DEFAULT_PALETTE_TAG_IMG);
- }
-
- /**
- * @return the singleton instance of the registry
- */
- public static ConverterFactoryRegistry getInstance() {
- if (_instance == null) {
- _instance = new ConverterFactoryRegistry();
- }
- return _instance;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/ConverterUtil.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/ConverterUtil.java
deleted file mode 100644
index ade2b79..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/ConverterUtil.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.converter;
-
-import java.util.Set;
-
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class ConverterUtil {
- /**
- *
- * @param source
- * @param dest
- * @param ignore
- */
- public static void copyAllAttributes(Element source, Element dest,
- Set ignore) {
- NamedNodeMap attrs = source.getAttributes();
- for (int i = 0, size = attrs.getLength(); i < size; i++) {
- Attr attr = (Attr) attrs.item(i);
- if (ignore == null || !ignore.contains(attr.getName())) {
- dest.setAttribute(attr.getName(), attr.getValue());
- }
- }
- }
-
- /**
- * copy a single attribute (if exist)
- *
- * @param source
- * @param srcattr
- * @param dest
- * @param destattr
- */
- public static void copyAttribute(Element source, String srcattr,
- Element dest, String destattr) {
- Attr attr = source.getAttributeNode(srcattr);
- if (attr != null) {
- dest.setAttribute(destattr, attr.getValue());
- }
- }
-
- /**
- * @param hostElement
- * @return true if hostElement represents an empty container
- */
- public static boolean isEmptyContainer(Element hostElement) {
- NodeList nl = hostElement.getChildNodes();
- if (nl == null || nl.getLength() == 0) {
- return true;
- }
-
- for (int i = 0, n = nl.getLength(); i < n; i++) {
- Node node = nl.item(i);
- if (!(node instanceof IDOMText)) {
- return false;
- }
- if (!((IDOMText) node).isElementContentWhitespace()) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * @param document
- * @param text
- * @return the descripton element in the document containing text
- */
- public static Element createDescriptionElement(IDOMDocument document,
- String text) {
- if (document == null) {
- return null;
- }
- Element span = document.createElement(IHTMLConstants.TAG_SPAN); //$NON-NLS-1$
- span.setAttribute(
- "style", "color:gray;font-style:italic;font-size:normal;"); //$NON-NLS-1$ //$NON-NLS-2$
- if (text == null) {
- span.appendChild(document.createTextNode(PDPlugin
- .getResourceString("ConverterUtil.Description"))); //$NON-NLS-1$
- } else {
- span.appendChild(document.createTextNode(text));
- }
- return span;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/DefaultUnknownTagConverter.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/DefaultUnknownTagConverter.java
deleted file mode 100644
index 7050685..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/DefaultUnknownTagConverter.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.converter;
-
-import org.eclipse.jst.pagedesigner.utils.DOMUtil;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-
-/**
- * This tag converter is for those unsupported jsp tags.
- *
- * @author mengbo
- * @version 1.5
- */
-public class DefaultUnknownTagConverter extends AbstractTagConverter {
-
- /**
- * @param host
- * @param mode
- */
- public DefaultUnknownTagConverter(Element host, int mode) {
- super(host);
- setMode(mode);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.converter.AbstractTagConverter#doConvertRefresh()
- */
- protected Element doConvertRefresh() {
- Element hostEle = this.getHostElement();
- Element divEle = createElement("div");
- String style = DOMUtil.getAttributeIgnoreCase(hostEle, "style");
- if (style == null) {
- style = "";
- }
- if (style.length() > 0 && !style.endsWith(";")) {
- style += ";";
- }
- style += "border: none; padding: 0; margin: 0";
- divEle.setAttribute("style", style);
- Element div2 = createElement("span");
- String border = isPreviewMode() ? "border-style: solid;border-width: 1px" : "border:none";
- div2.setAttribute("style", "background-color: white;"+border+";color:gray");
- Text txt = createText(hostEle.getTagName());
- div2.appendChild(txt);
-
- divEle.appendChild(div2);
-
- Element div3 = createElement("div");
- div3.setAttribute("style", "margin: 0; padding: 0");
- divEle.appendChild(div3);
-
- copyChildren(getHostElement(), div3);
- return divEle;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.converter.ITagConverter#isMultiLevel()
- */
- public boolean isMultiLevel() {
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.style.ITagEditInfo#isWidget()
- */
- public boolean isWidget() {
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.converter.AbstractTagConverter#needBorderDecorator()
- */
- public boolean needBorderDecorator() {
- return true;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/DumDeepTagConverter.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/DumDeepTagConverter.java
deleted file mode 100644
index 0a56b52..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/DumDeepTagConverter.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.converter;
-
-import org.eclipse.jst.pagedesigner.dom.DOMUtil;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class DumDeepTagConverter extends AbstractTagConverter {
-
- /**
- * @param host
- */
- public DumDeepTagConverter(Element host) {
- super(host);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.converter.AbstractTagConverter#doConvertRefresh()
- */
- protected Element doConvertRefresh() {
- return (Element) DOMUtil.cloneNodeDeepIgnoreError(getDestDocument(),
- getHostElement());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.visualtag.ITagConverter#isMultiLevel()
- */
- public boolean isMultiLevel() {
- return true;
- }
-
- // TODO: dead?
-// private boolean internalIsWidget(Element result) {
-// String tagname = result.getTagName();
-// if (IHTMLConstants.TAG_INPUT.equalsIgnoreCase(tagname)
-// || IHTMLConstants.TAG_SELECT.equalsIgnoreCase(tagname)
-// || IHTMLConstants.TAG_TEXTAREA.equalsIgnoreCase(tagname)
-// || IHTMLConstants.TAG_IMG.equalsIgnoreCase(tagname)
-// || IHTMLConstants.TAG_HEAD.equalsIgnoreCase(tagname)
-// || IHTMLConstants.TAG_SCRIPT.equalsIgnoreCase(tagname)
-// || IHTMLConstants.TAG_LINK.equalsIgnoreCase(tagname)) {
-// return true;
-// } else {
-//
-// return false;
-// }
-// }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.visualtag.ITagConverter#isWidget()
- */
- public boolean isWidget() {
- return true;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/DumDescriptionTagConverter.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/DumDescriptionTagConverter.java
deleted file mode 100644
index 2221a52..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/DumDescriptionTagConverter.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.converter;
-
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class DumDescriptionTagConverter extends AbstractTagConverter {
- /**
- * @param host
- */
- public DumDescriptionTagConverter(Element host) {
- super(host);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.converter.AbstractTagConverter#doConvertRefresh()
- */
- protected Element doConvertRefresh() {
- Element result = createElement(getHostElement().getTagName());
- ConverterUtil.copyAllAttributes(getHostElement(), result, null);
- copyChildren(getHostElement(), result);
-
- if (!this.isPreviewMode()
- && ConverterUtil.isEmptyContainer(getHostElement())) {
- result.appendChild(ConverterUtil.createDescriptionElement(
- getDestDocument(), null));
- }
-
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.converter.ITagConverter#isMultiLevel()
- */
- public boolean isMultiLevel() {
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.style.ITagEditInfo#isWidget()
- */
- public boolean isWidget() {
- return false;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/DumTagConverter.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/DumTagConverter.java
deleted file mode 100644
index 455bc85..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/DumTagConverter.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.converter;
-
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class DumTagConverter extends AbstractTagConverter {
- /**
- * @param host
- * @param needBorder
- */
- public DumTagConverter(Element host, boolean needBorder) {
- this(host);
- this.setNeedBorderDecorator(needBorder);
- }
-
- /**
- * @param host
- */
- public DumTagConverter(Element host) {
- super(host);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.converter.AbstractTagConverter#doConvertRefresh()
- */
- protected Element doConvertRefresh() {
- Element result = createElement(getHostElement().getTagName());
- ConverterUtil.copyAllAttributes(getHostElement(), result, null);
- if (!internalIsWidget(result)) {
- copyChildren(getHostElement(), result);
- } else {
- dumCopyChildren(getHostElement(), result);
- }
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.visualtag.ITagConverter#isMultiLevel()
- */
- public boolean isMultiLevel() {
- if (isWidget()) {
- return true;
- }
- return false;
- }
-
- /**
- * @param result
- * @return
- */
- private boolean internalIsWidget(Element result) {
- String tagname = result.getTagName();
- if (IHTMLConstants.TAG_INPUT.equalsIgnoreCase(tagname)
- || IHTMLConstants.TAG_SELECT.equalsIgnoreCase(tagname)
- || IHTMLConstants.TAG_TEXTAREA.equalsIgnoreCase(tagname)
- || IHTMLConstants.TAG_IMG.equalsIgnoreCase(tagname)
- || IHTMLConstants.TAG_OBJECT.equalsIgnoreCase(tagname)
- || IHTMLConstants.TAG_HEAD.equalsIgnoreCase(tagname)
- || IHTMLConstants.TAG_SCRIPT.equalsIgnoreCase(tagname)
- || IHTMLConstants.TAG_LINK.equalsIgnoreCase(tagname)
- || IHTMLConstants.TAG_BR.equalsIgnoreCase(tagname)
- || IHTMLConstants.TAG_STYLE.equalsIgnoreCase(tagname)
- || IHTMLConstants.TAG_HR.equalsIgnoreCase(tagname)) {
- return true;
- }
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.visualtag.ITagConverter#isWidget()
- */
- public boolean isWidget() {
- return internalIsWidget(getResultElement());
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/HTMLStringTagConverter.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/HTMLStringTagConverter.java
deleted file mode 100644
index 1b03c05..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/HTMLStringTagConverter.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.converter;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.jsf.common.ui.internal.utils.ResourceUtils;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.dom.DOMUtil;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Element;
-
-/**
- * For some tag, could generate some XML code.
- *
- * @author mengbo
- * @version 1.5
- */
-public abstract class HTMLStringTagConverter extends AbstractTagConverter {
-
- static Logger _log = PDPlugin.getLogger(HTMLStringTagConverter.class);
-
- /**
- * @param host
- */
- public HTMLStringTagConverter(Element host) {
- super(host);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.converter.AbstractTagConverter#doConvertRefresh()
- */
- protected Element doConvertRefresh() {
- // following are XML implementation. Assume the string is welformed HTML
- // try
- // {
- // String html = getGeneratedHTML();
- // DocumentBuilder builder =
- // DocumentBuilderFactory.newInstance().newDocumentBuilder();
- // Element result = builder.parse(new InputSource(new
- // StringReader(html))).getDocumentElement();
- // return (Element)DOMUtil.cloneNodeDeep(this.getDestDocument(),
- // result);
- // }
- // catch(Exception ex)
- // {
- // Element temp = createElement("div");
- // temp.appendChild(createText("ERROR: "+ex.getMessage()));
- // return temp;
- // }
- InputStream stream = null;
- try {
- String id = "" + System.currentTimeMillis() + ".html";
- IModelManager manager = StructuredModelManager.getModelManager();
- stream = new ByteArrayInputStream(getGeneratedHTML().getBytes());
- IDOMModel model = (IDOMModel) manager.getModelForRead(id, stream,
- null);
- Element root = model.getDocument().getDocumentElement();
- Element resultEle = (Element) DOMUtil.cloneNodeDeepIgnoreError(
- getDestDocument(), root);
- model.releaseFromRead();
- return resultEle;
- } catch (Exception ex) {
- _log.error("Log.Error.HTMLStringTagConverter.Error", ex);
- Element temp = createElement("div");
- temp.appendChild(createText("Error loading: " + ex.getMessage()));
- return temp;
- } finally {
- ResourceUtils.ensureClosed(stream);
- }
- }
-
- /**
- * @return the generated HTML string
- * @throws Exception
- */
- public abstract String getGeneratedHTML() throws Exception;
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.converter.ITagConverter#isMultiLevel()
- */
- public boolean isMultiLevel() {
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.style.ITagEditInfo#isWidget()
- */
- public boolean isWidget() {
- return true;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/HiddenTagConverter.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/HiddenTagConverter.java
deleted file mode 100644
index 51a6c1d..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/HiddenTagConverter.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.converter;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * This is for those tags that don't convert to HTML. So they will not display
- * anything in preview, and will display a small icon in designer.
- *
- * @author mengbo
- * @version 1.5
- */
-public class HiddenTagConverter implements ITagConverter {
- private Element _hostElement;
-
- private ILabelProvider _labelProvider;
-
- private int _mode;
-
- /**
- * @param host
- * @param labelProvider
- *
- */
- public HiddenTagConverter(Element host, ILabelProvider labelProvider) {
- _hostElement = host;
- //_image = image;
- _labelProvider = labelProvider;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.converter.ITagConverter#setDestDocument(org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument)
- */
- public void setDestDocument(IDOMDocument document) {
- // do nothing?
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.visualtag.ITagConverter#convertRefresh(java.lang.Object)
- */
- public void convertRefresh(Object context) {
- // do nothing
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.visualtag.ITagConverter#getHostElement()
- */
- public Element getHostElement() {
- return _hostElement;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.visualtag.ITagConverter#isVisualByHTML()
- */
- public boolean isVisualByHTML() {
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.visualtag.ITagConverter#getVisualImage()
- */
- public Image getVisualImage() {
- // defer the creation of the image until it is needed
- return _labelProvider.getImage(this);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.visualtag.ITagConverter#getResultElement()
- */
- public Element getResultElement() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.visualtag.ITagConverter#getChildModeList()
- */
- public List getChildModeList() {
- return Collections.EMPTY_LIST;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.visualtag.ITagConverter#getChildVisualPosition(org.w3c.dom.Node)
- */
- public ConvertPosition getChildVisualPosition(Node childModel) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.visualtag.ITagConverter#isMultiLevel()
- */
- public boolean isMultiLevel() {
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.visualtag.ITagConverter#isWidget()
- */
- public boolean isWidget() {
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.visualtag.ITagConverter#dispose()
- */
- public void dispose() {
- // do nothing
- // TODO: dispose of image or Element here?
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.converter.ITagConverter#setMode(int)
- */
- public void setMode(int mode) {
- this._mode = mode;
- }
-
- /**
- * @return the mode
- */
- public int getMode() {
- return _mode;
- }
-
- public List getNonVisualChildren() {
- return Collections.EMPTY_LIST;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/HiddenTagConverter2.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/HiddenTagConverter2.java
deleted file mode 100644
index f51af22..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/HiddenTagConverter2.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.converter;
-
-import org.eclipse.jst.pagedesigner.dom.DOMUtil;
-import org.eclipse.swt.graphics.Image;
-import org.w3c.dom.Element;
-
-/**
- * HiddenTagConverter2 is similiar to HiddenTagConverter, with the following
- * difference:
- *
- * <ol>
- * <li>HiddenTagConverter2 will copy the DOM sub tree to the destination
- * document.</li>
- * </ol>
- *
- * TODO: this the wrong way to do this. This should sub-class HiddenTagConverter
- *
- * @author mengbo
- * @version 1.5
- */
-public class HiddenTagConverter2 extends AbstractTagConverter {
-
- private Image _image;
-
- /**
- * @param host
- * @param image
- */
- public HiddenTagConverter2(Element host, Image image) {
- super(host);
- this._image = image;
- }
-
- protected Element doConvertRefresh() {
- return (Element) DOMUtil.cloneNodeDeepIgnoreError(getDestDocument(),
- getHostElement());
- }
-
- public boolean isVisualByHTML() {
- return false;
- }
-
- public Image getVisualImage() {
- return _image;
- }
-
- public boolean isMultiLevel() {
- return true;
- }
-
- public boolean isWidget() {
- return true;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/IConverterFactory.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/IConverterFactory.java
deleted file mode 100644
index f8aebf2..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/IConverterFactory.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.converter;
-
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public interface IConverterFactory {
- /**
- * indicates designer mode
- */
- public static final int MODE_DESIGNER = 0;
-
- /**
- * indicates preview mode
- */
- public static final int MODE_PREVIEW = 1;
-
- /**
- *
- * @param element
- * @param mode
- * @return null if this factory don't support this element
- */
- public ITagConverter createConverter(Element element, int mode);
-
- /**
- * get the URI namespace that this factory support. "null" means this
- * factory can be used as default factory.
- *
- * @return null if this factory don't have a specific URI to support.
- */
- public String getSupportedURI();
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/IDOMFactory.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/IDOMFactory.java
deleted file mode 100644
index 3e3d374..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/IDOMFactory.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.converter;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-
-/**
- * Factory interface. AbstractTagConverter will implement it.
- *
- * @author mengbo
- * @version 1.5
- */
-public interface IDOMFactory {
- /**
- * create element
- *
- * @param tag
- * @return a new element using tag as its name
- */
- public Element createElement(String tag);
-
- /**
- * create text node
- *
- * @param content
- * @return a new text node using content as its body
- */
- public Text createText(String content);
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/ITagConverter.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/ITagConverter.java
deleted file mode 100644
index b5aea53..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/ITagConverter.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.converter;
-
-import java.util.List;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * ITagConverter is used to convert a custom tag to a HTML tag. Each
- * ITagConverter instance will be dedicated to a single custom tag element.
- *
- * @author mengbo
- * @version 1.5
- */
-public interface ITagConverter {
- /**
- * Set the target document where the converted node should belong to.
- *
- * @param document
- */
- public void setDestDocument(IDOMDocument document);
-
- /**
- * refresh the internal state of this ITagConverter. This method normally is
- * called when the host element change.
- *
- * @param context
- */
- public void convertRefresh(Object context);
-
- /**
- * @return The host element being converted.
- */
- public Element getHostElement();
-
- /**
- * for some tags, they don't convert to HTML. In that case, this method
- * should return false for them. And if this method return false, then
- * should return an image in <code>getVisualImage()</code> for displaying
- * in the designer.
- *
- * @return true if the tag represents something that will be rendered visually at runtime
- */
- public boolean isVisualByHTML();
-
- /**
- * if isVisualByHTML() return false, then this method should return an image
- * to be displayed in designer.
- *
- * Normally this image will be a shared image for those hidden elements. It
- * is this class's responsibility to dispose the image if the image is not a
- * shared one.
- *
- * @return the placeholder image for non-visual tags
- */
- public Image getVisualImage();
-
- /**
- * @return the result element after conversion
- */
- public Element getResultElement();
-
- /**
- * @return the list of children that should be continuely converted.
- */
- public List getChildModeList();
-
- /**
- * @return a list of Element tags that map to non-visual children
- * Type should be always be Element.
- */
- public List getNonVisualChildren();
-
- /**
- * For child nodes that need further convert, return their position in the
- * converted DOM tree.
- *
- * @param childModel
- * @return the position of child nodes
- */
- public ConvertPosition getChildVisualPosition(Node childModel);
-
- /**
- * When the convert result in multi-level element. If this method return
- * false, then the caller should not use child nodes of
- * <code>getHostElement()</code>
- *
- * @return true if the host element has convertable children
- */
- public boolean isMultiLevel();
-
- /**
- *
- * @return true if the host element is a widget
- */
- public boolean isWidget();
-
- /**
- * API contract needed here
- *
- */
- public void dispose();
-
- /**
- * @param mode
- */
- public void setMode(int mode);
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/JSFConverterUtil.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/JSFConverterUtil.java
deleted file mode 100644
index 5ac56f8..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/JSFConverterUtil.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.converter;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Set;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class JSFConverterUtil {
- private static List NamedBooleanList = Arrays.asList(new String[] {
- "disabled", "readonly", "ismap" });
-
- /**
- *
- * @param source
- * @param dest
- * @param ignore
- */
- public static void copyAllAttributes(Element source, Element dest,
- Set ignore) {
- NamedNodeMap attrs = source.getAttributes();
- for (int i = 0, size = attrs.getLength(); i < size; i++) {
- Attr attr = (Attr) attrs.item(i);
- if (ignore == null || !ignore.contains(attr.getName())) {
- if (NamedBooleanList.contains(attr.getName())
- && "false".equalsIgnoreCase(attr.getValue())) {
- continue;
- }
- dest.setAttribute(attr.getName(), attr.getValue());
- }
- }
- }
-
- /**
- * copy a single attribute (if exist)
- *
- * @param source
- * @param srcattr
- * @param dest
- * @param destattr
- */
- public static void copyAttribute(Element source, String srcattr,
- Element dest, String destattr) {
- Attr attr = source.getAttributeNode(srcattr);
- if (attr != null) {
- dest.setAttribute(destattr, attr.getValue());
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/PreferenceReader.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/PreferenceReader.java
deleted file mode 100644
index ea9dc4e..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/PreferenceReader.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.converter;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class PreferenceReader {
- /**
- * expression type
- */
- public final static int FULL_EXPRESSION_TYPE = 0;
-
- /**
- * expression type
- */
- public final static int LAST_EXPRESSION_TYPE = 1;
-
- /**
- * expression type
- */
- public final static int REAL_VALUE_TYPE = 2;
-
- /**
- * @return the map value type
- */
- public static int getMapValueType() {
- return LAST_EXPRESSION_TYPE;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/TagConverterToDumBlock.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/TagConverterToDumBlock.java
deleted file mode 100644
index 619875d..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/TagConverterToDumBlock.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.converter;
-
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class TagConverterToDumBlock extends AbstractTagConverter {
-
- /**
- * @param host
- */
- public TagConverterToDumBlock(Element host) {
- super(host);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.converter.AbstractTagConverter#doConvertRefresh()
- */
- protected Element doConvertRefresh() {
- Element result = createElement(IHTMLConstants.TAG_DIV);
- copyChildren(getHostElement(), result);
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.converter.ITagConverter#isMultiLevel()
- */
- public boolean isMultiLevel() {
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.style.ITagEditInfo#isWidget()
- */
- public boolean isWidget() {
- return false;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/TagConverterToInlineBlock.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/TagConverterToInlineBlock.java
deleted file mode 100644
index a111932..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/TagConverterToInlineBlock.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.converter;
-
-import org.w3c.dom.Element;
-
-/**
- * This converter can be used simply convert the tag to inline div, and copy all
- * the children
- *
- * NOTE: It behave almost same as "span". In fact, we may remove this later, if
- * our css engine support "minWidth"/"minHeight" for inline element.
- *
- * NOTE: it will not copy attributes!
- *
- * @author mengbo
- * @version 1.5
- * @see org.eclipse.jst.pagedesigner.css2.style.ITagEditInfo#getMinHeight()
- * @see org.eclipse.jst.pagedesigner.css2.style.ITagEditInfo#getMinWidth()
- */
-public class TagConverterToInlineBlock extends AbstractTagConverter {
- private int displayMode;
-
- /**
- * @param host
- * @param mode
- */
- public TagConverterToInlineBlock(Element host, int mode) {
- super(host);
- this.displayMode = mode;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.converter.AbstractTagConverter#doConvertRefresh()
- */
- protected Element doConvertRefresh() {
- Element result = null;
- if (displayMode == IConverterFactory.MODE_PREVIEW) {
- result = createElement("span");
- copyChildren(getHostElement(), result);
- } else {
- result = createElement("div");
- result
- .setAttribute(
- "style",
- "display:inline-block; border-width:0; margin:0; min-width:1.2em;min-height:1.2em;");
- copyChildren(getHostElement(), result);
- }
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.converter.ITagConverter#isMultiLevel()
- */
- public boolean isMultiLevel() {
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.converter.ITagConverter#isWidget()
- */
- public boolean isWidget() {
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/TagConverterToSpan.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/TagConverterToSpan.java
deleted file mode 100644
index 5dfa800..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/TagConverterToSpan.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.converter;
-
-import org.w3c.dom.Element;
-
-/**
- * This converter can be used simply convert the tag to span, and copy all the
- * children
- *
- * NOTE: it will not copy attributes!
- *
- * @author mengbo
- * @version 1.5
- */
-public class TagConverterToSpan extends AbstractTagConverter {
-
- /**
- * @param host
- */
- public TagConverterToSpan(Element host) {
- super(host);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.converter.AbstractTagConverter#doConvertRefresh()
- */
- protected Element doConvertRefresh() {
- // Register a named facet on the UIComponent associated with the
- // closest parent UIComponent custom action.
- // we'll render facet as a inline flow figure. so treat it as simple
- // <span> here.
- Element result = createElement("span");
- copyChildren(getHostElement(), result);
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.converter.ITagConverter#isMultiLevel()
- */
- public boolean isMultiLevel() {
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.converter.ITagConverter#isWidget()
- */
- public boolean isWidget() {
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/html/ATagConverter.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/html/ATagConverter.java
deleted file mode 100644
index a86dd89..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/html/ATagConverter.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.converter.html;
-
-import org.eclipse.jst.pagedesigner.converter.ConverterUtil;
-import org.eclipse.jst.pagedesigner.converter.DumTagConverter;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class ATagConverter extends DumTagConverter {
- private boolean _emptyContainer = false;
-
- /**
- * @param host
- */
- public ATagConverter(Element host) {
- super(host);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.converter.AbstractTagConverter#doConvertRefresh()
- */
- protected Element doConvertRefresh() {
- _emptyContainer = ConverterUtil.isEmptyContainer(getHostElement());
- if (_emptyContainer) {
- Element resultEle = createElement("a");
- ConverterUtil.copyAllAttributes(getHostElement(), resultEle, null);
- Text fakedNode = createText("link");
- resultEle.appendChild(fakedNode);
- return resultEle;
- }
- return super.doConvertRefresh();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.converter.AbstractTagConverter#needBorderDecorator()
- */
- public boolean needBorderDecorator() {
- return _emptyContainer;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.converter.ITagConverter#isMultiLevel()
- */
- public boolean isMultiLevel() {
- return _emptyContainer;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.style.ITagEditInfo#isWidget()
- */
- public boolean isWidget() {
- return _emptyContainer;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/html/HTMLConverterFactory.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/html/HTMLConverterFactory.java
deleted file mode 100644
index de2a907..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/html/HTMLConverterFactory.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.converter.html;
-
-import org.eclipse.jst.jsf.common.ui.JSFUICommonPlugin;
-import org.eclipse.jst.jsf.common.ui.internal.utils.JSFSharedImages;
-import org.eclipse.jst.jsf.core.internal.tld.ITLDConstants;
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.converter.AbstractTagConverter;
-import org.eclipse.jst.pagedesigner.converter.DumDescriptionTagConverter;
-import org.eclipse.jst.pagedesigner.converter.DumTagConverter;
-import org.eclipse.jst.pagedesigner.converter.HiddenTagConverter2;
-import org.eclipse.jst.pagedesigner.converter.IConverterFactory;
-import org.eclipse.jst.pagedesigner.converter.ITagConverter;
-import org.eclipse.jst.pagedesigner.utils.HTMLUtil;
-import org.eclipse.swt.graphics.Image;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class HTMLConverterFactory implements IConverterFactory {
-
- /**
- * the constructor
- */
- public HTMLConverterFactory() {
- super();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.converter.IConverterFactory#createConverter(org.w3c.dom.Element)
- */
- public ITagConverter createConverter(Element element, int mode) {
- String tagName = element.getLocalName();
-
- if (mode == MODE_PREVIEW) {
- return new DumTagConverter(element);
- }
- if (!HTMLUtil.isVisualHtmlElement(tagName)) {
- return new HiddenTagConverter2(element, getUnknownImage());
- }
-
- AbstractTagConverter c;
- if (IHTMLConstants.TAG_TABLE.equalsIgnoreCase(tagName)) {
- c = new TableTagConverter(element);
- } else if (IHTMLConstants.TAG_A.equalsIgnoreCase(tagName)) {
- c = new ATagConverter(element);
- } else if (IHTMLConstants.TAG_FORM.equalsIgnoreCase(tagName)) {
- // for those HTML tag that we want to build a border decorator,
- // should
- // go there.
- c = new DumTagConverter(element, true);
- } else if (IHTMLConstants.TAG_HTML.equalsIgnoreCase(tagName)
- || IHTMLConstants.TAG_BODY.equalsIgnoreCase(tagName)) {
- c = new DumDescriptionTagConverter(element);
- c.setNeedBorderDecorator(true);
- } else {
- c = new DumTagConverter(element);
- }
- c.setMode(mode);
- return c;
- }
-
- private static Image getUnknownImage() {
- return JSFUICommonPlugin.getDefault().getImage(
- JSFSharedImages.DEFAULT_PALETTE_TAG_IMG);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.converter.IConverterFactory#getSupportedURI()
- */
- public String getSupportedURI() {
- return ITLDConstants.URI_HTML;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/html/TableTagConverter.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/html/TableTagConverter.java
deleted file mode 100644
index eaf1928..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/html/TableTagConverter.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.converter.html;
-
-import org.eclipse.jst.pagedesigner.converter.AbstractTagConverter;
-import org.eclipse.jst.pagedesigner.converter.ConverterUtil;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- */
-public class TableTagConverter extends AbstractTagConverter {
- /**
- * @param host
- */
- public TableTagConverter(Element host) {
- super(host);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.converter.AbstractTagConverter#doConvertRefresh()
- */
- protected Element doConvertRefresh() {
- Element result = createElement(getHostElement().getTagName());
- ConverterUtil.copyAllAttributes(getHostElement(), result, null);
- copyChildren(getHostElement(), result);
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.converter.ITagConverter#isMultiLevel()
- */
- public boolean isMultiLevel() {
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.style.ITagEditInfo#isWidget()
- */
- public boolean isWidget() {
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.converter.AbstractTagConverter#needTableDecorator()
- */
- public boolean needTableDecorator() {
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.converter.AbstractTagConverter#needBorderDecorator()
- */
- public boolean needBorderDecorator() {
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/jsp/IncludeTagConverterPreview.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/jsp/IncludeTagConverterPreview.java
deleted file mode 100644
index 73aa825..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/jsp/IncludeTagConverterPreview.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.converter.jsp;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.converter.AbstractTagConverter;
-import org.eclipse.jst.pagedesigner.jsp.core.internal.pagevar.DocumentPageVariableAdapter;
-import org.eclipse.jst.pagedesigner.jsp.core.pagevar.adapter.PageVariableAdapterFactory;
-import org.eclipse.jst.pagedesigner.preview.PageExpressionContext;
-import org.eclipse.jst.pagedesigner.preview.PreviewConvertContext;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.util.URIResolver;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * This is the tag converter for preview.
- *
- * @author mengbo
- * @version 1.5
- */
-public class IncludeTagConverterPreview extends AbstractTagConverter {
- private static Logger _log = PDPlugin
- .getLogger(IncludeTagConverterPreview.class);
-
- private String _fileAttrName;
-
- /**
- * @param host
- * @param fileAttrname
- */
- public IncludeTagConverterPreview(Element host, String fileAttrname) {
- super(host);
- this._fileAttrName = fileAttrname;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.converter.AbstractTagConverter#doConvertRefresh()
- */
- protected Element doConvertRefresh() {
- String fileName = getResolvedURL(getHostElement(), this._fileAttrName);
- if (fileName == null || fileName.length() == 0) {
- return null;
- }
- IPath includedPath = new Path(fileName);
- includedPath.makeAbsolute();
-
- IFile file = getFile(includedPath);
- if (file == null) {
- return null;
- }
- return previewFile(file);
- }
-
- /**
- * @param includedPath
- * @return the IFile corresponding to the IPath
- */
- public IFile getFile(IPath includedPath) {
- IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
- IProject[] projects = workspaceRoot.getProjects();
-
- for (int i = 0, length = projects.length; i < length; i++) {
- IPath path = projects[i].getLocation();
- path = path.makeAbsolute();
- if (path != null && path.isPrefixOf(includedPath)) {
- // -1 so we still have the project path
- includedPath = includedPath.removeFirstSegments(path
- .segmentCount() - 1);
- return ResourcesPlugin.getWorkspace().getRoot().getFile(
- includedPath);
- }
- }
- return null;
- }
-
- /**
- * @param file
- * @return the Element
- */
- public Element previewFile(IFile file) {
- IDOMModel xmlModel = null;
- DocumentPageVariableAdapter provider = null;
- boolean pushedPageVarProvider = false;
- try {
-
- xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getModelForRead(
- file);
- if (xmlModel != null) {
- IDOMDocument doc = xmlModel.getDocument();
-
- // XXX: need to also register page variable adapters. In the
- // future, this should go to some
- // SSE system registry mechanism.
- xmlModel.getFactoryRegistry().addFactory(
- new PageVariableAdapterFactory());
- provider = new DocumentPageVariableAdapter(doc);
- doc.addAdapter(provider);
-
- provider.refresh();
- PageExpressionContext.getCurrent()
- .pushPageVarProvider(provider);
-
- Node child = xmlModel.getDocument().getFirstChild();
- PreviewConvertContext context = new PreviewConvertContext(this
- .getDestDocument());
- List results = new ArrayList();
- while (child != null) {
- Node node = context.previewConvert(child);
- if (node != null) {
- results.add(node);
- }
- child = child.getNextSibling();
- }
-
- if (results.size() == 0) {
- return null;
- } else if (results.size() == 1
- && results.get(0) instanceof Element) {
- return (Element) results.get(0);
- } else {
- Element ret = createElement(IHTMLConstants.TAG_SPAN);
- for (int i = 0, n = results.size(); i < n; i++) {
- ret.appendChild((Node) results.get(i));
- }
- return ret;
- }
- }
- } catch (CoreException e) {
- _log.error("PreviewUtil.previewFile.CoreException", e);
- } catch (IOException e) {
- _log.error("PreviewUtil.previewFile.IOException", e);
- } catch (Exception ex) {
- _log.error("PreviewUtil.previewFile.CoreException", ex);
- } finally {
- if (pushedPageVarProvider) {
- PageExpressionContext.getCurrent().popPageVarProvider(provider);
- }
- if (xmlModel != null) {
- xmlModel.releaseFromRead();
- }
- }
- return null;
- }
-
- static String getResolvedURL(Element element, String attrName) {
- URIResolver resolver = null;
- if (element instanceof IDOMNode) {
- // TODO: the new URI resolver is not available on the IStructuredModel
- resolver = ((IDOMNode) element).getModel().getResolver();
- }
- if (null == resolver) {
- return null;
- }
- String src = element.getAttribute(attrName);
- if (src != null && src.length() > 0) {
- return resolver.getLocationByURI(src);
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.converter.ITagConverter#isMultiLevel()
- */
- public boolean isMultiLevel() {
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.style.ITagEditInfo#isWidget()
- */
- public boolean isWidget() {
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/jsp/JSPConverterFactory.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/jsp/JSPConverterFactory.java
deleted file mode 100644
index 2175d91..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/jsp/JSPConverterFactory.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.converter.jsp;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IWorkspaceContextResolver;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContextFactory2;
-import org.eclipse.jst.jsf.core.internal.tld.ITLDConstants;
-import org.eclipse.jst.pagedesigner.converter.HiddenTagConverter;
-import org.eclipse.jst.pagedesigner.converter.IConverterFactory;
-import org.eclipse.jst.pagedesigner.converter.ITagConverter;
-import org.eclipse.jst.pagedesigner.converter.TagConverterToDumBlock;
-import org.eclipse.jst.pagedesigner.editors.palette.TagImageManager;
-import org.eclipse.jst.pagedesigner.jsp.core.IJSPCoreConstants;
-import org.eclipse.swt.graphics.Image;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class JSPConverterFactory implements IConverterFactory {
- private final ILabelProvider _labelProvider;
-
- /**
- *
- */
- public JSPConverterFactory() {
- _labelProvider = new MyLabelProvider();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.converter.IConverterFactory#createConverter(org.w3c.dom.Element)
- */
- public ITagConverter createConverter(Element element, int mode) {
- String tagName = element.getLocalName();
-
- if (mode == IConverterFactory.MODE_PREVIEW) {
- // we want to generate the included page in preview, so
- // handle differently
- if (IJSPCoreConstants.TAG_INCLUDE.equalsIgnoreCase(tagName)) {
- IncludeTagConverterPreview c = new IncludeTagConverterPreview(
- element, "page");
- c.setMode(mode);
- return c;
- } else if (IJSPCoreConstants.TAG_DIRECTIVE_INCLUDE
- .equalsIgnoreCase(tagName)) {
- IncludeTagConverterPreview c = new IncludeTagConverterPreview(
- element, "file");
- c.setMode(mode);
- return c;
- } else if (IJSPCoreConstants.TAG_ROOT.equalsIgnoreCase(tagName)) {
- TagConverterToDumBlock c = new TagConverterToDumBlock(element);
- c.setNeedBorderDecorator(true);
- c.setMode(mode);
- return c;
- } else {
- return new HiddenTagConverter(element, _labelProvider);
- }
- }
- if (IJSPCoreConstants.TAG_ROOT.equalsIgnoreCase(tagName)) {
- TagConverterToDumBlock c = new TagConverterToDumBlock(element);
- c.setNeedBorderDecorator(true);
- c.setMode(mode);
- return c;
- }
- return new HiddenTagConverter(element, _labelProvider);
- }
-
- private static class MyLabelProvider extends org.eclipse.jface.viewers.LabelProvider
- {
-
- public Image getImage(Object element)
- {
- if (element instanceof ITagConverter)
- {
- final Element hostElement = ((ITagConverter)element).getHostElement();
- IStructuredDocumentContext context = IStructuredDocumentContextFactory2.INSTANCE.getContext(hostElement);
- if (context != null){
- IWorkspaceContextResolver wsResolver = IStructuredDocumentContextResolverFactory.INSTANCE.getWorkspaceContextResolver(context);
- if (wsResolver != null){
- return TagImageManager.getInstance().getSmallIconImage(wsResolver.getProject(),"JSP11", ITLDConstants.URI_JSP + ":"+hostElement.getLocalName());
- }
- }
- }
-
- return null;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.converter.IConverterFactory#getSupportedURI()
- */
- public String getSupportedURI() {
- return ITLDConstants.URI_JSP;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/package-info.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/package-info.java
deleted file mode 100644
index d74c9f9..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/package-info.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-/**
- * Tag conversion framework.
- *
- * <p><b>Provisional API - subject to change</b></p>
- */
-package org.eclipse.jst.pagedesigner.converter;
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/CSSTempUtil.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/CSSTempUtil.java
deleted file mode 100644
index 9303b67..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/CSSTempUtil.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetAdapter;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetListAdapter;
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.stylesheets.StyleSheet;
-import org.w3c.dom.stylesheets.StyleSheetList;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public final class CSSTempUtil {
- /**
- * the default implementation of (IStyleSheetListAdapter)
- * docnotifier.getAdapterFor(IStyleSheetListAdapter.class) will only get
- * those style tags under certain tags like "html", "head", etc.
- *
- * But datawindow is generating style tag and is not putting them into
- * "head". So we can't handle them using the default SSE mechanism.
- *
- * We have another problem: currently the converted element is also using
- * the original document, not generating another document, and these
- * elements is not really adding into the document, so they can't be reached
- * from the document.
- *
- * @param element
- * @return the list
- * see org.eclipse.wst.html.core.htmlcss.HTMLDocumentAdapter#addStyleSheet(org.w3c.dom.Element)
- */
- public static List getStyleSheets(Element element) {
- List styleSheets = new ArrayList();
- INodeNotifier docnotifier = (INodeNotifier) element.getOwnerDocument();
- IStyleSheetListAdapter adapter = (IStyleSheetListAdapter) docnotifier
- .getAdapterFor(IStyleSheetListAdapter.class);
-
- StyleSheetList ssl = (adapter == null ? null : adapter.getStyleSheets());
-
- if (ssl != null) {
- for (int i = 0, numStyles = ssl.getLength(); i < numStyles; i++) {
- // loop for styles (<style> and <link>)
- org.w3c.dom.stylesheets.StyleSheet ss = ssl.item(i);
- styleSheets.add(ss);
- }
- }
-
- // now is our work-around part for support datawindow.
- Node parent = element.getParentNode();
- Element rootEle = element;
- while (parent != null && parent instanceof Element) {
- rootEle = (Element) parent;
- parent = parent.getParentNode();
- }
- addStyleSheet(rootEle, styleSheets);
- return styleSheets;
- }
-
- /**
- */
- private static void addStyleSheet(Element node, List result) {
- IDOMElement element = (IDOMElement) node;
- String tagName = element.getTagName();
- if (tagName == null) {
- return;
- }
- boolean isContainer = false;
-
- if (element.isCommentTag()) {
- Node parent = element.getParentNode();
- if (parent == element.getOwnerDocument()) {
- // This condition is too severe, actually do not work for JSF
- // template.
- // But above (! globalTag() && isContainer()) cover JSF template
- // + tpl template
- isContainer = true;
- } else if (parent.getNodeType() == Node.ELEMENT_NODE) {
- tagName = ((Element) parent).getTagName();
- if (tagName != null
- && tagName
- .equalsIgnoreCase(HTML40Namespace.ElementName.HEAD)) {
- isContainer = true;
- }
- }
- } else {
- INodeNotifier notifier = element;
-
- // (lium) Increase performance: since this method is called tooooo
- // many times,
- // and getAdapterFor() is slow, so add a check on the tagName to
- // filter
- // those stylesheet stuff first.
- if (IHTMLConstants.TAG_LINK.equalsIgnoreCase(tagName)
- || IHTMLConstants.TAG_STYLE.equalsIgnoreCase(tagName)) {
- INodeAdapter adapter = notifier
- .getAdapterFor(IStyleSheetAdapter.class);
- if (adapter instanceof IStyleSheetAdapter) {
- // XXX: see bug 171740. This is a (hopefully) temporary
- // workaround that avoids having the call to getSheet throw an NPE
- IStyleSheetAdapter sheetAdapter = (IStyleSheetAdapter) adapter;
- if (sheetAdapter.getElement() != null
- && "text/css".equals(sheetAdapter.getElement().getAttribute(HTML40Namespace.ATTR_NAME_TYPE)))
-
- {
- StyleSheet sheet = ((IStyleSheetAdapter) adapter)
- .getSheet();
-
- if (sheet != null)
- {
- result.add(sheet);
- }
- }
- }
- }
-
- isContainer = true;
- }
- if (isContainer) {
- for (Node child = element.getFirstChild(); child != null; child = child
- .getNextSibling()) {
- if (child.getNodeType() != Node.ELEMENT_NODE)
- continue;
- addStyleSheet((Element) child, result);
- }
- }
- }
-
- private CSSTempUtil()
- {
- // util class, no instantiation
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/CSSUtil.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/CSSUtil.java
deleted file mode 100644
index fdda3ce..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/CSSUtil.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.jsf.common.ui.internal.utils.ResourceUtils;
-import org.eclipse.jst.pagedesigner.IJMTConstants;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.css2.font.CSSFont;
-import org.eclipse.jst.pagedesigner.css2.style.DefaultStyle;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetListAdapter;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.util.CSSClassTraverser;
-import org.eclipse.wst.html.core.internal.htmlcss.CSSQueryTraverser;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.css.CSSStyleDeclaration;
-import org.w3c.dom.stylesheets.StyleSheet;
-import org.w3c.dom.stylesheets.StyleSheetList;
-
-/**
- * @author mengbo
- */
-public class CSSUtil {
- private static StyleSheet _userAgentDefault;
-
- /**
- * @param doc
- * @return the css classes
- */
- public static String[] getCSSClasses(Document doc) {
- Collection c = Collections.EMPTY_SET;
- if (doc instanceof INodeNotifier) {
- IStyleSheetListAdapter adapter = (IStyleSheetListAdapter) ((INodeNotifier) doc)
- .getAdapterFor(IStyleSheetListAdapter.class);
- StyleSheetList ssl = (adapter == null ? null : adapter
- .getStyleSheets());
-
- CSSClassTraverser traverser = new CSSClassTraverser();
- if (ssl != null) {
- for (int i = 0, numStyles = ssl.getLength(); i < numStyles; i++) {
- // loop for styles (<style> and <link>)
- org.w3c.dom.stylesheets.StyleSheet ss = ssl.item(i);
-
- try {
- traverser.apply((ICSSNode) ss);
- } catch (ClassCastException ex) {
- Logger log = PDPlugin
- .getLogger(CSSStyleDeclaration.class);
- log.error("Error.CSSUtil.0", ex); //$NON-NLS-1$
- // FIXME: should this continue to be processed?
- }
- }
- c = traverser.getClassNames();
- }
- }
- String[] result = new String[c.size()];
- c.toArray(result);
- return result;
- }
-
- /**
- * Get the css style of a node.
- *
- * @param node
- * @return the style
- */
- public static ICSSStyle getCSSStyle(Element node) {
- ICSSStyle style = null;
- if (node instanceof IDOMElement) {
- style = (ICSSStyle) ((IDOMElement) node)
- .getAdapterFor(ICSSStyle.class);
- }
- if (style == null) {
- return DefaultStyle.getInstance();
- }
- return style;
- }
-
- /**
- * Resolve the css style string from css style elements.
- *
- * @param style
- * @return the style string
- */
- public static String resolveCSSStyle(ICSSStyle style) {
- StringBuffer sb = new StringBuffer();
- Object object1 = style.getColor();
- if (object1 instanceof Color) {
- sb.append("color:");
-
- sb.append("#").append(
- Integer.toHexString(((Color) object1).getRed()));
- sb.append("#").append(
- Integer.toHexString(((Color) object1).getGreen()));
- sb.append("#").append(
- Integer.toHexString(((Color) object1).getBlue()));
- sb.append(";");
- }
- Object object2 = style.getCSSFont();
- if (object2 instanceof CSSFont) {
- sb.append(((CSSFont) object2).getCSSString());
- }
- return sb.toString();
- }
-
- /**
- * Many of this method implementation copied from HTMLDocumentAdapter,
- * mainly add support for user agent default style sheet.
- *
- * @param element
- * the element.
- * @param pseudoName
- * the pseudoname of the element
- * @return the style declaration
- */
- public static CSSStyleDeclaration getCSSDeclaration(Element element,
- String pseudoName) {
- // please reference comments in CSSTempUtil.
- List styleSheets = CSSTempUtil.getStyleSheets(element);
- // INodeNotifier docnotifier = (INodeNotifier)
- // element.getOwnerDocument();
- // IStyleSheetListAdapter adapter = (IStyleSheetListAdapter)
- // docnotifier.getAdapterFor(IStyleSheetListAdapter.class);
- //
- // StyleSheetList ssl = (adapter == null ? null :
- // adapter.getStyleSheets());
-
- CSSQueryTraverser query = new CSSQueryTraverser();
- query.setTraverseImported(true);
- query.setTraverseImportFirst(true);
- query.setElement(element, pseudoName);
-
- // if (ssl != null)
- // {
- // for (int i = 0, numStyles = ssl.getLength(); i < numStyles; i++)
- // {
- // // loop for styles (<style> and <link>)
- // org.w3c.dom.stylesheets.StyleSheet ss = ssl.item(i);
- if (styleSheets != null) {
- for (int i = 0, numStyles = styleSheets.size(); i < numStyles; i++) {
- StyleSheet ss = (StyleSheet) styleSheets.get(i);
- try {
- query.apply((ICSSNode) ss);
- } catch (ClassCastException ex) {
- Logger log = PDPlugin.getLogger(CSSStyleDeclaration.class);
- log.error("Error.CSSUtil.0", ex); //$NON-NLS-1$
- // FIXME: should this continue to be processed?
- }
- }
- }
- CSSStyleDeclaration declare = query.getDeclaration();
- // FIXME: when do we need to apply the user agent style sheet?
- return declare;
- }
-
- /**
- * Many of this method implementation copied from HTMLDocumentAdapter,
- * mainly add support for user agent default style sheet.
- *
- * @param element
- * the element.
- * @param pseudoName
- * the pseudoname of the element
- * @return the style declaration
- */
- public static CSSStyleDeclaration getDefaultCSSDeclaration(Element element,
- String pseudoName) {
- CSSQueryTraverser query = new CSSQueryTraverser();
- query.setTraverseImported(true);
- query.setTraverseImportFirst(true);
-
- query.setElement(element, pseudoName);
-
- // FIXME: when do we need to apply the user agent style sheet?
- try {
- getUserAgentDefaultStyleSheet(element);
- } catch (UnsupportedEncodingException e) {
- Logger log = PDPlugin.getLogger(CSSStyleDeclaration.class);
- log.error("Error.CSSUtil.1", e); //$NON-NLS-1$
- } catch (IOException e) {
- Logger log = PDPlugin.getLogger(CSSStyleDeclaration.class);
- log.error("Error.CSSUtil.2", e); //$NON-NLS-1$
- }
- if (_userAgentDefault != null) {
- try {
- query.apply((ICSSNode) _userAgentDefault);
- } catch (ClassCastException ex) {
- Logger log = PDPlugin.getLogger(CSSStyleDeclaration.class);
- log.error("Error.CSSUtil.3", ex); //$NON-NLS-1$
- }
- }
- CSSStyleDeclaration declare = query.getDeclaration();
- return declare;
- }
-
- /**
- * Get the user agent default style sheet.
- *
- * @param element
- * @return
- * @throws IOException
- * @throws UnsupportedEncodingException
- */
- // XXX: in the future, we may get user agent default style sheet based on
- // device type.
- private static StyleSheet getUserAgentDefaultStyleSheet(Element element)
- throws UnsupportedEncodingException, IOException {
- if (_userAgentDefault == null) {
- InputStream input = null;
-
- try
- {
- input = CSSUtil.class
- .getResourceAsStream(IJMTConstants.USERAGENT);
- IStructuredModel model = StructuredModelManager.getModelManager()
- .getModelForEdit(IJMTConstants.USERAGENT, input, null);
- ICSSModel cssmodel = (ICSSModel) model;
- _userAgentDefault = (StyleSheet) cssmodel.getDocument();
- }
- finally
- {
- ResourceUtils.ensureClosed(input);
- }
- }
-
- return _userAgentDefault;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/ICSSStyle.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/ICSSStyle.java
deleted file mode 100644
index 9d1524b..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/ICSSStyle.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2;
-
-import java.util.Map;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.jst.pagedesigner.css2.font.ICSSFont;
-import org.eclipse.jst.pagedesigner.css2.list.ICounterValueGenerator;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-
-/**
- * The style declaration for an element can be cached.
- *
- * @author mengbo
- */
-public interface ICSSStyle extends INodeAdapter, IAdaptable {
-
- // the number of extra pixels to add to top, bottom, left and right padding insets
- // in the rendering so that separation between contained components is more
- // apparent at design time. These extra pixels are design mode only
- // Note: margin padding would be preferred but it doesn't seem to affect
- // bottom padding the way border insets do.
- // TODO: this should be set to a preference and probably also use an
- // algorithm to determine if the the current box style already has a large
- // enough separation offset (perhaps a threshold instead of an additive value)
- /**
- * the border offset
- */
- public static final int ARTIFICIAL_BORDER_OFFSET = 4;
-
- /**
- *
- */
- public static final int INHERIT = Integer.MIN_VALUE;
-
- /**
- * the top attribute vale
- */
- public static final String TOP = "top";
-
- /**
- * the right attribute value
- */
- public static final String RIGHT = "right";
-
- /**
- * the left attribute value
- */
- public static final String LEFT = "left";
-
- /**
- * the bottom attribute value
- */
- public static final String BOTTOM = "bottom";
-
- /**
- *
- */
- public void reset();
-
- /**
- * @return the font
- */
- public ICSSFont getCSSFont();
-
- /**
- * @param property
- * @return the style property
- */
- public Object getStyleProperty(String property);
-
- /**
- * @return the margin insets
- */
- public Insets getMarginInsets();
-
- /**
- * @return the border insets
- */
- public Insets getBorderInsets();
-
- /**
- * @return the padding insets
- */
- public Insets getPaddingInsets();
-
- /**
- * shortcut method to get the CSS display.
- *
- * see http://www.w3.org/TR/REC-CSS2/visuren.html#propdef-display
- * @return the display string
- */
- public String getDisplay();
-
- /**
- * null means transparent.
- *
- * @return the background color
- */
- public Object getBackgroundColor();
-
- /**
- * @return the foreground color
- */
- public Object getColor();
-
- /**
- * @return true if size includes border padding
- */
- public boolean isSizeIncludeBorderPadding();
-
- /**
- *
- */
- public void dispose();
-
- /**
- * @return the parent style
- */
- public ICSSStyle getParentStyle();
-
- /**
- * Get counters declared on this style. the counters are either created by
- * counter-reset or refered by counter-increment
- *
- * @return the counters
- */
- public Map getCounters();
-
- /**
- * Search a named counter declared on this style or its ancestors' styles
- *
- * @param name
- * @param must
- * @return the generator
- */
- public ICounterValueGenerator findCounter(String name, boolean must);
-
- /**
- * Currently, rowspan and colspan are not CSS property. But based on the CSS
- * specification, it is expected in the future this two will be added as CSS
- * property, so we also include them into ICSSStyle
- *
- * @return the row span
- */
- public int getRowSpan();
-
- /**
- * @return the column span
- */
- public int getColSpan();
-
- /**
- * Normally, when layout a figure and its children. We'll reset the counters
- * declared on this style. And if there are "counter-increment" on this
- * style, they'll also be processed.
- *
- */
- public void processCounters();
-
- /**
- * Whether the corresponding figure should be draw in selected mode. This is
- * not a real CSS property. This is a shortcut method. implemented through
- * getAdapter() on IRangeSelectionProxy
- *
- * @return true if in selection
- */
- public boolean isInSelection();
-
- /**
- * @param propertyName
- * @return the element init value
- */
- public Object getHTMLelementInitValue(String propertyName);
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/border/CSSBorder.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/border/CSSBorder.java
deleted file mode 100644
index b98f14f..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/border/CSSBorder.java
+++ /dev/null
@@ -1,542 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.border;
-
-import java.util.Arrays;
-
-import org.eclipse.draw2d.AbstractBorder;
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.jst.pagedesigner.editors.pagedesigner.MessageFormater;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * @author mengbo
- */
-public class CSSBorder extends AbstractBorder {
-
- private static final String BODER_QUERY_TEMPLETE = "border-{0}-style";
-
- private static final String COLOR_QUERY_TEMPLETE = "border-{0}-color";
-
- private final ICSSStyle _style;
-
- private final Rectangle _innerRect = new Rectangle();
-
- /**
- * @param style
- */
- public CSSBorder(ICSSStyle style) {
- this._style = style;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.draw2d.Border#getInsets(org.eclipse.draw2d.IFigure)
- */
- public Insets getInsets(IFigure figure) {
- return _style.getBorderInsets();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.draw2d.Border#paint(org.eclipse.draw2d.IFigure,
- * org.eclipse.draw2d.Graphics, org.eclipse.draw2d.geometry.Insets)
- */
- public void paint(IFigure figure, Graphics graphics, Insets insets) {
- tempRect.setBounds(getPaintRectangle(figure, insets));
- _innerRect.setBounds(tempRect);
- _innerRect.crop(_style.getBorderInsets());
- paintEdge(graphics, tempRect, _innerRect, ICSSStyle.LEFT);
- paintEdge(graphics, tempRect, _innerRect, ICSSStyle.RIGHT);
- paintEdge(graphics, tempRect, _innerRect, ICSSStyle.TOP);
- paintEdge(graphics, tempRect, _innerRect, ICSSStyle.BOTTOM);
- }
-
- /**
- * @param style
- * @return
- */
- private boolean shouldDraw(String style) {
- return style != null && !ICSSPropertyID.VAL_NONE.equals(style)
- && !ICSSPropertyID.VAL_HIDDEN.equals(style);
- }
-
- /**
- * Fetchs the color array used to draw the given edge under the given style
- *
- * @param graphics
- * @param style
- * @param edge
- * @return
- */
- private RGB[] getEdgeColors(Graphics graphics, String style, String edge) {
- String property = MessageFormater.format(COLOR_QUERY_TEMPLETE, edge);
- Object obj = _style.getStyleProperty(property);
- if (obj instanceof RGB) {
- return getCustomColors(graphics, style, edge, (RGB) obj);
- } else if (obj instanceof Color) {
- return getCustomColors(graphics, style, edge, ((Color) obj)
- .getRGB());
- } else {
- return getDefaultColors(graphics, style, edge);
- }
- }
- // TODO: needs refactoring
- private RGB[] getDefaultColors(Graphics graphics, String style, String edge) {
- if (ICSSPropertyID.VAL_OUTSET.equals(style)) {
- if (ICSSStyle.TOP.equals(edge) || ICSSStyle.LEFT.equals(edge)) {
- return new RGB[] { ColorConstants.button.getRGB(),
- ColorConstants.buttonLightest.getRGB() };
- }
- return new RGB[] { ColorConstants.buttonDarkest.getRGB(),
- ColorConstants.buttonDarker.getRGB() };
- } else if (ICSSPropertyID.VAL_INSET.equals(style)) {
- if (ICSSStyle.TOP.equals(edge) || ICSSStyle.LEFT.equals(edge)) {
- return new RGB[] { ColorConstants.buttonDarker.getRGB(),
- ColorConstants.buttonDarkest.getRGB() };
- }
- return new RGB[] { ColorConstants.buttonLightest.getRGB(),
- ColorConstants.button.getRGB() };
- } else if (ICSSPropertyID.VAL_TDBORDERSTYLE.equals(style)) {
- if (ICSSStyle.TOP.equals(edge) || ICSSStyle.LEFT.equals(edge)) {
- return new RGB[] { ColorConstants.buttonDarker.getRGB() };
- }
- return new RGB[] { ColorConstants.button.getRGB() };
- } else if (ICSSPropertyID.VAL_RIDGE.equals(style)) {
- if (ICSSStyle.TOP.equals(edge) || ICSSStyle.LEFT.equals(edge)) {
- return new RGB[] { ColorConstants.button.getRGB(),
- ColorConstants.buttonDarkest.getRGB() };
- }
- return new RGB[] { ColorConstants.buttonDarkest.getRGB(),
- ColorConstants.button.getRGB() };
- } else if (ICSSPropertyID.VAL_GROOVE.equals(style)) {
- if (ICSSStyle.TOP.equals(edge) || ICSSStyle.LEFT.equals(edge)) {
- return new RGB[] { ColorConstants.buttonDarker.getRGB(),
- ColorConstants.buttonLightest.getRGB() };
- }
- return new RGB[] { ColorConstants.buttonLightest.getRGB(),
- ColorConstants.buttonDarker.getRGB(), };
- } else if (ICSSPropertyID.VAL_DOUBLE.equals(style)) {
- return new RGB[] { ColorConstants.buttonDarkest.getRGB(),
- graphics.getBackgroundColor().getRGB(),
- ColorConstants.buttonDarkest.getRGB() };
- } else if (ICSSPropertyID.VAL_SOLID.equals(style)) {
- return new RGB[] { ColorConstants.black.getRGB() };
- }
-
- return new RGB[] { ColorConstants.black.getRGB() };
- }
-
- // TODO: needs refactoring
- private RGB[] getCustomColors(Graphics graphics, String style, String edge,
- RGB baseColor) {
- if (ICSSPropertyID.VAL_OUTSET.equals(style)) {
- if (ICSSStyle.TOP.equals(edge) || ICSSStyle.LEFT.equals(edge)) {
- return new RGB[] {
- new RGB(baseColor.red * 3 / 4,
- baseColor.green * 3 / 4,
- baseColor.blue * 3 / 4),
- new RGB(baseColor.red, baseColor.green, baseColor.blue) };
- }
- return new RGB[] {
- new RGB(baseColor.red / 2,
- baseColor.green / 2,
- baseColor.blue / 2),
- new RGB(baseColor.red / 4,
- baseColor.green / 4,
- baseColor.blue / 4) };
- } else if (ICSSPropertyID.VAL_INSET.equals(style)) {
- if (ICSSStyle.TOP.equals(edge) || ICSSStyle.LEFT.equals(edge)) {
- return new RGB[] {
- new RGB(baseColor.red / 4,
- baseColor.green / 4,
- baseColor.blue / 4),
- new RGB(baseColor.red / 2,
- baseColor.green / 2,
- baseColor.blue / 2) };
- }
- return new RGB[] {
- new RGB(baseColor.red, baseColor.green, baseColor.blue),
- new RGB(baseColor.red * 3 / 4,
- baseColor.green * 3 / 4,
- baseColor.blue * 3 / 4), };
- } else if (ICSSPropertyID.VAL_TDBORDERSTYLE.equals(style)) {
- if (ICSSStyle.TOP.equals(edge) || ICSSStyle.LEFT.equals(edge)) {
- return new RGB[] { new RGB(baseColor.red / 4,
- baseColor.green / 4, baseColor.blue / 4) };
- }
- return new RGB[] { new RGB(baseColor.red, baseColor.green,
- baseColor.blue) };
- } else if (ICSSPropertyID.VAL_RIDGE.equals(style)) {
- if (ICSSStyle.TOP.equals(edge) || ICSSStyle.LEFT.equals(edge)) {
- return new RGB[] {
- new RGB(baseColor.red * 3 / 4,
- baseColor.green * 3 / 4,
- baseColor.blue * 3 / 4),
- new RGB(baseColor.red / 2,
- baseColor.green / 2,
- baseColor.blue / 2) };
- }
- return new RGB[] {
- new RGB(baseColor.red / 2,
- baseColor.green / 2,
- baseColor.blue / 2),
- new RGB(baseColor.red * 3 / 4,
- baseColor.green * 3 / 4,
- baseColor.blue * 3 / 4) };
- } else if (ICSSPropertyID.VAL_GROOVE.equals(style)) {
- if (ICSSStyle.TOP.equals(edge) || ICSSStyle.LEFT.equals(edge)) {
- return new RGB[] {
- new RGB(baseColor.red / 4,
- baseColor.green / 4,
- baseColor.blue / 4),
- new RGB(baseColor.red, baseColor.green, baseColor.blue) };
-
- }
- return new RGB[] {
- new RGB(baseColor.red, baseColor.green, baseColor.blue),
- new RGB(baseColor.red / 4,
- baseColor.green / 4,
- baseColor.blue / 4) };
- } else if (ICSSPropertyID.VAL_DOUBLE.equals(style)) {
- return new RGB[] {
- new RGB(baseColor.red, baseColor.green, baseColor.blue),
- graphics.getBackgroundColor().getRGB(),
- new RGB(baseColor.red, baseColor.green, baseColor.blue) };
- } else if (ICSSPropertyID.VAL_SOLID.equals(style)) {
- return new RGB[] { new RGB(baseColor.red, baseColor.green,
- baseColor.blue) };
- }
- return new RGB[] { new RGB(baseColor.red, baseColor.green,
- baseColor.blue) };
- }
-
- /**
- * @param graphics
- * @param rect
- * @param innerRect
- * @param edge
- * @param style
- */
- public void paintEdge(Graphics graphics, Rectangle rect,
- Rectangle innerRect, String edge, String style) {
- if (!shouldDraw(style)) {
- return;
- }
- RGB[] rgbs = getEdgeColors(graphics, style, edge);
-
- if (ICSSStyle.TOP.equals(edge)) {
- paintTopEdge(graphics, rgbs, style, rect, innerRect);
- } else if (ICSSStyle.BOTTOM.equals(edge)) {
- paintBottomEdge(graphics, rgbs, style, rect, innerRect);
- } else if (ICSSStyle.LEFT.equals(edge)) {
- paintLeftEdge(graphics, rgbs, style, rect, innerRect);
- } else if (ICSSStyle.RIGHT.equals(edge)) {
- paintRightEdge(graphics, rgbs, style, rect, innerRect);
- }
- }
-
- /**
- * @param graphics
- * @param rect
- * @param innerRect
- * @param edge
- */
- protected void paintEdge(Graphics graphics, Rectangle rect,
- Rectangle innerRect, String edge) {
- String property = MessageFormater.format(BODER_QUERY_TEMPLETE, edge);
- Object obj = _style.getStyleProperty(property);
- String style = obj.toString();
- paintEdge(graphics, rect, innerRect, edge, style);
- }
-
- private void paintTopEdge(Graphics graphics, RGB[] rgbs, String style,
- Rectangle rect, Rectangle innerRect) {
- int leftX = rect.x;
- int rightX = rect.right() - 1;
- int y = rect.y;
- int width = innerRect.y - rect.y;
-
- if (ICSSPropertyID.VAL_DOTTED.equals(style)) {
- drawDottedBorder(graphics, rgbs, ICSSStyle.TOP, rect, width);
- } else if (ICSSPropertyID.VAL_DASHED.equals(style)) {
- drawDashedBorder(graphics, rgbs, ICSSStyle.TOP, rect, width);
- } else {
- double xLeftRate = ((double) (innerRect.x - rect.x)) / width;
- double xRightRate = ((double) (rect.right() - innerRect.right()))
- / width;
- graphics.pushState();
- for (int i = 0; i < width; i++) {
- Color color = new Color(Display.getCurrent(), rgbs[rgbs.length
- * i / width]);
- graphics.setForegroundColor(color);
- graphics.drawLine((int) (leftX + i * xLeftRate), y + i,
- (int) (rightX - i * xRightRate), y + i);
- color.dispose();
- }
- graphics.popState();
- }
- }
-
- private void paintBottomEdge(Graphics graphics, RGB[] rgbs, String style,
- Rectangle rect, Rectangle innerRect) {
- int leftX = rect.x;
- int rightX = rect.right() - 1;
- int y = rect.bottom() - 1;
- int width = rect.bottom() - innerRect.bottom();
-
- if (ICSSPropertyID.VAL_DOTTED.equals(style)) {
- drawDottedBorder(graphics, rgbs, ICSSStyle.BOTTOM, rect, width);
- } else if (ICSSPropertyID.VAL_DASHED.equals(style)) {
- drawDashedBorder(graphics, rgbs, ICSSStyle.BOTTOM, rect, width);
- } else {
- double xLeftRate = ((double) (innerRect.x - rect.x)) / width;
- double xRightRate = ((double) (rect.right() - innerRect.right()))
- / width;
- graphics.pushState();
- for (int i = 0; i < width; i++) {
- Color color = new Color(Display.getCurrent(), rgbs[rgbs.length
- * i / width]);
- graphics.setForegroundColor(color);
- graphics.drawLine(leftX + (int) (i * xLeftRate), y - i, rightX
- - (int) (i * xRightRate), y - i);
- color.dispose();
- }
- graphics.popState();
- }
- }
-
- private void paintLeftEdge(Graphics graphics, RGB[] rgbs, String style,
- Rectangle rect, Rectangle innerRect) {
- int x = rect.x;
- int topY = rect.y;
- int bottomY = rect.bottom() - 1;
- int width = innerRect.x - rect.x;
-
- if (ICSSPropertyID.VAL_DOTTED.equals(style)) {
- drawDottedBorder(graphics, rgbs, ICSSStyle.LEFT, rect, width);
- } else if (ICSSPropertyID.VAL_DASHED.equals(style)) {
- drawDashedBorder(graphics, rgbs, ICSSStyle.LEFT, rect, width);
- } else {
- double yTopRate = ((double) (innerRect.y - rect.y)) / width;
- double yBottomRate = ((double) (rect.bottom() - innerRect.bottom()))
- / width;
- graphics.pushState();
- for (int i = 0; i < width; i++) {
- Color color = new Color(Display.getCurrent(), rgbs[rgbs.length
- * i / width]);
- graphics.setForegroundColor(color);
- graphics.drawLine(x + i, topY + (int) (i * yTopRate), x + i,
- bottomY - (int) (i * yBottomRate));
- color.dispose();
- }
- graphics.popState();
- }
-
- }
-
- private void paintRightEdge(Graphics graphics, RGB[] rgbs, String style,
- Rectangle rect, Rectangle innerRect) {
- int x = rect.right() - 1;
- int topY = rect.y;
- int bottomY = rect.bottom() - 1;
- int width = rect.right() - innerRect.right();
-
- if (ICSSPropertyID.VAL_DOTTED.equals(style)) {
- drawDottedBorder(graphics, rgbs, ICSSStyle.RIGHT, rect, width);
- } else if (ICSSPropertyID.VAL_DASHED.equals(style)) {
- drawDashedBorder(graphics, rgbs, ICSSStyle.RIGHT, rect, width);
- } else {
- graphics.pushState();
- for (int i = 0; i < width; i++) {
- double yTopRate = ((double) (innerRect.y - rect.y)) / width;
- double yBottomRate = ((double) (rect.bottom() - innerRect
- .bottom()))
- / width;
- Color color = new Color(Display.getCurrent(), rgbs[rgbs.length
- * i / width]);
- graphics.setForegroundColor(color);
- graphics.drawLine(x - i, topY + (int) (i * yTopRate), x - i,
- bottomY - (int) (i * yBottomRate));
- color.dispose();
- }
- graphics.popState();
- }
- }
-
- private void drawDottedBorder(Graphics graphics, RGB[] rgbs, String style,
- Rectangle rect, int width) {
- if (width == 0 || 3 * width > rect.width) {
- return;
- }
-
- int beginX = 0;
- int beginY = 0;
- int xRate = 0;
- int yRate = 0;
- int span = 0;
-
- if (ICSSStyle.TOP.equals(style)) {
- beginX = rect.x;
- beginY = rect.y;
- xRate = 1;
- yRate = 0;
- span = rect.width;
- } else if (ICSSStyle.LEFT.equals(style)) {
- beginX = rect.x;
- beginY = rect.y;
- xRate = 0;
- yRate = 1;
- span = rect.height;
- } else if (ICSSStyle.BOTTOM.equals(style)) {
- beginX = rect.x;
- beginY = rect.y + rect.height - width;
- xRate = 1;
- yRate = 0;
- span = rect.width;
- } else if (ICSSStyle.RIGHT.equals(style)) {
- beginX = rect.x + rect.width - width;
- beginY = rect.y;
- xRate = 0;
- yRate = 1;
- span = rect.height;
- }
-
- int dottedCount = (span + width) / (2 * width);
- if (dottedCount < 2) {
- dottedCount = 2;
- }
- int averagePad = (span - dottedCount * width) / (dottedCount - 1);
- int leftPad = (span - dottedCount * width) % (dottedCount - 1);
- int[] paddings = new int[dottedCount - 1];
- Arrays.fill(paddings, averagePad);
- for (int i = 0; i < leftPad; i++) {
- paddings[i] = paddings[i] + 1;
- }
-
- int pad = 0;
- Color color = new Color(Display.getCurrent(), rgbs[0]);
- graphics.pushState();
- graphics.setBackgroundColor(color);
- for (int i = 0; i < dottedCount; i++) {
- graphics.fillOval(beginX + (pad + width * i) * xRate, beginY
- + (pad + width * i) * yRate, width, width);
- if (i != dottedCount - 1) {
- pad += paddings[i];
- }
- }
- graphics.popState();
- color.dispose();
-
- }
-
- private void drawDashedBorder(Graphics graphics, RGB[] rgbs, String style,
- Rectangle rect, int borderThick) {
- if (borderThick == 0 || 5 * borderThick > rect.width) {
- return;
- }
-
- if ((5 * borderThick > rect.height)
- && (ICSSStyle.LEFT.equals(style) || ICSSStyle.RIGHT
- .equals(style))) {
- return;
- }
-
- int width = 0;
- int height = 0;
- int edgeLength = 0;
- int beginX = 0;
- int beginY = 0;
- int xRate = 0;
- int yRate = 0;
- int span = 0;
-
- if (ICSSStyle.TOP.equals(style)) {
- width = borderThick * 2;
- height = borderThick;
- beginX = rect.x;
- beginY = rect.y;
- xRate = 1;
- yRate = 0;
-
- span = rect.width;
- edgeLength = width;
- } else if (ICSSStyle.LEFT.equals(style)) {
- width = borderThick;
- height = borderThick * 2;
- beginX = rect.x;
- beginY = rect.y;
- xRate = 0;
- yRate = 1;
-
- span = rect.height;
- edgeLength = height;
- } else if (ICSSStyle.BOTTOM.equals(style)) {
- width = borderThick * 2;
- height = borderThick;
- beginX = rect.x;
- beginY = rect.y + rect.height - height;
- xRate = 1;
- yRate = 0;
-
- span = rect.width;
- edgeLength = width;
- } else if (ICSSStyle.RIGHT.equals(style)) {
- width = borderThick;
- height = borderThick * 2;
- beginX = rect.x + rect.width - width;
- beginY = rect.y;
- xRate = 0;
- yRate = 1;
-
- span = rect.height;
- edgeLength = height;
- }
-
- int dottedCount = (span + borderThick) / (edgeLength + borderThick);
- if (dottedCount < 2) {
- dottedCount = 2;
- }
- int averagePad = (span - dottedCount * edgeLength) / (dottedCount - 1);
- int leftPad = (span - dottedCount * edgeLength) % (dottedCount - 1);
- int[] paddings = new int[dottedCount - 1];
- Arrays.fill(paddings, averagePad);
- for (int i = 0; i < leftPad; i++) {
- paddings[i] = paddings[i] + 1;
- }
-
- int pad = 0;
- graphics.pushState();
- Color color = new Color(Display.getCurrent(), rgbs[0]);
- graphics.setBackgroundColor(color);
- for (int i = 0; i < dottedCount; i++) {
- graphics.fillRectangle(beginX + (pad + width * i) * xRate, beginY
- + (pad + height * i) * yRate, width, height);
- if (i != dottedCount - 1) {
- pad += paddings[i];
- }
- }
- graphics.popState();
- color.dispose();
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/color/CSSColorConverter.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/color/CSSColorConverter.java
deleted file mode 100644
index ea520a1..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/color/CSSColorConverter.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.color;
-
-import java.util.StringTokenizer;
-
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.swt.graphics.RGB;
-
-/**
- * @author mengbo
- */
-public class CSSColorConverter {
- private static final String PREFIX_RGB = "rgb"; //$NON-NLS-1$
-
- private static Logger _log = PDPlugin.getLogger(CSSColorConverter.class);
-
- private static CSSColorConverter _instance = new CSSColorConverter();
-
- /**
- * @return singleton instance
- */
- public static CSSColorConverter getInstantce() {
- if (_instance == null) {
- _instance = new CSSColorConverter();
- }
- return _instance;
- }
-
- Object getCSSColor(String CSSText) {
- if (CSSText == null) {
- return null;
- }
-
- CSSText = CSSText.trim().toLowerCase();
- if (CSSText.length() == 0) {
- return null;
- }
- if (CSSColorDefaults.SYSTEM_DEFAULT_COLORS.containsKey(CSSText)) {
- Object result = null;
- result = CSSColorDefaults.SYSTEM_DEFAULT_COLORS.get(CSSText);
- return result;
- } else if (CSSColorDefaults.EXTENDED_COLORS.containsKey(CSSText)) {
- Object result = null;
- result = CSSColorDefaults.EXTENDED_COLORS.get(CSSText);
- return result;
- } else {
- return convertStringToRGB(CSSText);
- }
- }
-
- private RGB convertStringToRGB(String CSSText) {
- StringBuffer sb = new StringBuffer(CSSText);
- int value;
- try {
- if (sb.indexOf("#") == 0) //$NON-NLS-1$
- {
- if (sb.length() == 4) {
- sb.insert(1, sb.charAt(1));
- sb.insert(3, sb.charAt(3));
- sb.insert(5, sb.charAt(5));
- value = Integer.parseInt(sb.substring(1, sb.length())
- .toString(), 16);
- return new RGB(value >>> 16 & 0xff, value >>> 8 & 0xff,
- value & 0xff);
- } else if (sb.length() == 7) {
- value = Integer.parseInt(sb.substring(1, sb.length()), 16);
- return new RGB(value >>> 16 & 0xff, value >>> 8 & 0xff,
- value & 0xff);
- }
- } else if (CSSText.startsWith(PREFIX_RGB)) {
- return convertRgbToRGB(sb.substring(
- sb.indexOf("(") + 1, sb.indexOf(")"))); //$NON-NLS-1$ //$NON-NLS-2$
- }
- } catch (Exception e) {
- _log.info("CSSColorConverter.0", CSSText, null); //$NON-NLS-1$
- return null;
- }
- return null;
- }
-
- private RGB convertRgbToRGB(String text) {
- text = text.trim();
- try {
- StringTokenizer tokenizer = new StringTokenizer(text, ",");//$NON-NLS-1$
-
- if (tokenizer.countTokens() != 3) {
- return null;
- }
- String[] rgbText = new String[3];
- for (int i = 0; i < 3; i++) {
- rgbText[i] = tokenizer.nextToken();
- }
-
- int[] intRGB = new int[] { 0, 0, 0 };
- for (int i = 0; i < 3; i++) {
- int intValue = -1;
- String textValue = rgbText[i].trim();
-
- if (textValue.endsWith("%"))//$NON-NLS-1$
- {
- textValue = textValue.substring(0, textValue.length() - 1);
-
- intValue = Integer.parseInt(textValue) * 255 / 100;
- } else {
- intValue = Integer.parseInt(textValue);
- }
- if (intValue < 0) {
- intValue = 0;
- } else if (intValue > 255) {
- intValue = 255;
- }
- intRGB[i] = intValue;
- }
- return new RGB(intRGB[0], intRGB[1], intRGB[2]);
- } catch (Exception e) {
- // notify
- _log.info("CSSColorConverter.1", text, null); //$NON-NLS-1$
- return null;
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/color/CSSColorDefaults.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/color/CSSColorDefaults.java
deleted file mode 100644
index 556f5db..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/color/CSSColorDefaults.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.color;
-
-import java.util.HashMap;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * @author mengbo
- */
-public class CSSColorDefaults {
- static final HashMap SYSTEM_DEFAULT_COLORS = new HashMap(20);
-
- static final HashMap EXTENDED_COLORS = new HashMap(20);
-
- // TODO C.B.: there is overlap here between the default and extended
- // colors. Also, for the custom colors, should use a ColorRegistry
- // that allows other components to share values here
- static {
- SYSTEM_DEFAULT_COLORS.put("black", ColorConstants.black);
- SYSTEM_DEFAULT_COLORS.put("blue", ColorConstants.blue);
- SYSTEM_DEFAULT_COLORS.put("gray", ColorConstants.gray);
- SYSTEM_DEFAULT_COLORS.put("green", new Color(null, 0, 128, 0));
- SYSTEM_DEFAULT_COLORS.put("orange", ColorConstants.orange);
- SYSTEM_DEFAULT_COLORS.put("red", ColorConstants.red);
- SYSTEM_DEFAULT_COLORS.put("white", ColorConstants.white);
- SYSTEM_DEFAULT_COLORS.put("yellow", ColorConstants.yellow);
- SYSTEM_DEFAULT_COLORS.put("aqua", ColorConstants.cyan);
- SYSTEM_DEFAULT_COLORS.put("fuchsia", new Color(null, 255, 0, 255));
- SYSTEM_DEFAULT_COLORS.put("lime", ColorConstants.green);
- SYSTEM_DEFAULT_COLORS.put("maroon", new Color(null, 128, 0, 0));
- SYSTEM_DEFAULT_COLORS.put("navy", new Color(null, 0, 0, 128));
- SYSTEM_DEFAULT_COLORS.put("olive", new Color(null, 128, 128, 0));
- SYSTEM_DEFAULT_COLORS.put("purple", new Color(null, 128, 0, 128));
- SYSTEM_DEFAULT_COLORS.put("silver", ColorConstants.lightGray);
- SYSTEM_DEFAULT_COLORS.put("teal", new Color(null, 0, 128, 128));
-
- SYSTEM_DEFAULT_COLORS.put("activeborder", Display.getCurrent()
- .getSystemColor(SWT.COLOR_WIDGET_BORDER));
- // Active window border.
- SYSTEM_DEFAULT_COLORS.put("activecaption",
- ColorConstants.titleBackground);
- // Active window caption.
- SYSTEM_DEFAULT_COLORS
- .put("appworkspace", ColorConstants.listBackground);
- // Background color of multiple document interface.
- SYSTEM_DEFAULT_COLORS.put("background", ColorConstants.listBackground);
- // Desktop background.
- SYSTEM_DEFAULT_COLORS.put("buttonface", ColorConstants.button);
- // Face color for three-dimensional display elements.
- SYSTEM_DEFAULT_COLORS.put("buttonhighlight",
- ColorConstants.buttonLightest);
- // Dark shadow for three-dimensional display elements (for edges facing
- // away from the light source).
- SYSTEM_DEFAULT_COLORS.put("buttonshadow", ColorConstants.buttonDarker);
- // Shadow color for three-dimensional display elements.
- SYSTEM_DEFAULT_COLORS.put("buttontext", Display.getCurrent()
- .getSystemColor(SWT.COLOR_WIDGET_FOREGROUND));
- // Text on push buttons.
- SYSTEM_DEFAULT_COLORS
- .put("captiontext", ColorConstants.titleForeground);
- // Text in caption, size box, and scrollbar arrow box.
- SYSTEM_DEFAULT_COLORS.put("graytext",
- ColorConstants.titleInactiveForeground);
- // Grayed (disabled) text. This color is set to #000 if the current
- // display driver does not support a solid gray color.
- SYSTEM_DEFAULT_COLORS.put("highlight",
- ColorConstants.menuBackgroundSelected);
- // Item(s) selected in a control.
- SYSTEM_DEFAULT_COLORS.put("highlighttext",
- ColorConstants.menuForegroundSelected);
- // Text of item(s) selected in a control.
- SYSTEM_DEFAULT_COLORS.put("inactiveborder", Display.getCurrent()
- .getSystemColor(SWT.COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT));
- // Inactive window border.
- SYSTEM_DEFAULT_COLORS.put("inactivecaption",
- ColorConstants.titleInactiveBackground);
- // Inactive window caption.
- SYSTEM_DEFAULT_COLORS.put("inactivecaptiontext",
- ColorConstants.titleInactiveForeground);
- // Color of text in an inactive caption.
- SYSTEM_DEFAULT_COLORS.put("infobackground",
- ColorConstants.tooltipBackground);
- // Background color for tooltip controls.
- SYSTEM_DEFAULT_COLORS.put("infotext", ColorConstants.tooltipForeground);
- // Text color for tooltip controls.
- SYSTEM_DEFAULT_COLORS.put("menu", ColorConstants.menuBackground);
- // Menu background.
- SYSTEM_DEFAULT_COLORS.put("menutext", ColorConstants.menuForeground);
- // Text in menus.
- SYSTEM_DEFAULT_COLORS.put("scrollbar", Display.getCurrent()
- .getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
- // Scroll bar gray area.
- SYSTEM_DEFAULT_COLORS.put("threeddarkshadow", Display.getCurrent()
- .getSystemColor(SWT.COLOR_WIDGET_DARK_SHADOW));
- // Dark shadow for three-dimensional display elements.
- SYSTEM_DEFAULT_COLORS.put("threedface", Display.getCurrent()
- .getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
- // Face color for three-dimensional display elements.
- SYSTEM_DEFAULT_COLORS.put("threedhighlight", Display.getCurrent()
- .getSystemColor(SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW));
- // Highlight color for three-dimensional display elements.
- SYSTEM_DEFAULT_COLORS.put("threedlightshadow", Display.getCurrent()
- .getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW));
- // Light color for three-dimensional display elements (for edges facing
- // the light source).
- SYSTEM_DEFAULT_COLORS.put("threedshadow", Display.getCurrent()
- .getSystemColor(SWT.COLOR_WIDGET_DARK_SHADOW));
- // Dark shadow for three-dimensional display elements.
- SYSTEM_DEFAULT_COLORS.put("window", Display.getCurrent()
- .getSystemColor(SWT.COLOR_LIST_BACKGROUND));
- // Window background.
- SYSTEM_DEFAULT_COLORS.put("windowframe", Display.getCurrent()
- .getSystemColor(SWT.COLOR_WIDGET_BORDER));
- // Window frame.
- SYSTEM_DEFAULT_COLORS.put("windowtext", Display.getCurrent()
- .getSystemColor(SWT.COLOR_LIST_FOREGROUND));
- // Window text
- SYSTEM_DEFAULT_COLORS.put("hyperlink", ColorConstants.blue);
- }
-
- // populate the extended color palette. Where the extended
- // color is the same as a constant color, use that to save
- // on SWT resource handles
- static {
- EXTENDED_COLORS.put("aliceblue", new Color(null, 240, 248, 255));
- EXTENDED_COLORS.put("antiquewhite", new Color(null, 250, 235, 215));
- EXTENDED_COLORS.put("aqua", ColorConstants.cyan);
- EXTENDED_COLORS.put("aquamarine", new Color(null, 127, 255, 212));
- EXTENDED_COLORS.put("azure", new Color(null, 240, 255, 255));
- EXTENDED_COLORS.put("beige", new Color(null, 245, 245, 220));
- EXTENDED_COLORS.put("bisque", new Color(null, 255, 228, 196));
- EXTENDED_COLORS.put("black", ColorConstants.black);
- EXTENDED_COLORS.put("blanchedalmond", new Color(null, 255, 235, 205));
- EXTENDED_COLORS.put("blue", ColorConstants.blue);
- EXTENDED_COLORS.put("blueviolet", new Color(null, 138, 43, 226));
- EXTENDED_COLORS.put("brown", new Color(null, 165, 42, 42));
- EXTENDED_COLORS.put("burlywood", new Color(null, 222, 184, 135));
- EXTENDED_COLORS.put("cadetblue", new Color(null, 95, 158, 160));
- EXTENDED_COLORS.put("chartreuse", new Color(null, 127, 255, 0));
- EXTENDED_COLORS.put("chocolate", new Color(null, 210, 105, 30));
- EXTENDED_COLORS.put("coral", new Color(null, 255, 127, 80));
- EXTENDED_COLORS.put("cornflowerblue", new Color(null, 100, 149, 237));
- EXTENDED_COLORS.put("cornsilk", new Color(null, 255, 248, 220));
- EXTENDED_COLORS.put("crimson", new Color(null, 220, 20, 60));
- EXTENDED_COLORS.put("cyan", new Color(null, 0, 255, 255));
- EXTENDED_COLORS.put("darkblue", new Color(null, 0, 0, 139));
- EXTENDED_COLORS.put("darkcyan", new Color(null, 0, 139, 139));
- EXTENDED_COLORS.put("darkgoldenrod", new Color(null, 184, 134, 11));
- EXTENDED_COLORS.put("darkgray", new Color(null, 169, 169, 169));
- EXTENDED_COLORS.put("darkgreen", new Color(null, 0, 100, 0));
- EXTENDED_COLORS.put("darkkhaki", new Color(null, 189, 183, 107));
- EXTENDED_COLORS.put("darkmagenta", new Color(null, 139, 0, 139));
- EXTENDED_COLORS.put("darkolivegreen", new Color(null, 85, 107, 47));
- EXTENDED_COLORS.put("darkorange", new Color(null, 255, 140, 0));
- EXTENDED_COLORS.put("darkorchid", new Color(null, 153, 50, 204));
- EXTENDED_COLORS.put("darkred", new Color(null, 139, 0, 0));
- EXTENDED_COLORS.put("darksalmon", new Color(null, 233, 150, 122));
- EXTENDED_COLORS.put("darkseagreen", new Color(null, 143, 188, 143));
- EXTENDED_COLORS.put("darkslateblue", new Color(null, 72, 61, 139));
- EXTENDED_COLORS.put("darkslategray", new Color(null, 47, 79, 79));
- EXTENDED_COLORS.put("darkturquoise", new Color(null, 0, 206, 209));
- EXTENDED_COLORS.put("darkviolet", new Color(null, 148, 0, 211));
- EXTENDED_COLORS.put("deeppink", new Color(null, 255, 20, 147));
- EXTENDED_COLORS.put("deepskyblue", new Color(null, 0, 191, 255));
- EXTENDED_COLORS.put("dimgray", new Color(null, 105, 105, 105));
- EXTENDED_COLORS.put("dodgerblue", new Color(null, 30, 144, 255));
- EXTENDED_COLORS.put("feldspar", new Color(null, 209, 146, 117));
- EXTENDED_COLORS.put("firebrick", new Color(null, 178, 34, 34));
- EXTENDED_COLORS.put("floralwhite", new Color(null, 255, 250, 240));
- EXTENDED_COLORS.put("forestgreen", new Color(null, 34, 139, 34));
- EXTENDED_COLORS.put("fuchsia", new Color(null, 255, 0, 255));
- EXTENDED_COLORS.put("gainsboro", new Color(null, 220, 220, 220));
- EXTENDED_COLORS.put("ghostwhite", new Color(null, 248, 248, 255));
- EXTENDED_COLORS.put("gold", new Color(null, 255, 215, 0));
- EXTENDED_COLORS.put("goldenrod", new Color(null, 218, 165, 32));
- EXTENDED_COLORS.put("gray", ColorConstants.gray);
- EXTENDED_COLORS.put("green", new Color(null, 0, 128, 0));
- EXTENDED_COLORS.put("greenyellow", new Color(null, 173, 255, 47));
- EXTENDED_COLORS.put("honeydew", new Color(null, 240, 255, 240));
- EXTENDED_COLORS.put("hotpink", new Color(null, 255, 105, 180));
- EXTENDED_COLORS.put("indianred", new Color(null, 205, 92, 92));
- EXTENDED_COLORS.put("indigo", new Color(null, 75, 0, 130));
- EXTENDED_COLORS.put("ivory", new Color(null, 255, 255, 240));
- EXTENDED_COLORS.put("khaki", new Color(null, 240, 230, 140));
- EXTENDED_COLORS.put("lavender", new Color(null, 230, 230, 250));
- EXTENDED_COLORS.put("lavenderblush", new Color(null, 255, 240, 245));
- EXTENDED_COLORS.put("lawngreen", new Color(null, 124, 252, 0));
- EXTENDED_COLORS.put("lemonchiffon", new Color(null, 255, 250, 205));
- EXTENDED_COLORS.put("lightblue", new Color(null, 173, 216, 230));
- EXTENDED_COLORS.put("lightcoral", new Color(null, 240, 128, 128));
- EXTENDED_COLORS.put("lightcyan", new Color(null, 224, 255, 255));
- EXTENDED_COLORS.put("lightgoldenrodyellow", new Color(null, 250, 250,
- 210));
- EXTENDED_COLORS.put("lightgrey", new Color(null, 211, 211, 211));
- EXTENDED_COLORS.put("lightgreen", new Color(null, 144, 238, 144));
- EXTENDED_COLORS.put("lightpink", new Color(null, 255, 182, 193));
- EXTENDED_COLORS.put("lightsalmon", new Color(null, 255, 160, 122));
- EXTENDED_COLORS.put("lightseagreen", new Color(null, 32, 178, 170));
- EXTENDED_COLORS.put("lightskyblue", new Color(null, 135, 206, 250));
- EXTENDED_COLORS.put("lightslateblue", new Color(null, 132, 112, 255));
- EXTENDED_COLORS.put("lightslategray", new Color(null, 119, 136, 153));
- EXTENDED_COLORS.put("lightsteelblue", new Color(null, 176, 196, 222));
- EXTENDED_COLORS.put("lightyellow", new Color(null, 255, 255, 224));
- EXTENDED_COLORS.put("lime", ColorConstants.green);
- EXTENDED_COLORS.put("limegreen", new Color(null, 50, 205, 50));
- EXTENDED_COLORS.put("linen", new Color(null, 250, 240, 230));
- EXTENDED_COLORS.put("magenta", new Color(null, 255, 0, 255));
- EXTENDED_COLORS.put("maroon", new Color(null, 128, 0, 0));
- EXTENDED_COLORS.put("mediumaquamarine", new Color(null, 102, 205, 170));
- EXTENDED_COLORS.put("mediumblue", new Color(null, 0, 0, 205));
- EXTENDED_COLORS.put("mediumorchid", new Color(null, 186, 85, 211));
- EXTENDED_COLORS.put("mediumpurple", new Color(null, 147, 112, 216));
- EXTENDED_COLORS.put("mediumseagreen", new Color(null, 60, 179, 113));
- EXTENDED_COLORS.put("mediumslateblue", new Color(null, 123, 104, 238));
- EXTENDED_COLORS.put("mediumspringgreen", new Color(null, 0, 250, 154));
- EXTENDED_COLORS.put("mediumturquoise", new Color(null, 72, 209, 204));
- EXTENDED_COLORS.put("mediumvioletred", new Color(null, 199, 21, 133));
- EXTENDED_COLORS.put("midnightblue", new Color(null, 25, 25, 112));
- EXTENDED_COLORS.put("mintcream", new Color(null, 245, 255, 250));
- EXTENDED_COLORS.put("mistyrose", new Color(null, 255, 228, 225));
- EXTENDED_COLORS.put("moccasin", new Color(null, 255, 228, 181));
- EXTENDED_COLORS.put("navajowhite", new Color(null, 255, 222, 173));
- EXTENDED_COLORS.put("navy", new Color(null, 0, 0, 128));
- EXTENDED_COLORS.put("oldlace", new Color(null, 253, 245, 230));
- EXTENDED_COLORS.put("olive", new Color(null, 128, 128, 0));
- EXTENDED_COLORS.put("olivedrab", new Color(null, 107, 142, 35));
- EXTENDED_COLORS.put("orange", new Color(null, 255, 165, 0));
- EXTENDED_COLORS.put("orangeted", new Color(null, 255, 69, 0));
- EXTENDED_COLORS.put("orchid", new Color(null, 218, 112, 214));
- EXTENDED_COLORS.put("ralegoldenrod", new Color(null, 238, 232, 170));
- EXTENDED_COLORS.put("palegreen", new Color(null, 152, 251, 152));
- EXTENDED_COLORS.put("paleturquoise", new Color(null, 175, 238, 238));
- EXTENDED_COLORS.put("palevioletred", new Color(null, 216, 112, 147));
- EXTENDED_COLORS.put("papayawhip", new Color(null, 255, 239, 213));
- EXTENDED_COLORS.put("peachpuff", new Color(null, 255, 218, 185));
- EXTENDED_COLORS.put("peru", new Color(null, 205, 133, 63));
- EXTENDED_COLORS.put("pink", new Color(null, 255, 192, 203));
- EXTENDED_COLORS.put("plum", new Color(null, 221, 160, 221));
- EXTENDED_COLORS.put("powderblue", new Color(null, 176, 224, 230));
- EXTENDED_COLORS.put("purple", new Color(null, 128, 0, 128));
- EXTENDED_COLORS.put("red", ColorConstants.red);
- EXTENDED_COLORS.put("rosybrown", new Color(null, 188, 143, 143));
- EXTENDED_COLORS.put("royalblue", new Color(null, 65, 105, 225));
- EXTENDED_COLORS.put("saddlebrown", new Color(null, 139, 69, 19));
- EXTENDED_COLORS.put("salmon", new Color(null, 250, 128, 114));
- EXTENDED_COLORS.put("sandybrown", new Color(null, 244, 164, 96));
- EXTENDED_COLORS.put("seagreen", new Color(null, 46, 139, 87));
- EXTENDED_COLORS.put("seashell", new Color(null, 255, 245, 238));
- EXTENDED_COLORS.put("sienna", new Color(null, 160, 82, 45));
- EXTENDED_COLORS.put("silver", new Color(null, 192, 192, 192));
- EXTENDED_COLORS.put("skyblue", new Color(null, 135, 206, 235));
- EXTENDED_COLORS.put("slateblue", new Color(null, 106, 90, 205));
- EXTENDED_COLORS.put("slategray", new Color(null, 112, 128, 144));
- EXTENDED_COLORS.put("snow", new Color(null, 255, 250, 250));
- EXTENDED_COLORS.put("springgreen", new Color(null, 0, 255, 127));
- EXTENDED_COLORS.put("steelblue", new Color(null, 70, 130, 180));
- EXTENDED_COLORS.put("tan", new Color(null, 210, 180, 140));
- EXTENDED_COLORS.put("teal", new Color(null, 0, 128, 128));
- EXTENDED_COLORS.put("thistle", new Color(null, 216, 191, 216));
- EXTENDED_COLORS.put("tomato", new Color(null, 255, 99, 71));
- EXTENDED_COLORS.put("turquoise", new Color(null, 64, 224, 208));
- EXTENDED_COLORS.put("violet", new Color(null, 238, 130, 238));
- EXTENDED_COLORS.put("violetred", new Color(null, 208, 32, 144));
- EXTENDED_COLORS.put("wheat", new Color(null, 245, 222, 179));
- EXTENDED_COLORS.put("white", ColorConstants.white);
- EXTENDED_COLORS.put("whitesmoke", new Color(null, 245, 245, 245));
- EXTENDED_COLORS.put("yellow", ColorConstants.yellow);
- EXTENDED_COLORS.put("yellowgreen", new Color(null, 154, 205, 50));
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/color/CSSColorManager.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/color/CSSColorManager.java
deleted file mode 100644
index 66dce7b..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/color/CSSColorManager.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.color;
-
-/**
- * @author mengbo
- */
-public class CSSColorManager {
- private static CSSColorManager _instance;
-
- private CSSColorManager() {
- // no external instantiation
- }
-
- /**
- * @return the single instance
- */
- public static CSSColorManager getInstance() {
- if (_instance == null) {
- _instance = new CSSColorManager();
- }
- return _instance;
- }
-
- /**
- * return Color or RGB. If return color, then the returned color is system
- * color, caller should NOT dispose the returned color
- *
- * @param cssText
- * @return the color object for cssText
- */
- public Object getColor(String cssText) {
- return CSSColorConverter.getInstantce().getCSSColor(cssText);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/font/CSSFont.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/font/CSSFont.java
deleted file mode 100644
index 646da86..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/font/CSSFont.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.font;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Font;
-
-/**
- * @author mengbo
- */
-public class CSSFont implements ICSSFont {
- private String _family;
-
- private int _size;
-
- private int _style;
-
- private int _weight;
-
- private String _cssString;
-
- /**
- * @param family
- * @param size
- * @param style
- * @param weight
- * @param cssString
- *
- */
- public CSSFont(String family, int size, int style, int weight,
- String cssString) {
- this._family = family;
- this._size = size;
- this._style = style;
- this._weight = weight;
- _cssString = cssString;
- }
-
- public String getFontFamily() {
- return _family;
- }
-
- public int getFontSize() {
- return _size;
- }
-
- public int getFontStyle() {
- return _style;
- }
-
- public String getCSSString() {
- return _cssString;
- }
-
- public int getWeight() {
- return _weight;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
- if (obj instanceof CSSFont) {
- CSSFont fd = (CSSFont) obj;
- return this._family.equals(fd._family) && this._size == fd._size
- && this._style == fd._style && this._weight == fd._weight;
- }
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return _family.hashCode() + _size + _style + _weight;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.font.ICSSFont#getSwtFont()
- */
- public Font getSwtFont() {
- // return FontPoolManager.getInstance().getFont(this);
- return CSSFontManager.getInstance().getSwtFont(this);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.font.ICSSFont#getXHeight()
- */
- public int getXHeight() {
- return getFontSize();
- }
-
- /**
- * @return the style mask for the font style
- */
- public int getSwtFontStyle() {
- int style = SWT.NONE;
- // see:http://www.htmlhelp.com/reference/css/font/font-weight.html
- if (getWeight() >= 600)
- style |= SWT.BOLD;
- style |= getFontStyle();
- return style;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/font/CSSFontManager.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/font/CSSFontManager.java
deleted file mode 100644
index a47a81f..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/font/CSSFontManager.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.font;
-
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.property.FontFamilyMeta;
-import org.eclipse.jst.pagedesigner.css2.property.FontSizeMeta;
-import org.eclipse.jst.pagedesigner.css2.property.FontWeightMeta;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.jst.pagedesigner.css2.value.Length;
-import org.eclipse.jst.pagedesigner.utils.CacheManager;
-import org.eclipse.jst.pagedesigner.utils.ICacheEntryCreator;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * @author mengbo
- */
-public class CSSFontManager implements ICSSFontManager {
- private static CSSFontManager _instance;
-
- private static final boolean DEBUG = false;
-
- private int _totalFont = 0;
-
- // private static FontPoolManager _fontPoolManager;
- // Map _cache = new HashMap();
-
- private static final int CACHESIZE = 100; // we cache 100 font.
-
- // the scale to convert the px to pt.
- private final static double FONT_SCALE = ((double) Display.getCurrent()
- .getDPI().x) / 72;
-
- static String cssFontToLocalFont(String original) {
- if ("serif".equalsIgnoreCase(original)) {
- return "Georgia";
- } else if ("sans-serif".equalsIgnoreCase(original)) {
- return "Arial";
- } else if ("cursive".equalsIgnoreCase(original)) {
- // FIXME: MS windows does not support the alternative fonts that
- // match cursive defined at
- // http://www.w3.org/TR/REC-CSS2/fonts.html#generic-font-families,
- // We use Comic Sans MS font family
- // because it is MS alternative.
- return "Comic Sans MS";
- } else if ("fantasy".equalsIgnoreCase(original)) {
- return cssFontToLocalFont("serif");
- } else if ("monospace".equalsIgnoreCase(original)) {
- return "Courier New";
- } else {
- return original;
- }
- }
-
- private CacheManager _cacheManager = new CacheManager(
- new ICacheEntryCreator<CSSFont, Font>() {
- public Font createEntry(CSSFont key) {
- if (DEBUG) {
- _totalFont++;
- System.out.println("TotalFont++: " + _totalFont);
- }
- Font font = new Font(null, cssFontToLocalFont(key
- .getFontFamily()), (int) Math.round(key
- .getFontSize()
- / FONT_SCALE), key.getSwtFontStyle());
- return font;
- }
-
- public void dispose(CSSFont key, Font entry) {
- if (DEBUG) {
- _totalFont--;
- System.out.println("TotalFont--: " + _totalFont);
- }
- entry.dispose();
-
- }
- }, CACHESIZE);
-
- /**
- * constructor
- */
- private CSSFontManager() {
- super();
- }
-
- private String resolveFontStyleString(ICSSStyle style) {
- StringBuffer sb = new StringBuffer();
- sb.append(ICSSPropertyID.ATTR_FONT_FAMILY).append(":");
- sb.append("'").append(
- (String) style
- .getStyleProperty(ICSSPropertyID.ATTR_FONT_FAMILY))
- .append("'");
- sb.append(";");
- sb.append(ICSSPropertyID.ATTR_FONT_STYLE).append(":");
- sb
- .append(
- (String) style
- .getStyleProperty(ICSSPropertyID.ATTR_FONT_STYLE))
- .append(";");
- sb.append(ICSSPropertyID.ATTR_FONT_WEIGHT).append(":");
- sb.append(
- ((Integer) style
- .getStyleProperty(ICSSPropertyID.ATTR_FONT_WEIGHT))
- .toString()).append(";");
- sb.append(ICSSPropertyID.ATTR_FONT_SIZE).append(":");
- int fontSize = getFontSize(style, style
- .getStyleProperty(ICSSPropertyID.ATTR_FONT_SIZE));
- sb.append(Integer.toString(fontSize));
- return sb.toString();
- }
-
- public ICSSFont createFont(ICSSStyle style) {
- String fontfamily = (String) style
- .getStyleProperty(ICSSPropertyID.ATTR_FONT_FAMILY);
- Object fontsizeobj = style
- .getStyleProperty(ICSSPropertyID.ATTR_FONT_SIZE);
- int fontsize;
- fontsize = getFontSize(style, fontsizeobj);
- int fontstyle = getFontStyle(style);
- int fontweight = ((Integer) style
- .getStyleProperty(ICSSPropertyID.ATTR_FONT_WEIGHT)).intValue();
-
- return new CSSFont(fontfamily, fontsize, fontstyle, fontweight,
- resolveFontStyleString(style));
- }
-
- private int getFontSize(ICSSStyle style, Object fontsizeobj) {
- int fontsize;
- if (fontsizeobj instanceof Length) {
- fontsize = ((Length) fontsizeobj).getValue();
- } else {
- fontsize = style.getParentStyle().getCSSFont().getFontSize();
- }
- return fontsize;
- }
-
- /**
- * @param style
- */
- private int getFontStyle(ICSSStyle style) {
- int fontstyle;
- String fontstylestr = (String) style
- .getStyleProperty(ICSSPropertyID.ATTR_FONT_STYLE);
- if (ICSSPropertyID.VAL_ITALIC.equals(fontstylestr)
- || ICSSPropertyID.VAL_OBLIQUE.equals(fontstylestr)) {
- fontstyle = SWT.ITALIC;
- } else {
- fontstyle = SWT.NORMAL;
- }
- return fontstyle;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.font.ICSSFontManager#dispose()
- */
- public void dispose() {
- _cacheManager.disposeAll();
- }
-
- /**
- * @return the default css font
- */
- public ICSSFont createDefaultFont() {
- CSSFont result = new CSSFont(FontFamilyMeta.DEFAULT_FONT,
- (int) FontSizeMeta.MEDIUM_VAL_INT, SWT.NORMAL,
- FontWeightMeta.NORMAL_WEIGHT.intValue(), "");
- return result;
- }
-
- /**
- * @param f
- * @return the swt font for f
- */
- public Font getSwtFont(CSSFont f) {
- return (Font) _cacheManager.getEntry(f);
- }
-
- /**
- * @return the singleton font manager
- */
- public static CSSFontManager getInstance() {
- if (_instance == null) {
- _instance = new CSSFontManager();
- }
- return _instance;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/font/ICSSFont.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/font/ICSSFont.java
deleted file mode 100644
index 74adcfb..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/font/ICSSFont.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.font;
-
-import org.eclipse.swt.graphics.Font;
-
-/**
- * XXX: this class should be renamed to CSSFontDescriptor. Since now it is only
- * used to describe a CSSFont.
- *
- * @author mengbo
- */
-public interface ICSSFont {
- /**
- * Will get a Font system resource from a pool.
- *
- * The caller should NOT dispose the returned Font object.
- *
- * The caller should not hold reference on the returned Font object, since
- * system may dispose it at any time.
- *
- * @return the swt font
- */
- public Font getSwtFont();
-
- /**
- * @return the css font family
- */
- public String getFontFamily();
-
- /**
- * @return font size in pixel
- */
- public int getFontSize();
-
- /**
- * @return font x height in pixel
- */
- public int getXHeight();
-
- /**
- * @return the font weight
- */
- public int getWeight();
-
- /**
- *
- * @return could be SWT.NONE or SWT.ITALIC
- */
- public int getFontStyle();
-
- /**
- * @return the css string
- */
- public String getCSSString();
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/font/ICSSFontManager.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/font/ICSSFontManager.java
deleted file mode 100644
index a5a8d3d..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/font/ICSSFontManager.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.font;
-
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-
-/**
- * @author mengbo
- */
-public interface ICSSFontManager {
- /**
- * @param style
- * @return ??
- */
- public ICSSFont createFont(ICSSStyle style);
-
- /**
- * FIXME: purpose?
- */
- public void dispose();
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/html4.css b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/html4.css
deleted file mode 100644
index e91e5de..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/html4.css
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Basic HTML style information.
- */
-html,
-address,
-blockquote,listing,
-body, dd, div,
-dl, dt, fieldset, legend,form,
-frame, frameset,
-h1, h2, h3, h4,
-h5, h6, noframes,noscript,
-ol, p, ul, center,
-dir, hr, menu, pre, plaintext, xmp { display: block }
-
-ol {counter-reset: _anonymous; list-style-type: decimal}
-ul,dir,menu {counter-reset: _anonymous; list-style-type: disc}
-li {display: list-item}
-li {counter-increment: _anonymous}
-
-head { display: none }
-table { display: table }
-tr { display: table-row }
-thead { display: table-header-group }
-tbody { display: table-row-group }
-tfoot { display: table-footer-group }
-col { display: table-column }
-colgroup { display: table-column-group }
-td, th { display: table-cell; }
-caption { display: table-caption }
-th { font-weight: bolder;}
-caption { text-align: center;horizontal-align:top }
-button, textarea,
-input, object,
-select, img { display:inline-block; }
-pre,plaintext, xmp { white-space: pre }
-h1, h2, h3, h4,
-h5, h6, b,
-strong { font-weight: bold }
-i, cite, em,dfn,
-var, address { font-style: italic }
-pre, tt, code,plaintext, xmp,
-kbd, samp { font-family: monospace }
-ol { list-style-type: decimal }
-br:before { content: "\A" }
-center { text-align: center }
-sub { vertical-align: sub }
-sup { vertical-align: super }
-u, ins { text-decoration: underline }
-input { text-decoration: none }
-button { white-space: nowrap }
-a[href] { text-decoration: underline }
-
-/*
- * styles that may be different for different user agent.
- * This part may need to move out and put into different css files.
- */
-body { line-height: 1.12em }
-h1 { font-size: 2em; margin: .67em 0 }
-h2 { font-size: 1.5em; margin: .75em 0 }
-h3 { font-size: 1.17em; margin: .83em 0 }
-h4, p,ul,
-fieldset, form,
-ol, dl, dir,
-menu { margin: 1.12em 0 }
-blockquote { margin: 1em 40px }
-h5 { font-size: .83em; margin: 1.5em 0 }
-h6 { font-size: .75em; margin: 1.67em 0 }
-blockquote { margin-left: 40px; margin-right: 40px }
-big { font-size: larger }
-small, sub, sup { font-size: smaller }
-s, strike, del { text-decoration: line-through }
-hr { border: 1px inset }
-ol, ul, dir,
-menu, dd { margin-left: 40px;border:0px }
-ol ul, ul ol,
-ul ul, ol ol { margin-top: 0; margin-bottom: 0 }
-abbr, acronym { font-variant: small-caps; letter-spacing: 0.1em }
-a[href] { color:blue;}
-select {background-color: window;font-family:sans-serif;font-size:13px;font-weight: normal;}
-textarea {border: 2px inset;font-size:13px;font-family:monospace}
-textarea,
-input {background-color: window}
-input,
-input[type=text],
-input[type=password] {border: 2px inset;font-size:13px;font-family:sans-serif;font-weight: normal;}
-/* following upcased TYPE is for workaround the WTP M2 bug of not setting default content type */
-input[TYPE=submit],input[TYPE=reset],input[TYPE=button],input[TYPE=cancel],
-button,
-input[type=button],
-input[type=reset],
-input[type=cancel],
-input[type=submit] {background-color: ButtonFace; border: 2px outset; font-size:13px;
- font-family:sans-serif;text-align: center;font-weight: normal;}
-input[type=image],
-input[type=checkbox],
-input[type=radio] {border: none }
-input[type=hidden] {border: none }
-img {border: 0px none}
-listing {font-family:monospace;font-size: medium;white-space: pre; margin: 1em 0;}
-tbody,thead,tfoot {vertical-align: middle;}
-blink {text-decoration: blink;}
-
-hr {margin: 0.5em auto 0.5em auto;}
-caption {border: 0px none;margin: 0px; padding:0px 0px 4px 0px;}
-td, th,
-table {border: 4px none;}
-button {padding: 3px 5px;text-align: center;vertical-align: middle;}
-button,textarea,input {vertical-align: text-bottom;color:black;font-style:none;}
-select {vertical-align: text-bottom;}
-input[type=image] {vertical-align: baseline;}
-li {min-height:1.2em}
-button {min-height:1.8em}
-div,tr,form {min-height:1.2em}
-table,td {min-width:1.2em;min-height:1.2em}
-
-/* nested lists have no top/bottom margins */
-ul ul, ul ol, ul dir, ul menu, ul dl,
-ol ul, ol ol, ol dir, ol menu, ol dl,
-dir ul, dir ol, dir dir, dir menu, dir dl,
-menu ul, menu ol, menu dir, menu menu, menu dl,
-dl ul, dl ol, dl dir, dl menu, dl dl {margin-top: 0; margin-bottom: 0;}
-
-/* 2 deep unordered lists use a circle */
-ol ul, ul ul, menu ul, dir ul,
-ol menu, ul menu, menu menu, dir menu,
-ol dir, ul dir, menu dir, dir dir {list-style-type: circle;}
-
-/* 3 deep (or more) unordered lists use a square */
-ol ol ul, ol ul ul, ol menu ul, ol dir ul,
-ol ol menu, ol ul menu, ol menu menu, ol dir menu,
-ol ol dir, ol ul dir, ol menu dir, ol dir dir,
-ul ol ul, ul ul ul, ul menu ul, ul dir ul,
-ul ol menu, ul ul menu, ul menu menu, ul dir menu,
-ul ol dir, ul ul dir, ul menu dir, ul dir dir,
-menu ol ul, menu ul ul, menu menu ul, menu dir ul,
-menu ol menu, menu ul menu, menu menu menu, menu dir menu,
-menu ol dir, menu ul dir, menu menu dir, menu dir dir,
-dir ol ul, dir ul ul, dir menu ul, dir dir ul,
-dir ol menu, dir ul menu, dir menu menu, dir dir menu,
-dir ol dir, dir ul dir, dir menu dir, dir dir dir { list-style-type: square;}
-
-/**
- * We do not write codes to support some elements. This part defines properties for them
- * to improve the look of these elements.
- */
-applet {border: 1px solid;}
-fieldset {border: 2px groove;}
-applet,iframe {display:inline-block; border:3px inset; }
-object {display:inline-block;border:0px none;}
-
-
-/*
- * Sets right margin to have gap between widgets.
- */
-input,textarea,button { margin-right: 2px;}
\ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/BlockBox.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/BlockBox.java
deleted file mode 100644
index d20bc7a..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/BlockBox.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout;
-
-import org.eclipse.draw2d.geometry.Rectangle;
-
-/**
- * A CompositeBox suitable for containing multiple LineBox fragments. Based on
- * BlockBox of draw2d.
- *
- * @author mengbo
- */
-public class BlockBox extends CompositeBox {
- // internalContent dimension is for the closure of the FlowBox(es) added
- // into the BlockBox.
- private int _internalContentWidth = -1;
-
- private int _internalContentHeight = -1;
-
- Rectangle toRectangle() {
- return new Rectangle(_x, _y, Math.max(_width, _recommendedWidth),
- _height);
- }
-
- /**
- * Sets the height.
- *
- * @param h
- * The height
- */
- public void setHeight(int h) {
- _height = h;
- }
-
- /**
- * Unions the dimensions of this with the dimensions of the passed FlowBox.
- * For BlockBox, each time unionInfo is called, the passed in object
- * represents a line.
- *
- * @param box
- * The FlowBox to union this with
- */
- protected void unionInfo(FlowBox box) {
- _width = Math.max(_width, box._width + this.getBorderPaddingWidth());
- _height = Math.max(_height, box._y + box._height
- + this.getBorderPaddingHeight());
-
- _internalContentWidth = Math.max(_internalContentWidth, box._width);
- _internalContentHeight = Math.max(_internalContentHeight, box._y
- + box._height);
- }
-
- int getInternalContentWidth() {
- return _internalContentWidth;
- }
-
- int getInternalContentHeight() {
- return _internalContentHeight;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowBox#getAscent()
- */
- public int getAscent() {
- // XXX: some hard coded things here. If the blockbox is only for a
- // single widget, and if that widget support ascent, then we'll
- // delegate to that widget for ascent support.
- // if (_fragments.size()==1)
- // {
- // FlowBox box = (FlowBox) _fragments.get(0);
- // if (box instanceof LineBox)
- // {
- // List linecomponents = ((LineBox) box).getFragments();
- // if (linecomponents != null && linecomponents.size() == 1)
- // {
- // FlowBox box2 = (FlowBox) linecomponents.get(0);
- // if (box2 instanceof WidgetBox)
- // {
- // WidgetBox widgetBox = (WidgetBox) box2;
- // if (widgetBox.supportAscent())
- // {
- // return widgetBox.getAscent() + this.getBorderPaddingInsets().top;
- // }
- // }
- // }
- // }
- // }
- return super.getAscent();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/BlockFlow.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/BlockFlow.java
deleted file mode 100644
index d7b8b0b..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/BlockFlow.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout;
-
-import java.util.List;
-
-import org.eclipse.draw2d.PositionConstants;
-
-/**
- * A <code>FlowFigure</code> represented by a single {@link BlockBox}fragment
- * containing one or more lines. A BlockFlow is a creator of LineBoxes, which
- * its children require during layout. A BlockFlow can be thought of as a
- * paragraph.
- * <P>
- * BlockFlows should be nested inside other BlockFlows, but it is also valid to
- * place them in InlineFlows. {@link FlowPage}can be used as a "root" block and
- * can be added to normal draw2d Figures.
- * <P>
- * Only {@link FlowFigure}s can be added to a BlockFlow.
- */
-/*package*/ class BlockFlow extends FlowFigure {
-
- final BlockBox _blockBox;
-
- private int _aligment;
-
- /**
- * Constructs a new BlockFlow.
- */
- public BlockFlow() {
- setLayoutManager(createDefaultFlowLayout());
- _blockBox = createBlockBox();
- }
-
- BlockBox createBlockBox() {
- return new BlockBox();
- }
-
- /**
- * @return the default flow layout
- *
- */
- protected FlowFigureLayout createDefaultFlowLayout() {
- return new BlockFlowLayout(this);
- }
-
- /**
- * Returns the BlockBox associated with this.
- *
- * @return This BlockFlow's BlockBox
- */
- protected BlockBox getBlockBox() {
- return _blockBox;
- }
-
- /**
- * Returns the horizontal aligment.
- *
- * @return the hotizontal aligment
- */
- public int getHorizontalAligment() {
- return _aligment & PositionConstants.LEFT_CENTER_RIGHT;
- }
-
- /**
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowFigure#postValidate()
- */
- public void postValidate() {
- setBounds(getBlockBox().toRectangle().expand(getInsets()));
- List v = getChildren();
- for (int i = 0, n = v.size(); i < n; i++) {
- ((FlowFigure) v.get(i)).postValidate();
- }
- }
-
- /**
- * Sets the horitontal aligment of the block. Valid values are:
- * <UL>
- * <LI>{@link org.eclipse.draw2d.PositionConstants#LEFT}
- * <LI>{@link org.eclipse.draw2d.PositionConstants#RIGHT}
- * <LI>{@link org.eclipse.draw2d.PositionConstants#CENTER}
- *
- * @param value
- * the aligment
- */
- public void setHorizontalAligment(int value) {
- if (!(value == PositionConstants.LEFT
- || value == PositionConstants.RIGHT || value == PositionConstants.CENTER)) {
- throw new IllegalArgumentException(
- "Horizontal Aligment must be one of: LEFT, CENTER, RIGHT");
- }
- this._aligment &= ~PositionConstants.LEFT_CENTER_RIGHT;
- this._aligment |= value;
- revalidate();
- }
-
- /**
- * @see org.eclipse.draw2d.Figure#useLocalCoordinates()
- */
- protected boolean useLocalCoordinates() {
- return true;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/BlockFlowContext.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/BlockFlowContext.java
deleted file mode 100644
index 44c43c8..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/BlockFlowContext.java
+++ /dev/null
@@ -1,288 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout;
-
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.jst.pagedesigner.css2.value.Length;
-
-/**
- * When doing absolute positioning, we need to create a block. But that block
- * don't have a corresponding figure. So we need a block without corresponding
- * figure.
- *
- * @author mengbo
- * @version 1.5
- */
-public class BlockFlowContext implements FlowContext {
- private LineBox _currentLine;
-
- private LineBox _previousLine = null;
-
- BlockBox _blockBox;
-
- private final FlowContext _originalContext;
-
- private final ICSSStyle _style;
-
- /**
- * @param originalContext
- * @param style
- */
- public BlockFlowContext(FlowContext originalContext, ICSSStyle style) {
- this._originalContext = originalContext;
- this._style = style;
- setup();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowContext#getContainerWidth()
- */
- public int getContainerWidth() {
-
- return _originalContext.getContainerWidth();
- }
-
- /**
- * Initialize the object
- */
- private void setup() {
- _blockBox = new BlockBox();
- _blockBox.setRecommendedWidth(getRecommendedWidth());
- _currentLine = this.getCurrentLine();
- _previousLine = null;
- }
-
- private int getRecommendedWidth() {
- int containerWidth = getContainerWidth();
- Object leftObj = _style.getStyleProperty(ICSSPropertyID.ATTR_LEFT);
- if (leftObj != null && leftObj instanceof Length) {
- Length left = (Length) leftObj;
- int intLeft = left.getValue();
- if (left.isPercentage()) {
- intLeft = containerWidth * intLeft / 100;
- }
- if (intLeft < containerWidth) {
- return containerWidth - intLeft;
- }
- }
- return containerWidth;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowContext#addToCurrentLine(org.eclipse.jst.pagedesigner.css2.layout.FlowBox)
- */
- public void addToCurrentLine(FlowBox block) {
- getCurrentLine().add(block);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowContext#endLine()
- */
- public void endLine() {
- // this is called from child layouts.
- // If there is no current line, state is equivalent to new line
- if (_currentLine == null)
- return;
- if (_currentLine.isOccupied())
- layoutLine(); // finalize the current line layout
- else
- return;
-
- LineBox box = _currentLine;
- // _currentLine = _previousLine; //XXX: ???? why (yang)
- _previousLine = box;
-
- _currentLine = null;
- // setupLine(getCurrentLine());
-
- }
-
- /**
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowContext#getCurrentLine()
- */
- public LineBox getCurrentLine() {
- if (_currentLine == null)
- createNewLine();
- return _currentLine;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowContext#getCurrentLine(int)
- */
- public LineBox getCurrentLine(int topMargin) {
- if (_currentLine == null)
- createNewLine(topMargin);
- return _currentLine;
- }
-
- /**
- * @param topMargin
- */
- private void createNewLine(int topMargin) {
- createNewLine();
- }
-
- private void createNewLine() {
- _currentLine = new LineBox();
- setupLine(_currentLine, Integer.MIN_VALUE);
- }
-
- /**
- * Override to setup the line's x, remaining, and available width.
- *
- * @param line
- * the LineBox to set up
- * @param topMargin
- */
- protected void setupLine(LineBox line, int topMargin) {
- line.clear();
-
- // the caller of getCurrentLine() may add leftMargin and leftPadding and
- // leftBorder to line.x
- line._x = _blockBox.getBorderInsets().left + _blockBox.getPaddingInsets().left;
-
- // FIXME: here should check the floating boxes, and minus the width of
- // them from
- // current line.
- // XXX: the RecommendedContentWidth is related with the RecommendedWidth
- // of container that
- // usually larger than it needed.here we do not set the RecommendedWidth
- // for the sake of
- // layouting right absolute position.
- // /shortcoming:the box will break into multi-line after every white
- // space.
- // line.setRecommendedWidth(_blockBox.getRecommendedContentWidth());
- if (_previousLine == null) {
- line._y = _blockBox.getBorderInsets().top
- + _blockBox.getPaddingInsets().top;
- if (topMargin != Integer.MIN_VALUE)
- line._y += topMargin;
- } else {
- if (topMargin == Integer.MIN_VALUE)
- line._y = _previousLine._y + _previousLine.getHeight()
- + getLinePadding() + _previousLine.getMarginInsets().bottom; // XXX:
- // should
- // add
- // previous
- // margin
- // bottom?
- else
- line._y = _previousLine._y
- + _previousLine.getHeight()
- + Math.max(topMargin,
- _previousLine.getMarginInsets().bottom);
- }
- // line.validate();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowContext#getCurrentY()
- */
- public int getCurrentY() {
- return getCurrentLine()._y; // FIXME: margin of previous block?
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowContext#isCurrentLineOccupied()
- */
- public boolean isCurrentLineOccupied() {
- return _currentLine != null && _currentLine.isOccupied();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowContext#getLastMarginRight()
- */
- public int getLastMarginRight() {
- if (_currentLine == null || !_currentLine.isOccupied()) {
- return 0;
- }
- FlowBox box = (FlowBox) _currentLine.getFragments().get(
- _currentLine.getFragments().size() - 1);
- if (box != null) {
- return box.getMarginInsets().right;
- }
- return 0;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowContext#isCalculatingMaxWidth()
- */
- public boolean isCalculatingMaxWidth() {
- return false;
- }
-
- /**
- * Adjust all fragments in the current line to have the same baseline. Do
- * any additional adjustments, such as horizontal alignment.
- */
- protected void layoutLine() {
- // currentLine.x = 0; //XXX: comment out, don't understand why set to 0,
- // because it has already
- // been set when setupLine(). And if do need, should
- // set to getBorderPaddingInsets().left
- // if (!isInlineBlock() && shouldExpand())
- // {
- // // FIXME: currently we are using getRecommendedContentWidth,
- // // what happen if after adding the new line, the new width is bigger
- // than
- // // recommendedContentWidth? should we use getWidth() instead of
- // // recommendedcontentWidth?
- //
- // Object textalign =
- // (getCSSStyle().getStyleProperty(ICSSPropertyID.ATTR_TEXTALIGN));
- // if (textalign == ICSSPropertyID.VAL_RIGHT)
- // {
- // _currentLine._x = _blockBox.getRecommendedContentWidth() +
- // _blockBox.getBorderPaddingInsets().left - _currentLine.getWidth();
- // }
- // else if (textalign == ICSSPropertyID.VAL_CENTER)
- // {
- //
- // _currentLine._x = _blockBox.getBorderPaddingInsets().left +
- // (_blockBox.getRecommendedContentWidth() - _currentLine.getWidth()) /
- // 2;
- // }
- // if (_currentLine._x < 0)
- // _currentLine._x = 0;
- // }
-
- // FIXME: should check vertical alignment here?
- _currentLine.commit();
- _blockBox.add(_currentLine);
- }
-
- void endBlock() {
- endLine();
- }
-
- int getLinePadding() {
- return 0;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/BlockFlowLayout.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/BlockFlowLayout.java
deleted file mode 100644
index 05bf6c4..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/BlockFlowLayout.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout;
-
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.geometry.Insets;
-
-/**
- * The layout for {@link BlockFlow}figures.
- * <P>
- * WARNING: This class is not intended to be subclassed by clients.
- *
- * @author mengbo
- * @since 2.1
- */
-public class BlockFlowLayout extends FlowContainerLayout {
- private LineBox _previousLine = null;
-
- BlockBox _blockBox;
-
- /**
- * Creates a new BlockFlowLayout with the given BlockFlow.
- *
- * @param blockFlow
- * the BlockFlow
- */
- public BlockFlowLayout(BlockFlow blockFlow) {
- super(blockFlow);
- }
-
- /**
- * @see FlowContainerLayout#cleanup()
- */
- protected void cleanup() {
- _currentLine = _previousLine = null;
- }
-
- /**
- * @see FlowContainerLayout#createNewLine()
- */
- protected void createNewLine() {
- _currentLine = new LineBox();
- setupLine(_currentLine, Integer.MIN_VALUE);
- }
-
- protected void createNewLine(int topmargin) {
- _currentLine = new LineBox();
- setupLine(_currentLine, topmargin);
- }
-
- /**
- * Override to setup the line's x, remaining, and available width.
- *
- * @param line
- * the LineBox to set up
- * @param topMargin
- */
- protected void setupLine(LineBox line, int topMargin) {
- line.clear();
-
- // the caller of getCurrentLine() may add leftMargin and leftPadding and
- // leftBorder to line.x
- line._x = 0;
-
- // FIXME: here should check the floating boxes, and minus the width of
- // them from
- // current line.
- line.setRecommendedWidth(_blockBox.getRecommendedContentWidth());
- if (_previousLine == null) {
- line._y = 0;
- if (topMargin != Integer.MIN_VALUE) {
- line._y += topMargin;
- }
- } else {
- if (topMargin == Integer.MIN_VALUE) {
- line._y = _previousLine._y + _previousLine.getHeight()
- + getLinePadding() + _previousLine.getMarginInsets().bottom; // XXX:
- // should
- // add
- // previous
- // margin
- // bottom?
- } else {
- line._y = _previousLine._y
- + _previousLine.getHeight()
- + Math.max(topMargin,
- _previousLine.getMarginInsets().bottom);
- }
- }
- // line.validate();
- }
-
- /**
- * Called by flush(), adds the BlockBox associated with this BlockFlowLayout
- * to the current line and then ends the line.
- */
- protected void endBlock() {
- getFlowContext().addToCurrentLine(_blockBox);
-
- // FIXME: here should tell the context the bottom margin.
- getFlowContext().endLine();
- }
-
- /**
- * @see FlowContext#endLine()
- */
- public void endLine() {
- // this is called from child layouts.
- // If there is no current line, state is equivalent to new line
- if (_currentLine == null) {
- return;
- }
- if (_currentLine.isOccupied()) {
- layoutLine(); // finalize the current line layout
- } else {
- _currentLine = null;
- return;
- }
- LineBox box = _currentLine;
- _previousLine = box;
- _currentLine = null;// _previousLine; //XXX: ???? why (yang)
-
- // setupLine(getCurrentLine());
- }
-
- /**
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowContext#getCurrentY()
- */
- public int getCurrentY() {
- return getCurrentLine()._y; // FIXME: margin of previous block?
- }
-
- /**
- * Returns the BlockFlow associated with this BlockFlowLayout
- *
- * @return the BlockFlow
- */
- protected final BlockFlow getBlockFlow() {
- return (BlockFlow) getFlowFigure();
- }
-
- /**
- * Adjust all fragments in the current line to have the same baseline. Do
- * any additional adjustments, such as horizontal alignment.
- */
- protected void layoutLine() {
- // currentLine.x = 0; //XXX: comment out, don't understand why set to 0,
- // because it has already
- // been set when setupLine(). And if do need, should
- // set to getBorderPaddingInsets().left
- switch (getBlockFlow().getHorizontalAligment()) {
- case PositionConstants.RIGHT:
- _currentLine._x = _blockBox.getContentWidth()
- - getBorderPaddingInsets().right - _currentLine.getWidth();
- break;
- case PositionConstants.CENTER:
- _currentLine._x = (_blockBox.getContentWidth()
- + getBorderPaddingInsets().left
- - getBorderPaddingInsets().right - _currentLine.getWidth()) / 2;
- break;
- }
- // FIXME: should check vertical alignment here?
- _currentLine.commit();
- _blockBox.add(_currentLine);
- }
-
- /**
- * @see FlowContainerLayout#flush()
- */
- protected void flush() {
- if (_currentLine != null)
- layoutLine();
- endBlock();
- }
-
- /**
- * @see FlowContainerLayout#preLayout()
- */
- protected void preLayout() {
- _blockBox = getBlockFlow().getBlockBox();
- setupBlock();
- // Probably could setup current and previous line here, or just previous
- }
-
- /**
- * sets up the single block that contains all of the lines.
- */
- protected void setupBlock() {
- // Ask for a new line, in case we are in the middle of a line
-
- // FIXME: the endLine() should tell context the top margin of this
- // block.
- getFlowContext().endLine();
-
- LineBox line = getFlowContext().getCurrentLine();
- // int recommended = line.getAvailableWidth();
- // if (recommended != previousRecommendedWidth)
- // Remove all current Fragments
- _blockBox.clear();
-
- // Setup the one fragment for this Block with the correct X and
- // available width
-
- // FIXME: here should check whether the CSS already set recommended
- // width for this
- // block.
- _blockBox.setRecommendedWidth(line.getAvailableWidth());
-
- _blockBox._y = getFlowContext().getCurrentY();
-
- // FIXME: blockBox.x should be context.getBorderPaddingInsets().left
- // or just line.x ?
- _blockBox._x = 0;
- }
-
- Insets getBorderPaddingInsets() {
- // FIXME:
- return new Insets();
- }
-
- int getLinePadding() {
- return 0;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowFigureLayout#dispose()
- */
- public void dispose() {
- // TODO: anything to dispose?
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowContext#getContainerWidth()
- */
- public int getContainerWidth() {
- int width = Math.max(0, Math.max(_blockBox.getWidth(), _blockBox
- .getRecommendedWidth()));
- return width;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/BoxUtil.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/BoxUtil.java
deleted file mode 100644
index b91e30e..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/BoxUtil.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * @author mengbo
- */
-public class BoxUtil {
- /**
- * @param box
- * @param style
- */
- public static void setupBorderPaddingMargin(FlowBox box, ICSSStyle style) {
- box.setMarginInsets(new Insets(style.getMarginInsets()));
- box.setBorderInsets(new Insets(style.getBorderInsets()));
- box.setPaddingInsets(new Insets(style.getPaddingInsets()));
-
- if (box.getBorderPaddingHeight() > box.getHeight()) {
- box.setHeight(box.getBorderPaddingHeight());
- }
- if (box.getBorderPaddingWidth() > box.getWidth()) {
- box.setWidth(box.getBorderPaddingWidth());
- }
- }
-
- /**
- * Debug code.
- *
- * @param g
- * @param box
- */
- public static void drawBox(Graphics g, FlowBox box) {
- Color color = null;
- if (box instanceof BlockBox) {
- // color = ColorConstants.red;
- } else if (box instanceof LineBox) {
- color = ColorConstants.blue;
- } else if (box instanceof TextFragmentBox) {
- color = ColorConstants.green;
- } else {
- color = ColorConstants.darkGreen;
- }
- if (color != null) {
- g.setForegroundColor(color);
- g.setLineStyle(Graphics.LINE_DASH);
- g.setLineWidth(1);
- g.drawRectangle(box._x, box._y, box.getWidth(), box.getHeight());
- }
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/CSSBlockFlowLayout.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/CSSBlockFlowLayout.java
deleted file mode 100644
index dd02b49..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/CSSBlockFlowLayout.java
+++ /dev/null
@@ -1,745 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.FigureUtilities;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyMeta;
-import org.eclipse.jst.pagedesigner.css2.style.ITagEditInfo;
-import org.eclipse.jst.pagedesigner.css2.value.Length;
-import org.eclipse.jst.pagedesigner.css2.widget.BorderUtil;
-import org.eclipse.swt.graphics.FontMetrics;
-
-/**
- * The block layout for {@link CSSFigure}figures. Basic code structure is from
- * BlockFlowLayout.
- *
- * @author mengbo
- */
-public class CSSBlockFlowLayout extends CSSLayout implements ICSSPainter2 {
- private LineBox _previousLine = null;
-
- /**
- * the block box for the layout object
- */
- protected BlockBox _blockBox = null;
-
- /**
- * The font metrics for this layout object
- */
- protected FontMetrics _fontMetrices;
-
- int _userSpecifiedWidth;
-
- int _userSpecifiedHeight;
-
- /*
- * whether we need HScroll and VScroll when overflow is set to "scroll".
- * will be updated in "endBlock" and used in "paintFigurePostClientArea"
- */
- boolean _needHScroll = false;
-
- boolean _needVScroll = false;
-
- /**
- * Creates a new CSSBlockFlowLayout with the given BlockFlow.
- * @param cssfigure
- */
- public CSSBlockFlowLayout(CSSFigure cssfigure) {
- super(cssfigure);
- }
-
- /**
- * @return true if this layout box has more than one line
- */
- protected boolean hasMoreThanOneLine() {
- return _previousLine != null;
- }
-
- /**
- * @return true if this layout block is inline
- */
- public boolean isInlineBlock() {
- String obj = getCSSStyle().getDisplay();
- return ICSSPropertyID.VAL_INLINE_BLOCK.equals(obj)
- || ICSSPropertyID.VAL_INLINE_TABLE.equals(obj);
- }
-
- /**
- * @return true if should expand the width to all available width.
- */
- public boolean shouldExpand() {
- ICSSStyle style = getCSSStyle();
- if (style == null) {
- return false;
- }
- return "block".equalsIgnoreCase(style.getDisplay())
- || "list-item".equalsIgnoreCase(style.getDisplay());
- }
-
- // ---------------------------------------------------------------------------------------------------
- // preLayout stage. Major job is get the top-left corner information of the
- // new block.
-
- /**
- * sets up the single block that contains all of the lines.
- */
- protected void setupBlock() {
- // int recommended = line.getAvailableWidth();
- // if (recommended != previousRecommendedWidth)
- // Remove all current Fragments
- _blockBox.clear();
- // Ask for a new line, in case we are in the middle of a line
-
- if (!isInlineBlock()) {
- LineBox lineBox = getFlowContext().getCurrentLine();
- if (lineBox != null && !lineBox.isEmptyStringLine()) {
- getFlowContext().endLine();
- }
- }
-
- ICSSStyle style = getCSSStyle();
-
- // endLine will result in context create a new line, so we are in the
- // new line now.
- // passing in the top margin, and context will consider that when create
- // the new line.
- int marginTop = style.getMarginInsets().top;
- LineBox line = getFlowContext().getCurrentLine(marginTop);
-
- // Setup the one fragment for this Block with the correct X and
- // available width
-
- // FIXME: according to spec, when using percentage width/height, should
- // percentage to
- // the "containing block". But we don't have very good "containing
- // block" resolution
- // implementation yet.
-
- // calculate the min size
- // int minWidth = 0;
- // int minHeight = 0;
- // if (style != null)
- // {
- // // try to see whether there is any designer specified min size
- // ITagEditInfo info = (ITagEditInfo)
- // style.getAdapter(ITagEditInfo.class);
- // if (info != null)
- // {
- // minWidth = info.getMinWidth();
- // minHeight = info.getMinHeight();
- // }
- //
- // // CSS also has the min-width/min-height property. We should also get
- // that,
- // // and using the max of the "min-width" css property and the designer
- // specified min size.
- // int height = getLengthValue(style,ICSSPropertyID.ATTR_MIN_HEIGHT);
- // if(height > minHeight)
- // {
- // minHeight = height;
- // }
- // int width = getLengthValue(style,ICSSPropertyID.ATTR_MIN_WIDTH);
- // if(width > minWidth)
- // {
- // minWidth = width;
- // }
- // }
-
- // keep track of user specified size, this will be used when handling
- // the "overflow" CSS property.
- _userSpecifiedWidth = 0;
- _userSpecifiedHeight = 0;
-
- {
- int width = getLengthValue(style, ICSSPropertyID.ATTR_WIDTH);
-
- int availableWidth = line.getAvailableWidth()
- - style.getMarginInsets().getWidth();
- if (width <= 0) {
- // no width setting
- if (isCalculatingMaxWidth()) {
- _blockBox.setRecommendedWidth(Integer.MAX_VALUE);
- // _blockBox.setWidth( (minWidth>0?minWidth:0));
- } else {
- _blockBox.setRecommendedWidth(availableWidth);
- if (shouldExpand()) {
- _blockBox.setWidth(availableWidth);
- } else {
- // _blockBox.setWidth( (minWidth>0?minWidth:0));
- }
- }
- } else {
- int w = width;
- if (!style.isSizeIncludeBorderPadding()) {
- w += style.getBorderInsets().getWidth()
- + style.getPaddingInsets().getWidth();
- }
- // XXX: should we use minWidth or follow user's choice?
- // if (w < minWidth)
- // {
- // w = minWidth;
- // }
- _userSpecifiedWidth = w;
- _blockBox.setWidth(w);
- _blockBox.setRecommendedWidth(w);
- }
- }
-
- {
- int height = getLengthValue(style, ICSSPropertyID.ATTR_HEIGHT);
- // Object height =
- // style.getStyleProperty(ICSSPropertyID.ATTR_HEIGHT);
- // Length heightLength = (height instanceof Length) ? (Length)
- // height : null;
-
- if (height <= 0) {
- // if (minHeight > 0)
- // {
- // // _blockBox.setHeight(minHeight);
- // _blockBox.setRecommendedHeight(minHeight);
- // }
- // else
- {
- _blockBox.setHeight(0);
- _blockBox.setRecommendedHeight(0);
- }
- } else {
- int h = height;
- if (handlingBorderForBlock()
- && !style.isSizeIncludeBorderPadding()) {
- h += style.getBorderInsets().getHeight()
- + style.getPaddingInsets().getHeight();
- }
- // XXX: should we follow minHeight or user's choice?
- // if (minHeight > h)
- // {
- // h = minHeight;
- // }
- _userSpecifiedHeight = h;
- _blockBox.setHeight(h);
- _blockBox.setRecommendedHeight(h);
- }
- }
- _blockBox.setMarginInsets(new Insets(style.getMarginInsets()));
- if (handlingBorderForBlock()) {
- BoxUtil.setupBorderPaddingMargin(_blockBox, getCSSStyle());
- }
-
- // as in designer, we don't want to the element to have zero size, so
- // set a minimun size here.
- // _blockBox.setWidth(Math.max(20, _blockBox.getWidth()));
- // int minHeight = getCSSStyle().getCSSFont().getFontSize() +
- // _blockBox.getBorderPaddingHeight();
- // _blockBox.setHeight(Math.max(minHeight, _blockBox.getHeight()));
-
- _blockBox._y = line._y;
- _blockBox._x = line._x;
-
- setBlockVerticalAlign(_blockBox);
- }
-
- /**
- * @param style
- * @param property
- * @return the length value
- */
- protected int getLengthValue(ICSSStyle style, String property) {
- int lengthValue = 0;
- if (style != null) {
- Object object = style.getStyleProperty(property);
- Length lengthObj = (object instanceof Length) ? (Length) object
- : null;
-
- if (lengthObj != null) {
- lengthValue = lengthObj.getValue();
- if (lengthObj.isPercentage()) {
- if (ICSSPropertyID.ATTR_WIDTH.equalsIgnoreCase(property)
- || ICSSPropertyID.ATTR_MIN_WIDTH
- .equalsIgnoreCase(property)) {
- lengthValue = this.getFlowContext().getCurrentLine().getRecommendedContentWidth()
- * lengthValue / 100;
- } else if (ICSSPropertyID.ATTR_HEIGHT
- .equalsIgnoreCase(property)
- || ICSSPropertyID.ATTR_MIN_HEIGHT
- .equalsIgnoreCase(property)) {
- // XXX: we should omit it because we don't support
- // percentage height now.
- lengthValue = 0;
- }
- }
- }
- }
- return lengthValue;
- }
-
- private void setBlockVerticalAlign(BlockBox box) {
- ICSSStyle style = getCSSStyle();
- if (style != null) {
- box.setVerticalAlignData(style
- .getStyleProperty(ICSSPropertyID.ATTR_VERTICAL_ALIGN));
- }
- }
-
- /**
- * @see FlowContainerLayout#preLayout()
- */
- protected void preLayout() {
- super.preLayout();
- _blockBox = new BlockBox();
- setupBlock();
- // Probably could setup current and previous line here, or just previous
- }
-
- // -------------------------------------------------------------------------------------------------------
- /**
- * layout the lines in this layout
- */
- protected void layoutLines() {
- List lines = _blockBox.getFragments();
- if (lines != null) {
- for (int i = 0; i < lines.size(); i++) {
- if (lines.get(i) instanceof LineBox) {
- layoutLine((LineBox) lines.get(i));
- }
- }
- }
- }
-
- /**
- * Called by flush(), adds the BlockBox associated with this BlockFlowLayout
- * to the current line and then ends the line.
- */
- protected void endBlock() {
- layoutLines();
- ICSSStyle style = getCSSStyle();
- if (style != null) {
- int minWidth = 0;
- int minHeight = 0;
- // try to see whether there is any designer specified min size
- ITagEditInfo info = (ITagEditInfo) style
- .getAdapter(ITagEditInfo.class);
- if (info != null) {
- minWidth = info.getMinWidth();
- minHeight = info.getMinHeight();
- }
-
- // CSS also has the min-width/min-height property. We should also
- // get that,
- // and using the max of the "min-width" css property and the
- // designer specified min size.
- int height = getLengthValue(style, ICSSPropertyID.ATTR_MIN_HEIGHT);
- if (height > minHeight) {
- minHeight = height;
- }
- int width = getLengthValue(style, ICSSPropertyID.ATTR_MIN_WIDTH);
- if (width > minWidth) {
- minWidth = width;
- }
- if (minHeight > _blockBox.getHeight()) {
- _blockBox.setHeight(minHeight);
- }
- if (minWidth > _blockBox.getWidth()) {
- _blockBox.setWidth(minWidth);
- }
- }
-
- // reset scroll information.
- this._needHScroll = this._needVScroll = false;
-
- // ok, now we need to adjust the _blockBox's size according to the
- // "overflow" setting.
- // depends on different "overflow" style of this block, different sizing
- // policy may apply.
- // ICSSStyle style = this.getCSSStyle();
- if (style != null) {
- Object overflow = style
- .getStyleProperty(ICSSPropertyID.ATTR_OVERFLOW);
- if (ICSSPropertyID.VAL_HIDDEN.equals(overflow)) {
- if (_userSpecifiedWidth > 0) {
- _blockBox.setWidth(_userSpecifiedWidth);
- }
- if (_userSpecifiedHeight > 0) {
- _blockBox.setHeight(_userSpecifiedHeight);
- }
- } else if (ICSSPropertyID.VAL_SCROLL.equals(overflow)
- || ICSSPropertyID.VAL_AUTO.equals(overflow)) {
- // adjust _needHScroll and _needVScroll
- if (_userSpecifiedWidth > 0
- && _userSpecifiedWidth < _blockBox.getWidth()) {
- _needHScroll = true;
- }
- if (_userSpecifiedHeight > 0
- && _userSpecifiedHeight < _blockBox.getHeight()) {
- _needVScroll = true;
- }
- if (_needHScroll && !_needVScroll) {
- if (_userSpecifiedHeight > 0
- && _blockBox.getInternalContentHeight() >= 0
- && _userSpecifiedHeight < _blockBox
- .getInternalContentHeight()
- + _blockBox.getPaddingInsets().getHeight()
- + BorderUtil.SCROLL_WIDTH) {
- _needVScroll = true;
- }
- }
- if (!_needHScroll && _needVScroll) {
- if (_userSpecifiedWidth > 0
- && _blockBox.getInternalContentWidth() >= 0
- && _userSpecifiedWidth < _blockBox
- .getInternalContentWidth()
- + _blockBox.getPaddingInsets().getWidth()
- + BorderUtil.SCROLL_WIDTH) {
- _needHScroll = true;
- }
- }
-
- if (_userSpecifiedWidth > 0) {
- _blockBox.setWidth(_userSpecifiedWidth);
- }
- if (_userSpecifiedHeight > 0) {
- _blockBox.setHeight(_userSpecifiedHeight);
- }
- }
- }
-
- if (getFlowContext().isCurrentLineOccupied()
- && getFlowContext().getCurrentLine().getAvailableWidth() < _blockBox._width
- + _blockBox.getMarginInsets().getWidth()) {
- getFlowContext().endLine();
- }
- if (!isInlineBlock()) {
- LineBox line = getFlowContext().getCurrentLine();
- line.setHorizonalData(getCSSStyle().getStyleProperty(
- ICSSPropertyID.ATTR_HORIZONTAL_ALIGN));
- line.setHtmlInitData(getCSSStyle().getHTMLelementInitValue(
- ICSSPropertyID.ATTR_HORIZONTAL_ALIGN));
- line.add(_blockBox);
- // getFlowContext().addToCurrentLine(_blockBox);
- } else {
- getFlowContext().addToCurrentLine(_blockBox);
- }
- getFlowContext().getCurrentLine().getMarginInsets().bottom = getCSSStyle()
- .getMarginInsets().bottom;
-
- if (!isInlineBlock()) {
- getFlowContext().endLine();
- }
- }
-
- /**
- * @param line
- */
- protected void layoutLine(LineBox line) {
- // currentLine.x = 0; //XXX: comment out, don't understand why set to 0,
- // because it has already
- // been set when setupLine(). And if do need, should
- // set to getBorderPaddingInsets().left
- // if (!isInlineBlock() && shouldExpand())
- // {
- // FIXME: currently we are using getRecommendedContentWidth,
- // what happen if after adding the new line, the new width is bigger
- // than
- // recommendedContentWidth? should we use getWidth() instead of
- // recommendedcontentWidth?
- Object textalign = line.getHorizonalData();
- if (textalign == null
- || ICSSPropertyMeta.NOT_SPECIFIED.equals(textalign)) {
- textalign = (getCSSStyle()
- .getStyleProperty(ICSSPropertyID.ATTR_TEXTALIGN));
- }
- if (textalign == null
- || ICSSPropertyMeta.NOT_SPECIFIED.equals(textalign)) {
- textalign = line.getHtmlInitData();
- }
- if (ICSSPropertyID.VAL_RIGHT.equals(textalign)) {
- line._x = _blockBox.getContentWidth() - line.getWidth();
- } else if (ICSSPropertyID.VAL_CENTER.equals(textalign)) {
- line._x = (_blockBox.getContentWidth() - line.getWidth()) / 2;
- }
-
- if (line._x < 0) {
- line._x = 0;
- }
- line.commit();
- }
-
- /**
- * Adjust all fragments in the current line to have the same baseline. Do
- * any additional adjustments, such as horizontal alignment.
- */
- protected void addCurrentLine() {
- // The follow code is commented out, and moved into layoutLine(line)
- // called by endBlock().
- // since only when endBlock is called we really know how big is this
- // block box, and then can
- // do horizontal alignment.
- // // currentLine.x = 0; //XXX: comment out, don't understand why set to
- // 0, because it has already
- // // been set when setupLine(). And if do need, should
- // // set to getBorderPaddingInsets().left
- // if (!isInlineBlock() && shouldExpand())
- // {
- // // FIXME: currently we are using getRecommendedContentWidth,
- // // what happen if after adding the new line, the new width is bigger
- // than
- // // recommendedContentWidth? should we use getWidth() instead of
- // // recommendedcontentWidth?
- //
- // Object textalign =
- // (getCSSStyle().getStyleProperty(ICSSPropertyID.ATTR_TEXTALIGN));
- // if (textalign == ICSSPropertyID.VAL_RIGHT)
- // {
- // _currentLine._x = _blockBox.getContentWidth() +
- // _blockBox.getBorderPaddingInsets().left - _currentLine.getWidth();
- // }
- // else if (textalign == ICSSPropertyID.VAL_CENTER)
- // {
- //
- // _currentLine._x = _blockBox.getBorderPaddingInsets().left +
- // (_blockBox.getContentWidth() - _currentLine.getWidth()) / 2;
- // }
- // if (_currentLine._x < 0)
- // _currentLine._x = 0;
- // }
- //
- // // FIXME: should check vertical alignment here?
- // _currentLine.commit();
-
- // layoutLine(_currentLine);
- _blockBox.add(_currentLine);
- }
-
- /**
- * @see FlowContainerLayout#flush()
- */
- protected void flush() {
- if (_currentLine != null && _currentLine.isOccupied()) {
- addCurrentLine();
- }
- endBlock();
- }
-
- /**
- * @see FlowContainerLayout#cleanup()
- */
- protected void cleanup() {
- _currentLine = _previousLine = null;
- _fontMetrices = null;
- }
-
- // ----------------------------------------------------------------------------------
-
- /**
- * Override to setup the line's x, remaining, and available width.
- *
- * @param line
- * the LineBox to set up
- * @param topMargin
- */
- protected void setupLine(LineBox line, int topMargin) {
- line.clear();
-
- // the caller of getCurrentLine() may add leftMargin and leftPadding and
- // leftBorder to line.x
- line._x = 0;
-
- // FIXME: here should check the floating boxes, and minus the width of
- // them from
- // current line.
- line.setRecommendedWidth(_blockBox.getRecommendedContentWidth());
- if (_previousLine == null) {
- line._y = 0;
- if (topMargin != Integer.MIN_VALUE) {
- line._y += topMargin;
- }
- } else {
- if (topMargin == Integer.MIN_VALUE) {
- line._y = _previousLine._y + _previousLine.getHeight()
- + getLinePadding() + _previousLine.getMarginInsets().bottom; // XXX:
- // should
- // add
- // previous
- // margin
- // bottom?
- } else {
- line._y = _previousLine._y
- + _previousLine.getHeight()
- + Math.max(topMargin,
- _previousLine.getMarginInsets().bottom);
- }
- }
- setFontinfoForLine(line);
- // line.validate();
- }
-
- private void setFontinfoForLine(LineBox line) {
-
- ICSSStyle style = getCSSStyle();
- if (style != null) {
- if (_fontMetrices == null) {
- // as getSwtFont is resource consuming, so we cache the
- // _fontMetrics.
- _fontMetrices = FigureUtilities.getFontMetrics(style
- .getCSSFont().getSwtFont());
- }
- line.setFontMetrics(_fontMetrices);
- }
- }
-
- /**
- * @see FlowContainerLayout#createNewLine()
- */
- protected void createNewLine() {
- _currentLine = new LineBox();
- setupLine(_currentLine, Integer.MIN_VALUE);
- }
-
- protected void createNewLine(int topmargin) {
- _currentLine = new LineBox();
- setupLine(_currentLine, topmargin);
- }
-
- /**
- * @see FlowContext#endLine()
- */
- public void endLine() {
- // this is called from child layouts.
- // If there is no current line, state is equivalent to new line
- if (_currentLine == null) {
- return;
- }
- if (_currentLine.isOccupied()) {
- addCurrentLine(); // finalize the current line layout
- } else {
- _currentLine = null;
- return;
- }
-
- LineBox box = _currentLine;
- // _currentLine = _previousLine; //XXX: ???? why (yang)
- _previousLine = box;
-
- _currentLine = null;
- // setupLine(getCurrentLine());
- }
-
- /**
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowContext#getCurrentY()
- */
- public int getCurrentY() {
- return getCurrentLine()._y; // FIXME: margin of previous block?
- }
-
- int getLinePadding() {
- return 0;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.CSSLayout#useLocalCoordinates()
- */
- public boolean useLocalCoordinates() {
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowFigureLayout#dispose()
- */
- public void dispose() {
- //
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.ICSSLayout#getFragmentsForRead()
- */
- public List getFragmentsForRead() {
- List r = new ArrayList(1);
- r.add(_blockBox);
- return r;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.ICSSLayout#postValidate()
- */
- public void postValidate() {
-
- Rectangle r = new Rectangle(_blockBox._x, _blockBox._y, _blockBox
- .getWidth(), _blockBox.getHeight());
- getCSSFigure().setBounds(r);
- List list = getCSSFigure().getChildren();
- for (int i = 0; i < list.size(); i++) {
- ((FlowFigure) list.get(i)).postValidate();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowContext#getContainerWidth()
- */
- public int getContainerWidth() {
- int width = Math.max(0, Math.max(_blockBox.getWidth(), _blockBox
- .getRecommendedWidth()));
- return width;
- }
-
- /**
- * when the "overflow" is "scroll", we need to paint the scrollbar
- */
- public void paintFigurePostClientArea(Graphics g) {
- ICSSStyle style = this.getCSSStyle();
- if (style != null) {
- Object overflow = style
- .getStyleProperty(ICSSPropertyID.ATTR_OVERFLOW);
- if (ICSSPropertyID.VAL_SCROLL.equals(overflow)
- || ICSSPropertyID.VAL_AUTO.equals(overflow)) {
- if (this._needHScroll || this._needVScroll) {
- // as this is using localCoordinate, so translate to
- // relative to left/up corder of whole
- // blockbox.
- g.translate(-_blockBox.getBorderPaddingInsets().left,
- -_blockBox.getBorderPaddingInsets().top);
-
- Rectangle rect = new Rectangle(0, 0, _blockBox.getWidth(),
- _blockBox.getHeight());
- rect.crop(_blockBox.getBorderInsets());
-
- if (this._needHScroll && this._needVScroll) {
- BorderUtil.drawScrollBar(g, BorderUtil.SCROLL_WIDTH,
- rect, BorderUtil.BOTH);
- } else if (this._needHScroll) {
- BorderUtil.drawScrollBar(g, BorderUtil.SCROLL_WIDTH,
- rect, BorderUtil.HORIZONTAL_BAR);
- } else if (this._needVScroll) {
- BorderUtil.drawScrollBar(g, BorderUtil.SCROLL_WIDTH,
- rect, BorderUtil.VERTICAL_BAR);
- }
- }
- }
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/CSSBrFlowLayout.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/CSSBrFlowLayout.java
deleted file mode 100644
index 19ef939..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/CSSBrFlowLayout.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout;
-
-import java.util.List;
-
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * @author mengbo
- */
-public class CSSBrFlowLayout extends CSSInlineFlowLayout implements ICSSPainter {
- /**
- * @param flow
- */
- public CSSBrFlowLayout(CSSFigure flow) {
- super(flow);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.CSSInlineFlowLayout#flush()
- */
- protected void flush() {
- FlowBox forcedBox = new FlowBox();
- forcedBox.setWidth(16);
- forcedBox.setHeight(getCSSStyle().getCSSFont().getXHeight());
- addToCurrentLine(forcedBox);
- endLine();
-
- FlowBox flowbox = new FlowBox();
- flowbox.setHeight(getCSSStyle().getCSSFont().getFontSize());
- getCurrentLine().add(flowbox);
-
- super.flush();
- }
-
- public void paintFigure(Graphics g) {
- List fragments = getFragmentsForRead();
- if (!fragments.isEmpty()) {
- FlowBox box = (FlowBox) fragments.get(0);
- g.drawImage(getSharedHTMLImage(), new Point(box._x, box._y));
- }
- }
-
- private static Image getSharedHTMLImage() {
-
- return PDPlugin.getDefault().getImage("LineBreak.gif");
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/CSSFigure.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/CSSFigure.java
deleted file mode 100644
index a6c5289..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/CSSFigure.java
+++ /dev/null
@@ -1,525 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout;
-
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.LayoutManager;
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.border.CSSBorder;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.jst.pagedesigner.css2.property.VisibilityMeta;
-import org.eclipse.jst.pagedesigner.css2.style.DefaultStyle;
-import org.eclipse.jst.pagedesigner.css2.style.ITagEditInfo;
-import org.eclipse.jst.pagedesigner.css2.widget.BorderUtil;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.RGB;
-
-/**
- * Normally a CSSFigure is a container. It's layout will be driven by different
- * display type information from the style.
- *
- * Each CSSFigure will be driven by ICSSStyle, the display type of the ICSSStyle
- * will decide the layout to be used for the figure.
- *
- * @author mengbo
- */
-public class CSSFigure extends FlowFigure implements ICSSFigure {
- private static Logger _log = PDPlugin.getLogger(CSSFigure.class);
-
- private static final Rectangle PRIVATE_RECT = new Rectangle();
-
- private ICSSStyle _style;
-
- // if this field is set, then regetLayout() will still return this layout,
- // without going through the CSS resolution
- private CSSLayout _fixedLayout;
-
- /**
- * Default constructor
- * Equivalent to CSSFigure(DefaultStyle.getInstance())
- */
- public CSSFigure() {
- this(DefaultStyle.getInstance());
- }
-
- /**
- * @param style
- */
- public CSSFigure(ICSSStyle style) {
- _style = style;
- invalidateCSS();
- }
-
- public ICSSStyle getCSSStyle() {
- return _style;
- }
-
- /**
- * @param style
- */
- public void setCSSStyle(ICSSStyle style) {
- _style = style;
- invalidateCSS();
- }
-
- public void revalidate() {
- CSSLayout layout = (CSSLayout) getLayoutManager();
- layout.figureRevalidate();
- super.revalidate();
- }
-
- /**
- * this method is called when the css source noticed style change. So tell
- * the figure should invalidate its cached data.
- */
- public void invalidateCSS() {
- // maybe we changed from inline to block or block to inline
- // XXX: or even to table?
- CSSLayout layout = regetLayout(getLayoutManager());
- this.setLayoutManager(layout);
- }
-
- /**
- * @param layout
- */
- public void setFixedLayoutManager(CSSLayout layout) {
- this._fixedLayout = layout;
- this.setLayoutManager(regetLayout(getLayoutManager()));
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.draw2d.Figure#setLayoutManager(org.eclipse.draw2d.LayoutManager)
- */
- public void setLayoutManager(LayoutManager manager) {
- LayoutManager old = getLayoutManager();
- if (old != manager) {
- FlowContext context = null;
- if (old instanceof FlowFigureLayout) {
- context = ((FlowFigureLayout) old).getOriginalFlowContext();
- }
- if (manager instanceof FlowFigureLayout) {
- ((FlowFigureLayout) manager).setOriginalFlowContext(context);
- }
-
- if (manager instanceof FlowContext) {
- List list = getChildren();
- for (int i = 0, size = list.size(); i < size; i++) {
- try {
- ((FlowFigure) list.get(i))
- .setOriginalFlowContext((FlowContext) manager);
- } catch (ClassCastException classcastexception) {
- // Error in flowContext setting.
- _log.error("Error.CSSFigure.0", classcastexception); //$NON-NLS-1$
- }
- }
- }
- }
- super.setLayoutManager(manager);
- }
-
- /**
- * @param old
- * @return the layout
- */
- protected CSSLayout regetLayout(LayoutManager old) {
- if (_fixedLayout != null) {
- return _fixedLayout;
- }
- CSSLayout layout = DisplayToLayout.displayToLayout(this, getCSSStyle()
- .getDisplay(), old);
- if (layout != null) {
- return layout;
- }
- return new CSSInlineFlowLayout(this);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.draw2d.Figure#containsPoint(int, int)
- */
- public boolean containsPoint(int x, int y) {
- // check whether any float figure contains it.
- // FIXME: need check floating figure here!!!
- if (!super.containsPoint(x, y)) {
- return false;
- }
- List frags = getFragmentsForRead();
- // Here we should not get void pointer.
- if (frags != null) {
- for (int i = 0; i < frags.size(); i++) {
- FlowBox box = (FlowBox) frags.get(i);
- if (box != null && box.containsPoint(x, y)) {
- return true;
- }
- }
- }
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.ICSSFigure#getFragmentsForRead()
- */
- public List getFragmentsForRead() {
- CSSLayout layout = (CSSLayout) getLayoutManager();
- return layout.getFragmentsForRead();
- }
-
- /**
- * this method is a shortcut to getFragmentsForRead
- *
- * @return fragment bounds
- */
- public Rectangle[] getFragmentsBounds() {
- List list = getFragmentsForRead();
- if (list == null || list.size() == 0) {
- // should not happen. but still handle it.
- return new Rectangle[] { getBounds() };
- }
- Rectangle[] ret = new Rectangle[list.size()];
- for (int i = 0, size = list.size(); i < size; i++) {
- FlowBox box = (FlowBox) list.get(i);
- ret[i] = new Rectangle(box._x, box._y, box.getWidth(), box
- .getHeight());
- }
- return ret;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.draw2d.IFigure#setBounds(org.eclipse.draw2d.geometry.Rectangle)
- */
- public void setBounds(Rectangle r) {
- if (getBounds().equals(r)) {
- return;
- }
- boolean invalidate = getBounds().width != r.width
- || getBounds().height != r.height;
- super.setBounds(r);
-
- CSSLayout layout = (CSSLayout) this.getLayoutManager();
- layout.setBoundsCalled(r, invalidate);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowFigure#postValidate()
- */
- public void postValidate() {
- CSSLayout layout = (CSSLayout) getLayoutManager();
- layout.postValidateForAbsolute();
- layout.postValidate();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.draw2d.IFigure#validate()
- */
- public void validate() {
- super.validate();
- // should not call this.postValidate() here. PostValidate() should
- // only be started from the FlowPage. Otherwise it will be called
- // multiple times on a figure.
- // this.postValidate();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.draw2d.Figure#useLocalCoordinates()
- */
- protected boolean useLocalCoordinates() {
- CSSLayout layout = (CSSLayout) getLayoutManager();
- if (layout == null) {
- return false;
- }
- return layout.useLocalCoordinates();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.draw2d.IFigure#paint(org.eclipse.draw2d.Graphics)
- */
- public void paint(Graphics graphics) {
- ICSSStyle style = getCSSStyle();
- if (style != null) {
- Object visibility = style
- .getStyleProperty(ICSSPropertyID.ATTR_VISIBILITY);
- // handle visibility: hidden here.
- // TODO: "collapse" is not supported yet!
- if (VisibilityMeta.HIDDEN.equals(visibility)) {
- return;
- }
- }
-
- CSSLayout layout = (CSSLayout) this.getLayoutManager();
- graphics.pushState();
- try {
- paintFigure(graphics);
- graphics.restoreState();
- paintClientArea(graphics);
- if (layout instanceof ICSSPainter2) {
- if (useLocalCoordinates()) {
- graphics.translate(getBounds().x + getInsets().left,
- getBounds().y + getInsets().top);
- ((ICSSPainter2) layout).paintFigurePostClientArea(graphics);
- graphics.restoreState();
- } else {
- ((ICSSPainter2) layout).paintFigurePostClientArea(graphics);
- }
- }
- paintBorder(graphics);
- } finally {
- graphics.popState();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowFigure#paintFigure(org.eclipse.draw2d.Graphics)
- */
- protected void paintFigure(Graphics g) {
- Color rgbColor = null;
- boolean fillArea = false;
- Object bg = getCSSStyle().getBackgroundColor();
- if (bg instanceof RGB) {
- rgbColor = new Color(null, (RGB) bg);
- g.setBackgroundColor(rgbColor);
- fillArea = true;
- } else if (bg instanceof Color) {
- g.setBackgroundColor((Color) bg);
- fillArea = true;
- }
- if (fillArea) {
- List fragments = getFragmentsForRead();
-
- for (int i = 0, n = fragments.size(); i < n; i++) {
- Object obj = fragments.get(i);
- if (obj instanceof FlowBox) {
- FlowBox box = (FlowBox) obj;
- g.fillRectangle(box._x, box._y, box.getWidth(), box
- .getHeight());
- }
- }
- }
- if (rgbColor != null) {
- rgbColor.dispose();
- }
- g.restoreState();
-
- LayoutManager layout = getLayoutManager();
- if (layout instanceof ICSSPainter) {
- if (useLocalCoordinates()) {
- g.translate(getBounds().x + getInsets().left, getBounds().y
- + getInsets().top);
- ((ICSSPainter) layout).paintFigure(g);
- g.restoreState();
- } else {
- ((ICSSPainter) layout).paintFigure(g);
- }
- }
-
- // paint selected mode here.
- paintSelection(g);
-
- if (Debug.DEBUG_BOX) {
- // draw two levels of boxes. Since normally each figure will only
- // have two levels of boxes.
- List fragments = this.getFragmentsForRead();
- for (int i = 0, size = fragments.size(); i < size; i++) {
- FlowBox box = (FlowBox) fragments.get(i);
- BoxUtil.drawBox(g, box);
- if (box instanceof BlockBox) {
- BlockBox compositeBox = (BlockBox) box;
- List list = compositeBox.getFragments();
- for (int j = 0; j < list.size(); j++) {
- g.translate(this.getInsets().left,
- this.getInsets().right);
- BoxUtil.drawBox(g, (FlowBox) list.get(j));
- g.restoreState();
- }
- }
- }
- }
- if (Debug.DEBUG_BASELINE) {
- List fragments = this.getFragmentsForRead();
- for (int i = 0, size = fragments.size(); i < size; i++) {
- Object obj = fragments.get(i);
- if (obj instanceof LineBox) {
- LineBox linebox = (LineBox) obj;
- g.setForegroundColor(ColorConstants.red);
- g.drawLine(linebox._x, linebox._y + linebox.getAscent(),
- linebox._x + linebox.getWidth(), linebox._y
- + linebox.getAscent());
- }
- }
- }
-
- if (Debug.DEBUG_BORDERPADDING) {
- if (this.getLayoutManager() instanceof CSSBlockFlowLayout) {
- g.setLineWidth(1);
- Rectangle rect = getBounds().getCopy().crop(getInsets());
- g.setForegroundColor(ColorConstants.green);
- g.drawRectangle(rect);
- g.setForegroundColor(ColorConstants.red);
- g.drawRectangle(getBounds());
- }
- }
-
- if (Debug.DEBUG_BOX) {
- CSSLayout csslayout = (CSSLayout) this.getLayoutManager();
- if (csslayout.getAbsoluteContext() != null) {
- BlockBox blockbox = csslayout.getAbsoluteContext()._blockBox;
- g.setLineWidth(1);
- g.setForegroundColor(ColorConstants.green);
- g.drawRectangle(blockbox._x, blockbox._y, blockbox.getWidth(),
- blockbox.getHeight());
- }
- }
- }
-
- /**
- * Paints this Figure's client area. The client area is typically defined as
- * the anything inside the Figure's {@link org.eclipse.draw2d.Border} or {@link org.eclipse.draw2d.geometry.Insets}, and
- * by default includes the children of this Figure. On return, this method
- * must leave the given Graphics in its initial state.
- *
- * @param graphics
- * The Graphics used to paint
- * @since 2.0
- */
- protected void paintClientArea(Graphics graphics) {
- if (this.getChildren().isEmpty()) {
- return;
- }
-
- Object overflow = ICSSPropertyID.VAL_VISIBLE;
- ICSSStyle style = this.getCSSStyle();
- if (style != null) {
- overflow = style.getStyleProperty(ICSSPropertyID.ATTR_OVERFLOW);
- }
-
- boolean optimizeClip = ICSSPropertyID.VAL_VISIBLE.equals(overflow);
-
- if (useLocalCoordinates()) {
- graphics.translate(getBounds().x + getInsets().left, getBounds().y
- + getInsets().top);
- if (!optimizeClip) {
- graphics.clipRect(getClientArea(PRIVATE_RECT));
- }
- graphics.pushState();
- paintChildren(graphics);
- graphics.popState();
- graphics.restoreState();
- } else {
- if (optimizeClip) {
- paintChildren(graphics);
- } else {
- graphics.clipRect(getClientArea(PRIVATE_RECT));
- graphics.pushState();
- paintChildren(graphics);
- graphics.popState();
- graphics.restoreState();
- }
- }
- }
-
- /**
- * @param g
- */
- protected void paintSelection(Graphics g) {
- ICSSStyle style = this.getCSSStyle();
- if (style != null) {
- if (style.isInSelection()) {
- ITagEditInfo editInfo = (ITagEditInfo) style
- .getAdapter(ITagEditInfo.class);
- if (editInfo != null && editInfo.isWidget()) {
- BorderUtil.maskFigure(this, g);
- }
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.draw2d.Figure#paintBorder(org.eclipse.draw2d.Graphics)
- */
- protected void paintBorder(Graphics graphics) {
- CSSLayout layout = (CSSLayout) getLayoutManager();
- if (layout != null && !layout.handlingBorderForBlock()) {
- return;
- }
-
- ICSSStyle style = this.getCSSStyle();
- if (style != null) {
- CSSBorder border1 = new CSSBorder(this.getCSSStyle());
- border1.paint(this, graphics, NO_INSETS);
-
- // draw a border for those special elements like <h:form>, etc.
- ITagEditInfo editInfo = (ITagEditInfo) style
- .getAdapter(ITagEditInfo.class);
- if (editInfo != null && editInfo.needBorderDecorator()) {
- BorderUtil.drawBorderDecorator(this, graphics);
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.draw2d.IFigure#getInsets()
- */
- public Insets getInsets() {
- CSSLayout layout = (CSSLayout) getLayoutManager();
- if (layout != null && !layout.handlingBorderForBlock()) {
- return new Insets();
- }
- ICSSStyle style = this.getCSSStyle();
- if (style != null) {
- return style.getBorderInsets().getAdded(style.getPaddingInsets());
- }
- return new Insets();
- }
-
- /**
- * FIXME: need trace the implementation of Figure.invalidate() We want to
- * just mark this figure as invalid, but don't want to the layout get
- * invalidated.
- *
- */
- public void invalidate2() {
- if (!isValid())
- return;
- // if (getLayoutManager() != null)
- // getLayoutManager().invalidate();
- setValid(false);
-
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/CSSInlineFlowLayout.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/CSSInlineFlowLayout.java
deleted file mode 100644
index 39ddf89..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/CSSInlineFlowLayout.java
+++ /dev/null
@@ -1,320 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.FigureUtilities;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.jst.pagedesigner.css2.style.ITagEditInfo;
-
-/**
- * The layout manager for {@link CSSFigure}figures. This class is based on
- * InlineFlowLayout of draw2d.
- *
- * @author mengbo
- */
-public class CSSInlineFlowLayout extends CSSLayout {
- List _fragments = new ArrayList();
-
- /**
- * Creates a new InlineFlowLayout with the given FlowFigure.
- *
- * @param flow
- * The FlowFigure
- */
- public CSSInlineFlowLayout(CSSFigure flow) {
- super(flow);
- }
-
- /**
- * Clears out all fragments prior to the call to layoutChildren().
- */
- public void preLayout() {
- super.preLayout();
- _fragments.clear();
- // force creating of the first line. avoid empty element don't have
- // fragments.
- // createFirstLine();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowContainerLayout#layoutChildren()
- */
- protected void layoutChildren() {
- // For designer, to make it to have some size. otherwise can't
- // be found on screen.
- // List children = getCSSFigure().getChildren();
- // if (children.size() == 0)
- // {
- // FlowBox box = new FlowBox();
- // box._height = getCSSStyle().getCSSFont().getFontSize();
- // box._width = 2;
- // addToCurrentLine(box);
- //
- // }
- super.layoutChildren();
- }
-
- /**
- * Adds the given FlowBox to the current line of this InlineFlowLayout.
- *
- * @param block
- * the FlowBox to add to the current line
- */
- public void addToCurrentLine(FlowBox block) {
- getCurrentLine().add(block);
- // XXX: ???: will currentLine be added multiple times to fragments?
- // (yang)
- // _fragments.add(_currentLine);
- }
-
- private void createFirstLine() {
- _currentLine = new LineBox();
- setupLine(_currentLine, true);
- _fragments.add(_currentLine);
- }
-
- /**
- * @see FlowContainerLayout#createNewLine()
- */
- protected void createNewLine() {
- _currentLine = new LineBox();
- setupLine(_currentLine, false);
- _fragments.add(_currentLine);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowContainerLayout#createNewLine(int)
- */
- protected void createNewLine(int topMargin) {
- // inline flow don't support vertical margin.
- createNewLine();
- }
-
- /**
- * @see FlowContainerLayout#cleanup()
- */
- protected void cleanup() {
- _currentLine = null;
- }
-
- /**
- * @see FlowContainerLayout#flush()
- */
- protected void flush() {
- if (_fragments.isEmpty()) {
- createFirstLine();
- } else if (_fragments.size() == 1) {
-
- ICSSStyle style = getCSSStyle();
- int minWidth = 0, minHeight = 0;
- // try to see whether there is any designer specified min size
- ITagEditInfo info = (ITagEditInfo) style
- .getAdapter(ITagEditInfo.class);
- if (info != null) {
- minWidth = info.getMinWidth();
- minHeight = info.getMinHeight();
- }
- FlowBox box = (FlowBox) _fragments.get(0);
- if (minWidth > box._width) {
- box._width = minWidth;
- }
- if (minHeight > box._height) {
- box._height = minHeight;
- }
- }
-
- if (_currentLine != null /* && _currentLine.isOccupied() */) {
- _currentLine.getMarginInsets().right = getCSSStyle().getMarginInsets().right;
- getFlowContext().addToCurrentLine(_currentLine);
- }
-
- }
-
- /**
- * @see FlowContext#endLine()
- */
- public void endLine() {
- if (_currentLine == null) {
- getFlowContext().endLine();
- return;
- }
- // If nothing was ever placed in the line, ignore it. and if the line is
- // the first line, just remove it.
- if (_currentLine.isOccupied()) {
- getFlowContext().addToCurrentLine(_currentLine);
- } else if (_fragments.size() == 1) {
- _fragments.remove(0);
- }
- getFlowContext().endLine();
- _currentLine = null;
- }
-
- /**
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowContext#getCurrentY()
- */
- public int getCurrentY() {
- return getCurrentLine()._y;
- }
-
- /**
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowContainerLayout#isCurrentLineOccupied()
- */
- public boolean isCurrentLineOccupied() {
- if (_currentLine == null) {
- return getFlowContext().isCurrentLineOccupied();
- } else if (_currentLine.getFragments().isEmpty()) {
- return getFlowContext().isCurrentLineOccupied();
- } else {
- return true;
- }
- }
-
- /**
- * Initializes the given LineBox. Called by createNewLine().
- *
- * @param line
- * The LineBox to initialize.
- * @param firstline
- */
- protected void setupLine(LineBox line, boolean firstline) {
- LineBox parent = getFlowContext().getCurrentLine();
- line._x = 0;
- line._y = getFlowContext().getCurrentY();
-
- line.setRecommendedWidth(parent.getAvailableWidth());
-
- setLineVerticalAlign(line);
- setFontinfoForLine(line);
-
- if (firstline && getCSSStyle() != null) {
- ICSSStyle style = getCSSStyle();
- int minWidth = 0, minHeight = 0;
- // try to see whether there is any designer specified min size
- ITagEditInfo info = (ITagEditInfo) style
- .getAdapter(ITagEditInfo.class);
- if (info != null) {
- minWidth = info.getMinWidth();
- minHeight = info.getMinHeight();
- }
-
- // // CSS also has the min-width/min-height property. We should also
- // get that,
- // // and using the max of the "min-width" css property and the
- // designer specified min size.
- // int height =
- // getLengthValue(style,ICSSPropertyID.ATTR_MIN_HEIGHT);
- // if(height > minHeight)
- // {
- // minHeight = height;
- // }
- // int width = getLengthValue(style,ICSSPropertyID.ATTR_MIN_WIDTH);
- // if(width > minWidth)
- // {
- // minWidth = width;
- // }
- if (minWidth > 0) {
- line.setWidth(minWidth);
- }
- int fontHeight = this.getCSSStyle().getCSSFont().getXHeight();
- if (minHeight > 0 && minHeight > fontHeight) {
- line.setHeight(minHeight);
- } else {
- line.setHeight(fontHeight);
- }
- }
- }
-
- private void setLineVerticalAlign(LineBox box) {
- ICSSStyle style = getCSSStyle();
- if (style != null) {
- box.setVerticalAlignData(style
- .getStyleProperty(ICSSPropertyID.ATTR_VERTICAL_ALIGN));
- }
- }
-
- private void setFontinfoForLine(LineBox line) {
-
- ICSSStyle style = getCSSStyle();
- if (style != null) {
- line.setFontMetrics(FigureUtilities.getFontMetrics(style
- .getCSSFont().getSwtFont()));
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowFigureLayout#dispose()
- */
- public void dispose() {
- //
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.ICSSLayout#getFragmentsForRead()
- */
- public List getFragmentsForRead() {
- return _fragments;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.ICSSLayout#postValidate()
- */
- public void postValidate() {
- List list = _fragments;
-
- FlowBox box;
- int left = Integer.MAX_VALUE, top = left;
- int right = Integer.MIN_VALUE, bottom = right;
- for (int i = 0; i < list.size(); i++) {
- box = (FlowBox) list.get(i);
- // if (box instanceof LineBox && !((LineBox) box).isOccupied())
- // {
- // continue; // skip unoccupied line
- // }
- left = Math.min(left, box._x);
- right = Math.max(right, box._x + box._width);
- top = Math.min(top, box._y);
- bottom = Math.max(bottom, box._y + box._height);
- }
- getCSSFigure().setBounds(
- new Rectangle(left, top, right - left, bottom - top));
- list = getCSSFigure().getChildren();
- for (int i = 0; i < list.size(); i++) {
- ((FlowFigure) list.get(i)).postValidate();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowContext#getContainerWidth()
- */
- public int getContainerWidth() {
- // FIXME: don't really understand what means for inline
- return this.getFlowContext().getContainerWidth();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/CSSLayout.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/CSSLayout.java
deleted file mode 100644
index 9683a34..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/CSSLayout.java
+++ /dev/null
@@ -1,477 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout;
-
-import java.util.List;
-
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.jst.pagedesigner.css2.property.PositionMeta;
-import org.eclipse.jst.pagedesigner.css2.property.VerticalAlignMeta;
-import org.eclipse.jst.pagedesigner.css2.value.Length;
-
-/**
- * CSSLayout is the base layout manager for different CSS layouts, such as block
- * layout, inline layout (possible in the future table layout, etc)
- *
- * @author mengbo
- */
-public abstract class CSSLayout extends FlowFigureLayout implements FlowContext {
- private BlockFlowContext _absoluteContext;
-
- // when doing absolute layout, and if top/left are both "auto", it will be
- // relating to the normaly flow position. The following two fields try to
- // catch normal flow layout position.
- // int _xForAbsolute;
- // int _yForAbsolute;
- private FlowBox _boxForAbsolute;
-
- /**
- * the current line
- */
- protected LineBox _currentLine;
-
- private boolean _calculatingMaxWidth = false;
-
- /**
- * @param flowFigure
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowFigureLayout#FlowFigureLayout(FlowFigure)
- */
- protected CSSLayout(CSSFigure flowFigure) {
- super(flowFigure);
- }
-
- /**
- * a shortcut method to get the style associated with the figure.
- *
- * @return the css style
- */
- public ICSSStyle getCSSStyle() {
- return getCSSFigure().getCSSStyle();
- }
-
- /**
- * @return the absolute context
- */
- protected final BlockFlowContext getAbsoluteContext() {
- return _absoluteContext;
- }
-
- /**
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowContext#addToCurrentLine(FlowBox)
- */
- public void addToCurrentLine(FlowBox block) {
- getCurrentLine().add(block);
- }
-
- /**
- * Used by getCurrentLine().
- */
- protected abstract void createNewLine();
-
- /**
- * Used by getCurrentLine(int topmargin)
- *
- * @param topMargin
- */
- protected void createNewLine(int topMargin) {
- createNewLine();
- }
-
- /**
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowContext#getCurrentLine()
- */
- public LineBox getCurrentLine() {
- if (_currentLine == null) {
- createNewLine();
- }
- return _currentLine;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowContext#getCurrentLine(int)
- */
- public LineBox getCurrentLine(int topMargin) {
- if (_currentLine == null) {
- createNewLine(topMargin);
- }
- // if the current line only contains an empty string, reset the current
- // line using the given margin.
- else if (_currentLine.isEmptyStringLine()) {
- List list = _currentLine.getFragments();
- createNewLine(topMargin);
- _currentLine._fragments.addAll(list);
- }
- return _currentLine;
- }
-
- /**
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowContext#isCurrentLineOccupied
- */
- public boolean isCurrentLineOccupied() {
- return _currentLine != null && _currentLine.isOccupied();
- }
-
- /**
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowFigureLayout#layout()
- */
- protected void layout() {
- preLayout();
- layoutChildren();
- flush();
- cleanup();
- }
-
- /**
- * @return true if is absolute position
- */
- protected final boolean isAbsolutePosition() {
- ICSSStyle style = getCSSStyle();
-
- // FIXME: Some layout don't support absolute, need check here
- if (style != null) {
- Object obj = style.getStyleProperty(ICSSPropertyID.ATTR_POSITION);
- if (PositionMeta.ABSOLUTE.equals(obj)
- || PositionMeta.FIXED.equals(obj)) {
- return supportAbsolutePosition();
- }
- }
- return false;
- }
-
- /**
- * Child class could override this method.
- *
- * @return true if supports absolute position
- */
- protected boolean supportAbsolutePosition() {
- if (findContainingPositionedFigure() == null) {
- return false;
- }
- return true;
- }
-
- /**
- * Perform a prelayout
- */
- protected void preLayout() {
- ICSSStyle style = this.getCSSStyle();
- if (style != null) {
- style.processCounters();
- }
-
- if (isAbsolutePosition()) {
- FlowContext parentFigureContext = getParentFigureContext();
- _absoluteContext = new BlockFlowContext(parentFigureContext, style);
- _boxForAbsolute = new FlowBox();// size is 0. Just as a flag, so
- // later we
- // could figure out where will this figure be
- // be put in case of not absolute
- _boxForAbsolute.setVerticalAlignData(VerticalAlignMeta.TOP);
- parentFigureContext.addToCurrentLine(_boxForAbsolute);
- } else {
- _absoluteContext = null;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowFigureLayout#getFlowContext()
- */
- public FlowContext getFlowContext() {
- if (_absoluteContext != null) {
- return _absoluteContext;
- }
- return getOriginalFlowContext();
- }
-
- /**
- * @return the flow context
- */
- private FlowContext getParentFigureContext() {
- return super.getFlowContext();
- }
-
- final void postValidateForAbsolute() {
- if (_absoluteContext != null) {
- ICSSStyle style = this.getCSSStyle();
-
- _absoluteContext.endBlock();
-
- int xOffset;
- int yOffset;
-
- ICSSFigure containingPositionedFigure = findContainingPositionedFigure();
- IFigure parentFigure = this.getCSSFigure().getParent();
-
- xOffset = calculatePositionRelativeToParent(style,
- containingPositionedFigure, parentFigure, true);
- yOffset = calculatePositionRelativeToParent(style,
- containingPositionedFigure, parentFigure, false);
- move(_absoluteContext._blockBox, xOffset, yOffset);
- }
- }
-
- /**
- * @param style
- * @param containingPositionedFigure
- * @param parentFigure
- * @return
- */
- private int calculatePositionRelativeToParent(ICSSStyle style,
- ICSSFigure containingPositionedFigure, IFigure parentFigure,
- boolean horizontal) {
- int xOffset;
- Object left = horizontal ? style
- .getStyleProperty(ICSSPropertyID.ATTR_LEFT) : style
- .getStyleProperty(ICSSPropertyID.ATTR_TOP);
- Object right = horizontal ? style
- .getStyleProperty(ICSSPropertyID.ATTR_RIGHT) : style
- .getStyleProperty(ICSSPropertyID.ATTR_BOTTOM);
-
- if (!(left instanceof Length) && !(right instanceof Length)) {
- // _boxForAbsolute partipated the layout of the parent figure, and
- // is already relative to parent.
- return horizontal ? _boxForAbsolute._x : _boxForAbsolute._y;
- }
-
- // ok, user specified left or right. let's calculate the left
- int leftValue;
- if (left instanceof Length) {
- Length leftLength = (Length) left;
- leftValue = leftLength.getValue();
- if (leftLength.isPercentage()) {
- leftValue = (horizontal ? containingPositionedFigure
- .getBounds().width : containingPositionedFigure
- .getBounds().height)
- * leftValue / 100;
- }
- } else {
- Length rightLength = (Length) right;
- int lengthValue = rightLength.getValue();
- if (rightLength.isPercentage()) {
- lengthValue = (horizontal ? containingPositionedFigure
- .getBounds().width : containingPositionedFigure
- .getBounds().height)
- * lengthValue / 100;
- }
-
- if (horizontal) {
- leftValue = containingPositionedFigure.getBounds().width
- - _absoluteContext._blockBox.getWidth() - lengthValue;
- } else {
- leftValue = containingPositionedFigure.getBounds().height
- - _absoluteContext._blockBox.getHeight() - lengthValue;
- }
-
- }
-
- // xOffset is relative to the first box of the containing figure
- List fragments = containingPositionedFigure
- .getFragmentsForRead();
- if (fragments.size() > 0) {
- FlowBox box = (FlowBox) fragments.get(0);
- // box._x is the x location relative to containingPositionedFigure's
- // parent.
- // so now xOffset is relative to containingPositionedFigure's
- // parent.
- xOffset = (horizontal ? box._x : box._y) + leftValue;
- } else {
- xOffset = leftValue; // should not happen.
- }
- Point p;
- if (horizontal) {
- p = new Point(xOffset, 0);
- } else {
- p = new Point(0, xOffset);
- }
- containingPositionedFigure.translateFromParent(p);
- containingPositionedFigure.translateToAbsolute(p);
- parentFigure.translateToRelative(p);
- return horizontal ? p.x : p.y;
- }
-
- /**
- * @return
- */
- private ICSSFigure findContainingPositionedFigure() {
- IFigure figure = this.getCSSFigure().getParent();
- while (figure instanceof ICSSFigure) {
- return (ICSSFigure) figure;
- // ICSSStyle style = ((ICSSFigure) figure).getCSSStyle();
- // if (DisplayToLayout.isPositioned(style))
- // {
- // return (ICSSFigure) figure;
- // }
- // figure = figure.getParent();
- }
- return null;
-
- }
-
- /**
- * @param resultBox
- * @param x
- * @param y
- */
- private void move(CompositeBox compBox, int x, int y) {
- compBox._x += x;
- compBox._y += y;
- List list = compBox.getFragments();
- for (int i = 0; i < list.size(); i++) {
- FlowBox box = (FlowBox) list.get(i);
-
- if (box instanceof CompositeBox && !(box instanceof BlockBox)) {
- move((CompositeBox) box, x, y);
- } else {
- box._x += x;
- box._y += y;
- }
- }
- }
-
- /**
- * Layout all children.
- */
- protected void layoutChildren() {
- List children = getFlowFigure().getChildren();
- for (int i = 0; i < children.size(); i++) {
- Figure f = (Figure) children.get(i);
- f.invalidate();
- f.validate();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowContext#getLastMarginRight()
- */
- public int getLastMarginRight() {
- if (_currentLine == null || !_currentLine.isOccupied()) {
- return 0;
- }
- FlowBox box = (FlowBox) _currentLine.getFragments().get(
- _currentLine.getFragments().size() - 1);
- if (box != null) {
- return box.getMarginInsets().right;
- }
- return 0;
- }
-
- /**
- * @param c
- */
- public void setCalculatingMaxWidth(boolean c) {
- _calculatingMaxWidth = c;
- }
-
- /**
- * @return the calculated maximum width
- */
- public boolean getCalcuatingMaxWidth() {
- return _calculatingMaxWidth;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowContext#isCalculatingMaxWidth()
- */
- public boolean isCalculatingMaxWidth() {
- if (_calculatingMaxWidth) {
- return true;
- } else if (this.getFlowContext() == null) {
- return false;
- } else {
- return this.getFlowContext().isCalculatingMaxWidth();
- }
- }
-
- /**
- * Called after {@link #layoutChildren()}when all children have been laid
- * out. This method exists to flush the last line.
- */
- protected abstract void flush();
-
- /**
- * Flush anything pending and free all temporary data used during layout.
- */
- protected abstract void cleanup();
-
- // ------------------------------------------------------------------------------------
-
- /**
- * @return the css figure
- */
- protected final CSSFigure getCSSFigure() {
- return (CSSFigure) getFlowFigure();
- }
-
- /**
- *
- * @return the fragments for read
- */
- public abstract List getFragmentsForRead();
-
- /**
- * postValidate the child figures of this CSSFigure. Normally layout fall
- * into the first category need implement this method.
- */
- public abstract void postValidate();
-
- /**
- * setBounds is called on the CSSFigure. Normally layout fall into the
- * second category need implement this method.
- *
- * @param rect
- * @param invalidate
- */
- public void setBoundsCalled(Rectangle rect, boolean invalidate) {
- // TODO: dead?
- }
-
- /**
- * Child class can override this. Normally block figure will return true.
- *
- * @return true if should use local coordinates
- */
- protected boolean useLocalCoordinates() {
- return false;
- }
-
- /**
- * If CSSLayout will call paint rountine to draw Border for its box, this
- * method will return true, else return false, for example,the input file
- * will return false.
- *
- * @return true if handling border block
- */
- protected boolean handlingBorderForBlock() {
- return true;
- }
-
- /**
- * This method is called when the corresponding figure is revalidated.
- *
- */
- protected void figureRevalidate() {
- // child class can override.
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/CSSListItemLayout.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/CSSListItemLayout.java
deleted file mode 100644
index a8400f4..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/CSSListItemLayout.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout;
-
-import java.util.List;
-
-import org.eclipse.draw2d.FigureUtilities;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.list.CounterHelper;
-import org.eclipse.jst.pagedesigner.css2.list.ICounterValueGenerator;
-import org.eclipse.jst.pagedesigner.css2.marker.CounterUtil;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.jst.pagedesigner.css2.style.DefaultStyle;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * @author mengbo
- */
-public class CSSListItemLayout extends CSSBlockFlowLayout implements
- ICSSPainter {
- private static final String DEFAULT_LIST_COUNTER = "_anonymous";
-
- private static final int CIRCLE_DIAMETER = 6;
-
- private static final int DISC_DIAMETER = 5;
-
- private static final int ROUNDRECT_ARC = 2;
-
- private static final int TEXT_PADDING = 16;
-
- private int _count;
-
- /**
- * @param cssfigure
- */
- public CSSListItemLayout(CSSFigure cssfigure) {
- super(cssfigure);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.ICSSPainter#paintFigure(org.eclipse.draw2d.Graphics)
- */
- public void paintFigure(Graphics g) {
- ICSSStyle style = this.getCSSStyle();
- if (style == null) {
- style = DefaultStyle.getInstance();
- }
-
- Rectangle drawArea = null;
- Font font = getCSSStyle().getCSSFont().getSwtFont();
-
- // draw the marker box
- Object styleType = style
- .getStyleProperty(ICSSPropertyID.ATTR_LIST_STYLE_TYPE);
-
- g.pushState();
-
- Color newColor = null;
- Object color = style.getColor();
- if (color instanceof Color) {
- g.setForegroundColor((Color) color);
- g.setBackgroundColor((Color) color);
- } else if (color instanceof RGB) {
- newColor = new Color(Display.getCurrent(), (RGB) color);
- g.setForegroundColor(newColor);
- g.setBackgroundColor(newColor);
- }
-
- if (styleType instanceof String) {
- int type = CounterHelper.toTypeInt((String) styleType);
- switch (type) {
- case CounterHelper.LIST_T_UPPER_ALPHA:
- case CounterHelper.LIST_T_LOWER_ALPHA:
- case CounterHelper.LIST_T_LOWER_ROMAN:
- case CounterHelper.LIST_T_UPPER_ROMAN:
- case CounterHelper.LIST_T_DECIMAL:
- g.setFont(font);
- String displayString = CounterUtil.convertCount(_count, type);
- Point point = getDrawPointForText(displayString);
- g.drawString(displayString, point);
- break;
- case CounterHelper.LIST_T_CIRCLE:
- drawArea = getDrawAreaForGraph(CIRCLE_DIAMETER, CIRCLE_DIAMETER);
- g.drawArc(drawArea, 0, 360);
- break;
- case CounterHelper.LIST_T_SQUARE:
- drawArea = getDrawAreaForGraph(DISC_DIAMETER, DISC_DIAMETER);
- g.fillRectangle(drawArea);
- case CounterHelper.LIST_T_DECIMAL_LEADING_ZERO:
- case CounterHelper.LIST_T_LOWER_GREEK:
- case CounterHelper.LIST_T_ARMENIAN:
- case CounterHelper.LIST_T_GEORGIAN:
- case CounterHelper.LIST_T_IMAGE:
- case CounterHelper.LIST_T_NONE:
- default:
- drawArea = getDrawAreaForGraph(DISC_DIAMETER, DISC_DIAMETER);
- g.fillRoundRectangle(drawArea, ROUNDRECT_ARC, ROUNDRECT_ARC);
- break;
- }
- }
- g.popState();
-
- if (newColor != null) {
- newColor.dispose();
- }
- }
-
- /**
- * @param g
- * @return
- */
- private Rectangle getDrawAreaForGraph(int width, int height) {
- Rectangle drawArea;
-
- int x = 0;
- int y = 0;
-
- List list = _blockBox.getFragments();
- Rectangle box = _blockBox.toRectangle().getCopy().expand(
- _blockBox.getBorderPaddingInsets().getAdded(
- _blockBox.getMarginInsets()));
- if (list != null && !list.isEmpty()) {
- LineBox line = (LineBox) list.get(0);
- y = line.getBaseline() - CIRCLE_DIAMETER;
- x = box.x;
- } else {
- x = box.x;
- y = box.height / 2 - CIRCLE_DIAMETER;
- }
- drawArea = new Rectangle(x - CIRCLE_DIAMETER * 5 / 2, y, width, height);
- return drawArea;
- }
-
- private Point getDrawPointForText(String displayString) {
- Font font = getCSSStyle().getCSSFont().getSwtFont();
-
- int x = 0;
- int y = 0;
-
- Rectangle box = _blockBox.toRectangle().getCopy().expand(
- _blockBox.getBorderPaddingInsets().getAdded(
- _blockBox.getMarginInsets()));
-
- x = box.x - FigureUtilities.getTextWidth(displayString, font);
- x = x
- - (TEXT_PADDING - FigureUtilities.getFontMetrics(font)
- .getDescent());
-
- return new Point(x, y);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowContainerLayout#layoutChildren()
- */
- protected void layoutChildren() {
- ICounterValueGenerator counter = this.getCSSStyle().findCounter(
- DEFAULT_LIST_COUNTER, true);
- if (counter != null) {
- _count = counter.getCurrentCount();
- } else {
- // should not happen.
- _count = 1; // use 1 as the default value
- }
- super.layoutChildren();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/CSSPageFlowLayout.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/CSSPageFlowLayout.java
deleted file mode 100644
index 8662bc2..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/CSSPageFlowLayout.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout;
-
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-
-/**
- * This layout if for those thigns that it's parent will decide its size. Such
- * as table cell.
- *
- * @author mengbo
- * @version 1.5
- */
-public class CSSPageFlowLayout extends CSSBlockFlowLayout {
- private Dimension _pageSize = new Dimension();
-
- private int _recommendedWidth;
-
- private int _pageSizeCacheKeys[] = new int[4];
-
- private Dimension _pageSizeCacheValues[] = new Dimension[4];
-
-
- /**
- * @param cssfigure
- */
- public CSSPageFlowLayout(CSSFigure cssfigure) {
- super(cssfigure);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowFigureLayout#invalidate()
- */
- public void invalidate() {
- super.invalidate();
- _pageSizeCacheKeys = new int[4];
- _pageSizeCacheValues = new Dimension[4];
- _pageSize = new Dimension();
- _recommendedWidth = 0;
- }
-
- protected void endBlock() {
- layoutLines();
- }
-
- /**
- * TODO: This method is not being called.
- */
- public void postValidate() {
- Rectangle r = new Rectangle(_blockBox._x, _blockBox._y, _blockBox
- .getWidth(), _blockBox.getHeight());
- r = r.expand(getCSSFigure().getInsets());
- _pageSize.width = r.width;
- _pageSize.height = r.height;
-
- List list = getCSSFigure().getChildren();
- for (int i = 0; i < list.size(); i++) {
- ((FlowFigure) list.get(i)).postValidate();
- }
-
- }
-
- /**
- * Setup blockBox to the initial bounds of the Page
- */
- protected void setupBlock() {
- // Remove all current Fragments
- _blockBox.clear();
-
- // Setup the one fragment for this Block with the correct X and
- // available width
- int recommendedWidth = getRecommendedWidth();
- _blockBox.setRecommendedWidth(recommendedWidth);
-
- if (recommendedWidth > 0 && recommendedWidth != Integer.MAX_VALUE) {
- _blockBox.setWidth(recommendedWidth);
- }
-
- _blockBox._x = 0;
- }
-
- private int getRecommendedWidth() {
- return _recommendedWidth;
- }
-
- private void setRecommendedWidth(int width) {
- if (_recommendedWidth == width) {
- return;
- }
- _recommendedWidth = width;
- getCSSFigure().invalidate2();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.CSSLayout#setBoundsCalled(org.eclipse.jst.pagedesigner.css2.layout.CSSFigure,
- * org.eclipse.draw2d.geometry.Rectangle, boolean)
- */
- public void setBoundsCalled(Rectangle r, boolean invalidate) {
- super.setBoundsCalled(r, invalidate);
- CSSFigure figure = getCSSFigure();
- int newWidth = r.width - figure.getInsets().getWidth();
- if (invalidate || getRecommendedWidth() != newWidth) {
- setRecommendedWidth(newWidth);
- figure.getUpdateManager().addInvalidFigure(figure);
- }
- }
-
- /**
- * @see org.eclipse.draw2d.Figure#getPreferredSize(int, int)
- */
- public Dimension getPreferredSize(IFigure container, int width, int h) {
- if (width >= 0) {
- width = Math.max(0, width - container.getInsets().getWidth());
- }
-
- for (int i = 0; i < 4; i++) {
- if (_pageSizeCacheKeys[i] == width
- && _pageSizeCacheValues[i] != null) {
- return _pageSizeCacheValues[i];
- }
- }
-
- _pageSizeCacheKeys[3] = _pageSizeCacheKeys[2];
- _pageSizeCacheKeys[2] = _pageSizeCacheKeys[1];
- _pageSizeCacheKeys[1] = _pageSizeCacheKeys[0];
- _pageSizeCacheKeys[0] = width;
-
- _pageSizeCacheValues[3] = _pageSizeCacheValues[2];
- _pageSizeCacheValues[2] = _pageSizeCacheValues[1];
- _pageSizeCacheValues[1] = _pageSizeCacheValues[0];
-
- // Flowpage must temporarily layout to determine its preferred size
- int oldWidth = getRecommendedWidth();
- setRecommendedWidth(width);
- container.validate();
- _pageSizeCacheValues[0] = _pageSize.getExpanded(container.getInsets()
- .getWidth(), container.getInsets().getHeight());
-
- if (width != oldWidth) {
- setRecommendedWidth(oldWidth);
- container.getUpdateManager().addInvalidFigure(container);
- }
- return _pageSizeCacheValues[0];
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/CSSTextFigure.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/CSSTextFigure.java
deleted file mode 100644
index afb0f46..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/CSSTextFigure.java
+++ /dev/null
@@ -1,310 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.jst.pagedesigner.css2.provider.ICSSTextProvider;
-import org.eclipse.jst.pagedesigner.css2.style.DefaultStyle;
-import org.eclipse.jst.pagedesigner.css2.style.StyleUtil;
-import org.eclipse.jst.pagedesigner.viewer.CaretPositionResolver;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.RGB;
-
-/**
- * @author mengbo
- */
-public class CSSTextFigure extends FlowFigure implements ICSSFigure {
- private ICSSTextProvider _provider;
-
- private List _fragments = new ArrayList(1);
-
- /**
- * @param provider
- */
- public CSSTextFigure(ICSSTextProvider provider) {
- _provider = provider;
- this.setLayoutManager(createDefaultFlowLayout());
- }
-
- public ICSSStyle getCSSStyle() {
- IFigure parentFigure = this.getParent();
- if (parentFigure instanceof ICSSFigure) {
- ICSSStyle style = ((ICSSFigure) parentFigure).getCSSStyle();
- if (style != null) {
- return style;
- }
- }
- return DefaultStyle.getInstance();
- }
-
- /**
- * @see org.eclipse.draw2d.IFigure#containsPoint(int, int)
- */
- public boolean containsPoint(int x, int y) {
- if (!super.containsPoint(x, y)) {
- return false;
- }
- List frags = getFragments();
- for (int i = 0, n = frags.size(); i < n; i++) {
- if (((FlowBox) frags.get(i)).containsPoint(x, y)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * @return the default flow layout
- *
- */
- protected FlowFigureLayout createDefaultFlowLayout() {
- return new CSSTextLayout(this);
- }
-
- /**
- * Returns the <code>LineBox</code> fragments contained in this InlineFlow
- *
- * @return The fragments
- */
- public List getFragments() {
- return _fragments;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.ICSSFigure#getFragmentsForRead()
- */
- public List getFragmentsForRead() {
- return getFragments();
- }
-
- /**
- * @return the text
- */
- public String getText() {
- return _provider.getTextData();
- }
-
- /**
- * @see FlowFigure#postValidate()
- */
- public void postValidate() {
- List list = getFragments();
- FlowBox box;
- int left = Integer.MAX_VALUE, top = left;
- int right = Integer.MIN_VALUE, bottom = right;
- for (int i = 0, n = list.size(); i < n; i++) {
- box = (FlowBox) list.get(i);
- left = Math.min(left, box._x);
- right = Math.max(right, box._x + box._width);
- top = Math.min(top, box._y);
- bottom = Math.max(bottom, box._y + box._height);
- }
- setBounds(new Rectangle(left, top, right - left, bottom - top));
- list = getChildren();
- for (int i = 0, n = list.size(); i < n; i++) {
- ((FlowFigure) list.get(i)).postValidate();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.draw2d.Figure#paintBorder(org.eclipse.draw2d.Graphics)
- */
- protected void paintBorder(Graphics graphics) {
- if (Debug.DEBUG_TEXTBORDER) {
- if (_fragments != null) {
- graphics.setForegroundColor(ColorConstants.darkBlue);
- for (int i = 0, size = _fragments.size(); i < size; i++) {
- FlowBox box = (FlowBox) _fragments.get(i);
- BoxUtil.drawBox(graphics, box);
- }
- graphics.restoreState();
- }
- }
- }
-
- /**
- * @see org.eclipse.draw2d.Figure#paintFigure(Graphics)
- */
- protected void paintFigure(Graphics g) {
- Object result = this.getCSSStyle().getColor();
- Color color;
- if (result instanceof Color) {
- color = (Color) result;
- } else if (result instanceof RGB) {
- color = new Color(null, (RGB) result);
- } else {
- color = null;
- }
- int[] range = null;
- if (!StyleUtil.isInWidget(this.getCSSStyle())) {
- range = _provider.getSelectedRange();
- }
- if (range == null || range[0] == range[1]) {
- // we are not in selection
- TextLayoutSupport.paintTextFigure(g, _fragments, getCSSStyle()
- .getCSSFont().getSwtFont(), color, ((Integer) getCSSStyle()
- .getStyleProperty(ICSSPropertyID.ATTR_TEXTDECORATION))
- .intValue());
- } else {
- TextLayoutSupport.paintTextFigureWithSelection(g, _fragments,
- _provider.getTextData(), getCSSStyle().getCSSFont()
- .getSwtFont(), color, ((Integer) getCSSStyle()
- .getStyleProperty(
- ICSSPropertyID.ATTR_TEXTDECORATION))
- .intValue(), range[0], range[1],
- ColorConstants.white, ColorConstants.blue);
- }
- if (color != result && color != null) {
- color.dispose();
- }
- }
-
- /**
- * Find out lines which has closer y coordinate to point, and then line
- * which has closer x coordinate.
- *
- * @param relative
- * @return return the offset
- */
- // TODO: refactoring?
- public int getNewInsertionOffset(Point relative) {
- TextFragmentBox closestBox = null;
- // if there is one which are at the same line with relative, calculate
- // that line first;
- for (int i = 0, n = _fragments.size(); i < n; i++) {
- TextFragmentBox box = (TextFragmentBox) _fragments.get(i);
- if (box.containsPoint(relative.x, relative.y)) {
- int index = FlowUtilities.getTextInWidth(box.getTextData(),
- getCSSStyle().getCSSFont().getSwtFont(), relative.x
- - box._x, TextLayoutSupport
- .getAverageCharWidth(box));
- return box._offset + index;
- }
- if (closestBox == null) {
- closestBox = box;
- } else {
- // box is above point
- TextFragmentBox tempBox = box;
- int offset1 = Math
- .abs(CaretPositionResolver.getYDistance(
- new Rectangle(tempBox._x, tempBox._y,
- tempBox._width, tempBox._height),
- relative));
- tempBox = closestBox;
- int offset2 = Math
- .abs(CaretPositionResolver.getYDistance(
- new Rectangle(tempBox._x, tempBox._y,
- tempBox._width, tempBox._height),
- relative));
- if (offset1 < offset2) {
- closestBox = box;
- }
- }
- // at the same line
- if (box.containsPoint(box._x, relative.y)) {
- TextFragmentBox tempBox = box;
- int offset1 = Math
- .abs(CaretPositionResolver.getXDistance(
- new Rectangle(tempBox._x, tempBox._y,
- tempBox._width, tempBox._height),
- relative));
- tempBox = closestBox;
- int offset2 = Math
- .abs(CaretPositionResolver.getXDistance(
- new Rectangle(tempBox._x, tempBox._y,
- tempBox._width, tempBox._height),
- relative));
- if (offset1 < offset2) {
- closestBox = box;
- }
- }
- }
-
- if (closestBox.containsPoint(closestBox._x, relative.y)
- || closestBox.containsPoint(relative.x, closestBox._y)) {
- int offset = relative.x - closestBox._x;
- int index = FlowUtilities.getTextInWidth(closestBox.getTextData(),
- getCSSStyle().getCSSFont().getSwtFont(), offset,
- TextLayoutSupport.getAverageCharWidth(closestBox));
- return closestBox._offset + index;
- }
- return -1;
- }
-
- /**
- * @param relative
- * @return the insertion offset
- */
- public int getInsertionOffset(Point relative) {
- for (int i = 0, n = _fragments.size(); i < n; i++) {
- TextFragmentBox box = (TextFragmentBox) _fragments.get(i);
- if (box.containsPoint(relative.x, relative.y)) {
- int index = FlowUtilities.getTextInWidth(box.getTextData(),
- getCSSStyle().getCSSFont().getSwtFont(), relative.x
- - box._x, TextLayoutSupport
- .getAverageCharWidth(box));
- return box._offset + index;
- }
- }
- return -1;
- }
-
- /**
- * the returned rectangle will be relative to this text figure.
- *
- * @param offset
- * @return the caret position
- */
- public Rectangle calculateCaretPosition(int offset) {
- // search reverse order, find the latest box that has _offset small than
- // the specified one
- if (offset > 0) {
- for (int i = _fragments.size() - 1; i >= 0; i--) {
- TextFragmentBox box = (TextFragmentBox) _fragments.get(i);
- if (box._offset <= offset) {
- // ok, we find the box.
- if (box._offset + box._length < offset) {
- return new Rectangle(box._x + box._width, box._y, 1,
- box._height);
- }
- String s = box.getTextData().substring(0,
- offset - box._offset);
- int width = FlowUtilities.getTextExtents(s,
- getCSSStyle().getCSSFont().getSwtFont()).width;
- return new Rectangle(box._x + width, box._y, 1,
- box._height);
- }
- }
- } else {
- if (_fragments.size() > 0) {
- TextFragmentBox box = (TextFragmentBox) _fragments.get(0);
- return new Rectangle(box._x, box._y, 1, box._height);
- }
- }
- // should only reach here when there is no fragments.
- return new Rectangle(getBounds().x, getBounds().y, 1, getBounds().height);
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/CSSTextLayout.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/CSSTextLayout.java
deleted file mode 100644
index 2805c98..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/CSSTextLayout.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout;
-
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.jst.pagedesigner.css2.style.AbstractStyle;
-import org.eclipse.swt.graphics.Font;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- */
-// NOTE: CSSTextLayout does not extends CSSFlowLayout. Since text is a little
-// special,
-// we don't want to do things like "preLayout()" as in CSSFlowLayout.
-public class CSSTextLayout extends FlowFigureLayout {
- /**
- * Wrapping will ONLY occur at valid line breaks
- */
- public static final int WORD_WRAP_HARD = 0;
-
- /**
- * Wrapping will always occur at the end of the available space, breaking in
- * the middle of a word.
- */
- public static final int WORD_WRAP_SOFT = 1;
-
- /**
- * Wrapping will always occur at the end of available space, truncating a
- * word if it doesn't fit.
- */
- // don't support this flag
- // public static final int WORD_WRAP_TRUNCATE = 2;
- private int _wrappingStyle = WORD_WRAP_HARD;
-
- /**
- * @param textfigure
- */
- public CSSTextLayout(CSSTextFigure textfigure) {
- super(textfigure);
- }
-
- // --------------------------------------------------------------------------------------------------
- FlowBox findLastNonLineBox(LineBox box) {
- List fragments = box.getFragments();
- for (int i = fragments.size() - 1; i >= 0; i--) {
- FlowBox item = (FlowBox) fragments.get(i);
- if (item instanceof LineBox) {
- FlowBox found = findLastNonLineBox((LineBox) item);
- if (found != null) {
- return found;
- }
- } else {
- return item;
- }
- }
- return null;
- }
-
- // boolean isElementContentWhitespaceEnding()
- // {
- // if (!this._context.isCurrentLineOccupied())
- // return true;
- // LineBox line = this._context.getCurrentLine();
- // FlowBox lastNoneLinebox = findLastNonLineBox(line);
- // if (lastNoneLinebox instanceof TextFragmentBox)
- // return ((TextFragmentBox) lastNoneLinebox)._isLastCharWhitespace;
- // else
- // return true;
- // }
- //
- // String normalize(String text)
- // {
- // text = EntityMap.translateAndCompact(text);
- // if (text.length() > 0 &&
- // Character.isElementContentWhitespace(text.charAt(0)) &&
- // isElementContentWhitespaceEnding())
- // return text.substring(1);
- // else
- // return text;
- // }
-
- private void layoutEmptyString(List fragments, Font font) {
- // empty node! we want to create a fake fragment, so things can be
- // consistent
- // that all the CSSTextFigure will have something inside, also in this
- // way, even
- // empty text node will have a position, thus we can support showing
- // caret associated
- // with this text figure.
- fragments.clear();
- TextFragmentBox box = TextLayoutSupport.getFragment(0, fragments);
- box._length = 0;
- box._offset = 0;
- box._height = 0;
- box._width = 0;
- box.setTextData("");
-
- // {following comments deprecated XXX: If is empty string, we only want
- // to this figure to have a size, but don't
- // want to it to be added into current line. Otherwise, a line with only
- // a empty string
- // will also take a line's space.}
-
- // please reference LineBox.isOccupied()
- // now we treat a line with only an empty text as not occupied.
- getFlowContext().getCurrentLine().add(box);
- }
-
- /**
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowFigureLayout#layout()
- */
- protected void layout() {
- CSSTextFigure flowFigure = (CSSTextFigure) getFlowFigure();
-
- List fragments = flowFigure.getFragments();// Reuse the previous List
- // of fragments
- String text = flowFigure.getText();
- Font font = flowFigure.getCSSStyle().getCSSFont().getSwtFont();
- Object whitespace = flowFigure.getCSSStyle().getStyleProperty(
- ICSSPropertyID.ATTR_WHITESPACE);
-
- if (whitespace == ICSSPropertyID.VAL_PRE) {
- if (text == null || text.length() == 0)
- layoutEmptyString(fragments, font);
- else
- TextLayoutSupport.layoutNoWrap(getFlowContext(), text,
- fragments, font);
- } else if (whitespace == ICSSPropertyID.VAL_NOWRAP) {
- if (text == null || text.length() == 0)
- layoutEmptyString(fragments, font);
- else
- TextLayoutSupport.layoutNoWrap(getFlowContext(), text,
- fragments, font);
- } else {
- if (text == null || text.length() == 0)
- layoutEmptyString(fragments, font);
- else {
- //fix for bug #221629 - BEGIN
- boolean useShouldTrimLeadingWSInlineMethod = false;
- IFigure parentFigure = flowFigure.getParent();
- if (parentFigure instanceof CSSFigure) {
- ICSSStyle style = ((CSSFigure)parentFigure).getCSSStyle();
- if (style instanceof AbstractStyle) {
- Element element = ((AbstractStyle)style).getElement();
- if (element != null &&
- element.getNodeName().equals(IHTMLConstants.TAG_SPAN)) {
- useShouldTrimLeadingWSInlineMethod = true;
- }
- }
- }
- boolean trimLeadingChar;
- if (!useShouldTrimLeadingWSInlineMethod) {
- trimLeadingChar = (text.charAt(0) == ' ' && shouldTrimLeadingWhitespace(getFlowContext()));
- } else {
- trimLeadingChar = (text.charAt(0) == ' ' && shouldTrimLeadingWhitespaceInline(getFlowContext()));
- }
- //fix for bug #221629 - END
- TextLayoutSupport.layoutNormal(getFlowContext(), text,
- fragments, font, _wrappingStyle, trimLeadingChar);
- }
- }
- }
-
- /**
- * @param context
- * @return true if should trim leading whitespace
- */
- // XXX: maybe should move to TextSupport later.
- public boolean shouldTrimLeadingWhitespace(FlowContext context) {
- if (!context.isCurrentLineOccupied()) {
- return true;
- }
- while (context instanceof CSSInlineFlowLayout) {
- context = ((CSSInlineFlowLayout) context).getFlowContext();
- }
- LineBox line = context.getCurrentLine();
- if (line == null || !line.isOccupied()) {
- return true;
- }
- FlowBox lastNoneLinebox = findLastNonLineBox(line);
- if (lastNoneLinebox == null || lastNoneLinebox.getWidth() == 0) {
- return true;
- } else if (lastNoneLinebox instanceof TextFragmentBox) {
- return ((TextFragmentBox) lastNoneLinebox)._isLastCharWhitespace;
- } else {
- return false;
- }
- }
-
- /**
- * Used instead of shouldTrimLeadingWhitespace(FlowContext) if parent
- * figure's style is for an appropriate in-line element, such as "span".
- *
- * @param context FlowContext instance.
- * @return true if should trim leading whitespace, else false.
- */
- private boolean shouldTrimLeadingWhitespaceInline(FlowContext context) {
- if (!context.isCurrentLineOccupied()) {
- return true;
- }
- LineBox line = context.getCurrentLine();
- if (line == null || !line.isOccupied()) {
- return true;
- }
- FlowBox lastNoneLinebox = findLastNonLineBox(line);
- if (lastNoneLinebox == null || lastNoneLinebox.getWidth() == 0) {
- return true;
- } else if (lastNoneLinebox instanceof TextFragmentBox) {
- return ((TextFragmentBox) lastNoneLinebox)._isLastCharWhitespace;
- } else {
- return false;
- }
- }
-
- public void dispose() {
- // TODO: anything to dispose?
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/CSSWidgetLayout.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/CSSWidgetLayout.java
deleted file mode 100644
index 8e50123..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/CSSWidgetLayout.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout;
-
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.jst.pagedesigner.css2.provider.DimensionInfo;
-import org.eclipse.jst.pagedesigner.css2.provider.ICSSWidgetProvider;
-
-/**
- * @author mengbo
- */
-public class CSSWidgetLayout extends CSSBlockFlowLayout implements ICSSPainter {
- private WidgetBox _widgetBox;
-
- private ICSSWidgetProvider _provider;
-
- /**
- * @param flowfigure
- * @param provider
- */
- public CSSWidgetLayout(CSSFigure flowfigure, ICSSWidgetProvider provider) {
- super(flowfigure);
- _provider = provider;
- }
-
- /**
- * normally this method is called directly after constructor
- *
- * @param provider
- */
- public void setProvider(ICSSWidgetProvider provider) {
- _provider = provider;
- }
-
- /**
- * @return the provider
- */
- public ICSSWidgetProvider getProvider() {
- // return ((CSSWidgetFigure)this.getFlowFigure()).getProvider();
- return _provider;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.CSSBlockFlowLayout#isInlineBlock()
- */
- public boolean isInlineBlock() {
- ICSSWidgetProvider provider = getProvider();
- return provider.isInline();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowFigureLayout#layout()
- */
- protected void layoutChildren() {
- ICSSWidgetProvider provider = getProvider();
-
- // if we did endLine, then will result in context create a new line, so
- // we may in the new line now.
- // passing in the top margin, and context will consider that when
- // creating the new line.
-
- int suggestedWith = _blockBox.getContentWidth();
- int suggestedHeight = _blockBox.getContentHeight();
- // int suggestedWith = getSuggestedWidth(line, style, provider);
- // int suggestedHeight = getSuggestedHeight(line, style, provider);
-
- DimensionInfo resultInfo = provider.getPreferredDimension(
- suggestedWith, suggestedHeight);
- Dimension resultSize = resultInfo.getDimension();
-
- _widgetBox = new WidgetBox(); // ((CSSWidgetFigure)getFlowFigure()).getWidgetBox();
- // if (provider.isHandlingBorder() || style == null)
- // {
- _widgetBox.setWidth(resultSize.width);
- _widgetBox.setHeight(resultSize.height);
- _widgetBox.setAscent(resultInfo.getAscent());
- // }
- // else
- // {
- // widgetBox.setWidth(resultSize.width +
- // style.getBorderInsets().getWidth());
- // widgetBox.setHeight(resultSize.height +
- // style.getBorderInsets().getHeight());
- // widgetBox.setAscent(resultInfo.getAscent()+style.getBorderInsets().top);
- // }
- this.addToCurrentLine(_widgetBox);
- // if (!provider.isInline())
- // {
- // context.endLine();
- // }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowFigureLayout#dispose()
- */
- public void dispose() {
- // TODO: anything to dispose?
- }
-
- // public int getSuggestedWidth(LineBox line, ICSSStyle style,
- // ICSSWidgetProvider provider)
- // {
- // if (style == null) return -1;
- //
- // Object width = style.getStyleProperty(ICSSPropertyID.ATTR_WIDTH);
- // Length recommendedWidth = (width instanceof Length) ? (Length) width :
- // null;
- //
- // int rw = 0;
- // if (recommendedWidth == null || recommendedWidth.getValue() <= 0)
- // {
- // return -1;
- // }
- // else
- // {
- // if (recommendedWidth.isPercentage())
- // {
- // rw = line.getAvailableWidth() * recommendedWidth.getValue() / 100;
- // }
- // else
- // {
- // rw = recommendedWidth.getValue();
- // }
- //
- // if (!style.isSizeIncludeBorderPadding() && provider.isHandlingBorder())
- // {
- // rw += style.getBorderInsets().getWidth() +
- // style.getPaddingInsets().getWidth();
- // }
- // else if (style.isSizeIncludeBorderPadding() &&
- // !provider.isHandlingBorder())
- // {
- // rw -= style.getBorderInsets().getWidth() +
- // style.getPaddingInsets().getWidth();
- // }
- // }
- //
- // return rw;
- // }
- //
- // public int getSuggestedHeight(LineBox line, ICSSStyle style,
- // ICSSWidgetProvider provider)
- // {
- // if (style == null) return -1;
- //
- // Object height = style.getStyleProperty(ICSSPropertyID.ATTR_HEIGHT);
- // Length recommendedHeight = (height instanceof Length) ? (Length) height :
- // null;
- //
- // int rh = 0;
- // if (recommendedHeight == null || recommendedHeight.getValue() <= 0)
- // {
- // return -1;
- // }
- // else
- // {
- // if (recommendedHeight.isPercentage())
- // {
- // // we don't support percentage height for this version, ignore
- // return -1;
- // }
- // else
- // {
- // rh = recommendedHeight.getValue();
- // }
- //
- // if (!style.isSizeIncludeBorderPadding() && provider.isHandlingBorder())
- // {
- // rh += style.getBorderInsets().getHeight() +
- // style.getPaddingInsets().getHeight();
- // }
- // else if (style.isSizeIncludeBorderPadding() &&
- // !provider.isHandlingBorder())
- // {
- // rh -= style.getBorderInsets().getHeight() +
- // style.getPaddingInsets().getHeight();
- // }
- // }
- //
- // return rh;
- // }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.ICSSPainter#paintFigure(org.eclipse.draw2d.Graphics)
- */
- public void paintFigure(Graphics g) {
- ICSSWidgetProvider provider = this.getProvider();
- if (provider != null && _widgetBox != null) {
- provider.paintFigure(g, new Rectangle(_widgetBox._x, _widgetBox._y,
- _widgetBox.getWidth(), _widgetBox.getHeight()));
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.CSSLayout#handlingBorderForBlock()
- */
- public boolean handlingBorderForBlock() {
- ICSSWidgetProvider provider = this.getProvider();
- if (provider != null) {
- return provider.isHandlingBorder();
- }
- return super.handlingBorderForBlock();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/CompositeBox.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/CompositeBox.java
deleted file mode 100644
index 75d6a0e..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/CompositeBox.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * A FlowBox that can contain other BlockInfos. The contained BlockInfos are
- * called <i>fragments </i>.
- *
- * @author mengbo
- * @since 2.1
- */
-public abstract class CompositeBox extends FlowBox {
-
- /**
- * The contained fragments.
- */
- protected List _fragments = new ArrayList();
-
- int _recommendedWidth;
-
- int _recommendedHeight;
-
- /**
- * Adds the specified FlowBox. Updates the width, height, and ascent
- * properties.
- *
- * @param block
- * the FlowBox being added
- */
- public void add(FlowBox block) {
- // The order is critical.see the first "if" block in the unionInfo()
- // method.
- unionInfo(block);
- _fragments.add(block);
- }
-
- /**
- * Removes all owned fragments and invalidates this CompositeBox.
- */
- public void clear() {
- _fragments.clear();
- resetInfo();
- }
-
- /**
- * Overridden to ensure that the CompositeBox is valid.
- *
- * @see FlowBox#getBounds()
- */
- // public Rectangle getBounds() {
- // validate();
- // return this;
- // }
- /**
- * @return the List of fragments
- */
- public List getFragments() {
- return _fragments;
- }
-
- /**
- * Returns the recommended width for this CompositeBox.
- *
- * @return the recommended width
- */
- public int getRecommendedWidth() {
- return _recommendedWidth;
- }
-
- /**
- * resets fields before unioning the data from the fragments.
- */
- protected void resetInfo() {
- _width = _height = 0;
- }
-
- /**
- * Sets the recommended width for this CompositeBox.
- *
- * @param w
- * the width
- */
- public void setRecommendedWidth(int w) {
- _recommendedWidth = w;
- }
-
- /**
- * @param h
- */
- public void setRecommendedHeight(int h) {
- _recommendedHeight = h;
- }
-
- /**
- * unions the fragment's width, height, and ascent into this composite.
- *
- * @param box
- * the fragment
- */
- protected void unionInfo(FlowBox box) {
- int right = Math.max(_x + _width, box._x + box._width);
- int bottom = Math.max(_y + _height, box._y + box._height);
- _x = Math.min(_x, box._x);
- _y = Math.min(_y, box._y);
- _width = right - _x;
- _height = bottom - _y;
- }
-
- /**
- * @return the content width
- */
- public int getContentWidth() {
- return getWidth() - getBorderPaddingWidth();
- }
-
- /**
- * @return the content height
- */
- public int getContentHeight() {
- return getHeight() - getBorderPaddingHeight();
- }
-
- /**
- * @return the recommended content width
- */
- public int getRecommendedContentWidth() {
- return Math.max(0, getRecommendedWidth() - getBorderPaddingWidth());
- }
- //
- // public int getRecommendedContentHeight()
- // {
- // return Math.max(0, getRecommendedHeight() - getBorderPaddingHeight());
- // }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/Debug.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/Debug.java
deleted file mode 100644
index f83e901..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/Debug.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout;
-
-/**
- * Debug constants.
- *
- * @author mengbo
- * @version 1.5
- */
-public class Debug {
- /**
- * Debug flag
- */
- public static final boolean DEBUG_BASELINE = false;
-
- /**
- * Debug flag
- */
- public static final boolean DEBUG_BOX = false;
-
- /**
- * Debug flag
- */
- public static final boolean DEBUG_BORDERPADDING = false;
-
- /**
- * Debug flag
- */
- public static final boolean DEBUG_TEXTBORDER = false;
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/DisplayToLayout.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/DisplayToLayout.java
deleted file mode 100644
index cefb4de..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/DisplayToLayout.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout;
-
-import org.eclipse.draw2d.LayoutManager;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.layout.table.CSSTRGroupLayout;
-import org.eclipse.jst.pagedesigner.css2.layout.table.CSSTRLayout;
-import org.eclipse.jst.pagedesigner.css2.layout.table.CSSTableCaptionLayout;
-import org.eclipse.jst.pagedesigner.css2.layout.table.CSSTableCellLayout;
-import org.eclipse.jst.pagedesigner.css2.layout.table.CSSTableLayout2;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.jst.pagedesigner.css2.property.PositionMeta;
-
-/**
- * @author mengbo
- */
-public final class DisplayToLayout {
- /**
- * @param figure
- * @param display
- * @param old
- * @return the layout
- */
- public static CSSLayout displayToLayout(CSSFigure figure, String display,
- LayoutManager old) {
- if ("block".equalsIgnoreCase(display)) //$NON-NLS-1$
- {
- return new CSSBlockFlowLayout(figure);
- } else if ("inline".equalsIgnoreCase(display)) //$NON-NLS-1$
- {
- return new CSSInlineFlowLayout(figure);
- } else if ("table".equalsIgnoreCase(display) || "inline-table".equalsIgnoreCase(display)) //$NON-NLS-1$ $NON-NLS-2$
- {
- return new CSSTableLayout2(figure);
- } else if ("table-row".equalsIgnoreCase(display)) //$NON-NLS-1$
- {
- return new CSSTRLayout(figure);
- } else if ("table-row-group".equalsIgnoreCase(display) //$NON-NLS-1$
- || "table-header-group".equalsIgnoreCase(display) //$NON-NLS-1$
- || "table-footer-group".equalsIgnoreCase(display)) //$NON-NLS-1$
- {
- return new CSSTRGroupLayout(figure);
- } else if ("table-cell".equalsIgnoreCase(display)) //$NON-NLS-1$
- {
- return new CSSTableCellLayout(figure);
- } else if (display.equalsIgnoreCase("table-caption")) //$NON-NLS-1$
- {
- return new CSSTableCaptionLayout(figure);
- } else if ("inline-block".equalsIgnoreCase(display)) //$NON-NLS-1$
- {
- return new CSSBlockFlowLayout(figure) {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.CSSBlockFlowLayout#isInlineBlock()
- */
- public boolean isInlineBlock() {
- return true;
- }
- };
- } else if (ICSSPropertyID.VAL_LIST_ITEM.equalsIgnoreCase(display)) {
- return new CSSListItemLayout(figure);
- }
- return null;
- }
-
- /**
- * @param display
- * @return true if is inline
- */
- public static boolean isInline(String display) {
- return "inline".equalsIgnoreCase(display) //$NON-NLS-1$
- || "inline-block".equalsIgnoreCase(display); //$NON-NLS-1$
- }
-
- /**
- * @param style
- * @return true if is positioned
- */
- public static boolean isPositioned(ICSSStyle style) {
- Object position = style.getStyleProperty(ICSSPropertyID.ATTR_POSITION);
- if (PositionMeta.STATIC.equalsIgnoreCase((String) position)) {
- return false;
- }
- return true;
- }
-
- private DisplayToLayout()
- {
- // util class, no instantiation
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/FigureUtil.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/FigureUtil.java
deleted file mode 100644
index 56d775c..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/FigureUtil.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Translatable;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public final class FigureUtil {
- /**
- * @param figure
- * @param t
- */
- // XXX:
- // seemed Figure.translateToRelative is bug?
- public static final void translateToRelative(IFigure figure, Translatable t) {
- if (figure.getParent() != null) {
- translateToRelative(figure.getParent(), t);
- // figure.getParent().translateToRelative(t);
- figure.translateFromParent(t);
- }
- }
-
- /**
- * @param figure
- * @param t
- */
- // XXX:
- // seemed Figure.translateToAbsolute is bug?
- public static final void translateToAbsolute(IFigure figure, Translatable t) {
- if (figure.getParent() != null) {
- figure.translateToParent(t);
- translateToAbsolute(figure.getParent(), t);
- // figure.getParent().translateToAbsolute(t);
- }
-
- }
-
- private FigureUtil()
- {
- // util class. No instantiation
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/FlowBox.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/FlowBox.java
deleted file mode 100644
index 52b3765..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/FlowBox.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout;
-
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.draw2d.geometry.Rectangle;
-
-/**
- * This class represents the CSS box model. See chapter 8 of CSS2 spec.
- *
- * see http://www.w3.org/TR/REC-CSS2/box.html
- *
- */
-public class FlowBox {
- private Object _verticalAlignData = null;
-
- /**
- * The x location
- */
- protected int _x;
-
- /**
- * The y location
- */
- protected int _y;
-
- int _width;
-
- int _height;
-
- private Insets _marginInsets = new Insets();
-
- private Insets _borderInsets = new Insets();
-
- private Insets _paddingInsets = new Insets();
-
- /**
- * This method must be called on a block that is completely positioned and
- * committed.
- *
- * @param x
- * X
- * @param y
- * Y
- * @return <code>true</code> if the FlowBox contains the point
- */
- public boolean containsPoint(int x, int y) {
- return x >= this._x && y >= this._y && x < this._x + this._width
- && y < this._y + this._height;
- }
-
- /**
- * By default, a FlowBox is all ascent, and no descent, so the height is
- * returned.
- *
- * @return the <i>ascent </i> in pixels above the baseline
- */
- public int getAscent() {
- return getHeight();
- }
-
-
- /**
- * By default, a simple FlowBox is all ascent, and no descent. Zero is
- * returned.
- *
- * @return the <i>descent </i> in pixels below the baseline
- */
- public final int getDescent() {
- return getHeight() - getAscent();
- }
-
- /**
- * Returns the height
- *
- * @return height
- */
- public int getHeight() {
- return _height;
- }
-
- /**
- * Returns the width
- *
- * @return width
- */
- public int getWidth() {
- return _width;
- }
-
- /**
- * @param w
- */
- public void setWidth(int w) {
- _width = w;
- }
-
- /**
- * @param h
- */
- public void setHeight(int h) {
- _height = h;
- }
-
- /**
- * Used to set the baseline of this FlowBox to the specified value.
- *
- * @param value
- * the new baseline
- */
- public void makeBaseline(int value) {
- _y = (value - getAscent());
- }
-
- /**
- * @return the border padding width
- */
- public int getBorderPaddingWidth() {
- return _borderInsets.getWidth() + _paddingInsets.getWidth();
- }
-
- /**
- * @return the border padding height
- */
- public int getBorderPaddingHeight() {
- return _borderInsets.getHeight() + _paddingInsets.getHeight();
- }
-
- /**
- * @return the border padding insets
- */
- public Insets getBorderPaddingInsets() {
- Insets temp = new Insets(_borderInsets);
- return temp.add(_paddingInsets);
- }
-
- /**
- * @param rect
- */
- public void setXYWidthHeight(Rectangle rect) {
- this._x = rect.x;
- this._y = rect.y;
- this.setWidth(rect.width);
- this.setHeight(rect.height);
- }
-
- /**
- * @return Returns the _verticalAlignData.
- */
- public Object getVerticalAlignData() {
- return _verticalAlignData;
- }
-
- /**
- * @param alignData
- * The _verticalAlignData to set.
- */
- public void setVerticalAlignData(Object alignData) {
- _verticalAlignData = alignData;
- }
-
- /**
- * @return a copy of the rectangle
- * TODO: use getCopy() ?
- */
- public Rectangle getRectangle() {
- return new Rectangle(this._x, this._y, this.getWidth(), this
- .getHeight());
- }
-
- /**
- * @return the x coordinate
- */
- public final int getX() {
- return _x;
- }
-
- /**
- * @return the y coordinate
- */
- public final int getY() {
- return _y;
- }
-
- /**
- * @param y
- */
- protected void setY(int y)
- {
- _y = y;
- }
-
- /**
- * @return the margin insets
- */
- public final Insets getMarginInsets() {
- return _marginInsets;
- }
-
- final void setMarginInsets(Insets marginInsets) {
- _marginInsets = marginInsets;
- }
-
- final Insets getBorderInsets() {
- return _borderInsets;
- }
-
- final void setBorderInsets(Insets borderInsets)
- {
- _borderInsets = borderInsets;
- }
-
- final Insets getPaddingInsets() {
- return _paddingInsets;
- }
-
- final void setPaddingInsets(Insets paddingInsets)
- {
- _paddingInsets = paddingInsets;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/FlowContainerLayout.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/FlowContainerLayout.java
deleted file mode 100644
index ca43353..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/FlowContainerLayout.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout;
-
-import java.util.List;
-
-import org.eclipse.draw2d.Figure;
-
-/**
- * A layout for FlowFigures with children.
- * <P>
- * WARNING: This class is not intended to be subclassed by clients.
- *
- * @author mengbo
- * @since 2.1
- */
-public abstract class FlowContainerLayout extends FlowFigureLayout implements
- FlowContext {
-// private static Logger _log = PDPlugin.getLogger(FlowContainerLayout.class);
-
- /**
- * the current line
- */
- protected LineBox _currentLine;
-
- private boolean _calculatingMaxWidth;
-
- /**
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowFigureLayout#FlowFigureLayout(FlowFigure)
- */
- protected FlowContainerLayout(FlowFigure flowFigure) {
- super(flowFigure);
- }
-
- /**
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowContext#addToCurrentLine(FlowBox)
- */
- public void addToCurrentLine(FlowBox block) {
- getCurrentLine().add(block);
- }
-
- /**
- * Used by getCurrentLine().
- */
- protected abstract void createNewLine();
-
- /**
- * Used by getCurrentLine(int topmargin)
- *
- * @param topMargin
- */
- protected void createNewLine(int topMargin) {
- createNewLine();
- }
-
- /**
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowContext#getCurrentLine()
- */
- public LineBox getCurrentLine() {
- if (_currentLine == null)
- createNewLine();
- return _currentLine;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowContext#getCurrentLine(int)
- */
- public LineBox getCurrentLine(int topMargin) {
- if (_currentLine == null) {
- createNewLine(topMargin);
- }
- // if the current line only contains an empty string, reset the current
- // line using the given margin.
- else if (_currentLine.isEmptyStringLine()) {
- List list = _currentLine.getFragments();
- createNewLine(topMargin);
- _currentLine._fragments.addAll(list);
- }
- return _currentLine;
- }
-
- /**
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowContext#isCurrentLineOccupied
- */
- public boolean isCurrentLineOccupied() {
- return _currentLine != null && _currentLine.isOccupied();
- }
-
- /**
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowFigureLayout#layout()
- */
- protected void layout() {
- preLayout();
- layoutChildren();
- flush();
- cleanup();
- }
-
- /**
- * Layout all children.
- */
- protected void layoutChildren() {
- List children = getFlowFigure().getChildren();
- for (int i = 0; i < children.size(); i++) {
- Figure f = (Figure) children.get(i);
- f.invalidate();
- f.validate();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowContext#getLastMarginRight()
- */
- public int getLastMarginRight() {
- if (_currentLine == null || !_currentLine.isOccupied()) {
- return 0;
- }
- FlowBox box = (FlowBox) _currentLine.getFragments().get(
- _currentLine.getFragments().size() - 1);
- if (box != null) {
- return box.getMarginInsets().right;
- }
- return 0;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowContext#isCalculatingMaxWidth()
- */
- public boolean isCalculatingMaxWidth() {
- if (_calculatingMaxWidth) {
- return true;
- } else if (this.getFlowContext() == null) {
- return false;
- } else {
- return this.getFlowContext().isCalculatingMaxWidth();
- }
- }
-
- /**
- * Called before layoutChildren() to setup any necessary state.
- */
- protected abstract void preLayout();
-
- /**
- * Called after {@link #layoutChildren()}when all children have been laid
- * out. This method exists to flush the last line.
- */
- protected abstract void flush();
-
- /**
- * Flush anything pending and free all temporary data used during layout.
- */
- protected abstract void cleanup();
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/FlowContext.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/FlowContext.java
deleted file mode 100644
index bdd4e51..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/FlowContext.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout;
-
-/**
- * Copied from draw2d. Enhanced to meet page designer's needs. The context that
- * a {@link FlowFigureLayout}uses to perform its layout.
- * <P>
- * WARNING: This interface is not intended to be implemented by clients. It
- * exists to define the API between the layout and its context.
- */
-public interface FlowContext {
-
- /**
- * Adds the given box into the current line.
- *
- * @param box
- * the FlowBox to add
- */
- void addToCurrentLine(FlowBox box);
-
- /**
- * The current line should be committed if it is occupied, and then set to
- * <code>null</code>. Otherwise, do nothing.
- */
- void endLine();
-
- /**
- * Obtains the current line, creating a new line if there is no current
- * line. if create a new line, the new line's x will be set correctly
- * without considering the new element's left margin. Also, if create new
- * line, it will treat as the new line's top margin is 0.
- *
- * @return the current line
- */
- LineBox getCurrentLine();
-
- /**
- * if create a new line, the new line's x will be set correctly without
- * considering the new element's left margin.
- *
- * @param topMargin
- * @return the current line
- */
- LineBox getCurrentLine(int topMargin);
-
- /**
- * Returns the current Y value.
- *
- * @return the current Y value
- */
- int getCurrentY();
-
- /**
- * @return <code>true</code> if the current line contains any fragments
- */
- boolean isCurrentLineOccupied();
-
- /**
- * @return the last margin right coord
- */
- int getLastMarginRight();
-
- /**
- * when layout table, we need to calculate max width of a cell. This is done
- * by don't break line (other than explicit required). Currently, the
- * solution is to make the recommended width to be very big, and when create
- * block element we don't set the block element's size to be recommended
- * width. Please see CSSBlockFlowLayout
- *
- * @return true if is calculating max width
- */
- boolean isCalculatingMaxWidth();
-
- /**
- * when calculating percentage width, we need the container width
- *
- * @return container width
- */
- int getContainerWidth();
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/FlowFigure.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/FlowFigure.java
deleted file mode 100644
index 6a910d8..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/FlowFigure.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout;
-
-import java.util.List;
-
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-
-/**
- * The base implementation for text flow figures. A flow figure is used to
- * render a document in which elements are laid out horizontally within a "line"
- * until that line is filled. Layout continues on the next line.
- * <p>
- * WARNING: This class is not intended to be subclassed by clients. Future
- * versions may contain additional abstract methods.
- *
- * @author mengbo
- * @since 2.1
- */
-public abstract class FlowFigure extends Figure {
-
- // static final boolean SHOW_BASELINE = true;
-
- /**
- * Constructs a new FlowFigure.
- */
- public FlowFigure() {
- // setLayoutManager(createDefaultFlowLayout());
- }
-
- /**
- * If the child is a <code>FlowFigure</code>, its FlowContext is passed
- * to it.
- *
- * @see org.eclipse.draw2d.IFigure#add(IFigure, Object, int)
- */
- public void add(IFigure child, Object constraint, int index) {
- super.add(child, constraint, index);
- if (child instanceof FlowFigure) {
- FlowFigure ff = (FlowFigure) child;
- if (getLayoutManager() instanceof FlowContext) {
- ff.setOriginalFlowContext((FlowContext) getLayoutManager());
- } else {
- PDPlugin.getLogger(this.getClass()).error("layout is not FlowContext", new Throwable("This exception is artificial so we can get a stack trace"));
- }
- }
- }
-
- /**
- * Creates the default layout manager
- *
- * @return The default layout
- */
- // protected abstract FlowFigureLayout createDefaultFlowLayout();
- /**
- * @see Figure#paintFigure(Graphics)
- */
- protected void paintFigure(Graphics g) {
- super.paintFigure(g);
- // g.drawRectangle(getBounds().getResized(-1,-1));
- }
-
- /**
- * Called after validate has occurred. This is used to update the bounds of
- * the FlowFigure to encompass its new flow boxed created during validate.
- */
- public abstract void postValidate();
-
- /**
- * FlowFigures override setBounds() to prevent translation of children.
- * "bounds" is a derived property for FlowFigures, calculated from the
- * fragments that make up the FlowFigure.
- *
- * @see Figure#setBounds(Rectangle)
- */
- public void setBounds(Rectangle r) {
- if (getBounds().equals(r))
- return;
- erase();
- bounds.x = r.x;
- bounds.y = r.y;
- bounds.width = r.width;
- bounds.height = r.height;
- fireFigureMoved();
- repaint();
- }
-
- /**
- * Sets the flow context.
- *
- * @param flowContext
- * the flow context for this flow figure
- */
- public void setOriginalFlowContext(FlowContext flowContext) {
- ((FlowFigureLayout) getLayoutManager())
- .setOriginalFlowContext(flowContext);
- }
-
- public String toString() {
- if (_displayString == null)
- {
- return super.toString();
- }
- return _displayString + " " + getClass().getName();
- }
-
- private String _displayString; // for debug
-
- /**
- * @return the flow context
- */
- public FlowContext getFlowContext() {
- return ((FlowFigureLayout) getLayoutManager()).getFlowContext();
- }
-
- // ----------------------------------------------------------------------
- // as absolute positioning and relative positioning may have children
- // out-side
- // of parent bounds, so we want to disable clipping when drawing figures
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.draw2d.Figure#paintChildren(org.eclipse.draw2d.Graphics)
- */
- protected void paintChildren(Graphics graphics) {
- IFigure child;
-
- Rectangle clip = Rectangle.SINGLETON;
- List children = this.getChildren();
- for (int i = 0; i < children.size(); i++) {
- child = (IFigure) children.get(i);
- if (child.isVisible() && child.intersects(graphics.getClip(clip))) {
- // graphics.clipRect(child.getBounds());
- child.paint(graphics);
- graphics.restoreState();
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.draw2d.Figure#paintClientArea(org.eclipse.draw2d.Graphics)
- */
- protected void paintClientArea(Graphics graphics) {
- if (this.getChildren().isEmpty())
- return;
-
- // boolean optimizeClip = getBorder() == null || getBorder().isOpaque();
-
- if (useLocalCoordinates()) {
- graphics.translate(getBounds().x + getInsets().left, getBounds().y
- + getInsets().top);
- // if (!optimizeClip)
- // graphics.clipRect(getClientArea(PRIVATE_RECT));
- graphics.pushState();
- paintChildren(graphics);
- graphics.popState();
- graphics.restoreState();
- } else {
- // if (optimizeClip)
- paintChildren(graphics);
- // else {
- // graphics.clipRect(getClientArea(PRIVATE_RECT));
- // graphics.pushState();
- // paintChildren(graphics);
- // graphics.popState();
- // graphics.restoreState();
- // }
- }
-
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/FlowFigureLayout.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/FlowFigureLayout.java
deleted file mode 100644
index 4a77597..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/FlowFigureLayout.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout;
-
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-
-/**
- * Layout for flow figures
- *
- */
-public abstract class FlowFigureLayout extends AbstractLayout {
-
- /**
- * <code>true</code> if the context has changed, and a layout is needed.
- */
- protected boolean _invalid = true;
-
- /**
- * The flow context in which this LayoutManager exists.
- */
- private FlowContext _context;
-
- /**
- * The figure passed by layout(Figure) is held for convenience.
- */
- private final FlowFigure _flowFigure;
-
- /**
- * Constructs a new FlowFigureLayout with the given FlowFigure.
- *
- * @param flowfigure
- * the FlowFigure
- */
- protected FlowFigureLayout(FlowFigure flowfigure) {
- this._flowFigure = flowfigure;
- }
-
- /**
- * TextFlowLayouts do not calculate a preferred size because it is too
- * expensive. {@link FlowPage}will actually layout itself in order to
- * calculate preferredSize.
- *
- * @see AbstractLayout#calculatePreferredSize(IFigure)
- */
- public Dimension calculatePreferredSize(IFigure f, int w, int h) {
- return null;
- }
-
- /**
- * @return the FlowFigure
- */
- protected FlowFigure getFlowFigure() {
- return _flowFigure;
- }
-
- /**
- * Marks this layout as invalid.
- *
- * @see org.eclipse.draw2d.LayoutManager#invalidate()
- */
- public void invalidate() {
- _invalid = true;
- super.invalidate();
- }
-
- /**
- * @see org.eclipse.draw2d.LayoutManager#layout(IFigure)
- */
- public final void layout(IFigure figure) {
- layout();
- _invalid = false;
- }
-
- /**
- * Called during {@link #layout(IFigure)}. The {@link #_invalid}flag is
- * reset after this method is called.
- */
- protected abstract void layout();
-
- /**
- * Sets the context for this layout manager.
- *
- * @param flowContext
- * the context of this layout
- */
- public void setOriginalFlowContext(FlowContext flowContext) {
- _context = flowContext;
- }
-
- /**
- * @return the original flow context
- */
- protected final FlowContext getOriginalFlowContext() {
- return _context;
- }
-
- /**
- * get flow context.
- *
- * @return the flow context
- */
- public FlowContext getFlowContext() {
- return _context;
- }
-
- public String toString() {
- // for debug purpose.
- return _flowFigure.toString();
- }
-
- /**
- * Called to dispose the layout
- */
- abstract public void dispose();
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/FlowPage.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/FlowPage.java
deleted file mode 100644
index cd81a03..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/FlowPage.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout;
-
-import java.util.Iterator;
-
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.draw2d.geometry.Rectangle;
-
-/**
- * The root of a Flow hierarchy. A flow page can be treated as a normal figure,
- * but contains FlowFigures.
- * <P>
- * A FlowPage will not have a defined width unless it is inside a figure whose
- * layout provides width hints when calling
- * {@link org.eclipse.draw2d.IFigure#getPreferredSize(int, int)}.
- * <P>
- * WARNING: This class is not intended to be subclassed by clients.
- */
-public class FlowPage extends BlockFlow {
-
- private Dimension _pageSize = new Dimension();
-
- private int _recommendedWidth;
-
- private int _pageSizeCacheKeys[] = new int[4];
-
- private Dimension _pageSizeCacheValues[] = new Dimension[4];
-
- /**
- * @see org.eclipse.jst.pagedesigner.css2.layout.BlockFlow#createDefaultFlowLayout()
- */
- protected FlowFigureLayout createDefaultFlowLayout() {
- return new PageFlowLayout(this);
- }
-
- /**
- * @see org.eclipse.draw2d.Figure#getMinimumSize()
- */
- public Dimension getMinimumSize(int w, int h) {
- return getPreferredSize(w, h);
- }
-
- /**
- * @see org.eclipse.draw2d.Figure#invalidate()
- */
- public void invalidate() {
- _pageSizeCacheValues = new Dimension[4];
- super.invalidate();
- }
-
- /**
- * @see org.eclipse.draw2d.Figure#getPreferredSize(int, int)
- */
- public Dimension getPreferredSize(int width, int h) {
- if (width >= 0)
- width = Math.max(0, width - getInsets().getWidth());
-
- for (int i = 0; i < 4; i++) {
- if (_pageSizeCacheKeys[i] == width
- && _pageSizeCacheValues[i] != null)
- return _pageSizeCacheValues[i];
- }
-
- _pageSizeCacheKeys[3] = _pageSizeCacheKeys[2];
- _pageSizeCacheKeys[2] = _pageSizeCacheKeys[1];
- _pageSizeCacheKeys[1] = _pageSizeCacheKeys[0];
- _pageSizeCacheKeys[0] = width;
-
- _pageSizeCacheValues[3] = _pageSizeCacheValues[2];
- _pageSizeCacheValues[2] = _pageSizeCacheValues[1];
- _pageSizeCacheValues[1] = _pageSizeCacheValues[0];
-
- // Flowpage must temporarily layout to determine its preferred size
- int oldWidth = getRecommendedWidth();
- setRecommendedWidth(width);
- validate();
- _pageSizeCacheValues[0] = _pageSize.getExpanded(getInsets().getWidth(),
- getInsets().getHeight());
-
- if (width != oldWidth) {
- setRecommendedWidth(oldWidth);
- getUpdateManager().addInvalidFigure(this);
- }
- return _pageSizeCacheValues[0];
- }
-
- int getRecommendedWidth() {
- return _recommendedWidth;
- }
-
- /**
- * @see BlockFlow#postValidate()
- */
- public void postValidate() {
- Rectangle r = getBlockBox().toRectangle();
- _pageSize.width = r.width;
- _pageSize.height = r.height;
- for (final Iterator it = getChildren().iterator(); it.hasNext();)
- {
- ((FlowFigure)it.next()).postValidate();
- }
- }
-
- /**
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowFigure#setBounds(Rectangle)
- */
- public void setBounds(Rectangle r) {
- if (getBounds().equals(r))
- return;
- boolean invalidate = getBounds().width != r.width
- || getBounds().height != r.height;
- super.setBounds(r);
- int newWidth = r.width - getInsets().getWidth();
- if (invalidate || getRecommendedWidth() != newWidth) {
- setRecommendedWidth(newWidth);
- getUpdateManager().addInvalidFigure(this);
- }
- }
-
- private void setRecommendedWidth(int width) {
- if (_recommendedWidth == width)
- return;
- _recommendedWidth = width;
- super.invalidate();
- }
-
- /**
- * @see org.eclipse.draw2d.Figure#validate()
- */
- public void validate() {
- if (isValid())
- return;
- super.validate();
- postValidate();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.draw2d.Figure#setValid(boolean)
- */
- public void setValid(boolean value) {
- super.setValid(value);
- }
-
- public Insets getInsets() {
- return new Insets(8);
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/FlowUtilities.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/FlowUtilities.java
deleted file mode 100644
index 6cd9e19..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/FlowUtilities.java
+++ /dev/null
@@ -1,271 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout;
-
-import java.text.BreakIterator;
-
-import org.eclipse.draw2d.FigureUtilities;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontMetrics;
-
-/**
- * Utility class for FlowFigures.
- *
- */
-public final class FlowUtilities extends FigureUtilities {
- /**
- * Returns the number of characters from the specified String that will fit
- * in the available amount of space. An average character width can be
- * provided as a hint for faster calculation.
- *
- * @param frag
- * the TextFragmentBox
- * @param string
- * the String
- * @param font
- * the Font used for measuring
- * @param availableWidth
- * the available width in pixels
- * @param avg
- * 0.0, or an avg character width to use during calculation
- * @param wrapping
- * the word wrap style
- * @return the number of characters that will fit in the space
- */
- public static int setupFragmentBasedOnTextSpace(TextFragmentBox frag,
- String string, Font font, int availableWidth, float avg,
- int wrapping) {
- int result = getTextForSpace(string, font, availableWidth, avg,
- wrapping);
- frag._length = result;
- setupFragment(frag, font, string);
- return result;
- }
-
- /**
- * given the text string, font and available width and wrapping mode.
- * Calculate how much text can fit into.
- *
- * @param string
- * @param font
- * @param availableWidth
- * @param avg
- * @param wrapping
- * @return how much text can fit into
- */
- public static int getTextForSpace(String string, Font font,
- int availableWidth, float avg, int wrapping) {
- if (string.length() == 0) {
- return 0;
- }
-
- FontMetrics metrics = getFontMetrics(font);
- BreakIterator breakItr = BreakIterator.getLineInstance();
- breakItr.setText(string);
- int MIN, min, max;
- if (avg == 0.0) {
- avg = metrics.getAverageCharWidth();
- }
-
- int firstBreak = breakItr.next();
-
- int winNL = string.indexOf("\r\n"); //$NON-NLS-1$
- int macNL = string.indexOf('\r');
- int unixNL = string.indexOf('\n');
-
- MIN = min = (wrapping == CSSTextLayout.WORD_WRAP_HARD) ? firstBreak : 1;
- if (macNL == winNL) {
- macNL = -1; // If the Mac newline is just the prefix to the win NL,
- // ignore it
- }
-
- max = string.length() + 1;
-
- if (winNL != -1) {
- max = Math.min(max, winNL);
- min = Math.min(min, winNL);
- }
- if (unixNL != -1) {
- max = Math.min(max, unixNL);
- min = Math.min(min, unixNL);
- }
- if (macNL != -1) {
- max = Math.min(max, macNL);
- min = Math.min(min, macNL);
- }
-
- int origMax = max;
- // The size of the current guess
- int guess = 0, guessSize = 0;
-
- while ((max - min) > 1) {
- // Pick a new guess size
- // New guess is the last guess plus the missing width in pixels
- // divided by the average character size in pixels
- guess = guess + (int) ((availableWidth - guessSize) / avg);
-
- if (guess >= max) {
- guess = max - 1;
- }
- if (guess <= min) {
- guess = min + 1;
- }
-
- // Measure the current guess
- guessSize = getStringExtents2(string.substring(0, guess), font).width;
-
- if (guessSize <= availableWidth) {
- // We did not use the available width
- min = guess;
- } else {
- // We exceeded the available width
- max = guess;
- }
- }
-
- int result = string.length();
- switch (wrapping) {
- case CSSTextLayout.WORD_WRAP_HARD:
- if (min == string.length() || min == winNL || min == unixNL
- || min == macNL) {
- result = min;
- } else if (max == origMax
- && getStringExtents2(string.substring(0, max), font).width <= availableWidth) {
- result = max;
- } else {
- result = Math.max(MIN, breakItr.preceding(Math.min(max, string
- .length() - 1)));
- }
- break;
-
- case CSSTextLayout.WORD_WRAP_SOFT:
- if (min == string.length() || min == winNL || min == unixNL
- || min == macNL) {
- result = min;
- } else if (max == origMax
- && getStringExtents2(string.substring(0, max), font).width <= availableWidth) {
- result = max;
- } else if (breakItr.isBoundary(min)) {
- result = min;
- } else if (breakItr.isBoundary(Math.min(max, string.length() - 1))) {
- result = max;
- } else {
- result = breakItr.preceding(Math.min(max, string.length() - 1));
- }
- if (result <= 0) {
- result = min;
- }
- break;
- // case CSSTextLayout.WORD_WRAP_TRUNCATE:
- // if (min == string.length() || min == winNL || min == unixNL || min ==
- // macNL)
- // {
- // result = frag._length = min;
- // setupFragment(frag, font, string);
- // if (frag.getWidth() <= availableWidth)
- // return result;
- // min -= 1;
- // }
- // else if (max == origMax && getStringExtents(string.substring(0, max),
- // font).width <= availableWidth)
- // {
- // result = frag._length = max;
- // setupFragment(frag, font, string);
- // return result;
- // }
- // result = breakItr.preceding(Math.min(max + 1, string.length() - 1));
- // if (result <= 0)
- // {
- // ELLIPSIS_SIZE =
- // FigureUtilities.getStringExtents(CSSTextFigure.ELLIPSIS, font);
- // getTextForSpace(frag, string, font, availableWidth -
- // ELLIPSIS_SIZE.width, avg, CSSTextLayout.WORD_WRAP_SOFT);
- // //frag.length = min;
- // frag._truncated = true;
- // result = breakItr.following(min);
- // if (result == BreakIterator.DONE)
- // result = string.length();
- // }
- // else
- // {
- // frag._length = result;
- // }
- }
-
- return result;
- }
-
- /**
- * @param string
- * @param font
- * @param availableWidth
- * @param avg
- * @return the text width
- */
- public static int getTextInWidth(String string, Font font,
- int availableWidth, float avg) {
- if (string.length() == 0) {
- return 0;
- }
- int guess = 0;
- while (true) {
- Dimension a = getTextExtents(string.substring(0, guess), font);
- if (a.width >= availableWidth) {
- return guess;
- }
- guess++;
- if (guess == string.length()) {
- return guess;
- }
- }
- }
-
- /**
- * change the parent implementation of getStringExtents(). Don't expend the
- * 1 width. So empty string will not have any width.
- *
- * @param s
- * @param f
- * @return the dimension
- */
- public static Dimension getStringExtents2(String s, Font f) {
- return new Dimension(getStringDimension(s, f));
- }
-
- static void setupFragment(TextFragmentBox frag, Font f, String s) {
- // if (frag.length != s.length())
- // we don't skip whitespace here. since already truncated in
- // CSSTextLayout
-
- // while (frag.length > 0 &&
- // Character.isElementContentWhitespace(s.charAt(frag.length - 1)))
- // frag.length--;
- frag.setTextData(s.substring(0, frag._length));
- Dimension d = getStringExtents2(s.substring(0, frag._length), f);
- FontMetrics fm = getFontMetrics(f);
- frag.setHeight(fm.getHeight());
- frag.setAscent(fm.getAscent() + fm.getLeading());
- if (frag._length > 0
- && Character.isWhitespace(s.charAt(frag._length - 1))) {
- frag._isLastCharWhitespace = true;
- } else {
- frag._isLastCharWhitespace = false;
- }
- frag.setWidth(d.width);
- }
-
- private FlowUtilities()
- {
- // no instantiation
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/ICSSFigure.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/ICSSFigure.java
deleted file mode 100644
index cecf650..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/ICSSFigure.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout;
-
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-
-/**
- * @author mengbo
- */
-public interface ICSSFigure extends IFigure {
- /**
- * get fragments of this figure. Each item of the list will be a FlowBox.
- * Note, this method is for read only, caller should not change the returned
- * list and items in the returned list.
- *
- * @return the list of fragments
- */
- public List getFragmentsForRead();
-
- /**
- * get the CSSStyle of this CSS figure.
- *
- * @return the css style
- */
- public ICSSStyle getCSSStyle();
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/ICSSLayout.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/ICSSLayout.java
deleted file mode 100644
index f17c54a..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/ICSSLayout.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout;
-
-import org.eclipse.draw2d.LayoutManager;
-
-/**
- * There are several kinds of layout involved. 1. the layout need let the child
- * figures do certain layouting of themselves first, then decide the final
- * result based on child information. 2. the layout could decide the size
- * information of this figure without child information.
- *
- * @author mengbo
- * @version 1.5
- */
-public interface ICSSLayout extends LayoutManager {
- /**
- * Each ICSSLayout is dedicated to a single CSSFigure.
- *
- * @return the figure
- */
- public ICSSFigure getICSSFigure();
-
- /**
- *
- * @return
- */
- // public List getFragmentsForRead();
- /**
- * postValidate the child figures of this CSSFigure. Normally layout fall
- * into the first category need implement this method.
- */
- // public void postValidate();
- /**
- * setBounds is called on the CSSFigure. Normally layout fall into the
- * second category need implement this method.
- *
- * @param rect
- * @param invalidate
- */
- // public void setBoundsCalled(Rectangle rect, boolean invalidate);
- /**
- * @return
- */
- // public boolean useLocalCoordinates();
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/ICSSPainter.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/ICSSPainter.java
deleted file mode 100644
index 5f83cb8..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/ICSSPainter.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout;
-
-import org.eclipse.draw2d.Graphics;
-
-/**
- * @author mengbo
- */
-public interface ICSSPainter {
- /**
- * this method is called in the figure's <code>paintFigure</code> method,
- * before <code>paintClientArea</code>. So it is called before children.
- * Thus, children may override its effects.
- *
- * @param g
- */
- public void paintFigure(Graphics g);
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/ICSSPainter2.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/ICSSPainter2.java
deleted file mode 100644
index f93fb84..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/ICSSPainter2.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout;
-
-import org.eclipse.draw2d.Graphics;
-
-/**
- * If the layout implements this interface, then it will have chance to paint
- * something to override children effect.
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.ICSSPainter
- * @see org.eclipse.jst.pagedesigner.css2.layout.CSSFigure
- *
- * @author mengbo
- * @version 1.5
- */
-public interface ICSSPainter2 {
- /**
- * this method is called after <code>paintClientArea</code>. So it is
- * called after children. Thus, it could override some children effects.
- *
- * @param g
- */
- public void paintFigurePostClientArea(Graphics g);
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/LineBox.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/LineBox.java
deleted file mode 100644
index fcfe8b4..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/LineBox.java
+++ /dev/null
@@ -1,424 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout;
-
-import org.eclipse.jst.pagedesigner.css2.property.VerticalAlignMeta;
-import org.eclipse.jst.pagedesigner.css2.value.Length;
-import org.eclipse.swt.graphics.FontMetrics;
-
-/**
- * A composite box representing a single line. LineBox calculates its ascent and
- * descent from the child boxes it contains. Clients can call
- * {@link #getAscent()} at any time and expect valid
- * values. The child boxes that are added to a line have unspecied locations
- * until {@link #commit()}is called, at which time the child boxes are layed
- * out in left-to-right order, and their baselines are all aligned vertically.
- *
- */
-public class LineBox extends CompositeBox {
- private final static int BASELINE = 0;
-
- private final static int MIDDLE = 1;
-
- private final static int SUB = 2;
-
- private final static int SUPER = 3;
-
- private final static int TEXT_TOP = 4;
-
- private final static int TEXT_BOTTOM = 5;
-
- private final static int TOP = 6;
-
- private final static int BOTTOM = 7;
-
- private final static int LENGTH = 8;
-
- private int _ascent = 0;
-
- private int _descent = 0;
-
- private int _fontAscent = 0;
-
- private int _fontDescent = 0;
-
- private int _fontLeading = 0;
-
- private Object _horizonalData = null;
-
- private Object _htmlInitData = null;
-
- private int _accumlatedWidth = 0;
-
- /**
- * Removes all owned fragments and invalidates this CompositeBox.
- */
- public void clear() {
- super.clear();
- _horizonalData = null;
- _htmlInitData = null;
- }
-
- /**
- * Committing a LineBox will position its children correctly. All children
- * boxes are made to have the same baseline, and are layed out from
- * left-to-right.
- */
- public void commit() {
- int baseline = getBaseline();
- int xLocation = _x;
- for (int i = 0; i < _fragments.size(); i++) {
- FlowBox block = (FlowBox) _fragments.get(i);
- block._x = xLocation + block.getMarginInsets().left;
- xLocation = block._x + block._width + block.getMarginInsets().right;
-
- if (_fragments.size() > 1 && block instanceof TextFragmentBox) {
- TextFragmentBox textBox = (TextFragmentBox) block;
- if (textBox.getTextData().length() == 0) {
- textBox._height = _fontAscent + _fontDescent + _fontLeading;
- textBox.setAscent(_fontAscent + _fontLeading);
- block._y = this._y;
- continue;
- }
- }
-
- switch (getVerticalAlignType(block)) {
- case TOP:
- block._y = this._y;
- break;
- case BOTTOM:
- block._y = this.getBaseline() - (block.getHeight() - _descent);
- break;
- case MIDDLE:
- int halfXHeight = getHalfXHeight();
- block._y = this.getBaseline() - halfXHeight
- - (block.getHeight() + 1) / 2;
- break;
- case TEXT_TOP:
- block._y = this.getBaseline() - _fontAscent - _fontLeading;
- break;
- case TEXT_BOTTOM:
- block._y = this.getBaseline() - (block._height - _fontDescent);
- break;
- case LENGTH:
- block._y = this.getBaseline() + getIncrement(block);
- break;
- case SUPER:
- block._y = this.getBaseline() - getHalfXHeight() * 2
- - block._height;
- break;
- case SUB:
- block._y = this.getBaseline() - block._height * _fontLeading
- / getFontHeight();
- break;
- case BASELINE:
- default:
- block.makeBaseline(baseline);
- break;
- }
- if (block instanceof LineBox) {
- ((LineBox) block).commit();
- }
- }
- }
-
- private int getVerticalAlignType(FlowBox box) {
- Object data = box.getVerticalAlignData();
-
- if (data != null) {
- if (data instanceof Length) {
- return LENGTH;
- } else if (VerticalAlignMeta.BASELINE.equals(data)) {
- return BASELINE;
- } else if (VerticalAlignMeta.MIDDLE.equals(data)) {
- return MIDDLE;
- } else if (VerticalAlignMeta.SUB.equals(data)) {
- return SUB;
- } else if (VerticalAlignMeta.SUPER.equals(data)) {
- return SUPER;
- } else if (VerticalAlignMeta.TEXT_TOP.equals(data)) {
- return TEXT_TOP;
- } else if (VerticalAlignMeta.TEXT_BOTTOM.equals(data)) {
- return TEXT_BOTTOM;
- } else if (VerticalAlignMeta.TOP.equals(data)) {
- return TOP;
- } else if (VerticalAlignMeta.BOTTOM.equals(data)) {
- return BOTTOM;
- }
- return BASELINE;
- }
- return BASELINE;
- }
-
- /**
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowBox#getAscent()
- */
- public int getAscent() {
- // because at initial, ascent is 0. And the linebox
- // could have some size setting without children. In
- // that case, we need handle differently.
- if (_ascent == 0 && _fragments.isEmpty()) {
- return getHeight();
- }
- return _ascent;
- }
-
- /**
- * Returns the width available to child fragments.
- *
- * @return the width in pixels
- */
- public int getAvailableWidth() {
- if (_recommendedWidth < 0) {
- return Integer.MAX_VALUE;
- }
- int availableWidth = _recommendedWidth - _accumlatedWidth;
- if (availableWidth < 0) {
- availableWidth = 0;
- }
- return availableWidth;
- }
-
- /**
- * Returns the baseline of this LineBox, which is the y value plus the
- * ascent.
- *
- * @return the baseline value.
- */
- public int getBaseline() {
- return _y + getAscent();
- }
-
- /**
- * @see CompositeBox#resetInfo()
- */
- protected void resetInfo() {
- super.resetInfo();
- _accumlatedWidth = 0;
- _ascent = 0;
- }
-
- /**
- * @see CompositeBox#unionInfo(FlowBox)
- */
- protected void unionInfo(FlowBox blockInfo) {
- if (blockInfo instanceof TextFragmentBox) {
- if (((TextFragmentBox) blockInfo).getTextData().length() == 0) {
- return;
- }
- }
-
- if (_fragments == null || _fragments.isEmpty()) {
- this._ascent = 0;
- this._descent = 0;
- this._height = 0;
- }
-
- int valign = getVerticalAlignType(blockInfo);
-
- if (valign == BASELINE) {
- _ascent = Math.max(_ascent, blockInfo.getAscent());
- if (blockInfo instanceof WidgetBox) {
- _descent = 0;
- } else {
- _descent = Math.max(_descent, blockInfo.getDescent());
- }
- _height = Math.max(_height, _ascent + _descent);
- } else if (valign == MIDDLE) {
- int halfXHeight = getHalfXHeight();
- _ascent = Math.max(_ascent, (blockInfo.getHeight() + 1) / 2
- + halfXHeight);
- _descent = Math.max(_descent, blockInfo.getHeight() / 2
- - halfXHeight);
- _height = Math.max(_height, _ascent + _descent);
- } else if (valign == TEXT_TOP) {
- _ascent = Math.max(_ascent, _fontAscent + _fontLeading);
- _descent = Math.max(_descent, blockInfo.getHeight() - _fontAscent
- - _fontLeading);
- _height = Math.max(_height, _ascent + _descent);
- } else if (valign == TEXT_BOTTOM) {
- _ascent = Math.max(_ascent, blockInfo.getHeight() - _fontDescent);
- _descent = Math.max(_descent, _fontDescent);
- _height = Math.max(_height, _ascent + _descent);
- } else if (valign == SUB) {
- int blockTop = blockInfo._height * _fontLeading / getFontHeight();
- _ascent = Math.max(_ascent, blockTop);
- _descent = Math.max(_descent, blockInfo.getHeight() - blockTop);
- _height = Math.max(_height, _ascent + _descent);
- } else if (valign == SUPER) {
- int blockTop = blockInfo._height;
- _ascent = Math.max(_ascent, getHalfXHeight() * 2 + blockTop);
- _height = Math.max(_height, _ascent + _descent);
- } else if (valign == LENGTH) {
- int increment = getIncrement(blockInfo);
- _ascent = Math.max(_ascent, blockInfo.getAscent() + increment);
- _descent = Math.max(_descent, blockInfo.getDescent() - increment);
- _height = Math.max(_height, _ascent + _descent);
- } else if (valign == TOP) {
- _descent = Math.max(_descent, blockInfo.getHeight() - _ascent);
- _height = Math.max(_height, _ascent + _descent);
- } else if (valign == BOTTOM) {
- // XXX:the render of IE is not consistent with spec, mozilla is. so
- // we follow mozilla's implementation.
- _ascent = Math.max(_ascent, blockInfo.getHeight() - _descent);
- _height = Math.max(_height, _ascent + _descent);
- } else {
- _ascent = Math.max(_ascent, blockInfo.getAscent());
- _descent = Math.max(_descent, blockInfo.getDescent());
- _height = Math.max(_height, blockInfo.getHeight());
- }
-
- _accumlatedWidth += blockInfo._width
- + blockInfo.getMarginInsets().getWidth();
- if (_accumlatedWidth > _width) {
- _width = _accumlatedWidth;
- }
- }
-
- private int getIncrement(FlowBox blockInfo) {
- int valign = getVerticalAlignType(blockInfo);
- if (valign == LENGTH) {
- int increment = 0;
- Length length = (Length) blockInfo.getVerticalAlignData();
- if (length.isPercentage()) {
- increment = length.getValue() * getFontHeight() / 100;
- } else {
- increment = length.getValue();
- }
- return increment;
- }
- return 0;
- }
-
- /**
- * @return true if is occupied
- * @see org.eclipse.draw2d.geometry.Rectangle#isEmpty()
- */
- public boolean isOccupied() {
- if (_width > 0) {
- return true;
- }
-
- if (_fragments.isEmpty()) {
- return false;
- }
- // int size = _fragments.size();
- // if (size > 1)
- // {
- // return true;
- // }
- // ok, we have one segment
- // FlowBox box = (FlowBox) _fragments.get(0);
- // if (box instanceof TextFragmentBox)
- // {
- // if (((TextFragmentBox) box).getTextData().length() == 0)
- // {
- // // this is an empty string text box.
- // return false;
- // }
- // }
- return true;
- }
-
- /**
- * @return true if is empty string line
- */
- public boolean isEmptyStringLine() {
- // if(this.getWidth() == 0)
- // {
- // return true;
- // }
- // else
- // {
- // return false;
- // }
- if (_fragments.size() == 1) {
- FlowBox box = (FlowBox) _fragments.get(0);
- if (box instanceof TextFragmentBox) {
- if (box instanceof TextFragmentBox) {
- if (((TextFragmentBox) box).getTextData().length() == 0) {
- return true;
- }
- }
- }
- }
- return false;
- }
-
- /**
- * @param fontMetrics
- */
- public void setFontMetrics(FontMetrics fontMetrics) {
- if (fontMetrics != null) {
- _fontAscent = fontMetrics.getAscent();
- _fontDescent = fontMetrics.getDescent();
- _fontLeading = fontMetrics.getLeading();
- // if (_fragments == null || _fragments.isEmpty())
- // {
- // this._ascent = _fontAscent + _fontLeading;
- // this._descent = _fontDescent;
- // if (this._height < this._ascent + this._descent)
- // {
- // this._height = this._ascent + this._descent;
- // }
- // }
- } else {
- _fontAscent = 0;
- _fontDescent = 0;
- _fontLeading = 0;
- }
- }
-
- private int getHalfXHeight() {
- return (_fontAscent + _fontDescent + _fontLeading) / 5;
- }
-
- private int getFontHeight() {
- return _fontAscent + _fontDescent + _fontLeading;
- }
-
- /**
- * @return Returns the horizonalData.
- */
- public Object getHorizonalData() {
- return _horizonalData;
- }
-
- /**
- * @param horizonalData
- * The horizonalData to set.
- */
- public void setHorizonalData(Object horizonalData) {
- this._horizonalData = horizonalData;
- }
-
- /**
- * @return Returns the htmlInitData.
- */
- public Object getHtmlInitData() {
- return _htmlInitData;
- }
-
- /**
- * @param htmlInitData
- * The htmlInitData to set.
- */
- public void setHtmlInitData(Object htmlInitData) {
- this._htmlInitData = htmlInitData;
- }
-
- @Override
- public void setY(int y) {
- // make set y public
- super.setY(y);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/MultiLineLabel.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/MultiLineLabel.java
deleted file mode 100644
index e49872c..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/MultiLineLabel.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout;
-
-import org.eclipse.draw2d.FigureUtilities;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontMetrics;
-
-/**
- * A multi-line label
- *
- */
-public class MultiLineLabel extends Label {
- private static String ELLIPSIS = "..."; //$NON-NLS-1$
-
- protected void paintFigure(Graphics graphics) {
- if (isOpaque()) {
- graphics.fillRectangle(getBounds());
- }
- Rectangle bounds1 = getBounds();
- graphics.translate(bounds1.x, bounds1.y);
- drawText(graphics);
- graphics.translate(-bounds1.x, -bounds1.y);
- }
-
- private void drawText(Graphics graphics) {
- String[] strings = splitString(getText());
- int y = 0;
- int lineHeight = FigureUtilities.getFontMetrics(getFont()).getHeight();
- for (int i = 0; i < strings.length; i++) {
- graphics.drawText(getSubStringText(strings[i]), 0, y);
- y += lineHeight;
- }
-
- }
-
- private String[] splitString(String text) {
- String[] lines = new String[1];
- int start = 0, pos;
- do {
- pos = text.indexOf('\n', start);
- if (pos == -1) {
- lines[lines.length - 1] = text.substring(start);
- } else {
- boolean crlf = (pos > 0) && (text.charAt(pos - 1) == '\r');
- lines[lines.length - 1] = text.substring(start, pos
- - (crlf ? 1 : 0));
- start = pos + 1;
- String[] newLines = new String[lines.length + 1];
- System.arraycopy(lines, 0, newLines, 0, lines.length);
- lines = newLines;
- }
- } while (pos != -1);
- return lines;
- }
-
- /**
- * @param text
- * @return the substring text
- */
- private String getSubStringText(String text) {
- String subStringText = text;
-
- Font currentFont = getFont();
- int textWidth = FigureUtilities.getTextWidth(text, currentFont);
- if (textWidth - getSize().width <= 0) {
- return subStringText;
- }
-
- Dimension effectiveSize = new Dimension(getSize().width, 0);
-
- int dotsWidth = FigureUtilities.getTextWidth(ELLIPSIS, currentFont);
-
- if (effectiveSize.width < dotsWidth) {
- effectiveSize.width = dotsWidth;
- }
-
- int subStringLength = getLargestSubstringConfinedTo(text, currentFont,
- effectiveSize.width - dotsWidth);
- subStringText = new String(text.substring(0, subStringLength)
- + ELLIPSIS);
- return subStringText;
- }
-
- int getLargestSubstringConfinedTo(String s, Font f, int availableWidth) {
- FontMetrics metrics = FigureUtilities.getFontMetrics(f);
- int min, max;
- float avg = metrics.getAverageCharWidth();
- min = 0;
- max = s.length() + 1;
-
- // The size of the current guess
- int guess = 0, guessSize = 0;
- while ((max - min) > 1) {
- // Pick a new guess size
- // New guess is the last guess plus the missing width in pixels
- // divided by the average character size in pixels
- guess = guess + (int) ((availableWidth - guessSize) / avg);
-
- if (guess >= max) {
- guess = max - 1;
- }
- if (guess <= min) {
- guess = min + 1;
- }
-
- // Measure the current guess
- guessSize = FigureUtilities
- .getTextExtents(s.substring(0, guess), f).width;
-
- if (guessSize < availableWidth) {
- // We did not use the available width
- min = guess;
- } else {
- // We exceeded the available width
- max = guess;
- }
- }
- return min;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/PageFlowLayout.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/PageFlowLayout.java
deleted file mode 100644
index 33ff6a1..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/PageFlowLayout.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout;
-
-import org.eclipse.draw2d.FigureUtilities;
-import org.eclipse.jst.pagedesigner.css2.font.CSSFont;
-import org.eclipse.jst.pagedesigner.css2.font.CSSFontManager;
-import org.eclipse.swt.graphics.Font;
-
-/**
- * A block layout which requires no FlowContext to perform its layout. This
- * class is used by {@link FlowPage}.
- * <p>
- * WARNING: This class is not intended to be subclassed by clients.
- */
-public class PageFlowLayout extends BlockFlowLayout {
-
- /**
- * Creates a new PageFlowLayout with the given FlowPage
- *
- * @param page
- * the FlowPage
- */
- public PageFlowLayout(FlowPage page) {
- super(page);
- }
-
- /**
- * @see BlockFlowLayout#endBlock()
- */
- protected void endBlock() {
- // do nothing
- }
-
- /**
- *
- */
- public void postValidate() {
- // TODO: This method is not being called.
- }
-
- protected void setupLine(LineBox line, int topMargin) {
- super.setupLine(line, topMargin);
-
- CSSFontManager fontManager = CSSFontManager.getInstance();
- Font font = fontManager.getSwtFont((CSSFont) fontManager
- .createDefaultFont());
- line.setFontMetrics(FigureUtilities.getFontMetrics(font));
- }
-
- /**
- * Setup blockBox to the initial bounds of the Page
- */
- protected void setupBlock() {
- // Remove all current Fragments
- _blockBox.clear();
-
- // Setup the one fragment for this Block with the correct X and
- // available width
- _blockBox.setRecommendedWidth(((FlowPage) getFlowFigure())
- .getRecommendedWidth());
- _blockBox._x = 0;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/TextFragmentBox.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/TextFragmentBox.java
deleted file mode 100644
index 58776e4..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/TextFragmentBox.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout;
-
-/**
- * A Geometric object for representing a TextFragment region on a line of Text.
- */
-public class TextFragmentBox extends FlowBox {
-
- /** The offset in pixels * */
- public int _offset;
-
- /** The length in pixels * */
- public int _length;
-
- private int _ascent;
-
- // boolean _truncated;
-
- /*package*/ boolean _isLastCharWhitespace = false;
-
- private String _textData;
-
- /**
- * Creates a new TextFragmentBox
- */
- public TextFragmentBox() {
- // do nothgin
- }
-
- /**
- * Returns the ascent of this TextFragmentBox
- *
- * @return the ascent
- */
- public int getAscent() {
- return _ascent;
- }
-
- /**
- * Sets the ascent of this TextFragmentBox to the given value
- *
- * @param a
- * the ascent
- */
- public void setAscent(int a) {
- _ascent = a;
- }
-
- /**
- * Sets the height of this TextFragmentBox to the given value
- *
- * @param h
- * the height
- */
- public void setHeight(int h) {
- _height = h;
- }
-
- /**
- * Sets the width of this TextFragmentBox to the given value
- *
- * @param w
- * the width
- */
- public void setWidth(int w) {
- _width = w;
- }
-
- /**
- * @return the text data
- */
- public String getTextData() {
- return _textData;
- }
-
- /**
- * @param txt
- */
- public void setTextData(String txt) {
- _textData = txt;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/TextLayoutSupport.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/TextLayoutSupport.java
deleted file mode 100644
index 65ca4c1..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/TextLayoutSupport.java
+++ /dev/null
@@ -1,427 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout;
-
-import java.util.List;
-
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.css2.property.TextDecorationMeta;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-
-/**
- * @author mengbo
- */
-public class TextLayoutSupport {
- private static final Logger _log = PDPlugin
- .getLogger(TextLayoutSupport.class);
-
- private static final String[] DELIMITERS = { "\r\n", //$NON-NLS-1$
- "\n", //$NON-NLS-1$
- "\r" //$NON-NLS-1$
- }; //$NON-NLS-1$
-
- static private int delimeterLength;
-
- /**
- * Reuses an existing <code>TextFragmentBox</code>, or creates a new one.
- *
- * @param i
- * the index
- * @param fragments
- * the original list of fragments
- * @return a TextFragmentBox
- */
- // copied from TextLayout
- protected static TextFragmentBox getFragment(int i, List fragments) {
- if (fragments.size() > i) {
- return (TextFragmentBox) fragments.get(i);
- }
- TextFragmentBox box = new TextFragmentBox();
- fragments.add(box);
- return box;
- }
-
- /**
- * Returns the average character width of given TextFragmentbox
- *
- * @param fragment
- * the TextFragmentBox
- * @return the average character width
- */
- public static float getAverageCharWidth(TextFragmentBox fragment) {
- if (fragment._width != 0 && fragment._length != 0) {
- return fragment._width / (float) fragment._length;
- }
- return 0.0f;
- }
-
- // ----------------------------------------------------------------------------------------
- /**
- * this method will create a set of TextFragment. Each fragment will offset
- * to the original text (whole text for the text figure).
- * @param context
- * @param text
- * @param fragments
- * @param font
- * @param wrappingStyle
- * @param trimLeading
- */
- public static void layoutNormal(FlowContext context, String text,
- List fragments, Font font, int wrappingStyle, boolean trimLeading) {
- int i = 0; // The index of the current fragment;
- int offset = 0;
- if (trimLeading) {
- offset = 1;
- text = text.substring(1);
- }
-
- int length = 0; // The length of the current fragment
- float prevAvgCharWidth;
- LineBox currentLine;
- TextFragmentBox fragment;
-
- while (text.length() > 0) {
- fragment = null;
- prevAvgCharWidth = 0f;
- fragment = getFragment(i, fragments);
- prevAvgCharWidth = getAverageCharWidth(fragment);
-
- // Check for newline, if it exists, call context.endLine and skip
- // over the newline
- // Exccept for first time through, don't do this.
- if (i != 0) {
- boolean changed = false;
- if (text.charAt(0) == '\r') {
- text = text.substring(1);
- changed = true;
- offset += 1;
- }
- if (text.length() != 0 && text.charAt(0) == '\n') {
- text = text.substring(1);
- changed = true;
- offset += 1;
- }
- if (changed) {
- context.endLine();
- }
- }
-
- fragment._offset = offset;
-
- // This loop is done at most twice.
- // The second time through, a context.endLine()
- // was requested, and the loop will break.
- while (true) {
- currentLine = context.getCurrentLine();
- length = FlowUtilities.setupFragmentBasedOnTextSpace(fragment,
- text, font, currentLine.getAvailableWidth(),
- prevAvgCharWidth, wrappingStyle);
-
- if (fragment._width <= currentLine.getAvailableWidth()
- || !context.isCurrentLineOccupied()) {
- break;
- }
- context.endLine();
- }
- // fragment.x = context.getCurrentX();
- context.addToCurrentLine(fragment);
- text = text.substring(length);
- offset += length;
- if (text.length() > 0) {
- context.endLine();
- }
- i++;
- }
-
- // Remove the remaining unused fragments.
- while (i < fragments.size()) {
- fragments.remove(fragments.size() - 1);
- }
- }
-
- /**
- * @param context
- * @param text
- * @param fragments
- * @param font
- */
- public static void layoutNoWrap(FlowContext context, String text,
- List fragments, Font font) {
- TextFragmentBox fragment;
- int i = 0;
- int offset = 0;
-
- while (offset < text.length()) {
- int result = nextLineBreak(text, offset);
- fragment = getFragment(i++, fragments);
- fragment._length = result - offset;
- fragment._offset = offset;
- FlowUtilities.setupFragment(fragment, font, text.substring(offset));
- context.getCurrentLine().add(fragment);
- offset = result + delimeterLength;
- if (delimeterLength != 0) {
- // in nextLineBreak we fo
- context.endLine();
- }
-
- }
- // Remove the remaining unused fragments.
- while (i < fragments.size()) {
- fragments.remove(i++);
- }
- }
-
- private static int nextLineBreak(String text, int offset) {
- int result = text.length();
- delimeterLength = 0;
- int current;
- for (int i = 0; i < DELIMITERS.length; i++) {
- current = text.indexOf(DELIMITERS[i], offset);
- if (current != -1 && current < result) {
- result = current;
- delimeterLength = DELIMITERS[i].length();
- }
- }
- return result;
- }
-
- /**
- * @param g
- * @param fragments
- * @param font
- * @param textDecoration
- */
- public static void paintTextFigure(Graphics g, List fragments, Font font,
- int textDecoration) {
- paintTextFigure(g, fragments, font, null, textDecoration);
- }
-
- /**
- * @param g
- * @param rect
- * @param textDecoration
- */
- public static void paintTextDecoration(Graphics g, Rectangle rect,
- int textDecoration) {
- if ((textDecoration & TextDecorationMeta.UNDERLINE) != 0) {
- g.drawLine(rect.x, rect.y + rect.height - 1, rect.x + rect.width
- - 1, rect.y + rect.height - 1);
- }
- if ((textDecoration & TextDecorationMeta.OVERLINE) != 0) {
- g.drawLine(rect.x, rect.y + 1, rect.x + rect.width - 1, rect.y + 1);
- }
- if ((textDecoration & TextDecorationMeta.LINETHROUGH) != 0) {
- g.drawLine(rect.x, rect.y + rect.height / 2, rect.x + rect.width
- - 1, rect.y + rect.height / 2);
- }
- }
-
- /**
- * @param g
- * @param fragments
- * @param font
- * @param color
- * @param textDecoration
- */
- public static void paintTextFigure(Graphics g, List fragments, Font font,
- Color color, int textDecoration) {
- // FIXME: It happens there is problem in this method's parameters. what
- // exception should be catched?
- try {
- TextFragmentBox frag;
- // XXX: adjust font. Here is not using setFont(), because that will
- // result in revalidate
- g.setFont(font);
-
- for (int i = 0; i < fragments.size(); i++) {
- frag = (TextFragmentBox) fragments.get(i);
- // if (!g.getClip(Rectangle.SINGLETON).intersects(frag))
- // continue;
- String draw;
- draw = frag.getTextData();
-
- if (color != null) {
- g.setForegroundColor(color);
- }
- g.drawText(draw, frag._x, frag._y);
- if ((textDecoration & TextDecorationMeta.UNDERLINE) != 0) {
- g.drawLine(frag._x, frag._y + frag.getHeight() - 1, frag._x
- + frag.getWidth(), frag._y + frag.getHeight() - 1);
- }
- if ((textDecoration & TextDecorationMeta.OVERLINE) != 0) {
- g.drawLine(frag._x, frag._y, frag._x + frag.getWidth(),
- frag._y);
- }
- if ((textDecoration & TextDecorationMeta.LINETHROUGH) != 0) {
- g.drawLine(frag._x, frag._y + frag.getHeight() / 2, frag._x
- + frag.getWidth(), frag._y + frag.getHeight() / 2);
- }
-
- if (Debug.DEBUG_BASELINE) {
- g.drawLine(frag._x, frag._y + frag.getAscent(), frag._x
- + frag.getWidth(), frag._y + frag.getAscent());
- }
- }
- } catch (Exception e) {
- // "Error in text painting:"
- _log.info("TextLayoutSupport.Info.1", e); //$NON-NLS-1$
- }
- }
-
- /**
- *
- * @param g
- * @param fragments
- * @param text
- * all the text in the Text figure.
- * @param font
- * @param color
- * @param textDecoration
- * @param start
- * @param end
- * @param selectionForeColor
- * @param selectionBackColor
- */
- public static void paintTextFigureWithSelection(Graphics g, List fragments,
- String text, Font font, Color color, int textDecoration, int start,
- int end, Color selectionForeColor, Color selectionBackColor) {
- // FIXME: It happens there is problem in this method's parameters. what
- // exception should be catched?
- try {
- TextFragmentBox frag;
-
- Color originalForeground = g.getForegroundColor();
- Color originalBackgroud = g.getBackgroundColor();
-
- // XXX: adjust font. Here is not using setFont(), because that will
- // result in revalidate
- g.setFont(font);
-
- for (int i = 0, n = fragments.size(); i < n; i++) {
- frag = (TextFragmentBox) fragments.get(i);
-
- // to make things simpler, we always draw the line using default
- // color
- if (color != null) {
- g.setForegroundColor(color);
- }
-
- // if (!g.getClip(Rectangle.SINGLETON).intersects(frag))
- // continue;
- String draw;
- draw = frag.getTextData();
- if (frag._offset >= end || frag._offset + frag._length <= start) {
- // we are not in selection. no need to change color
- g.drawText(draw, frag._x, frag._y);
- paintTextDecoration(g, frag.getRectangle(), textDecoration);
- } else if (frag._offset >= start
- && frag._offset + frag._length <= end) {
- // we are fully in selection
- g.setForegroundColor(selectionForeColor);
- g.setBackgroundColor(selectionBackColor);
- g
- .fillRectangle(frag._x, frag._y, FlowUtilities
- .getTextExtents(draw, font).width, frag
- .getHeight());
- g.drawText(draw, frag._x, frag._y);
- paintTextDecoration(g, frag.getRectangle(), textDecoration);
- } else {
- // partial of the fragment's text is in selection.
-
- // draw the original string first
- g.drawText(draw, frag._x, frag._y);
- // then override with the selected parts.
- g.setForegroundColor(selectionForeColor);
- g.setBackgroundColor(selectionBackColor);
- int partialStart = frag._offset > start ? frag._offset
- : start;
- int partialEnd = (frag._offset + frag._length > end) ? end
- : (frag._offset + frag._length);
- int x = 0;
- String skip = text.substring(frag._offset, partialStart);
- x = FlowUtilities.getTextExtents(skip, font).width;
- String todraw = text.substring(partialStart, partialEnd);
- if (todraw.length() > 0) {
- Dimension dimension = FlowUtilities.getTextExtents(skip
- + todraw, font);
- g.fillRectangle(frag._x + x, frag._y, dimension.width
- - x, dimension.height);
- g.drawText(skip + todraw, frag._x, frag._y);
- if (color != null) {
- g.setForegroundColor(color);
- } else {
- g.setForegroundColor(originalForeground);
- }
- g.drawText(skip, frag._x, frag._y);
- paintTextDecoration(g, frag.getRectangle(),
- textDecoration);
- g.setForegroundColor(selectionForeColor);
- paintTextDecoration(g,
- new Rectangle(frag._x + x, frag._y,
- dimension.width - x, dimension.height),
- textDecoration);
- }
- }
-
- // we do this in each loop, to make sure we are using correct
- // color
- g.setForegroundColor(originalForeground);
- g.setBackgroundColor(originalBackgroud);
-
- }
- } catch (Exception e) {
- // "Error in text painting:"
- _log.info("TextLayoutSupport.Info.1", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @param textAlign
- * @param rect
- * @param textWidth
- * @return the x value
- */
- public static int getBeginX(Object textAlign, Rectangle rect, int textWidth) {
- int x = rect.x;
- if (textAlign != null) {
- String align = textAlign.toString();
- if ("left".equalsIgnoreCase(align)) //$NON-NLS-1$
- {
- x = rect.x + 1;
- } else if ("right".equalsIgnoreCase(align)) //$NON-NLS-1$
- {
- x = rect.x + rect.width - textWidth - 1;
- if (x < 1) {
- x = 1;
- }
- } else if ("center".equalsIgnoreCase(align)) //$NON-NLS-1$
- {
- int offset = (rect.width - textWidth) / 2;
- if (offset <= 0) {
- offset = 0;
- }
- x = x + offset + 1;
- }
- }
- return x;
- }
-
- private TextLayoutSupport()
- {
- // no instantiation
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/WidgetBox.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/WidgetBox.java
deleted file mode 100644
index 220d61c..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/WidgetBox.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout;
-
-/**
- * Simple box support ascent.
- *
- * @author mengbo
- * @version 1.5
- */
-public class WidgetBox extends FlowBox {
- private int _ascent = -1;
-
- public int getAscent() {
- if (_ascent < 0) {
- return super.getAscent();
- }
- return _ascent;
- }
-
- /*package*/ void setAscent(int ascent) {
- _ascent = ascent;
- }
-
- /**
- * @return true if supports ascent
- */
- public boolean supportAscent() {
- return _ascent > 0;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/table/CSSTRGroupLayout.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/table/CSSTRGroupLayout.java
deleted file mode 100644
index 0a3cd40..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/table/CSSTRGroupLayout.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout.table;
-
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.LayoutManager;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.jst.pagedesigner.css2.layout.CSSBlockFlowLayout;
-import org.eclipse.jst.pagedesigner.css2.layout.CSSFigure;
-import org.eclipse.jst.pagedesigner.css2.layout.FlowFigure;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class CSSTRGroupLayout extends CSSBlockFlowLayout {
-
- /**
- * @param cssfigure
- */
- public CSSTRGroupLayout(CSSFigure cssfigure) {
- super(cssfigure);
- }
-
- /**
- * @return the parent figure of TRGroup should be table figure. If so, return the
- * corresponding table layout.
- */
- public CSSTableLayout2 getTableLayoutContext() {
- IFigure parent = getCSSFigure().getParent();
- if (parent != null) {
- LayoutManager parentLayout = parent.getLayoutManager();
- if (parentLayout instanceof CSSTableLayout2) {
- return (CSSTableLayout2) parentLayout;
- }
- }
-
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.CSSBlockFlowLayout#postValidate()
- */
- public void postValidate() {
- CSSTableLayout2 tableLayout = getTableLayoutContext();
- if (tableLayout == null) {
- super.postValidate();
- } else {
- Rectangle r = getTRGroupRect(tableLayout);
- if (r != null) {
- _blockBox.setXYWidthHeight(r);
- getCSSFigure().setBounds(r);
- List list = getCSSFigure().getChildren();
- for (int i = 0; i < list.size(); i++) {
- ((FlowFigure) list.get(i)).postValidate();
- }
- } else {
- super.postValidate();
- }
- }
- }
-
- /**
- * @return
- */
- private Rectangle getTRGroupRect(CSSTableLayout2 tableLayout) {
- TableRowGroupInfo groupinfo = tableLayout.getGroupInfo(this
- .getCSSFigure());
- int rowIndex = groupinfo.getRowIndex();
- int rowCount = groupinfo.getRowCount();
- int y = (rowIndex + 1) * tableLayout.getVSpacing();
- for (int k = 0; k < rowIndex; k++) {
- y += tableLayout.getRowHeights()[k];
- }
- if (tableLayout.getCaptionInfo() != null
- && "top".equalsIgnoreCase(tableLayout.getCaptionInfo().getAlign())) //$NON-NLS-1$
- {
- y += tableLayout.getCaptionSize().height;
- }
-
- int height = (rowCount - 1) * tableLayout.getVSpacing();
- for (int k = 0; k < rowCount; k++) {
- height += tableLayout.getRowHeights()[rowIndex + k];
- }
- //ICSSFigure figure = groupinfo.getFigure();
- return new Rectangle(tableLayout.getRowX(), y, tableLayout
- .getRowWidth(), height);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.CSSBlockFlowLayout#useLocalCoordinates()
- */
- public boolean useLocalCoordinates() {
- // if is in table, we don't use local coordinates.
- return getTableLayoutContext() == null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.CSSBlockFlowLayout#endBlock()
- */
- protected void endBlock() {
- if (getTableLayoutContext() == null) {
- super.endBlock();
- } else {
- layoutLines();
- }
- }
-
- // /* (non-Javadoc)
- // * @see
- // org.eclipse.jst.pagedesigner.css2.layout.FlowContainerLayout#layout()
- // */
- // protected void layout()
- // {
- // CSSTableLayout2 tableLayout = getTableLayoutContext();
- // if (tableLayout == null)
- // {
- // // we are not in table? treat as block.
- // super.layout();
- // }
- // else
- // {
- // // ok, we are in table. we need to layout our children.
- // TableRowGroupInfo groupInfo =
- // tableLayout.getGroupInfo(this.getCSSFigure());
- // int[] rowHeights = tableLayout.getRowHeights();
- // int vspacing = tableLayout.getVSpacing();
- // int rowwidth = getCSSFigure().getBounds().width;// XXX: get from table
- // layout?
- // int grouprowindex = groupInfo.getRowIndex();
- // List rows = groupInfo.getRowList();
- // for (int i=0, size=rows.size(); i<size; i++)
- // {
- // TableRowInfo rowinfo = (TableRowInfo) rows.get(i);
- // ICSSFigure figure = rowinfo.getFigure();
- //
- // int y = 0;
- // int rowindex = rowinfo.getRowIndex();
- // for (int row=grouprowindex; row<rowindex; row++)
- // {
- // y += rowHeights[row];
- // y += vspacing;
- // }
- // int height = rowHeights[rowindex];
- // Rectangle rect = new Rectangle(0, y, rowwidth, height);
- // figure.setBounds(rect);
- // }
- // }
- // }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.CSSLayout#handlingBorderForBlock()
- */
- public boolean handlingBorderForBlock() {
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/table/CSSTRLayout.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/table/CSSTRLayout.java
deleted file mode 100644
index 12590c1..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/table/CSSTRLayout.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout.table;
-
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.LayoutManager;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.jst.pagedesigner.css2.layout.CSSBlockFlowLayout;
-import org.eclipse.jst.pagedesigner.css2.layout.CSSFigure;
-import org.eclipse.jst.pagedesigner.css2.layout.FlowFigure;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class CSSTRLayout extends CSSBlockFlowLayout {
- /**
- * @param cssfigure
- */
- public CSSTRLayout(CSSFigure cssfigure) {
- super(cssfigure);
- }
-
- /**
- * @return the parent figure of TRGroup should be table figure. If so, return the
- * corresponding table layout.
- */
- public CSSTableLayout2 getTableLayoutContext() {
- IFigure parent = getCSSFigure().getParent();
- if (parent != null) {
- LayoutManager parentLayout = parent.getLayoutManager();
- if (parentLayout instanceof CSSTableLayout2) {
- return (CSSTableLayout2) parentLayout;
- } else if (parentLayout instanceof CSSTRGroupLayout) {
- return ((CSSTRGroupLayout) parentLayout)
- .getTableLayoutContext();
- }
- }
-
- return null;
- }
-
- /**
- * @return the group layout or null
- */
- public CSSTRGroupLayout getTRGroupLayout() {
- IFigure parent = getCSSFigure().getParent();
- if (parent != null) {
- LayoutManager parentLayout = parent.getLayoutManager();
- if (parentLayout instanceof CSSTRGroupLayout) {
- return ((CSSTRGroupLayout) parentLayout);
- }
- }
-
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.CSSBlockFlowLayout#postValidate()
- */
- public void postValidate() {
- CSSTableLayout2 tableLayout = getTableLayoutContext();
- if (tableLayout == null) {
- // we are not in table? treat as block.
- super.postValidate();
- } else {
- Rectangle r = getTRRect(tableLayout, getTRGroupLayout());
- if (r != null) {
- _blockBox.setXYWidthHeight(r);
- getCSSFigure().setBounds(r);
- List list = getCSSFigure().getChildren();
- for (int i = 0; i < list.size(); i++) {
- ((FlowFigure) list.get(i)).postValidate();
- }
- } else {
- super.postValidate();
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.CSSBlockFlowLayout#endBlock()
- */
- protected void endBlock() {
- if (this.getTableLayoutContext() == null) {
- super.endBlock();
- } else {
- layoutLines();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.CSSBlockFlowLayout#useLocalCoordinates()
- */
- public boolean useLocalCoordinates() {
- return this.getTableLayoutContext() == null;
- }
-
- private Rectangle getTRRect(CSSTableLayout2 tableLayout,
- CSSTRGroupLayout groupLayout) {
- TableRowInfo rowinfo = tableLayout.getRowInfo(this.getCSSFigure());
- int rowIndex = rowinfo.getRowIndex();
- int y = (rowIndex + 1) * tableLayout.getVSpacing();
- for (int k = 0; k < rowIndex; k++) {
- y += tableLayout.getRowHeights()[k];
- }
- if (tableLayout.getCaptionInfo() != null
- && "top".equalsIgnoreCase(tableLayout.getCaptionInfo().getAlign())) //$NON-NLS-1$
- {
- y += tableLayout.getCaptionSize().height;
- }
-
- int height = tableLayout.getRowHeights()[rowIndex];
- //ICSSFigure figure = rowinfo.getFigure();
- return new Rectangle(tableLayout.getRowX(), y, tableLayout
- .getRowWidth(), height);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.CSSLayout#handlingBorderForBlock()
- */
- public boolean handlingBorderForBlock() {
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/table/CSSTableCaptionLayout.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/table/CSSTableCaptionLayout.java
deleted file mode 100644
index 3d42a50..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/table/CSSTableCaptionLayout.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout.table;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.LayoutManager;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.jst.pagedesigner.css2.layout.CSSFigure;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class CSSTableCaptionLayout extends CachedTableCellLayout {
- private CSSTableLayout2 _tableLayout;
-
- private TableCaptionInfo _caption;
-
- /**
- * @param cssfigure
- */
- public CSSTableCaptionLayout(CSSFigure cssfigure) {
- super(cssfigure);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowFigureLayout#invalidate()
- */
- public void invalidate() {
- super.invalidate();
-
- _tableLayout = null;
- _caption = null;
- }
-
- public Rectangle getCellRect() {
- int x = 0;
-
- int[] rowHeights = _tableLayout.getRowHeights();
- int vspacing = _tableLayout.getVSpacing();
- int y = vspacing;
- if (_caption != null && "bottom".equalsIgnoreCase(_caption.getAlign())) //$NON-NLS-1$
- {
- for (int row = 0; row < rowHeights.length; row++) {
- y += rowHeights[row];
- y += vspacing;
- }
- }
-
- int height = 0;
- height = _tableLayout.getCaptionSize().height;
- int width = _tableLayout.getCaptionSize().width;
- Rectangle rect = new Rectangle(x, y, width, height);
- return rect;
- }
-
- /**
- * the parent figure of TRGroup should be table figure. If so, return the
- * corresponding table layout.
- *
- * @return the css table layout context or null if none.
- */
- public CSSTableLayout2 getTableLayoutContext() {
- IFigure parent = getCSSFigure().getParent();
- if (parent != null) {
- LayoutManager parentLayout = parent.getLayoutManager();
- if (parentLayout instanceof CSSTableLayout2) {
- return (CSSTableLayout2) parentLayout;
- }
- }
- return null;
- }
-
- /**
- * @return true if the table has a caption
- */
- public boolean initializeTableInfo() {
- _caption = null;
- _tableLayout = getTableLayoutContext();
- if (_tableLayout != null) {
- _caption = _tableLayout.getCaptionInfo();
- return _caption != null;
- }
- return false;
- }
-
- /**
- * @return the table layout
- */
- public CSSTableLayout2 getTableLayout() {
- return _tableLayout;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.CSSLayout#isCalculatingMaxWidth()
- */
- public boolean isCalculatingMaxWidth() {
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/table/CSSTableCellLayout.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/table/CSSTableCellLayout.java
deleted file mode 100644
index 1eb62e8..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/table/CSSTableCellLayout.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout.table;
-
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.LayoutManager;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.layout.CSSFigure;
-import org.eclipse.jst.pagedesigner.css2.layout.FlowBox;
-import org.eclipse.jst.pagedesigner.css2.layout.LineBox;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.jst.pagedesigner.css2.property.VerticalAlignMeta;
-
-/**
- * This layout is for those thigns that it's parent will decide its size. Such
- * as table cell.
- *
- * @author mengbo
- * @version 1.5
- */
-public class CSSTableCellLayout extends CachedTableCellLayout {
- private CSSTableLayout2 _tableLayout;
-
- private TableRowInfo _rowinfo;
-
- private TableCellInfo _cellinfo;
-
- /**
- * @param cssfigure
- */
- public CSSTableCellLayout(CSSFigure cssfigure) {
- super(cssfigure);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.FlowFigureLayout#invalidate()
- */
- public void invalidate() {
- super.invalidate();
-
- _tableLayout = null;
- _rowinfo = null;
- _cellinfo = null;
- }
-
- protected void endBlock() {
- if (isTable()) {
- verticalLayoutLines();
- layoutLines();
- } else {
- super.endBlock();
- }
- }
-
- /**
- * process the vertical layout lines
- */
- protected void verticalLayoutLines() {
- List lines = _blockBox.getFragments();
-
- String verticalStyle = getVerticalAlign();
- int linesHeight = 0;
-
- if (lines != null && !lines.isEmpty()) {
- FlowBox bottomBox = ((FlowBox) lines.get(lines.size() - 1));
- FlowBox topBox = ((FlowBox) lines.get(0));
- linesHeight = bottomBox.getY() + bottomBox.getHeight() - topBox.getY();
- }
- int movement = 0;
- if (VerticalAlignMeta.BOTTOM.equals(verticalStyle)) {
- movement = _blockBox.getHeight() - linesHeight
- - _blockBox.getBorderPaddingHeight() / 2;
- } else if (VerticalAlignMeta.TOP.equals(verticalStyle)) {
- movement = 0;
- }
- // else if (VerticalAlignMeta.BASELINE.equals(verticalStyle))
- // {
- // movement = _blockBox.getHeight() - linesHeight;
- // }
- else // if (VerticalAlignMeta.MIDDLE.equals(verticalStyle))
- {
- movement = (_blockBox.getHeight() - linesHeight - _blockBox
- .getBorderPaddingHeight()) / 2;
- }
- // VerticalAlignMeta.TOP, ICSSPropertyID.VAL_AUTO and others
- // else
- // {
- // movement = 0;
- // }
- if (lines != null) {
- for (int i = 0, n = lines.size(); i < n; i++) {
- if (lines.get(i) instanceof LineBox) {
- LineBox lineBox = (LineBox) lines.get(i);
- int LineMovement = Math.max(lineBox.getMarginInsets()
- .getHeight(), movement);
- lineBox.setY(lineBox.getY() + LineMovement
- - lineBox.getMarginInsets().getHeight());
- }
- }
- }
- }
-
- private String getVerticalAlign() {
- ICSSStyle style = getCSSStyle();
- if (style != null) {
- return style.getStyleProperty(ICSSPropertyID.ATTR_VERTICAL_ALIGN)
- .toString();
- }
- return VerticalAlignMeta.MIDDLE;
- }
-
- public Rectangle getCellRect() {
- int columnIndex = _cellinfo.getColumnIndex();
- int rowIndex = _cellinfo.getRowIndex();
- int[] columnWidths = _tableLayout.getColumnWidths();
- int hspacing = _tableLayout.getHSpacing();
- int x = hspacing;
- for (int col = 0; col < columnIndex; col++) {
- x += columnWidths[col];
- x += hspacing;
- }
-
- int[] rowHeights = _tableLayout.getRowHeights();
- int vspacing = _tableLayout.getVSpacing();
- int y = vspacing;
- for (int row = 0; row < rowIndex; row++) {
- y += rowHeights[row];
- y += vspacing;
- }
- if (_tableLayout.getCaptionInfo() != null
- && "top".equalsIgnoreCase(_tableLayout.getCaptionInfo().getAlign())) //$NON-NLS-1$
- {
- y += _tableLayout.getCaptionSize().height;
- }
-
- int width = _tableLayout.getCellWidth(_cellinfo, columnWidths);
- int height = _tableLayout.getCellHeight(_cellinfo, rowHeights);
-
- Rectangle rect = new Rectangle(x, y, width, height);
- return rect;
- }
-
- /**
- * the parent figure of TRGroup should be table figure. If so, return the
- * corresponding table layout.
- *
- * @return the table layout context
- */
- public CSSTableLayout2 getTableLayoutContext() {
- IFigure parent = getCSSFigure().getParent();
- if (parent != null) {
- LayoutManager parentLayout = parent.getLayoutManager();
- if (parentLayout instanceof CSSTRLayout) {
- return ((CSSTRLayout) parentLayout).getTableLayoutContext();
- }
- }
-
- return null;
- }
-
- /**
- * @return true if the table layout has cell info
- */
- public boolean initializeTableInfo() {
- _rowinfo = null;
- _cellinfo = null;
- _tableLayout = getTableLayoutContext();
- if (_tableLayout != null) {
- _rowinfo = _tableLayout.getRowInfo((CSSFigure) this.getCSSFigure()
- .getParent());
- if (_rowinfo != null) {
- _cellinfo = _rowinfo.getCellInfo(this.getCSSFigure());
- if (_cellinfo != null) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * @return the table layout or nul if none
- */
- public CSSTableLayout2 getTableLayout() {
- return _tableLayout;
- }
-
- /**
- * @return the table cell info or null
- */
- public TableCellInfo getTableCellInfo() {
- return _cellinfo;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/table/CSSTableLayout2.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/table/CSSTableLayout2.java
deleted file mode 100644
index 3a9fa0d..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/table/CSSTableLayout2.java
+++ /dev/null
@@ -1,633 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout.table;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.layout.CSSBlockFlowLayout;
-import org.eclipse.jst.pagedesigner.css2.layout.CSSFigure;
-import org.eclipse.jst.pagedesigner.css2.layout.ICSSPainter;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.jst.pagedesigner.css2.style.ITagEditInfo;
-import org.eclipse.swt.SWT;
-
-/**
- * see also http://www.w3.org/TR/REC-CSS2/tables.html
- *
- * @author mengbo
- * @version 1.5
- */
-public class CSSTableLayout2 extends CSSBlockFlowLayout implements ICSSPainter {
- static Logger _log = PDPlugin.getLogger(CSSTableLayout2.class);
-
- int _hspacing;
-
- int _vspacing;
-
- int[] _columnWidths;
-
- int[] _rowHeights;
-
- Dimension _captionSize;
-
- // _tableInfo will be initialized in preLayout
- TableInfo _tableInfo;
-
- private int _internalTableWidth;
-
- private int _internalTableHeight;
-
- private int _rowx;
-
- private int _rowwidth;
-
- /**
- * @param flowfigure
- */
- public CSSTableLayout2(CSSFigure flowfigure) {
- super(flowfigure);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.CSSBlockFlowLayout#preLayout()
- */
- protected void preLayout() {
- // super.preLayout will setup the block box.
- super.preLayout();
-
- ICSSStyle style = this.getCSSStyle();
-
- _hspacing = _vspacing = 3; // default value
-
- if (style != null) {
- Object borderspacing = style
- .getStyleProperty(ICSSPropertyID.ATTR_BORDER_SPACING);
- if (borderspacing instanceof int[]) {
- int[] intvalues = (int[]) borderspacing;
- _hspacing = intvalues[0];
- _vspacing = intvalues[1];
- } else {
- ITagEditInfo info = (ITagEditInfo) style
- .getAdapter(ITagEditInfo.class);
- if (info != null && info.needTableDecorator()) {
- // default decorating value. to make things look more
- // separated.
- if (_hspacing < 5) {
- _hspacing = 5;
- }
- if (_vspacing < 5) {
- _vspacing = 5;
- }
- }
- }
- }
-
- // TODO: support caption
- _tableInfo = new TableInfo(getCSSFigure());
-
- // construct the table structure.
- _tableInfo.constructTable();
-
- // calculate the user specified width/height for table and cells.
- // contentWidth is the user specified content width. If <= 0 means no
- // user
- // specification.
- int contentWidth = this._blockBox.getContentWidth();
- int availableWidth = this._blockBox.getRecommendedContentWidth();
- int contentHeight = this._blockBox.getContentHeight();
-
- _tableInfo.calculateWidth(contentWidth, availableWidth);
- _tableInfo.calculateHeight(contentHeight);
-
- int columnCount = _tableInfo.getColumnCount();
-
- int columnMinWidths[] = new int[columnCount];
- int columnMaxWidths[] = new int[columnCount];
-
- // For each column, determine a maximum and minimum column width from
- // the cells that span only that column. The minimum is that required by
- // the cell with the largest minimum cell width (or the column 'width',
- // whichever is larger). The maximum is that required by the cell with
- // the
- // largest maximum cell width (or the column 'width', whichever is
- // larger).
- List cells = _tableInfo.getCells();
- for (int i = 0, size = cells.size(); i < size; i++) {
- TableCellInfo cellinfo = (TableCellInfo) cells.get(i);
- if (cellinfo.getColSpan() == 1) {
- int column = cellinfo.getColumnIndex();
- Dimension mincw = cellinfo.getMinCWDimension();
- Dimension maxcw = cellinfo.getMaxCWDimension();
- if (maxcw.width < mincw.width) {
- maxcw.width = mincw.width;
- }
- if (mincw.width > columnMinWidths[column]) {
- columnMinWidths[column] = mincw.width;
- }
- if (maxcw.width > columnMaxWidths[column]) {
- columnMaxWidths[column] = maxcw.width;
- }
- }
- }
- // For caption, determine a maximum and minimum width from it.
- int captionWidth = 0;
- if (_tableInfo.getCaption() != null) {
- captionWidth = _tableInfo.getCaption().getDimension().width;
- }
-
- // For each cell that spans more than one column, increase the
- // minimum widths of the columns it spans so that together, they
- // are at least as wide as the cell. Do the same for the maximum
- // widths. If possible, widen all spanned columns by approximately
- // the same amount.
- for (int i = 0, size = cells.size(); i < size; i++) {
- TableCellInfo cellinfo = (TableCellInfo) cells.get(i);
- int colspan = cellinfo.getColSpan();
- if (colspan > 1) {
- int column = cellinfo.getColumnIndex();
- Dimension mincw = cellinfo.getMinCWDimension();
- Dimension maxcw = cellinfo.getMaxCWDimension();
-
- adjustWidth(column, colspan, mincw.width, columnMinWidths);
- adjustWidth(column, colspan, maxcw.width, columnMaxWidths);
- }
- }
-
- int sigmaMinWidth = 0;
- int sigmaMaxWidth = 0;
- for (int i = 0; i < columnMinWidths.length; i++) {
- sigmaMinWidth += columnMinWidths[i];
- if (columnMaxWidths[i] == Integer.MAX_VALUE) {
- sigmaMaxWidth = Integer.MAX_VALUE;
- } else if (sigmaMaxWidth != Integer.MAX_VALUE) {
- sigmaMaxWidth += columnMaxWidths[i];
- if (sigmaMaxWidth < 0) {
- sigmaMaxWidth = Integer.MAX_VALUE;
- }
- }
- }
- int spacingall = (columnMinWidths.length + 1) * _hspacing;
- sigmaMinWidth += spacingall;
- if (sigmaMaxWidth != Integer.MAX_VALUE) {
- sigmaMaxWidth += spacingall;
- if (sigmaMaxWidth < 0) {
- sigmaMaxWidth = Integer.MAX_VALUE;
- }
- }
-
- int tableWidth = _tableInfo.getTableWidth();
- if (tableWidth > 0) {
- // If the 'table' or 'inline-table' element's 'width' property has a
- // specified value (W) other than 'auto', the property's computed
- // value
- // is the greater of W and the minimum width required by all the
- // columns
- // plus cell spacing or borders (MIN). If W is greater than MIN, the
- // extra
- // width should be distributed over the columns.
- int maxMin = Math.max(captionWidth, sigmaMinWidth);
- if (maxMin >= tableWidth) {
- tableWidth = maxMin;
- }
- distribute(tableWidth - sigmaMinWidth, columnMinWidths,
- columnMaxWidths);
- } else {
- // If the 'table' or 'inline-table' element has 'width: auto', the
- // computed
- // table width is the greater of the table's containing block width
- // and MIN.
- // However, if the maximum width required by the columns plus cell
- // spacing or
- // borders (MAX) is less than that of the containing block, use MAX.
- // int availableWidth = this.getCurrentLine().getAvailableWidth();
- int maxMin = Math.max(captionWidth, sigmaMaxWidth);
- if (maxMin <= availableWidth) {
- // TODO: if _tableInfo.hasWidthPercentage, then we need take
- // that into consideration
- // to distribute the column width. Left to next version.
- tableWidth = maxMin;
- // columnMinWidths = columnMaxWidths;
- } else {
- tableWidth = availableWidth;
- }
- distribute(tableWidth - sigmaMinWidth, columnMinWidths,
- columnMaxWidths);
- }
-
- // now columnMinWidths contains width for each column
- _columnWidths = columnMinWidths;
-
- // ok, we have finished calculating column width.
- // next we need to find out row heights.
- _rowHeights = new int[_tableInfo.getRowCount()];
-
- // first find out those TR that has height settings and use them.
- List rows = _tableInfo.getRows();
- for (int i = 0, size = rows.size(); i < size && i < _rowHeights.length; i++) {
- TableRowInfo rowInfo = (TableRowInfo) rows.get(i);
- if (rowInfo.getSpecifiedRowHeight() > 0) {
- _rowHeights[i] = rowInfo.getSpecifiedRowHeight();
- }
- }
-
- // First the cells don't span multiple rows.
- cells = _tableInfo.getCells();
- for (int i = 0, size = cells.size(); i < size; i++) {
- TableCellInfo cellinfo = (TableCellInfo) cells.get(i);
- IFigure figure = cellinfo.getFigure();
- int rowspan = cellinfo.getRowSpan();
- if (rowspan == 1) {
- int cellWidth = getCellWidth(cellinfo, _columnWidths);
- Dimension d = figure.getPreferredSize(cellWidth, cellinfo
- .getHeight());
- if (d.height > _rowHeights[cellinfo.getRowIndex()]) {
- _rowHeights[cellinfo.getRowIndex()] = d.height;
- }
- }
- }
-
- // Next those cells span multiple rows.
- cells = _tableInfo.getCells();
- for (int i = 0, size = cells.size(); i < size; i++) {
- TableCellInfo cellinfo = (TableCellInfo) cells.get(i);
- IFigure figure = cellinfo.getFigure();
- int rowspan = cellinfo.getRowSpan();
- if (rowspan > 1) {
- int cellWidth = getCellWidth(cellinfo, _columnWidths);
- Dimension d = figure.getPreferredSize(cellWidth, cellinfo
- .getHeight());
- if (d.height > getCellHeight(cellinfo, _rowHeights)) {
- adjustHeight(cellinfo.getRowIndex(), rowspan, d.height,
- _rowHeights);
- }
- }
- }
-
- // Next we may need distribute height.
- int sigmaHeight = (_tableInfo.getRowCount() + 1) * _vspacing;
- for (int i = 0; i < _rowHeights.length; i++) {
- sigmaHeight += _rowHeights[i];
- }
- if (sigmaHeight < contentHeight) {
- distributeHeights(contentHeight - sigmaHeight, _rowHeights);
- }
-
- // now we have calculated the width and height of all cells.
- // FIXME: border?
- Insets insets = (style == null ? new Insets() : style.getBorderInsets()
- .getAdded(style.getPaddingInsets()));
- _internalTableWidth = (_tableInfo.getColumnCount() + 1) * _hspacing;
- for (int i = 0; i < _columnWidths.length; i++) {
- _internalTableWidth += _columnWidths[i];
- }
- int minWidth = getLengthValue(style, ICSSPropertyID.ATTR_MIN_WIDTH);
- _internalTableWidth = _internalTableWidth > minWidth ? _internalTableWidth
- : minWidth;
-
- _blockBox.setWidth(_internalTableWidth + insets.getWidth());
- _internalTableHeight = (_tableInfo.getRowCount() + 1) * _vspacing;
- for (int i = 0; i < _rowHeights.length; i++) {
- _internalTableHeight += _rowHeights[i];
- }
- int minHeight = getLengthValue(style, ICSSPropertyID.ATTR_MIN_HEIGHT);
- _internalTableHeight = _internalTableHeight > minHeight ? _internalTableHeight
- : minHeight;
-
- int captionHeight = 0;
- if (_tableInfo.getCaption() != null) {
- _captionSize = _tableInfo.getCaption().getFigure().getPreferredSize(
- _internalTableWidth, SWT.DEFAULT);
- captionHeight = _captionSize.height;
- } else {
- _captionSize = null;
- }
- _internalTableHeight += captionHeight;
-
- _blockBox.setHeight(_internalTableHeight + insets.getHeight());
-
- _rowwidth = _internalTableWidth - 2 * _hspacing;
- _rowx = _hspacing; // XXX: table border width left?
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.CSSBlockFlowLayout#endBlock()
- */
- protected void endBlock() {
- _blockBox.setWidth(_internalTableWidth
- + _blockBox.getBorderPaddingWidth());
- _blockBox.setHeight(_internalTableHeight
- + _blockBox.getBorderPaddingHeight());
- super.endBlock();
- }
-
- //
- // /**
- // * when some of the column has percentage width, and sigmaMax smaller than
- // container,
- // * @param containerWidth
- // * @param columnMinWidths
- // * @param columnMaxWidths
- // * @return
- // */
- // private int distribute2(int containerWidth, int[] columnMinWidths, int[]
- // columnMaxWidths)
- // {
- //
- // }
- //
- /**
- * Distribute the additional width to columnMinWidths, using max width as a
- * possible reference on how to distribute.
- *
- * @param toDistribute
- * @param columnMinWidths
- * @param columnMaxWidths
- */
- private void distribute(int toDistribute, int[] columnMinWidths,
- int[] columnMaxWidths) {
- if (toDistribute <= 0)
- return;
- if (columnMinWidths.length == 0)
- return;
-
- int[] delta = new int[columnMinWidths.length];
- int sigmaDelta = 0;
- for (int i = 0; i < columnMinWidths.length && toDistribute > 0; i++) {
- if (_tableInfo.getWidthSpecified()[i]) {
- delta[i] = 0;
- } else {
- delta[i] = columnMaxWidths[i] - columnMinWidths[i];
- if (delta[i] <= 0) {
- delta[i] = 0;
- }
- sigmaDelta += delta[i];
- }
- }
- if (sigmaDelta == 0) {
- // should not happen, but anyway, distribute all to the last column
- // columnMinWidths[columnMinWidths.length-1] += toDistribute;
- averageDeltaToCell(columnMinWidths, toDistribute);
- } else {
- int left = toDistribute;
- for (int i = 0; i < columnMinWidths.length - 1; i++) {
- if (delta[i] > 0) {
- int add = delta[i] * toDistribute / sigmaDelta;
- left -= add;
- columnMinWidths[i] += add;
- }
- }
- columnMinWidths[columnMinWidths.length - 1] += left;
- }
- }
-
- private void averageDeltaToCell(int[] columnMinWidths, int toDistribute) {
-
- if (toDistribute <= 0) {
- return;
- }
- ArrayList list = new ArrayList();
- for (int i = 0; i < columnMinWidths.length; i++) {
- if (!_tableInfo.getWidthSpecified()[i]) {
- list.add(new Integer(i));
- }
- }
- if (list.size() == 0) {
- for (int i = 0; i < columnMinWidths.length; i++) {
- list.add(new Integer(i));
- }
- }
- int padding = toDistribute / list.size();
- int left = toDistribute % list.size();
- for (int i = 0, n = list.size(); i < n; i++) {
- columnMinWidths[((Integer) list.get(i)).intValue()] += padding;
- }
- if (left > 0) {
- for (int i = 0; i < left; i++) {
- columnMinWidths[((Integer) list.get(i)).intValue()] += 1;
- }
- }
- }
-
- /**
- * @param i
- * @param heights
- */
- private void distributeHeights(int toDistribute, int[] heights) {
- if (heights.length == 0)
- return;
- int eachDelta = toDistribute / heights.length;
- for (int i = 0; i < heights.length - 1; i++) {
- heights[i] += eachDelta;
- }
- heights[heights.length - 1] += toDistribute - (heights.length - 1)
- * eachDelta;
- }
-
- /**
- * @param cellinfo
- * @param heights
- * @return the cell height
- */
- public int getCellHeight(TableCellInfo cellinfo, int[] heights) {
- int rowIndex = cellinfo.getRowIndex();
- int rowspan = cellinfo.getRowSpan();
- int h = 0;
- for (int i = 0; i < rowspan; i++) {
- h += heights[rowIndex + i];
- }
- h += (rowspan - 1) * _vspacing;
- return h;
- }
-
- /**
- * @param cellinfo
- * @param widths
- * @return the cell width
- */
- public int getCellWidth(TableCellInfo cellinfo, int[] widths) {
- int columnIndex = cellinfo.getColumnIndex();
- int colspan = cellinfo.getColSpan();
- int w = 0;
- for (int i = 0; i < colspan; i++) {
- w += widths[columnIndex + i];
- }
- w += (colspan - 1) * _hspacing;
- return w;
- }
-
- /**
- * @param column
- * the start column
- * @param colspan
- * number of columns
- * @param width
- * desired width
- * @param columnWidths
- * current columns widths. After the adjust, need make sure the
- * columnWidths to be bigger than desired width
- */
- private void adjustWidth(int column, int colspan, int width,
- int[] columnWidths) {
- adjustSpan(column, colspan, width, columnWidths, _hspacing);
- }
-
- /**
- * @see #adjustWidth(int, int, int, int[])
- */
- private void adjustHeight(int rowIndex, int rowspan, int height,
- int[] heights) {
- adjustSpan(rowIndex, rowspan, height, heights, _vspacing);
- }
-
- static private void adjustSpan(int column, int colspan, int width,
- int[] columnWidths, int spacing) {
- int spanwidth = 0;
- for (int i = 0; i < colspan; i++) {
- spanwidth += columnWidths[column + i];
- }
- // XXX: vspacing here?
- spanwidth += (colspan - 1) * spacing;
-
- if (spanwidth >= width) {
- return;
- }
- int delta = width - spanwidth;
- int deltaeach = delta / colspan;
- for (int i = 0; i < colspan - 1; i++) {
- columnWidths[column + i] += deltaeach;
- }
- columnWidths[column + colspan - 1] += (delta - (colspan - 1)
- * deltaeach);
- }
-
- /**
- * @return the row heights
- */
- public int[] getRowHeights() {
- return _rowHeights;
- }
-
- /**
- * @return the column widths
- */
- public int[] getColumnWidths() {
- return _columnWidths;
- }
-
- /**
- * @return the vertical spacing value
- */
- public int getVSpacing() {
- return _vspacing;
- }
-
- /**
- * @return the horizontal spacing value
- */
- public int getHSpacing() {
- return _hspacing;
- }
-
- /**
- * @param figure
- * @return the table row info for the figure
- */
- public TableRowInfo getRowInfo(CSSFigure figure) {
- return _tableInfo.findRowInfo(figure);
- }
-
- /**
- * @return the table caption info
- */
- public TableCaptionInfo getCaptionInfo() {
- return _tableInfo.getCaption();
- }
-
- /**
- * @param figure
- * @return the table row group info for the figure
- */
- public TableRowGroupInfo getGroupInfo(CSSFigure figure) {
- return _tableInfo.findGroupInfo(figure);
- }
-
- /**
- * @return the row's x
- */
- public int getRowX() {
- return _rowx;
- }
-
- /**
- * @return the row's width
- */
- public int getRowWidth() {
- return _rowwidth;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.CSSBlockFlowLayout#shouldExpand()
- */
- public boolean shouldExpand() {
- return false;
- }
-
- /**
- * @return the rendered dimensions of the table caption
- */
- public Dimension getCaptionSize() {
- return _captionSize;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.ICSSPainter#paintFigure(org.eclipse.draw2d.Graphics)
- */
- public void paintFigure(Graphics g) {
- ICSSStyle style = this.getCSSStyle();
- if (style != null) {
- ITagEditInfo info = (ITagEditInfo) style
- .getAdapter(ITagEditInfo.class);
- if (info != null && info.needTableDecorator()) {
- List cells = _tableInfo.getCells();
- for (int i = 0, size = cells.size(); i < size; i++) {
- TableCellInfo cellInfo = (TableCellInfo) cells.get(i);
- IFigure cellfigure = cellInfo.getFigure();
- Rectangle rect = cellfigure.getBounds().getCopy();
- rect = rect.expand(1, 1);
- g.setLineStyle(Graphics.LINE_SOLID);
- g.setLineWidth(1);
- g.setForegroundColor(ColorConstants.lightGray);
- g.drawRectangle(rect);
- }
- }
- }
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/table/CachedTableCellLayout.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/table/CachedTableCellLayout.java
deleted file mode 100644
index 24e2be8..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/table/CachedTableCellLayout.java
+++ /dev/null
@@ -1,263 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout.table;
-
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.jst.pagedesigner.css2.layout.BoxUtil;
-import org.eclipse.jst.pagedesigner.css2.layout.CSSBlockFlowLayout;
-import org.eclipse.jst.pagedesigner.css2.layout.CSSFigure;
-import org.eclipse.jst.pagedesigner.css2.layout.FlowFigure;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public abstract class CachedTableCellLayout extends CSSBlockFlowLayout
-{
- private Dimension _pageSize = new Dimension();
-
- private boolean _calculatingSize = false;
-
- private int _pageSizeCacheKeys[] = new int[4];
-
- private Dimension _pageSizeCacheValues[] = new Dimension[4];
-
- private int _recommendedWidth;
-
- private Dimension _cacheMaxWidthSize = null;
-
- private boolean _isTable;
-
- /**
- * @param cssfigure
- */
- public CachedTableCellLayout(CSSFigure cssfigure) {
- super(cssfigure);
- }
-
- /**
- * when figure revalidated, means some child or itself get changed somehow,
- * so clear the cache information here.
- */
- public void figureRevalidate() {
- super.figureRevalidate();
- _pageSizeCacheKeys = new int[4];
- _pageSizeCacheValues = new Dimension[4];
- _pageSize = new Dimension();
- _recommendedWidth = 0;
- _cacheMaxWidthSize = null;
- _isTable = false;
- }
-
- /**
- * TODO: This method is not being called.
- */
- public void postValidate() {
- if (_isTable) {
- if (_calculatingSize) {
- _pageSize.width = _blockBox.getWidth();
- _pageSize.height = _blockBox.getHeight();
- } else {
- if (_isTable) {
- Rectangle rect = getCellRect();
- _blockBox.setXYWidthHeight(rect);
- this.getCSSFigure().setBounds(rect);
- }
- }
- List list = getCSSFigure().getChildren();
- for (int i = 0, n = list.size(); i < n; i++) {
- ((FlowFigure) list.get(i)).postValidate();
- }
- } else {
- super.postValidate();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.layout.CSSBlockFlowLayout#preLayout()
- */
- protected void preLayout() {
- _isTable = initializeTableInfo();
- if (_isTable) {
- if (!_calculatingSize) {
- // XXX: I don't know why need to call setValid(false) here, if I
- // don't call
- // it, the layout will be wrong.
- getCSSFigure().setValid(false);
- }
- }
- super.preLayout();
- }
-
- /**
- * @return the cell rectangle
- */
- protected abstract Rectangle getCellRect();
-
- /**
- * @return true if initialized
- */
- protected abstract boolean initializeTableInfo();
-
- protected void setupBlock() {
- if (_isTable) {
- // Remove all current Fragments
- _blockBox.clear();
-
- if (_calculatingSize) {
- // we are not in the real layout
- // Setup the one fragment for this Block with the correct X and
- // available width
- int recommendedWidth = getRecommendedWidth();
- _blockBox.setRecommendedWidth(recommendedWidth);
-
- if (recommendedWidth > 0
- && recommendedWidth != Integer.MAX_VALUE) {
- _blockBox.setWidth(recommendedWidth);
- }
- } else {
- Rectangle rect = getCellRect();
- _blockBox.setWidth(rect.width);
- _blockBox.setRecommendedWidth(rect.width);
- _blockBox.setHeight(rect.height);
- _blockBox.setRecommendedHeight(rect.height);
- }
-
- BoxUtil.setupBorderPaddingMargin(_blockBox, getCSSStyle());
- } else {
- super.setupBlock();
- }
- }
-
- /**
- * @see org.eclipse.draw2d.Figure#getPreferredSize(int, int)
- */
- public Dimension getPreferredSize(IFigure container, int width, int h) {
- if (this.isCalculatingMaxWidth()) {
- return getMaxContentWidthSize(container, width, h);
- }
- try {
- _calculatingSize = true;
- // if (width >= 0)
- // {
- // width = Math.max(0, width - container.getInsets().getWidth());
- // }
-
- for (int i = 0; i < 4; i++) {
- if (_pageSizeCacheKeys[i] == width
- && _pageSizeCacheValues[i] != null) {
- if (h > _pageSizeCacheValues[i].height) {
- return new Dimension(_pageSizeCacheValues[i].width, h);
- }
- return _pageSizeCacheValues[i];
- }
- }
-
- _pageSizeCacheKeys[3] = _pageSizeCacheKeys[2];
- _pageSizeCacheKeys[2] = _pageSizeCacheKeys[1];
- _pageSizeCacheKeys[1] = _pageSizeCacheKeys[0];
- _pageSizeCacheKeys[0] = width;
-
- _pageSizeCacheValues[3] = _pageSizeCacheValues[2];
- _pageSizeCacheValues[2] = _pageSizeCacheValues[1];
- _pageSizeCacheValues[1] = _pageSizeCacheValues[0];
-
- // Flowpage must temporarily layout to determine its preferred size
- int oldWidth = getRecommendedWidth();
- setRecommendedWidth(width);
- ((CSSFigure) container).setValid(false);
- container.validate();
- ((CSSFigure) container).postValidate();
- _pageSizeCacheValues[0] = new Dimension(_pageSize);
-
- if (width != oldWidth) {
- setRecommendedWidth(oldWidth);
- // container.getUpdateManager().addInvalidFigure(container);
- }
- if (h > _pageSizeCacheValues[0].height) {
- return new Dimension(_pageSizeCacheValues[0].width, h);
- }
- return _pageSizeCacheValues[0];
- } finally {
- _calculatingSize = false;
- }
- }
-
- private int getRecommendedWidth() {
- return _recommendedWidth;
- }
-
- private void setRecommendedWidth(int width) {
- if (_recommendedWidth == width) {
- return;
- }
- _recommendedWidth = width;
- }
-
- /**
- * @param container
- * @param width
- * @param height
- * @return max width size
- */
- public Dimension getMaxContentWidthSize(IFigure container, int width,
- int height) {
- try {
- _calculatingSize = true;
-
- if (this._cacheMaxWidthSize == null) {
- boolean b = getCalcuatingMaxWidth();
- setCalculatingMaxWidth(true);
-
- // Flowpage must temporarily layout to determine its preferred
- // size
- int oldWidth = getRecommendedWidth();
- if (width <= 0) {
- setRecommendedWidth(Integer.MAX_VALUE);
- } else {
- setRecommendedWidth(width);
- }
- ((CSSFigure) container).setValid(false);
- container.validate();
-
- ((CSSFigure) container).postValidate();
- _cacheMaxWidthSize = new Dimension(_pageSize);
- if (height > _pageSize.height) {
- _cacheMaxWidthSize.height = height;
- }
-
- if (0 != oldWidth) {
- setRecommendedWidth(oldWidth);
- // container.getUpdateManager().addInvalidFigure(container);
- }
-
- setCalculatingMaxWidth(b);
- }
- return _cacheMaxWidthSize;
- } finally {
- _calculatingSize = false;
- }
- }
-
- /**
- * @return Returns the _isTable.
- */
- protected boolean isTable() {
- return _isTable;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/table/TableCaptionInfo.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/table/TableCaptionInfo.java
deleted file mode 100644
index 010cbc5..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/table/TableCaptionInfo.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout.table;
-
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.layout.ICSSFigure;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.swt.SWT;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class TableCaptionInfo extends TableItemInfo {
- String _align;
-
- /**
- * @param figure
- */
- public TableCaptionInfo(ICSSFigure figure) {
- super(figure);
- ICSSStyle style = figure.getCSSStyle();
- if (style != null) {
- _align = style.getStyleProperty(
- ICSSPropertyID.ATTR_HORIZONTAL_ALIGN).toString();
- }
- }
-
- /**
- * @param width
- * @param height
- * @return the preferred dimension of the figure
- */
- public Dimension getDimension(int width, int height) {
- return getFigure().getPreferredSize(width, height);
- }
-
- /**
- * @return getDimension(width, height)
- */
- public Dimension getDimension() {
- return getDimension(SWT.DEFAULT, SWT.DEFAULT);
- }
-
- /**
- * @return Returns the align.
- */
- public String getAlign() {
- // TODO:We do not support left/right align of caption currently. so we
- // treat them as top.
- if ("bottom".equalsIgnoreCase(_align)) //$NON-NLS-1$
- {
- return _align;
- }
- return "top"; //$NON-NLS-1$
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/table/TableCellInfo.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/table/TableCellInfo.java
deleted file mode 100644
index 286462a..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/table/TableCellInfo.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout.table;
-
-import org.eclipse.draw2d.LayoutManager;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.layout.ICSSFigure;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.jst.pagedesigner.css2.value.Length;
-import org.eclipse.jst.pagedesigner.utils.IntFlexArray;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class TableCellInfo extends TableItemInfo {
- int _rowSpan = 1;
-
- int _colSpan = 1;
-
- int _colIndex;
-
- int _rowIndex;
-
- int _cellWidth = 0;
-
- int _cellHeight = 0;
-
- /**
- * @param childfigure
- */
- public TableCellInfo(ICSSFigure childfigure) {
- super(childfigure);
- }
-
- /**
- * @return column span
- */
- public int getColSpan() {
- return _colSpan;
- }
-
- /**
- * @return row span
- */
- public int getRowSpan() {
- return _rowSpan;
- }
-
- /**
- * @return the row index
- */
- public int getRowIndex() {
- return _rowIndex;
- }
-
- /**
- * @return the column index
- */
- public int getColumnIndex() {
- return _colIndex;
- }
-
- /**
- * @return the minimum cell dimensions
- */
- public Dimension getMinCWDimension() {
- return getFigure().getPreferredSize(_cellWidth, _cellHeight);
- }
-
- /**
- * @return the max cell dimensions
- */
- public Dimension getMaxCWDimension() {
- ICSSFigure figure = getFigure();
- LayoutManager layout = figure.getLayoutManager();
- if (layout instanceof CSSTableCellLayout) {
- Dimension d = ((CSSTableCellLayout) layout).getMaxContentWidthSize(
- figure, _cellWidth, _cellHeight);
- return d;
- }
-
- // should not happen
- return getMinCWDimension();
- }
-
- /**
- * @param context
- */
- public void calculateCellInfo(TableInfoContext context) {
- ICSSStyle style = this.getStyle();
- _rowSpan = style.getRowSpan();
- _colSpan = style.getColSpan();
-
- // FIXME: we don't support rowspan and colspan to be 0.
- // by spec, 0 means span from current col/row to end.
- if (_rowSpan <= 0) {
- _rowSpan = 1;
- }
- if (_colSpan <= 0) {
- _colSpan = 1;
- }
-
- _rowIndex = context.getCurrentRow();
-
- IntFlexArray array = context.getIntFlexArray();
- int currentCol = context.getCurrentCol();
-
- // find a cell that is not occupied by cells in previous rows.
- while (array.getAt(currentCol) > 0) {
- currentCol++;
- }
-
- // ok, now array.getAt(currentCol) == 0
- _colIndex = currentCol;
-
- for (int i = 0; i < _colSpan; i++, currentCol++) {
- array.setAt(currentCol, _rowSpan);
- }
- context.setCurrentCol(currentCol);
- }
-
- /**
- * @param tableInfo
- * @param tablewidth
- * table width
- */
- public void calculateWidth(TableInfo tableInfo, int tablewidth) {
- ICSSStyle style = this.getFigure().getCSSStyle();
- if (style == null) {
- _cellWidth = -1;
- } else {
- Object width = style.getStyleProperty(ICSSPropertyID.ATTR_WIDTH);
- Length recommendedWidth = (width instanceof Length) ? (Length) width
- : null;
-
- int rw = 0;
- if (recommendedWidth == null || recommendedWidth.getValue() <= 0) {
- rw = 0;
- } else {
- if (recommendedWidth.isPercentage()) {
- // percentage width is used for remaining width
- // distribution, so not used here.
- int colspan = this.getColSpan();
- for (int i = 0; i < colspan; i++) {
- tableInfo.setWidthPercentage(this.getColumnIndex() + i,
- recommendedWidth.getValue() / colspan);
- }
- } else {
- rw = recommendedWidth.getValue();
- if (!style.isSizeIncludeBorderPadding()) {
- rw += style.getBorderInsets().getWidth()
- + style.getPaddingInsets().getWidth();
- }
- if (this.getColSpan() == 1) {
- tableInfo.getWidthSpecified()[this.getColumnIndex()] = true;
- }
- }
-
- }
- _cellWidth = rw;
- }
-
- }
-
- /**
- * @param tableInfo
- * @param tableheight
- */
- public void calculateHeight(TableInfo tableInfo, int tableheight) {
- ICSSStyle style = this.getFigure().getCSSStyle();
- if (style == null) {
- _cellHeight = -1;
- } else {
- Object height = style.getStyleProperty(ICSSPropertyID.ATTR_HEIGHT);
- Length recommendedHeight = (height instanceof Length) ? (Length) height
- : null;
-
- int rh = 0;
- if (recommendedHeight == null || recommendedHeight.getValue() <= 0) {
- rh = 0;
- } else {
- if (recommendedHeight.isPercentage()) {
- int rowspan = this.getRowSpan();
- for (int i = 0; i < rowspan; i++) {
- tableInfo.setHeightPercentage(this.getRowIndex() + i,
- recommendedHeight.getValue() / rowspan);
- }
- } else {
- rh = recommendedHeight.getValue();
- }
- if (!style.isSizeIncludeBorderPadding()) {
- rh += style.getBorderInsets().getHeight()
- + style.getPaddingInsets().getHeight();
- }
- }
- _cellHeight = rh;
- }
-
- }
-
- /**
- * @return the height
- */
- public int getHeight() {
- return _cellHeight;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/table/TableInfo.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/table/TableInfo.java
deleted file mode 100644
index 06e135c..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/table/TableInfo.java
+++ /dev/null
@@ -1,379 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout.table;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.layout.CSSFigure;
-import org.eclipse.jst.pagedesigner.css2.layout.ICSSFigure;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-/*package*/ class TableInfo extends TableItemInfo {
- private List _tableHeaderGroups = new ArrayList();
-
- private List _tableTRandTRGs = new ArrayList();
-
- private List _tableFooterGroups = new ArrayList();
-
- private TableCaptionInfo _caption;
-
- private int _columnCount;
-
- private int _rowCount;
-
- private List _cells = null;
-
- private List _rows = null;
-
- private int _tableWidth; // calculated table width, valid after calling to
-
- // calculateTableWidth
-
- private int _tableHeight;
-
- private int[] _widthPercentage;
-
- private int[] _heightPercentage;
-
- private boolean[] _widthSpecified;
-
- /**
- * @param figure
- */
- public TableInfo(ICSSFigure figure) {
- super(figure);
- }
-
-
- /**
- * @return the column count
- */
- public int getColumnCount() {
- return _columnCount;
- }
-
- /**
- * @return the row count
- */
- public int getRowCount() {
- return _rowCount;
- }
-
- final TableCaptionInfo getCaption() {
- return _caption;
- }
-
-
- /**
- * @return width specified
- */
- final boolean[] getWidthSpecified() {
- return _widthSpecified;
- }
-
-
- void constructTable() {
- List child = getFigure().getChildren();
- for (int i = 0, size = child.size(); i < size; i++) {
- IFigure childfigure = (IFigure) child.get(i);
- if (childfigure instanceof ICSSFigure) {
- ICSSStyle style = ((ICSSFigure) childfigure).getCSSStyle();
- if (style != null) {
- String display = style.getDisplay();
- if ("table-caption".equalsIgnoreCase(display)) //$NON-NLS-1$
- {
- _caption = new TableCaptionInfo(
- (ICSSFigure) childfigure);
- } else if ("table-row".equalsIgnoreCase(display)) //$NON-NLS-1$
- {
- TableRowInfo rowInfo = new TableRowInfo(
- (ICSSFigure) childfigure);
- _tableTRandTRGs.add(rowInfo);
- } else if ("table-row-group".equalsIgnoreCase(display)) //$NON-NLS-1$
- {
- TableRowGroupInfo groupInfo = new TableRowGroupInfo(
- (ICSSFigure) childfigure);
- _tableTRandTRGs.add(groupInfo);
- } else if ("table-header-group".equalsIgnoreCase(display)) //$NON-NLS-1$
- {
- TableRowGroupInfo groupInfo = new TableRowGroupInfo(
- (ICSSFigure) childfigure);
- _tableHeaderGroups.add(groupInfo);
- } else if ("table-footer-group".equalsIgnoreCase(display)) //$NON-NLS-1$
- {
- TableRowGroupInfo groupInfo = new TableRowGroupInfo(
- (ICSSFigure) childfigure);
- _tableFooterGroups.add(groupInfo);
- } else {
- // something unexpected inside table
- }
- } else {
- // something unexpected inside table
- }
- } else {
- // something unexpected inside table
- }
- }
-
- TableInfoContext context = new TableInfoContext();
- // now we have the rows ordered, need to calculate row details now.
- for (int i = 0, size = _tableHeaderGroups.size(); i < size; i++) {
- TableRowGroupInfo groupInfo = (TableRowGroupInfo) _tableHeaderGroups
- .get(i);
- groupInfo.calculateRowGroup(context);
- }
- for (int i = 0, size = _tableTRandTRGs.size(); i < size; i++) {
- Object obj = _tableTRandTRGs.get(i);
- if (obj instanceof TableRowGroupInfo) {
- TableRowGroupInfo groupInfo = (TableRowGroupInfo) obj;
- groupInfo.calculateRowGroup(context);
- } else {
- TableRowInfo rowInfo = (TableRowInfo) obj;
- rowInfo.calculateRow(context);
- }
- }
- for (int i = 0, size = _tableFooterGroups.size(); i < size; i++) {
- TableRowGroupInfo groupInfo = (TableRowGroupInfo) _tableFooterGroups
- .get(i);
- groupInfo.calculateRowGroup(context);
- }
- context.finishTable();
-
- _columnCount = context.getColumnCount();
- _rowCount = context.getRowCount();
-
- this._widthPercentage = new int[_columnCount];
- this._heightPercentage = new int[_rowCount];
-
- this._widthSpecified = new boolean[_columnCount];
- for (int i = 0; i < _columnCount; i++) {
- this._widthSpecified[i] = false;
- }
- }
-
- /**
- * @param columnIndex
- * @param percentageValue
- */
- void setWidthPercentage(int columnIndex, int percentageValue) {
- if (percentageValue > this._widthPercentage[columnIndex]) {
- this._widthPercentage[columnIndex] = percentageValue;
- }
- }
-
- void setHeightPercentage(int rowIndex, int percentageValue) {
- if (percentageValue > this._heightPercentage[rowIndex]) {
- this._heightPercentage[rowIndex] = percentageValue;
- }
- }
-
- /**
- * width percentage will be used to calculate remaining width distribution.
- *
- * @return the width percentages
- */
- public int[] getWidthPercentages() {
- return this._widthPercentage;
- }
-
- int[] getHeightPercentages() {
- return this._heightPercentage;
- }
-
- List getRows() {
- if (_rows == null) {
- this._rows = new ArrayList();
-
- for (int i = 0, size = _tableHeaderGroups.size(); i < size; i++) {
- TableRowGroupInfo groupInfo = (TableRowGroupInfo) _tableHeaderGroups
- .get(i);
- _rows.addAll(groupInfo.getRowList());
- }
- for (int i = 0, size = _tableTRandTRGs.size(); i < size; i++) {
- Object obj = _tableTRandTRGs.get(i);
- if (obj instanceof TableRowGroupInfo) {
- TableRowGroupInfo groupInfo = (TableRowGroupInfo) obj;
- _rows.addAll(groupInfo.getRowList());
- } else {
- TableRowInfo rowInfo = (TableRowInfo) obj;
- _rows.add(rowInfo);
- }
- }
- for (int i = 0, size = _tableFooterGroups.size(); i < size; i++) {
- TableRowGroupInfo groupInfo = (TableRowGroupInfo) _tableFooterGroups
- .get(i);
- _rows.addAll(groupInfo.getRowList());
- }
- }
- return _rows;
- }
-
- List getCells() {
- if (_cells == null) {
- _cells = new ArrayList();
-
- for (int i = 0, size = _tableHeaderGroups.size(); i < size; i++) {
- TableRowGroupInfo groupInfo = (TableRowGroupInfo) _tableHeaderGroups
- .get(i);
- groupInfo.getCells(_cells);
- }
- for (int i = 0, size = _tableTRandTRGs.size(); i < size; i++) {
- Object obj = _tableTRandTRGs.get(i);
- if (obj instanceof TableRowGroupInfo) {
- TableRowGroupInfo groupInfo = (TableRowGroupInfo) obj;
- groupInfo.getCells(_cells);
- } else {
- TableRowInfo rowInfo = (TableRowInfo) obj;
- rowInfo.getCells(_cells);
- }
- }
- for (int i = 0, size = _tableFooterGroups.size(); i < size; i++) {
- TableRowGroupInfo groupInfo = (TableRowGroupInfo) _tableFooterGroups
- .get(i);
- groupInfo.getCells(_cells);
- }
- }
- return _cells;
- }
-
- /**
- * @param contentWidth
- * if the width specification is percentage, then will use
- * container width.
- * @param availableWidth
- */
- public void calculateWidth(int contentWidth, int availableWidth) {
- _tableWidth = contentWidth;
- //_availableWidth = availableWidth;
-
- // next calculate cell width
- List cells = getCells();
- for (int i = 0, size = cells.size(); i < size; i++) {
- TableCellInfo cellinfo = (TableCellInfo) cells.get(i);
- cellinfo.calculateWidth(this, _tableWidth);
- }
- }
-
- void calculateHeight(int contentHeight) {
- _tableHeight = contentHeight;
-
- List rows = getRows();
- for (int i = 0, size = rows.size(); i < size; i++) {
- TableRowInfo rowinfo = (TableRowInfo) rows.get(i);
- rowinfo.calculateHeight(this, _tableHeight);
- }
-
- // next calculate cell width
- List cells = getCells();
- for (int i = 0, size = cells.size(); i < size; i++) {
- TableCellInfo cellinfo = (TableCellInfo) cells.get(i);
- cellinfo.calculateHeight(this, _tableHeight);
- }
- }
-
- /**
- * @return table width
- */
- public int getTableWidth() {
- return _tableWidth;
- }
-
- /**
- * @param figure
- * @return find the group info
- */
- public TableRowGroupInfo findGroupInfo(CSSFigure figure) {
- for (int i = 0, size = _tableHeaderGroups.size(); i < size; i++) {
- TableRowGroupInfo groupInfo = (TableRowGroupInfo) _tableHeaderGroups
- .get(i);
- if (figure == groupInfo.getFigure()) {
- return groupInfo;
- }
- }
- for (int i = 0, size = _tableTRandTRGs.size(); i < size; i++) {
- Object obj = _tableTRandTRGs.get(i);
- if (obj instanceof TableRowGroupInfo) {
- TableRowGroupInfo groupInfo = (TableRowGroupInfo) obj;
- if (figure == groupInfo.getFigure()) {
- return groupInfo;
- }
-
- }
- }
- for (int i = 0, size = _tableFooterGroups.size(); i < size; i++) {
- TableRowGroupInfo groupInfo = (TableRowGroupInfo) _tableFooterGroups
- .get(i);
- if (figure == groupInfo.getFigure()) {
- return groupInfo;
- }
- }
- return null; // should not happen.
- }
-
- /**
- * @param figure
- * @return the row info
- */
- public TableRowInfo findRowInfo(CSSFigure figure) {
- for (int i = 0, size = _tableHeaderGroups.size(); i < size; i++) {
- TableRowGroupInfo groupInfo = (TableRowGroupInfo) _tableHeaderGroups
- .get(i);
- TableRowInfo rowinfo = groupInfo.findRowInfo(figure);
- if (rowinfo != null) {
- return rowinfo;
- }
- }
- for (int i = 0, size = _tableTRandTRGs.size(); i < size; i++) {
- Object obj = _tableTRandTRGs.get(i);
- if (obj instanceof TableRowGroupInfo) {
- TableRowGroupInfo groupInfo = (TableRowGroupInfo) obj;
- TableRowInfo rowinfo = groupInfo.findRowInfo(figure);
- if (rowinfo != null) {
- return rowinfo;
- }
- } else if (obj instanceof TableRowInfo) {
- TableRowInfo info = (TableRowInfo) obj;
- if (figure == info.getFigure()) {
- return info;
- }
- }
- }
- for (int i = 0, size = _tableFooterGroups.size(); i < size; i++) {
- TableRowGroupInfo groupInfo = (TableRowGroupInfo) _tableFooterGroups
- .get(i);
- TableRowInfo rowinfo = groupInfo.findRowInfo(figure);
- if (rowinfo != null) {
- return rowinfo;
- }
- }
- return null; // should not happen.
- }
-
- /**
- *
- * @return the width percentage
- */
- public boolean hasWidthPercentage() {
- for (int i = 0; i < this._widthPercentage.length; i++) {
- if (this._widthPercentage[i] > 0) {
- return true;
- }
- }
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/table/TableInfoContext.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/table/TableInfoContext.java
deleted file mode 100644
index f28d3e0..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/table/TableInfoContext.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout.table;
-
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.utils.IntFlexArray;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-/*package*/ class TableInfoContext {
- static Logger _log = PDPlugin.getLogger(TableInfoContext.class);
-
- int _currentCol = 0;
-
- int _currentRow = 0;
-
- IntFlexArray _array = new IntFlexArray();
-
- int _colCount = 0;
-
- int _rowCount = 0;
-
- /**
- *
- */
- public TableInfoContext() {
- // do nothing
- }
-
- /**
- * @return the flex array
- */
- public IntFlexArray getIntFlexArray() {
- return _array;
- }
-
- /**
- * @return the current column
- */
- public int getCurrentCol() {
- return _currentCol;
- }
-
- /**
- * @param currentcol
- */
- public void setCurrentCol(int currentcol) {
- _currentCol = currentcol;
- }
-
- /**
- * @return the current row
- */
- public int getCurrentRow() {
- return _currentRow;
- }
-
- /**
- * @return the column count
- */
- public int getColumnCount() {
- return _colCount;
- }
-
- /**
- *
- */
- public void finishRow() {
- if (_currentCol > _colCount) {
- _colCount = _currentCol;
- }
- _currentCol = 0;
- _currentRow++;
- for (int i = 0; i < _colCount; i++) {
- if (_array.getAt(i) > 0) {
- _array.setAt(i, _array.getAt(i) - 1);
- }
- }
- }
-
- /**
- *
- */
- public void finishTable() {
- // do some checking here.
- int additionalRow = 0;
- for (int i = 0; i < _colCount; i++) {
- if (_array.getAt(i) > additionalRow) {
- additionalRow = _array.getAt(i);
- }
- }
- _rowCount = _currentRow + additionalRow;
- }
-
- /**
- *
- */
- public void finishRowGroup() {
- // TODO: does nothing; only called in one places
- }
-
- /**
- * @return the row count
- */
- public int getRowCount() {
- return _rowCount;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/table/TableItemInfo.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/table/TableItemInfo.java
deleted file mode 100644
index 9f39064..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/table/TableItemInfo.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout.table;
-
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.layout.ICSSFigure;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-/*package*/ class TableItemInfo
-{
- private ICSSFigure _figure;
-
- /**
- * @param figure
- */
- public TableItemInfo(ICSSFigure figure) {
- _figure = figure;
- }
-
- /**
- * @return the figure
- */
- public ICSSFigure getFigure() {
- return _figure;
- }
-
- /**
- * @return the style
- */
- public ICSSStyle getStyle() {
- return _figure.getCSSStyle();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/table/TableRowGroupInfo.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/table/TableRowGroupInfo.java
deleted file mode 100644
index 8ab83ff..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/table/TableRowGroupInfo.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout.table;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.layout.CSSFigure;
-import org.eclipse.jst.pagedesigner.css2.layout.ICSSFigure;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-/*package*/ class TableRowGroupInfo extends TableItemInfo {
- List _rowList = new ArrayList();
-
- private int _rowIndex;
-
- private int _rowCount;
-
- /**
- * @param figure
- */
- public TableRowGroupInfo(ICSSFigure figure) {
- super(figure);
- }
-
- List getRowList() {
- return _rowList;
- }
-
- int getRowIndex() {
- return _rowIndex;
- }
-
- int getRowCount() {
- return this._rowCount;
- }
-
- /**
- * @param context
- */
- public void calculateRowGroup(TableInfoContext context) {
- this._rowIndex = context.getCurrentRow();
- List children = getFigure().getChildren();
- for (int i = 0, size = children.size(); i < size; i++) {
- IFigure childfigure = (IFigure) children.get(i);
- if (childfigure instanceof ICSSFigure) {
- ICSSStyle childstyle = ((ICSSFigure) childfigure).getCSSStyle();
- if (childstyle != null
- && "table-row"
- .equalsIgnoreCase(childstyle.getDisplay())) {
- TableRowInfo rowInfo = new TableRowInfo(
- (ICSSFigure) childfigure);
- _rowList.add(rowInfo);
- rowInfo.calculateRow(context);
- } else {
- // skip
- }
- } else {
- // skip
- }
- }
- context.finishRowGroup();
- this._rowCount = context.getCurrentRow() - this._rowIndex;
- }
-
- /**
- * @param _cells
- */
- public void getCells(List _cells) {
- for (int i = 0, size = _rowList.size(); i < size; i++) {
- TableRowInfo rowInfo = (TableRowInfo) _rowList.get(i);
- rowInfo.getCells(_cells);
- }
- }
-
- /**
- * @param figure
- * @return the table row info
- */
- public TableRowInfo findRowInfo(CSSFigure figure) {
- for (int i = 0, size = _rowList.size(); i < size; i++) {
- TableRowInfo rowInfo = (TableRowInfo) _rowList.get(i);
- if (figure == rowInfo.getFigure()) {
- return rowInfo;
- }
- }
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/table/TableRowInfo.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/table/TableRowInfo.java
deleted file mode 100644
index 75544e2..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/layout/table/TableRowInfo.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.layout.table;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.layout.CSSFigure;
-import org.eclipse.jst.pagedesigner.css2.layout.ICSSFigure;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.jst.pagedesigner.css2.value.Length;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-/*package*/ class TableRowInfo extends TableItemInfo {
- List _cells = new ArrayList();
-
- int _rowIndex;
-
- private int _rowHeight;
-
- /**
- * @param figure
- */
- public TableRowInfo(ICSSFigure figure) {
- super(figure);
- }
-
- List getCells() {
- return _cells;
- }
-
- int getRowIndex() {
- return _rowIndex;
- }
-
- int getSpecifiedRowHeight() {
- return _rowHeight;
- }
-
- /**
- * @param context
- */
- public void calculateRow(TableInfoContext context) {
- this._rowIndex = context.getCurrentRow();
-
- List children = getFigure().getChildren();
- for (int i = 0, size = children.size(); i < size; i++) {
- IFigure childfigure = (IFigure) children.get(i);
- if (childfigure instanceof ICSSFigure) {
- ICSSStyle childstyle = ((ICSSFigure) childfigure).getCSSStyle();
- if (childstyle != null) {
- String display = childstyle.getDisplay();
- if ("table-cell".equalsIgnoreCase(display)) {
- TableCellInfo cellInfo = new TableCellInfo(
- (ICSSFigure) childfigure);
- cellInfo.calculateCellInfo(context);
- _cells.add(cellInfo);
- } else {
- // skip
- }
- }
- } else {
- // skip
- }
- }
- // ok, we have finished a row
- context.finishRow();
- }
-
- /**
- * @param cells
- */
- public void getCells(List cells) {
- cells.addAll(this._cells);
- }
-
- /**
- * @param figure
- * @return the table cell info
- */
- public TableCellInfo getCellInfo(CSSFigure figure) {
- for (int i = 0, size = _cells.size(); i < size; i++) {
- TableCellInfo cellinfo = (TableCellInfo) _cells.get(i);
- if (cellinfo.getFigure() == figure) {
- return cellinfo;
- }
- }
- return null;
- }
-
- /**
- * @param info
- * @param tableHeight
- */
- public void calculateHeight(TableInfo info, int tableHeight) {
- ICSSStyle style = this.getFigure().getCSSStyle();
- if (style == null) {
- this._rowHeight = -1;
- } else {
- Object height = style.getStyleProperty(ICSSPropertyID.ATTR_HEIGHT);
- Length recommendedHeight = (height instanceof Length) ? (Length) height
- : null;
-
- int rh = 0;
- if (recommendedHeight == null || recommendedHeight.getValue() <= 0) {
- rh = 0;
- } else {
- if (recommendedHeight.isPercentage()) {
- // not supported.
- } else {
- rh = recommendedHeight.getValue();
- }
- if (rh > 0 && !style.isSizeIncludeBorderPadding()) {
- rh += style.getBorderInsets().getHeight()
- + style.getPaddingInsets().getHeight();
- }
- }
- this._rowHeight = rh;
- }
-
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/list/CSSHtmlListStyleData.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/list/CSSHtmlListStyleData.java
deleted file mode 100644
index 01465cd..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/list/CSSHtmlListStyleData.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.list;
-
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * @author mengbo
- */
-public class CSSHtmlListStyleData {
- /**
- * Image
- */
- public final static int LIST_T_IMAGE = 0;
-
- /**
- * Disc
- */
- public final static int LIST_T_DISC = 1;
-
- /**
- * Circle
- */
- public final static int LIST_T_CIRCLE = 2;
-
- /**
- * Square
- */
- public final static int LIST_T_SQUARE = 3;
-
- /**
- * Decimal
- */
- public final static int LIST_T_DECIMAL = 0x11;
-
- /**
- * Decimial w/ leading zero
- */
- public final static int LIST_T_DECIMAL_LEADING_ZERO = 0x12;
-
- /**
- * Lower alpha
- */
- public final static int LIST_T_LOWER_ALPHA = 0x13;
-
- /**
- * Lower Roman
- */
- public final static int LIST_T_LOWER_ROMAN = 0x14;
-
- /**
- * Upper alpha
- */
- public final static int LIST_T_UPPER_ALPHA = 0x15;
-
- /**
- * Upper Roman
- */
- public final static int LIST_T_UPPER_ROMAN = 0x16;
-
- //private CSSMarkerStyleData _markerStyleData;
-
- private Image _markerImage;
-
- private int _type;
-
- /**
- * @return if is a default picture type
- */
- public boolean isDefaultPicture() {
- return (_type & 0xf) != 0;
- }
-
- private String getResolvedURL() {
- //String textValue = _markerStyleData.getTextContent();
- // TODO: when I found this, resolver was not being set and would either
- // have thrown NPE or returned "".. so I've "improved it :)
- //URIResolver resolver = null;// FIXME: this is not implemented yet.
- // DesignerPropertyTool.getModel().getResolver();
- //if (textValue != null && textValue.length() > 0) {
- // return resolver.getLocationByURI(textValue);
- //}
- return "";
- }
-
- /**
- * @return Returns the markerImage.
- */
- public Image getMarkerImage() {
- if (!this.isImage()) {
- return null;
- }
- if (_markerImage == null) {
- String uri = this.getResolvedURL();
- _markerImage = new Image(null, uri);
- }
- return _markerImage;
- }
-
- /**
- * @return Returns the type.
- */
- public int getType() {
- return _type;
- }
-
- /**
- * @param type
- */
- public void setType(String type) {
-
- this._type = toTypeInt(type);
- }
-
- /**
- * @param index
- * @return Returns the markerString.
- */
- public String getTextValue(int index) {
- if (!this.isText()) {
- return null;
- }
- // ICounter counter = CounterFactory.getInstance().getCounter(_type);
- return "";
-
- }
-
- /**
- * @return true if is a text type
- */
- public boolean isText() {
- return (_type & 0xf0) != 0;
- }
-
- /**
- * @return true if is an image type
- */
- public boolean isImage() {
- return (_type == LIST_T_IMAGE);
- }
-
- /**
- * @param type
- * @return convert the 'type' String to one of LIST_T_*
- */
- public static int toTypeInt(String type) {
- if (type.equalsIgnoreCase(ICSSPropertyID.VAL_DECIMAL)) {
- return LIST_T_DECIMAL;
- } else if (type
- .equalsIgnoreCase(ICSSPropertyID.VAL_DECIMAL_LEADING_ZERO)) {
- return LIST_T_DECIMAL_LEADING_ZERO;
- } else if (type.equalsIgnoreCase(ICSSPropertyID.VAL_DISC)) {
- return LIST_T_DISC;
- } else if (type.equalsIgnoreCase(ICSSPropertyID.VAL_CIRCLE)) {
- return LIST_T_CIRCLE;
- } else if (type.equalsIgnoreCase(ICSSPropertyID.VAL_SQUARE)) {
- return LIST_T_SQUARE;
- } else if (type.equalsIgnoreCase(ICSSPropertyID.VAL_IMAGE)) {
- return LIST_T_IMAGE;
- }
-
- return 0;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/list/CSSMarkerStyleData.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/list/CSSMarkerStyleData.java
deleted file mode 100644
index 0383b52..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/list/CSSMarkerStyleData.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.list;
-
-import java.util.Vector;
-
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-
-/**
- * @author mengbo
- */
-public class CSSMarkerStyleData {
- private Vector _content;
-
- private String _textContent;
-
- private int _Offset;
-
- private boolean _isOutside;
-
- /**
- * @return Returns the isBefore.
- */
- public boolean isOutside() {
- return _isOutside;
- }
-
- /**
- * @param position
- * The isBefore to set.
- */
- public void setPosition(String position) {
- if (position == ICSSPropertyID.VAL_INSIDE) {
- _isOutside = false;
- } else if (position == ICSSPropertyID.VAL_OUTSIDE) {
- _isOutside = true;
- }
- }
-
- /**
- * @return Returns the _Offset.
- */
- public int getOffset() {
- return _Offset;
- }
-
- /**
- * @param offset
- * The _Offset to set.
- */
- public void setOffset(int offset) {
- _Offset = offset;
- }
-
- /**
- * @return Returns the _textValue.
- */
- public String getTextContent() {
- return _textContent;
- }
-
- /**
- * @param value
- * The _textValue to set.
- */
- public void setTextContent(String value) {
- _textContent = value;
- }
-
- /**
- * @return the next element. removes it from the content vector. Returns
- * null if the content is empty
- */
- public Object getNextElement() {
- if (_content == null || _content.size() == 0) {
- return null;
- }
- return _content.remove(0);
- }
-
- /**
- * @param content
- */
- public void setContent(Vector content) {
- _content = content;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/list/ContentObject.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/list/ContentObject.java
deleted file mode 100644
index ad32149..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/list/ContentObject.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.list;
-
-/**
- * A simple template objec, when we resole content in detail, we will create
- * more complicated object reference structure.
- *
- * @author mengbo
- */
-public class ContentObject {
- private ICounterValueGenerator _counter;
-
- /**
- * @return Returns the _counter.
- */
- public ICounterValueGenerator getCounter() {
- return _counter;
- }
-
- /**
- * @param counter
- * The _counter to set.
- */
- public void setCounter(ICounterValueGenerator counter) {
- this._counter = counter;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/list/CounterHelper.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/list/CounterHelper.java
deleted file mode 100644
index b6913d7..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/list/CounterHelper.java
+++ /dev/null
@@ -1,280 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.list;
-
-import java.util.HashMap;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyMeta;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPrimitiveValue;
-import org.w3c.dom.css.CSSPrimitiveValue;
-
-/**
- * @author mengbo
- */
-public final class CounterHelper {
- /**
- * Image
- */
- public final static int LIST_T_IMAGE = 0;
-
- /**
- * Disc
- */
- public final static int LIST_T_DISC = 1;
-
- /**
- * Circle
- */
- public final static int LIST_T_CIRCLE = 2;
-
- /**
- * Square
- */
- public final static int LIST_T_SQUARE = 3;
-
- /**
- * Decimal
- */
- public final static int LIST_T_DECIMAL = 0x11;
-
- /**
- * Leading-zero decimal
- */
- public final static int LIST_T_DECIMAL_LEADING_ZERO = 0x12;
-
- /**
- * Lower alpha
- */
- public final static int LIST_T_LOWER_ALPHA = 0x13;
-
- /**
- * Lower roman
- */
- public final static int LIST_T_LOWER_ROMAN = 0x14;
-
- /**
- * Upper alpha
- */
- public final static int LIST_T_UPPER_ALPHA = 0x15;
-
- /**
- * Upper roman
- */
- public final static int LIST_T_UPPER_ROMAN = 0x16;
-
- /**
- * Lower greek
- */
- public final static int LIST_T_LOWER_GREEK = 0x21;
-
- /**
- * Armenian
- */
- public final static int LIST_T_ARMENIAN = 0x22;
-
- /**
- * Georgian
- */
- public final static int LIST_T_GEORGIAN = 0x23;
-
- /**
- * None
- */
- public final static int LIST_T_NONE = 0x24;
- /**
- * @param style
- * @param counters
- */
- public static void processCounterReset(ICSSStyle style, HashMap counters) {
- Assert.isTrue(style != null && counters != null);
- // counter-reset will create new one.
- Object counterResets = style
- .getStyleProperty(ICSSPropertyID.ATTR_COUNTER_RESET);
- if ((counterResets) != null
- && counterResets != ICSSPropertyMeta.NOT_SPECIFIED) {
- if (counterResets instanceof List) {
- List crList = (List) counterResets;
- for (int i = 0, n = crList.size(); i < n; i++) {
- ResetObject rObject = (ResetObject) crList.get(i);
- String name = rObject.getCounterName();
- Object counter = null;
- if (counters.size() > 0 && counters.containsKey(name)) {
- // Already resolved
- counter = counters.get(name);
- }
- if (counter != null) {
- if (rObject.getInitial() != null) {
- ((ICounterValueGenerator) counter)
- .resetCount(rObject.getInitial().intValue());
- } else {
- counter = ((ICounterValueGenerator) counter)
- .resetCount();
- }
- counters.put(((ICounterValueGenerator) counter)
- .getIdentifier(), counter);
- } else {
- // create new one
- Object listStyle = style
- .getStyleProperty(ICSSPropertyID.ATTR_LIST_STYLE_TYPE);
- if (listStyle instanceof String) {
- counter = new CounterValueGenerator(name,
- (String) listStyle, null, style);
- if (rObject.getInitial() != null) {
- ((ICounterValueGenerator) counter)
- .resetCount(rObject.getInitial()
- .intValue());
- } else {
- counter = ((ICounterValueGenerator) counter)
- .resetCount();
- }
- }
- counters.put(((ICounterValueGenerator) counter)
- .getIdentifier(), counter);
- }
- }
- }
- }
- }
-
- /**
- * @param style
- */
- public static void processCounterIncrement(ICSSStyle style) {
- Object counterIncrements = style
- .getStyleProperty(ICSSPropertyID.ATTR_COUNTER_INCREMENT);
- if (counterIncrements != null
- && counterIncrements != ICSSPropertyMeta.NOT_SPECIFIED) {
- if (counterIncrements instanceof List) {
- List crList = (List) counterIncrements;
- for (int i = 0, n = crList.size(); i < n; i++) {
- IncrementObject rObject = (IncrementObject) crList.get(i);
- String name = rObject.getCounterName();
- Object counter = null;
- counter = style.findCounter(name, true);
- if (counter != null) {
- if (HTMLListInfoHelper.getValueInt(style) == null) {
- if (rObject.getIncrement() != null) {
- ((ICounterValueGenerator) counter)
- .increase(rObject.getIncrement()
- .intValue());
- } else {
- ((ICounterValueGenerator) counter).increase();
- }
- } else {
- ((ICounterValueGenerator) counter)
- .setCount(HTMLListInfoHelper
- .getValueInt(style));
- }
- }
- }
- }
- }
- }
-
- /**
- * @param style
- * @return true if the style is a text style
- */
- public static boolean isText(ICSSStyle style) {
- String display = style.getDisplay();
- Object styleType = style
- .getStyleProperty(ICSSPropertyID.ATTR_LIST_STYLE_TYPE);
- return (display
- .equalsIgnoreCase(ICSSPropertyID.VAL_LIST_ITEM) //
- && styleType instanceof String //
- && !CounterValueGenerator.NON_STRING_TYPES.contains(styleType));
- }
-
- /**
- * @param style
- * @return the type of the style. One of the LIST_T_* values, or -1 if the
- * style is unknown
- */
- public static int getType(ICSSStyle style) {
- Object type = style
- .getStyleProperty(ICSSPropertyID.ATTR_LIST_STYLE_TYPE);
- if (type instanceof String) {
- return toTypeInt((String) type);
- }
- return -1;
- }
-
- /**
- * @param type
- * @return the type enumeration for the type string
- */
- public static int toTypeInt(String type) {
-
- if (type.equalsIgnoreCase(ICSSPropertyID.VAL_DECIMAL)) {
- return LIST_T_DECIMAL;
- } else if (type
- .equalsIgnoreCase(ICSSPropertyID.VAL_DECIMAL_LEADING_ZERO)) {
- return LIST_T_DECIMAL_LEADING_ZERO;
- } else if (type.equalsIgnoreCase(ICSSPropertyID.VAL_DISC)) {
- return LIST_T_DISC;
- } else if (type.equalsIgnoreCase(ICSSPropertyID.VAL_CIRCLE)) {
- return LIST_T_CIRCLE;
- } else if (type.equalsIgnoreCase(ICSSPropertyID.VAL_SQUARE)) {
- return LIST_T_SQUARE;
- } else if (type.equalsIgnoreCase(ICSSPropertyID.VAL_IMAGE)) {
- return LIST_T_IMAGE;
- } else if (type.equalsIgnoreCase(ICSSPropertyID.VAL_UPPER_LATIN)) {
- return LIST_T_UPPER_ALPHA;
- } else if (type.equalsIgnoreCase(ICSSPropertyID.VAL_UPPER_ALPHA)) {
- return LIST_T_UPPER_ALPHA;
- } else if (type.equalsIgnoreCase(ICSSPropertyID.VAL_LOWER_LATIN)) {
- return LIST_T_LOWER_ALPHA;
- } else if (type.equalsIgnoreCase(ICSSPropertyID.VAL_LOWER_ALPHA)) {
- return LIST_T_LOWER_ALPHA;
- } else if (type.equalsIgnoreCase(ICSSPropertyID.VAL_UPPER_ROMAN)) {
- return LIST_T_UPPER_ROMAN;
- } else if (type.equalsIgnoreCase(ICSSPropertyID.VAL_LOWER_ROMAN)) {
- return LIST_T_LOWER_ROMAN;
- } else if (type.equalsIgnoreCase(ICSSPropertyID.VAL_LOWER_GREEK)) {
- return LIST_T_LOWER_GREEK;
- } else if (type.equalsIgnoreCase(ICSSPropertyID.VAL_ARMENIAN)) {
- return LIST_T_ARMENIAN;
- } else if (type.equalsIgnoreCase(ICSSPropertyID.VAL_GEORGIAN)) {
- return LIST_T_GEORGIAN;
- } else if (type.equalsIgnoreCase(ICSSPropertyID.VAL_NONE)) {
- return LIST_T_NONE;
- }
- return 0;
- }
-
- /**
- * @param cssValue
- * @return true if the cssValue is an IDENT
- */
- public static boolean isIdentifier(Object cssValue) {
- return (cssValue instanceof ICSSPrimitiveValue)
- && ((ICSSPrimitiveValue) cssValue).getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT;
- }
-
- /**
- * @param cssValue
- * @return true if the css value is a number
- */
- public static boolean isNumber(Object cssValue) {
- return cssValue instanceof ICSSPrimitiveValue
- && ((ICSSPrimitiveValue) cssValue).getPrimitiveType() == ICSSPrimitiveValue.CSS_INTEGER;
- }
-
- private CounterHelper()
- {
- // util class; no instantiation
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/list/CounterValueGenerator.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/list/CounterValueGenerator.java
deleted file mode 100644
index a05bb7b..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/list/CounterValueGenerator.java
+++ /dev/null
@@ -1,446 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.list;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyMeta;
-
-/**
- * The counter is used to generate automatic conters and numbering for list
- * item. XXX: what do we deal with psedo? and we need to refer to web tools
- * content to consult for style content.
- *
- * @author mengbo
- */
-public class CounterValueGenerator implements ICounterValueGenerator {
- private final static int DEFAULT_INITIAL_VALUE = 0;
-
- private static final Set STRING_TYPES = new HashSet();
-
- static final Set NON_STRING_TYPES = new HashSet();
- static {
- NON_STRING_TYPES.add("disc");
- NON_STRING_TYPES.add("circle");
- NON_STRING_TYPES.add("square");
- STRING_TYPES.add("decimal");
- STRING_TYPES.add("decimal-leading-zero");
- STRING_TYPES.add("lower-roman");
- STRING_TYPES.add("upper-roman");
- STRING_TYPES.add("lower-greek");
- STRING_TYPES.add("lower-alpha");
- STRING_TYPES.add("lower-latin");
- STRING_TYPES.add("upper-alpha");
- STRING_TYPES.add("upper-latin");
- STRING_TYPES.add("hebrew");
- STRING_TYPES.add("armenian");
- STRING_TYPES.add("georgian");
- STRING_TYPES.add("cjk-ideographic");
- STRING_TYPES.add("hiragana");
- STRING_TYPES.add("katakana");
- STRING_TYPES.add("hiragana-iroha");
- STRING_TYPES.add("katakana-iroha");
- }
-
- private final static int DEFAULT_INCREMENT = 1;
-
- private boolean _first = true;
-
- private Integer _initial;
-
- private List _visitors;
-
- private int _count;
-
- private String _identifier;
-
- private String _styleType;
-
- private String _seperator;
-
- private ICSSStyle _style;
-
- /**
- * @param identifier
- * @param styleType
- * @param seperator
- * @param style
- */
- public CounterValueGenerator(String identifier, String styleType,
- String seperator, ICSSStyle style) {
- _identifier = identifier;
- _styleType = styleType;
- _seperator = seperator;
- _style = style;
- if (HTMLListInfoHelper.getStartInt(style) != null) {
- _count = HTMLListInfoHelper.getStartInt(style).intValue();
- } else {
- _count = DEFAULT_INITIAL_VALUE;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.Counter#getIdentifier()
- */
- public String getIdentifier() {
- return _identifier;
- }
-
- /**
- * @return the style type
- * @see org.w3c.dom.css.Counter#getListStyle()
- */
- public String getListStyle() {
- return _styleType;
- }
-
- /**
- * @return the separator
- *
- * @see org.w3c.dom.css.Counter#getSeparator()
- */
- public String getSeparator() {
- return _seperator;
- }
-
- // /**
- // * @return Returns the type.
- // */
- // public String getType()
- // {
- // return _styleType;
- // }
-
- // /**
- // * @return Returns the markerString.
- // */
- // public String getTextValue()
- // {
- // Assert.isTrue(this.isText());
- // _index = getDeclaredIndex();
- // Node container = findParentComtainer();
- // if (container == null)
- // {
- // // what condition?
- // return "";
- // }
- // String exp = "";
- // int startIndex = getStartIndex(container);
- // int maxLength = calculateMaxlength(container, 0) + startIndex - 1;
- // Assert.isTrue(maxLength > 0);
- // if (_index == -1)
- // {
- // // no declared value
- // calculateIndex(container);
- // Assert.isTrue(_index > -1);
- // exp = Integer.toString(_index + startIndex);
- // }
- // else
- // {
- // exp = Integer.toString(_index);
- // }
- // if (getType() == CounterHelper.LIST_T_DECIMAL)
- // {
- // exp = appendSuffix(exp, Integer.toString(maxLength).length() -
- // exp.length());
- // }
- // else if (getType() == CounterHelper.LIST_T_DECIMAL_LEADING_ZERO)
- // {
- // exp = addPrefix(exp, maxLength - exp.length());
- // }
- // return exp + ".";
- //
- // }
-
- // private String addPrefix(String exp, int length)
- // {
- // while (length > 0)
- // {
- // exp = "0" + exp;
- // length--;
- // }
- // return exp;
- // }
- //
- // private String appendSuffix(String exp, int length)
- // {
- // while (length > 0)
- // {
- // exp = exp + " ";
- // length--;
- // }
- // return exp;
- // }
-
- // private boolean calculateIndex(Node node)
- // {
- // if (node == _node)
- // {
- // _index++;
- // return true;
- // }
- // String name = node.getNodeName();
- // if (name != null && name.equalsIgnoreCase("li"))
- // {
- // _index++;
- // }
- // if (!node.hasChildNodes())
- // {
- // return false;
- // }
- // node = node.getFirstChild();
- // while (node != null)
- // {
- // name = node.getNodeName();
- // if (name != null && !(name.equalsIgnoreCase("ul") ||
- // name.equalsIgnoreCase("ol")))
- // {
- // if (calculateIndex(node))
- // {
- // return true;
- // }
- // }
- // node = node.getNextSibling();
- // }
- // return false;
- // }
-
- // This method may be refered for the zero-leading calculation.
- // private int calculateMaxlength(Node node, int index)
- // {
- // String name = node.getNodeName();
- // if (name != null && name.equalsIgnoreCase("li"))
- // {
- // index++;
- // }
- // if (!node.hasChildNodes())
- // {
- // return index;
- // }
- // node = node.getFirstChild();
- // while (node != null)
- // {
- // name = node.getNodeName();
- // if (name != null && !(name.equalsIgnoreCase("ul") ||
- // name.equalsIgnoreCase("ol")))
- // {
- // index = calculateMaxlength(node, index);
- // }
- // node = node.getNextSibling();
- // }
- // return index;
- // }
- //
-
- // private int getStartIndex(Node container)
- // {
- // String value = ((Element) container).getAttribute("start");
- // try
- // {
- // int index = Integer.parseInt(value);
- // if (index < 0)
- // {
- // return 1;
- // }
- // return index;
- // }
- // catch (Exception e)
- // {
- // return 1;
- // }
- // }
-
- // private boolean isStringTyped(ICSSStyle style)
- // {
- // style.getStyleProperty("list-style-type");
- // return true;
- // }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#clone()
- */
- protected Object clone() throws CloneNotSupportedException {
- CounterValueGenerator newInstance = new CounterValueGenerator(
- _identifier, _styleType, _seperator, _style);
- return newInstance;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.list.Counter2#increase()
- */
- public void increase(int increment) {
- if (!_first || HTMLListInfoHelper.getStartInt(_style) == null) {
- _count += increment;
- }
- _first = false;
- }
-
- public void increase() {
- increase(DEFAULT_INCREMENT);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.list.Counter2#setCount()
- */
- public ICounterValueGenerator resetCount() {
- try {
- ICounterValueGenerator counter = (ICounterValueGenerator) this
- .clone();
- _initial = null;
- _count = HTMLListInfoHelper.getStartInt(_style) != null ? HTMLListInfoHelper
- .getStartInt(_style).intValue()
- : DEFAULT_INITIAL_VALUE;
- return counter;
- } catch (CloneNotSupportedException e) {
- return null;
- }
- }
-
- /**
- * @return Returns the _initial.
- */
- public int getInitial() {
- if (HTMLListInfoHelper.getStartInt(_style) != null) {
- return HTMLListInfoHelper.getStartInt(_style).intValue();
- }
- return _initial != null ? _initial.intValue()
- : DEFAULT_INITIAL_VALUE;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.list.Counter2#setCount()
- */
- public ICounterValueGenerator resetCount(int initial) {
- try {
- CounterValueGenerator counter = (CounterValueGenerator) this
- .clone();
- _initial = new Integer(initial);
- _count = initial;
- return counter;
- } catch (CloneNotSupportedException e) {
- return null;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.list.ICounterValueGenerator#setCount(org.eclipse.jst.pagedesigner.css2.list.HTMLListInfo)
- */
- public void setCount(Integer value) {
- if (value != null) {
- _count = value.intValue();
- _first = false;
- }
- }
-
- // /**
- // * The clients of this counter need to regist them.
- // *
- // * @see
- // org.eclipse.jst.pagedesigner.css2.list.Counter2#regist(java.lang.Object)
- // */
- // public void regist(Object caller)
- // {
- // Assert.isTrue(caller instanceof ICSSStyle);
- // if (_visitors == null)
- // {
- // _visitors = new LinkedList();
- // }
- // if (!_visitors.contains(caller))
- // {
- // _visitors.add(caller);
- // }
- // }
- //
- // /**
- // * (non-Javadoc)
- // *
- // * @see
- // org.eclipse.jst.pagedesigner.css2.list.Counter2#unregist(java.lang.Object)
- // */
- // public void unregist(Object caller)
- // {
- // if (_visitors.contains(caller))
- // {
- // _visitors.remove(caller);
- // }
- // }
-
- /**
- * Return the int value.
- *
- * @author mengbo
- */
- public int getCurrentCount() {
- return _count;
- }
-
- /**
- * Currently we recalculate the count, to enhance the performance, we may
- * use _count, but this requires delicate synchronization when the
- * calculation is looped.
- */
- public Integer getCount(Object oCaller) {
- Assert.isTrue(oCaller instanceof ICSSStyle && _visitors != null
- && _visitors.size() > 0);
- ICSSStyle caller = (ICSSStyle) oCaller;
- if (!_visitors.contains(caller)) {
- return null;
- }
- int result = getInitial();
-
- for (int i = 0, n = _visitors.size(); i < n; i++) {
- ICSSStyle style = (ICSSStyle) _visitors.get(i);
- // get the count;
- Object counterIncrements = style
- .getStyleProperty(ICSSPropertyID.ATTR_COUNTER_INCREMENT);
- if (counterIncrements != null
- && counterIncrements != ICSSPropertyMeta.NOT_SPECIFIED) {
- if (counterIncrements instanceof List) {
- List crList = (List) counterIncrements;
- for (int j = 0, nn = crList.size(); j < nn; j++) {
- IncrementObject rObject = (IncrementObject) crList
- .get(j);
- String name = rObject.getCounterName();
- if (getIdentifier().equalsIgnoreCase(name)) {
- if (rObject.getIncrement() != null) {
- result += rObject.getIncrement().intValue();
- } else {
- result += DEFAULT_INCREMENT;
- }
- }
- }
- }
- }
- if (style == caller) {
- return new Integer(result);
- }
- }
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/list/HTMLListInfoHelper.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/list/HTMLListInfoHelper.java
deleted file mode 100644
index c352f96..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/list/HTMLListInfoHelper.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.list;
-
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.style.AbstractStyle;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * Resolve the attrbites 'start' on 'ol' and 'value' on 'li'.
- *
- * @author mengbo
- */
-/*package*/ final class HTMLListInfoHelper {
- /**
- * @return Returns the start.
- */
- private static String getStart(ICSSStyle _style) {
- if (_style instanceof AbstractStyle) {
- Element element = ((AbstractStyle) _style).getElement();
- Node parent = null;
- if ((parent = EditModelQuery.getParent(IHTMLConstants.TAG_OL,
- element, true)) != null) {
- return ((Element) parent)
- .getAttribute(IHTMLConstants.ATTR_START);
- }
- }
- return null;
- }
-
- /**
- * @param style
- * @return the start int
- */
- public static Integer getStartInt(ICSSStyle style) {
- try {
- return new Integer(getStart(style));
- } catch (Exception e) {
- return null;
- }
- }
-
- /**
- * @return Returns the value.
- */
- private static String getValue(ICSSStyle _style) {
- if (_style instanceof AbstractStyle) {
- Element element = ((AbstractStyle) _style).getElement();
- if (element != null) {
- return element.getAttribute(IHTMLConstants.ATTR_VALUE);
- }
- }
- return null;
- }
-
- /**
- * @param style
- * @return the Integer value or null if not parsable
- */
- public static Integer getValueInt(ICSSStyle style) {
- try {
- return Integer.valueOf(getValue(style));
- } catch (NumberFormatException ex) {
- return null;
- }
- }
-
- private HTMLListInfoHelper()
- {
- // no external instantiation
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/list/ICounterValueGenerator.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/list/ICounterValueGenerator.java
deleted file mode 100644
index 67d0197..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/list/ICounterValueGenerator.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.list;
-
-/**
- * @author mengbo
- */
-public interface ICounterValueGenerator {
- /**
- * @return the identifier
- */
- public String getIdentifier();
-
- /**
- * @param initial
- * @return the reset count
- */
- public ICounterValueGenerator resetCount(int initial);
-
- /**
- * @return the generator
- */
- public ICounterValueGenerator resetCount();
-
- /**
- * Set the counter based on value.
- * @param value
- */
- public void setCount(Integer value);
-
- // public void regist(Object caller);
- // public void unregist(Object caller);
-
- /**
- * Increase counter based on declared increment number
- * @param increment
- */
- public void increase(int increment);
-
- /**
- * Increase counter with default increment number(1)
- */
- public void increase();
-
- /**
- * @param caller
- * @return the count
- */
- public Integer getCount(Object caller);
-
- /**
- * @return the current count
- */
- public int getCurrentCount();
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/list/IIndexConverter.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/list/IIndexConverter.java
deleted file mode 100644
index 5e220a1..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/list/IIndexConverter.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.list;
-
-/**
- * @author mengbo
- */
-public interface IIndexConverter {
- /**
- * @param index
- * @return the string at index
- */
- String getString(int index);
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/list/IncrementObject.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/list/IncrementObject.java
deleted file mode 100644
index 71c9140..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/list/IncrementObject.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.list;
-
-/**
- * @author mengbo
- */
-public class IncrementObject {
- private String _counterName;
-
- private Integer _increment;
-
- /**
- * @param name
- * @param increment
- */
- public IncrementObject(String name, Integer increment) {
- _counterName = name;
- _increment = increment;
- }
-
- /**
- * @return Returns the _counterName.
- */
- public String getCounterName() {
- return _counterName;
- }
-
- /**
- * @param name
- * The _counterName to set.
- */
- public void setCounterName(String name) {
- _counterName = name;
- }
-
- /**
- * @return Returns the _increment.
- */
- public Integer getIncrement() {
- return _increment;
- }
-
- /**
- * @param _increment
- * The _increment to set.
- */
- public void setIncrement(Integer _increment) {
- this._increment = _increment;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/list/ListStyleUtil.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/list/ListStyleUtil.java
deleted file mode 100644
index ccab58f..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/list/ListStyleUtil.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.list;
-
-/**
- * @author mengbo
- */
-/*package*/ final class ListStyleUtil {
- /**
- * @param type
- * @param index
- * @return the type as a string
- */
- public static String convertTypeToString(int type, int index) {
- if (type == CSSHtmlListStyleData.LIST_T_LOWER_ROMAN
- || type == CSSHtmlListStyleData.LIST_T_UPPER_ROMAN) {
- // TODO: to implement roman.
- // return decimalToRoman(index);
- } else if (type == CSSHtmlListStyleData.LIST_T_DECIMAL
- || type == CSSHtmlListStyleData.LIST_T_DECIMAL_LEADING_ZERO) {
- return Integer.toString(index);
- }
- return null;
- }
-
- private ListStyleUtil()
- {
- // no instantiation
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/list/ResetObject.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/list/ResetObject.java
deleted file mode 100644
index 0cc1138..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/list/ResetObject.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.list;
-
-/**
- * @author mengbo
- */
-public class ResetObject {
- private String _counterName;
-
- private Integer _initial;
-
- /**
- * @param name
- * @param initial
- */
- public ResetObject(String name, Integer initial) {
- _counterName = name;
- _initial = initial;
- }
-
- /**
- * @return Returns the _counterName.
- */
- public String getCounterName() {
- return _counterName;
- }
-
- /**
- * @param name
- * The _counterName to set.
- */
- public void setCounterName(String name) {
- _counterName = name;
- }
-
- /**
- * @return Returns the _increment.
- */
- public Integer getInitial() {
- return _initial;
- }
-
- /**
- * @param _initial
- * The _increment to set.
- */
- public void setInitial(Integer _initial) {
- this._initial = _initial;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/marker/CounterFactory.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/marker/CounterFactory.java
deleted file mode 100644
index 32dec84..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/marker/CounterFactory.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.marker;
-
-import org.eclipse.jst.pagedesigner.css2.list.CSSHtmlListStyleData;
-
-/**
- * @author mengbo
- */
-public class CounterFactory {
- private static DecimalCounter _decimalCounterInstance;
-
- private static RomanCounter _romanCounterInstance;
-
- private static CounterFactory _instance;
-
- /**
- * @return the factory singelton
- */
- public static CounterFactory getInstance() {
- if (_instance == null) {
- _instance = new CounterFactory();
- }
- return _instance;
- }
-
- /**
- * @param type
- * @return the counter for type
- */
- public ICounter getCounter(int type) {
- switch (type) {
- case CSSHtmlListStyleData.LIST_T_DECIMAL:
- case CSSHtmlListStyleData.LIST_T_DECIMAL_LEADING_ZERO:
- if (_decimalCounterInstance == null) {
- _decimalCounterInstance = new DecimalCounter();
- }
- return _decimalCounterInstance;
- case CSSHtmlListStyleData.LIST_T_LOWER_ROMAN:
- case CSSHtmlListStyleData.LIST_T_UPPER_ROMAN:
- if (_romanCounterInstance == null) {
- _romanCounterInstance = new RomanCounter();
- }
- return _romanCounterInstance;
- default:
- return null;
-
- }
- }
-
- private CounterFactory()
- {
- // singleton, no external instantiation
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/marker/CounterUtil.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/marker/CounterUtil.java
deleted file mode 100644
index 4864dd3..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/marker/CounterUtil.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.marker;
-
-import org.eclipse.jst.pagedesigner.css2.list.CounterHelper;
-
-/**
- * @author mengbo
- */
-public final class CounterUtil {
- /**
- * @param count
- * @param type
- * @return the converter count
- */
- public static String convertCount(int count, int type) {
- // XXX: currently we only support style that IE supported.for type that
- // does not
- // support we return an empty String.
- StringBuffer buffer = new StringBuffer();
- switch (type) {
- case CounterHelper.LIST_T_DECIMAL:
- buffer.append(count);
- buffer.append('.');
- break;
- case CounterHelper.LIST_T_UPPER_ALPHA:
- case CounterHelper.LIST_T_LOWER_ALPHA:
- char charA = 'a';
- if (type == CounterHelper.LIST_T_UPPER_ALPHA) {
- charA = 'A';
- }
- int index = count;
- while (index > 0 && index > 26) {
- buffer.append((char) (charA + (index / 26) - 1));
- index = index % 26;
- }
- buffer.append((char) (charA + (index - 1)));
- buffer.append(".");
- break;
- case CounterHelper.LIST_T_UPPER_ROMAN:
- case CounterHelper.LIST_T_LOWER_ROMAN:
- String string = new RomanCounter().getString(count);
- if (type == CounterHelper.LIST_T_LOWER_ROMAN) {
- buffer.append(string.toLowerCase());
- } else {
- buffer.append(string);
- }
- buffer.append(".");
- break;
- case CounterHelper.LIST_T_ARMENIAN:
- break;
- case CounterHelper.LIST_T_DECIMAL_LEADING_ZERO:
- break;
- case CounterHelper.LIST_T_LOWER_GREEK:
- break;
- case CounterHelper.LIST_T_GEORGIAN:
- break;
- default:
- break;
- }
- return buffer.toString();
- }
-
- private CounterUtil()
- {
- // no instantiation
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/marker/DecimalCounter.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/marker/DecimalCounter.java
deleted file mode 100644
index ddce690..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/marker/DecimalCounter.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.marker;
-
-import org.eclipse.jst.pagedesigner.css2.list.CSSHtmlListStyleData;
-
-/**
- * @author mengbo
- */
-/*package*/ class DecimalCounter extends EnumerableCounter
-{
-
- DecimalCounter()
- {
- // do nothing; only nee
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.list.EnumerableCounter#getString(int)
- */
- public String getNextString(int index, int type) {
- //String result;
- switch (type) {
- case CSSHtmlListStyleData.LIST_T_DECIMAL:
- return Integer.toString(index);
-
- case CSSHtmlListStyleData.LIST_T_DECIMAL_LEADING_ZERO:
- StringBuffer sb = new StringBuffer();
- int count = 1;
- for (int i = sb.length(); i < count; i++) {
- sb.append('0');
- }
- sb.append(Integer.toString(index));
- return sb.toString();
- default:
- return null;
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/marker/EnumerableCounter.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/marker/EnumerableCounter.java
deleted file mode 100644
index 3dfbef8..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/marker/EnumerableCounter.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.marker;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * @author mengbo
- */
-public abstract class EnumerableCounter implements ICounter {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.list.ICounter#getNextObject(org.w3c.dom.Element,
- * java.lang.String)
- */
- public final Object getNextObject(Element element, int type) {
- int index = calculateIndex(element);
- return getNextString(index, type);
- }
-
- /**
- * @param element
- * @return the index of the element in its parent
- */
- public final int calculateIndex(Element element) {
- final String tag = element.getLocalName();
- final Node parent = element.getParentNode();
- final NodeList children = parent.getChildNodes();
- int index = 1;
- for (int i = 0; i < children.getLength(); i++) {
- final Node child = children.item(i);
- if (child == element) {
- break;
- }
- if (child.getLocalName().equalsIgnoreCase(tag)) {
- index++;
- }
- }
- return index;
- }
-
- /**
- * @param index
- * @param type
- * @return the string for the next index
- */
- public abstract String getNextString(int index, int type);
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/marker/ICounter.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/marker/ICounter.java
deleted file mode 100644
index cc06af3..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/marker/ICounter.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.marker;
-
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- */
-public interface ICounter {
- /**
- * @param element
- * @param type
- * @return the next object for element, type
- */
- public Object getNextObject(Element element, int type);
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/marker/RomanCounter.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/marker/RomanCounter.java
deleted file mode 100644
index 52e4626..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/marker/RomanCounter.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.marker;
-
-import org.eclipse.jst.pagedesigner.css2.list.CSSHtmlListStyleData;
-
-/**
- * @author mengbo
- */
-/*package*/ class RomanCounter extends EnumerableCounter {
- RomanCounter()
- {
- // do nothing
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.list.EnumerableCounter#getString(int,
- * boolean)
- */
- public String getNextString(int index, int type) {
- switch (type) {
- case CSSHtmlListStyleData.LIST_T_LOWER_ROMAN:
- return getString(index).toLowerCase();
- case CSSHtmlListStyleData.LIST_T_UPPER_ROMAN:
- return getString(index);
- default:
- return null;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.list.NumberCounter#getString(int)
- */
- /*package*/ String getString(int index) {
- // FIXME: Need to enhance more.
- StringBuffer roman = new StringBuffer();
- int a, b, c, d;
- a = (index / 1000) * 1000;
- b = ((index / 100) % 10) * 100;
- c = ((index / 10) % 10) * 10;
- d = ((index / 1) % 10) * 1;
-
- if (a == 1000)
- roman.append("M");
- else if (a == 2000)
- roman.append("MM");
- else if (a == 3000)
- roman.append("MMM");
-
- if (b == 100)
- roman.append("C");
- else if (b == 200)
- roman.append("CC");
- else if (b == 300)
- roman.append("CCC");
- else if (b == 400)
- roman.append("CD");
- else if (b == 500)
- roman.append("D");
- else if (b == 600)
- roman.append("DC");
- else if (b == 700)
- roman.append("DCC");
- else if (b == 800)
- roman.append("DCCC");
- else if (b == 900)
- roman.append("CM");
-
- if (c == 10)
- roman.append("X");
- else if (c == 20)
- roman.append("XX");
- else if (c == 30)
- roman.append("XXX");
- else if (c == 40)
- roman.append("XL");
- else if (c == 50)
- roman.append("L");
- else if (c == 60)
- roman.append("LX");
- else if (c == 70)
- roman.append("LXX");
- else if (c == 80)
- roman.append("LXXX");
- else if (c == 90)
- roman.append("XC");
-
- if (d == 1)
- roman.append("I");
- else if (d == 2)
- roman.append("II");
- else if (d == 3)
- roman.append("III");
- else if (d == 4)
- roman.append("IV");
- else if (d == 5)
- roman.append("V");
- else if (d == 6)
- roman.append("VI");
- else if (d == 7)
- roman.append("VII");
- else if (d == 8)
- roman.append("VIII");
- else if (d == 9)
- roman.append("IX");
-
- return roman.toString();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/BackgroundColorMeta.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/BackgroundColorMeta.java
deleted file mode 100644
index f738c47..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/BackgroundColorMeta.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.property;
-
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.color.CSSColorManager;
-import org.eclipse.jst.pagedesigner.utils.DOMUtil;
-import org.w3c.dom.Element;
-import org.w3c.dom.css.CSSValue;
-
-/**
- * @author mengbo
- */
-public class BackgroundColorMeta extends CSSPropertyMeta {
- private static final String[] _keywords = new String[] { ICSSPropertyID.VAL_TRANSPARENT };
-
- /**
- */
- public BackgroundColorMeta() {
- super(false, ICSSPropertyID.VAL_TRANSPARENT);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyMeta#calculateCSSValueResult(org.w3c.dom.css.CSSValue,
- * java.lang.String,
- * org.eclipse.jst.pagedesigner.css2.property.AbstractStyle)
- */
- public Object calculateCSSValueResult(CSSValue value, String propertyName,
- ICSSStyle style) {
- String text = value.getCssText();
- Object result = CSSColorManager.getInstance().getColor(text);
- if (result != null) {
- return result;
- }
- return getInitialValue(propertyName, style);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#getKeywordValues()
- */
- protected String[] getKeywordValues() {
- return _keywords;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyMeta#calculateHTMLAttributeOverride(org.w3c.dom.Element,
- * java.lang.String, java.lang.String,
- * org.eclipse.jst.pagedesigner.css2.ICSSStyle)
- */
- public Object calculateHTMLAttributeOverride(Element element,
- String htmltag, String propertyName, ICSSStyle style) {
- Object result;
- String colorAttr = null;
- if (ICSSPropertyID.ATTR_BACKGROUND_COLOR.equalsIgnoreCase(propertyName)) {
- colorAttr = DOMUtil.getAttributeIgnoreCase(element,
- ICSSPropertyID.ATTR_BGCOLOR);
- }
- if (colorAttr != null && colorAttr.trim().length() != 0) {
- colorAttr = colorAttr.trim();
- result = CSSColorManager.getInstance().getColor(colorAttr);
- return result;
- }
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/BorderCollapseMeta.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/BorderCollapseMeta.java
deleted file mode 100644
index f2cbe1d..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/BorderCollapseMeta.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.property;
-
-/**
- * @author mengbo
- */
-public class BorderCollapseMeta extends CSSPropertyMeta {
- static String[] keywords = new String[] { ICSSPropertyID.VAL_COLLAPSE,
- ICSSPropertyID.VAL_SEPARATE };
-
- /**
- */
- public BorderCollapseMeta() {
- // XXX: the spec says COLLAPSE is initial value, but seemed that IE
- // is using separate as default
- super(true, ICSSPropertyID.VAL_SEPARATE);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#getKeywordValues()
- */
- protected String[] getKeywordValues() {
- return keywords;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/BorderColorMeta.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/BorderColorMeta.java
deleted file mode 100644
index d493a71..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/BorderColorMeta.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.property;
-
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.color.CSSColorManager;
-import org.eclipse.jst.pagedesigner.utils.DOMUtil;
-import org.w3c.dom.Element;
-import org.w3c.dom.css.CSSValue;
-
-/**
- * @author mengbo
- */
-public class BorderColorMeta extends CSSPropertyMeta {
-
- private static final String[] _keywords = new String[] { ICSSPropertyID.VAL_TRANSPARENT };
-
- /**
- */
- public BorderColorMeta() {
- super(false, ICSSPropertyID.VAL_TRANSPARENT);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyMeta#calculateCSSValueResult(org.w3c.dom.css.CSSValue,
- * java.lang.String,
- * org.eclipse.jst.pagedesigner.css2.property.AbstractStyle)
- */
- public Object calculateCSSValueResult(CSSValue value, String propertyName,
- ICSSStyle style) {
- String text = value.getCssText();
- Object result = CSSColorManager.getInstance().getColor(text);
- if (result != null) {
- return result;
- }
- return getInitialValue(propertyName, style);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#getKeywordValues()
- */
- protected String[] getKeywordValues() {
- return _keywords;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyMeta#calculateHTMLAttributeOverride(org.w3c.dom.Element,
- * java.lang.String, java.lang.String,
- * org.eclipse.jst.pagedesigner.css2.ICSSStyle)
- */
- public Object calculateHTMLAttributeOverride(Element element,
- String htmltag, String propertyName, ICSSStyle style) {
- Object result;
- String colorAttr = null;
- if (IHTMLConstants.TAG_HR.equalsIgnoreCase(htmltag)) {
- colorAttr = DOMUtil.getAttributeIgnoreCase(element,
- ICSSPropertyID.ATTR_COLOR);
- } else if (ICSSPropertyID.ATTR_BACKGROUND_COLOR
- .equalsIgnoreCase(propertyName)) {
- colorAttr = DOMUtil.getAttributeIgnoreCase(element,
- ICSSPropertyID.ATTR_BGCOLOR);
- }
- if (colorAttr != null && colorAttr.trim().length() != 0) {
- colorAttr = colorAttr.trim();
- result = CSSColorManager.getInstance().getColor(colorAttr);
- return result;
- }
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/BorderSpacingMeta.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/BorderSpacingMeta.java
deleted file mode 100644
index 22313c3..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/BorderSpacingMeta.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.property;
-
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.value.Length;
-import org.eclipse.jst.pagedesigner.utils.DOMUtil;
-import org.w3c.dom.Element;
-import org.w3c.dom.css.CSSValue;
-import org.w3c.dom.css.CSSValueList;
-
-/**
- * The value will always be of type int[2]
- *
- * @author mengbo
- */
-public class BorderSpacingMeta extends CSSPropertyMeta {
- private static final int[] INITIAL_SPACING = new int[] { 3, 3 };
-
- /**
- */
- public BorderSpacingMeta() {
- // the specification says "border-spacing" is inherited. But seemed
- // browse is not treating it as inherited. So we treat is as not
- // inherited.
- super(false, INITIAL_SPACING);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#getKeywordValues()
- */
- protected String[] getKeywordValues() {
- return EMPTY_KEYWORDS;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#calculateCSSValueResult(org.w3c.dom.css.CSSValue,
- * java.lang.String,
- * org.eclipse.jst.pagedesigner.css2.style.AbstractStyle)
- */
- public Object calculateCSSValueResult(CSSValue value, String propertyName,
- ICSSStyle style) {
- if (value == null || value.getCssValueType() == CSSValue.CSS_CUSTOM) {
- return INITIAL_SPACING;
- }
- if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
- int intvalue = toIntValue(value.getCssText(), style);
- if (intvalue >= 0) {
- return new int[] { intvalue, intvalue };
- }
- return INITIAL_SPACING;
- } else if (value.getCssValueType() == CSSValue.CSS_VALUE_LIST) {
- CSSValueList list = (CSSValueList) value;
- if (list.getLength() >= 2) {
- int i1 = toIntValue(list.item(0).getCssText(), style);
- int i2 = toIntValue(list.item(1).getCssText(), style);
- if (i1 < 0) {
- i1 = 0;
- }
- if (i2 < 0) {
- i2 = 0;
- }
- return new int[] { i1, i2 };
- }
- return INITIAL_SPACING;
- } else {
- return INITIAL_SPACING;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#calculateHTMLAttributeOverride(org.w3c.dom.Element,
- * java.lang.String, java.lang.String,
- * org.eclipse.jst.pagedesigner.css2.ICSSStyle)
- */
- public Object calculateHTMLAttributeOverride(Element element,
- String htmltag, String propertyName, ICSSStyle style) {
- if (IHTMLConstants.TAG_TABLE.equalsIgnoreCase(htmltag)) {
- String spacing = DOMUtil.getAttributeIgnoreCase(element,
- IHTMLConstants.ATTR_CELLSPACING);
- if (spacing != null) {
- int intvalue = toIntValue(spacing, style);
- if (intvalue >= 0) {
- return new int[] { intvalue, intvalue };
- }
- }
- }
-
- return super.calculateHTMLAttributeOverride(element, htmltag,
- propertyName, style);
- }
-
- /**
- * @param valuetext
- * @param style
- * @return the integer value for value text
- */
- protected int toIntValue(String valuetext, ICSSStyle style) {
- Object length = LengthMeta.toLength(valuetext, style, PERCENTAGE_NONE,
- style.getCSSFont());
- if (length instanceof Length && !((Length) length).isPercentage()) {
- return ((Length) length).getValue();
- }
- return Integer.MIN_VALUE;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/BorderStyleMeta.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/BorderStyleMeta.java
deleted file mode 100644
index bae4612..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/BorderStyleMeta.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.property;
-
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.utils.DOMUtil;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- */
-public class BorderStyleMeta extends CSSPropertyMeta {
- static final String[] KEYWORDS = new String[] { ICSSPropertyID.VAL_NONE,
- ICSSPropertyID.VAL_HIDDEN, ICSSPropertyID.VAL_DOTTED,
- ICSSPropertyID.VAL_DASHED, ICSSPropertyID.VAL_SOLID,
- ICSSPropertyID.VAL_DOUBLE, ICSSPropertyID.VAL_GROOVE,
- ICSSPropertyID.VAL_RIDGE, ICSSPropertyID.VAL_INSET,
- ICSSPropertyID.VAL_OUTSET };
-
- /**
- */
- public BorderStyleMeta() {
- super(false, ICSSPropertyID.VAL_NONE);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#getKeywordValues()
- */
- protected String[] getKeywordValues() {
- return KEYWORDS;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#calculateHTMLAttributeOverride(org.w3c.dom.Element,
- * java.lang.String, java.lang.String,
- * org.eclipse.jst.pagedesigner.css2.ICSSStyle)
- */
- public Object calculateHTMLAttributeOverride(Element element,
- String htmltag, String propertyName, ICSSStyle style) {
- if (IHTMLConstants.TAG_TABLE.equalsIgnoreCase(htmltag)) {
- return calculateTableOverride(element, propertyName);
- } else if (IHTMLConstants.TAG_TD.equalsIgnoreCase(htmltag)
- || IHTMLConstants.TAG_TH.equalsIgnoreCase(htmltag)) {
- return calculateTDOverride(element, propertyName, style);
- } else if (IHTMLConstants.TAG_IMG.equalsIgnoreCase(htmltag)) {
- String border = DOMUtil.getAttributeIgnoreCase(element,
- IHTMLConstants.ATTR_BORDER);
- if (border != null) {
- return ICSSPropertyID.VAL_SOLID;
- }
- }
- return super.calculateHTMLAttributeOverride(element, htmltag,
- propertyName, style);
- }
-
- /**
- * @param element
- * @param propertyName
- * @return
- */
- private Object calculateTDOverride(Element element, String propertyName,
- ICSSStyle style) {
- // if element is empty, and "empty-cells" property is hide, then we
- // don't display border.
- Object obj = style.getStyleProperty(ICSSPropertyID.ATTR_EMPTY_CELLS);
- if (EmptyCellsMeta.HIDE.equals(obj) && TableUtil.isEmptyCell(element)) {
- return ICSSPropertyID.VAL_NONE;
- }
-
- // find containing table first
- Node parent = element;
- Element tableEle = null;
- while ((parent = parent.getParentNode()) != null
- && parent instanceof Element) {
- if (((Element) parent).getTagName().equalsIgnoreCase(
- IHTMLConstants.TAG_TABLE)) {
- tableEle = (Element) parent;
- break;
- }
-
- }
- if (tableEle != null) {
- String rules = DOMUtil.getAttributeIgnoreCase(tableEle,
- IHTMLConstants.ATTR_RULES);
- String borderstr = DOMUtil.getAttributeIgnoreCase(tableEle,
- IHTMLConstants.ATTR_BORDER);
- if (rules == null || rules.length() == 0) {
- if (borderstr == null || "0".equals(borderstr.trim())) {
- return ICSSPropertyID.VAL_NONE;
- }
- return ICSSPropertyID.VAL_TDBORDERSTYLE;
- }
- // ok, we got a value for rules
- if (TableUtil.matchRules(extractEdge(propertyName), rules)) {
- return ICSSPropertyID.VAL_TDBORDERSTYLE;
- }
- return ICSSPropertyID.VAL_NONE;
- }
- return null;
- }
-
- /**
- * @param element
- * @param propertyName
- * @return
- */
- private Object calculateTableOverride(Element element, String propertyName) {
- String frame = DOMUtil.getAttributeIgnoreCase(element,
- IHTMLConstants.ATTR_FRAME);
- String borderstr = DOMUtil.getAttributeIgnoreCase(element,
- IHTMLConstants.ATTR_BORDER);
- // border="0" implies frame="void"
- if ("0".equals(borderstr)) {
- return ICSSPropertyID.VAL_NONE;
- }
- if (frame == null || frame.length() == 0) {
- if (borderstr == null) {
- return ICSSPropertyID.VAL_NONE;
- } else if (borderstr.trim().length() == 0) {
- frame = IHTMLConstants.ATTR_BORDER;
- } else {
- try {
- Integer.parseInt(borderstr);
- frame = IHTMLConstants.ATTR_BORDER;
- } catch (Exception ex) {
- frame = borderstr;
- }
- }
- }
- // ok, we got a value for frame.
- if (TableUtil.matchFrame(extractEdge(propertyName), frame)) {
- return ICSSPropertyID.VAL_OUTSET;
- }
- return ICSSPropertyID.VAL_NONE;
- }
-
- static String extractEdge(String propertyName) {
- if (ICSSPropertyID.ATTR_BORDER_BOTTOM_STYLE
- .equalsIgnoreCase(propertyName)) {
- return "bottom";
- } else if (ICSSPropertyID.ATTR_BORDER_LEFT_STYLE
- .equalsIgnoreCase(propertyName)) {
- return "left";
- } else if (ICSSPropertyID.ATTR_BORDER_RIGHT_STYLE
- .equalsIgnoreCase(propertyName)) {
- return "right";
- } else {
- return "top";
- }
- }
-
- /**
- * @param propertyName
- * @return true if property name is a border style
- */
- public static boolean isBorderStyle(String propertyName) {
- return ICSSPropertyID.ATTR_BORDER_BOTTOM_STYLE
- .equalsIgnoreCase(propertyName)
- || ICSSPropertyID.ATTR_BORDER_LEFT_STYLE
- .equalsIgnoreCase(propertyName)
- || ICSSPropertyID.ATTR_BORDER_RIGHT_STYLE
- .equalsIgnoreCase(propertyName)
- || ICSSPropertyID.ATTR_BORDER_TOP_STYLE
- .equalsIgnoreCase(propertyName);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/BorderWidthMeta.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/BorderWidthMeta.java
deleted file mode 100644
index 4a2d68c..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/BorderWidthMeta.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.property;
-
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.value.Length;
-import org.eclipse.jst.pagedesigner.utils.DOMUtil;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.css.CSSValue;
-
-/**
- *
- * @author mengbo
- */
-// FIXME: when the border-style is none, how should we treat border-width?
-public class BorderWidthMeta extends LengthMeta {
-
- private static final Length LENGTH_4 = new Length(4, false);
-
- static final String[] KEYWORDS = new String[] { ICSSPropertyID.VAL_AUTO,
- ICSSPropertyID.VAL_THIN, ICSSPropertyID.VAL_MEDIUM,
- ICSSPropertyID.VAL_THICK };
-
- /**
- */
- public BorderWidthMeta() {
- super(false, LENGTH_4); // medium length.
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.LengthMeta#getKeywordValues()
- */
- protected String[] getKeywordValues() {
- return KEYWORDS;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#getPercentageType()
- */
- public int getPercentageType() {
- return PERCENTAGE_NONE;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.LengthMeta#calculateCSSValueResult(org.w3c.dom.css.CSSValue,
- * java.lang.String,
- * org.eclipse.jst.pagedesigner.css2.style.AbstractStyle)
- */
- public Object calculateCSSValueResult(CSSValue value, String propertyName,
- ICSSStyle style) {
- // Computed value: absolute length; '0' if the border style is 'none' or
- // 'hidden'
- Object stylevalue = style.getStyleProperty("border-"
- + extractEdge(propertyName) + "-style");
- if (ICSSPropertyID.VAL_NONE.equals(stylevalue)
- || ICSSPropertyID.VAL_HIDDEN.equals(stylevalue)) {
- return Length.LENGTH_0;
- }
-
- Object obj = super.calculateCSSValueResult(value, propertyName, style);
- if (ICSSPropertyID.VAL_THIN.equals(obj)) {
- return Length.LENGTH_1;
- } else if (ICSSPropertyID.VAL_MEDIUM.equals(obj)) {
- return Length.LENGTH_3;
- } else if (ICSSPropertyID.VAL_THICK.equals(obj)) {
- return Length.LENGTH_8;
- }
- return obj;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#calculateHTMLAttributeOverride(org.w3c.dom.Element,
- * java.lang.String, java.lang.String,
- * org.eclipse.jst.pagedesigner.css2.ICSSStyle)
- */
- public Object calculateHTMLAttributeOverride(Element element,
- String htmltag, String propertyName, ICSSStyle style) {
- if ("table".equalsIgnoreCase(htmltag)) {
- return calculateTableOverride(element, propertyName);
- } else if ("td".equalsIgnoreCase(htmltag)
- || "th".equalsIgnoreCase(htmltag)) {
- return calculateTDOverride(element, propertyName);
- } else if ("img".equalsIgnoreCase(htmltag)) {
- String border = DOMUtil.getAttributeIgnoreCase(element, "border");// ICSSPropertyID.ATTR_BORDERSIZE);
- if (border != null) {
- try {
- return new Length(Integer.parseInt(border), false);
- } catch (Exception ex) {
- // Integer processing, no need to report.
- }
- }
- }
-
- return super.calculateHTMLAttributeOverride(element, htmltag,
- propertyName, style);
- }
-
- /**
- * @param element
- * @param propertyName
- * @return
- */
- private Object calculateTDOverride(Element element, String propertyName) {
- // find containing table first
- Node parent = element;
- Element tableEle = null;
- while ((parent = parent.getParentNode()) != null
- && parent instanceof Element) {
- if (((Element) parent).getTagName().equalsIgnoreCase("table")) {
- tableEle = (Element) parent;
- break;
- }
-
- }
- if (tableEle != null) {
- String rules = DOMUtil.getAttributeIgnoreCase(tableEle, "rules");
- String borderstr = DOMUtil.getAttributeIgnoreCase(tableEle,
- "border");
- if (rules == null || rules.length() == 0) {
- if (borderstr == null || "0".equals(borderstr.trim())) {
- return null;
- }
- return Length.LENGTH_1;
- }
- // ok, we got a value for rules
- if (TableUtil.matchRules(extractEdge(propertyName), rules)) {
- return Length.LENGTH_1;
- }
- return Length.LENGTH_0;
- }
- return Length.LENGTH_0;
- }
-
- /**
- * @param element
- * @param propertyName
- * @return
- */
- private Object calculateTableOverride(Element element, String propertyName) {
- String frame = DOMUtil.getAttributeIgnoreCase(element, "frame");
- String borderstr = DOMUtil.getAttributeIgnoreCase(element, "border");
- // border="0" implies frame="void"
- if ("0".equals(borderstr)) {
- return Length.LENGTH_0;
- }
- if (frame == null || frame.length() == 0) {
- if (borderstr == null) {
- return null;
- } else if (borderstr.trim().length() == 0) {
- return Length.LENGTH_1;
- } else {
- try {
- return new Length(Integer.parseInt(borderstr), false);
- } catch (Exception ex) {
- frame = borderstr;
- }
- }
- }
- // ok, we got a value for frame.
- if (TableUtil.matchFrame(extractEdge(propertyName), frame)) {
- if (borderstr != null) {
- try {
- return new Length(Integer.parseInt(borderstr), false);
- } catch (Exception ex) {
- // ignore. pass through to return length_1
- }
- }
- return Length.LENGTH_1;
- }
- return Length.LENGTH_0;
- }
-
- static String extractEdge(String propertyName) {
- if (ICSSPropertyID.ATTR_BORDER_BOTTOM_WIDTH
- .equalsIgnoreCase(propertyName)) {
- return "bottom";
- } else if (ICSSPropertyID.ATTR_BORDER_LEFT_WIDTH
- .equalsIgnoreCase(propertyName)) {
- return "left";
- } else if (ICSSPropertyID.ATTR_BORDER_RIGHT_WIDTH
- .equalsIgnoreCase(propertyName)) {
- return "right";
- } else {
- return "top";
- }
- }
-
- /**
- * @param propertyName
- * @return true if property name is a border width
- */
- public static boolean isBorderWidth(String propertyName) {
- return ICSSPropertyID.ATTR_BORDER_BOTTOM_WIDTH
- .equalsIgnoreCase(propertyName)
- || ICSSPropertyID.ATTR_BORDER_LEFT_WIDTH
- .equalsIgnoreCase(propertyName)
- || ICSSPropertyID.ATTR_BORDER_RIGHT_WIDTH
- .equalsIgnoreCase(propertyName)
- || ICSSPropertyID.ATTR_BORDER_TOP_WIDTH
- .equalsIgnoreCase(propertyName);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#getInitialValue(java.lang.String,
- * org.eclipse.jst.pagedesigner.css2.ICSSStyle)
- */
- public Object getInitialValue(String propertyName, ICSSStyle style) {
- // Computed value: absolute length; '0' if the border style is 'none' or
- // 'hidden'
- Object stylevalue = style.getStyleProperty("border-"
- + extractEdge(propertyName) + "-style");
- if (ICSSPropertyID.VAL_NONE.equals(stylevalue)
- || ICSSPropertyID.VAL_HIDDEN.equals(stylevalue)) {
- return Length.LENGTH_0;
- }
- return super.getInitialValue(propertyName, style);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/CSSMetaRegistry.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/CSSMetaRegistry.java
deleted file mode 100644
index 670f3dd..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/CSSMetaRegistry.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.property;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author mengbo
- */
-public class CSSMetaRegistry {
- Map _map = new HashMap();
-
- private static CSSMetaRegistry _instance;
-
- private CSSMetaRegistry() {
- initialize();
- }
-
- /**
- * class initiallizer
- */
- private void initialize() {
- _map.put(ICSSPropertyID.ATTR_DISPLAY, new DisplayMeta());
- _map.put(ICSSPropertyID.ATTR_TEXTALIGN, new TextAlignMeta());
- _map.put(ICSSPropertyID.ATTR_HORIZONTAL_ALIGN,
- new HorizontalAlignMeta());
- _map.put(ICSSPropertyID.ATTR_TEXTDECORATION, new TextDecorationMeta());
- _map.put(ICSSPropertyID.ATTR_WHITESPACE, new WhiteSpaceMeta());
- _map.put(ICSSPropertyID.ATTR_WIDTH, new WidthMeta());
- _map.put(ICSSPropertyID.ATTR_MIN_WIDTH, new WidthMeta());
- _map.put(ICSSPropertyID.ATTR_HEIGHT, new HeightMeta());
- _map.put(ICSSPropertyID.ATTR_MIN_HEIGHT, new HeightMeta());
-
- _map.put(ICSSPropertyID.ATTR_BORDER_LEFT_WIDTH, new BorderWidthMeta());
- _map.put(ICSSPropertyID.ATTR_BORDER_RIGHT_WIDTH, new BorderWidthMeta());
- _map
- .put(ICSSPropertyID.ATTR_BORDER_BOTTOM_WIDTH,
- new BorderWidthMeta());
- _map.put(ICSSPropertyID.ATTR_BORDER_TOP_WIDTH, new BorderWidthMeta());
-
- _map.put(ICSSPropertyID.ATTR_BORDER_LEFT_STYLE, new BorderStyleMeta());
- _map.put(ICSSPropertyID.ATTR_BORDER_RIGHT_STYLE, new BorderStyleMeta());
- _map
- .put(ICSSPropertyID.ATTR_BORDER_BOTTOM_STYLE,
- new BorderStyleMeta());
- _map.put(ICSSPropertyID.ATTR_BORDER_TOP_STYLE, new BorderStyleMeta());
-
- _map.put(ICSSPropertyID.ATTR_BORDER_LEFT_COLOR, new BorderColorMeta());
- _map.put(ICSSPropertyID.ATTR_BORDER_RIGHT_COLOR, new BorderColorMeta());
- _map
- .put(ICSSPropertyID.ATTR_BORDER_BOTTOM_COLOR,
- new BorderColorMeta());
- _map.put(ICSSPropertyID.ATTR_BORDER_TOP_COLOR, new BorderColorMeta());
-
- _map.put(ICSSPropertyID.ATTR_PADDING_LEFT, new PaddingWidthMeta());
- _map.put(ICSSPropertyID.ATTR_PADDING_RIGHT, new PaddingWidthMeta());
- _map.put(ICSSPropertyID.ATTR_PADDING_BOTTOM, new PaddingWidthMeta());
- _map.put(ICSSPropertyID.ATTR_PADDING_TOP, new PaddingWidthMeta());
-
- _map.put(ICSSPropertyID.ATTR_MARGIN_LEFT, new MarginWidthMeta());
- _map.put(ICSSPropertyID.ATTR_MARGIN_RIGHT, new MarginWidthMeta());
- _map.put(ICSSPropertyID.ATTR_MARGIN_BOTTOM, new MarginWidthMeta());
- _map.put(ICSSPropertyID.ATTR_MARGIN_TOP, new MarginWidthMeta());
-
- _map.put(ICSSPropertyID.ATTR_FONT_FAMILY, new FontFamilyMeta());
- _map.put(ICSSPropertyID.ATTR_FONT_SIZE, new FontSizeMeta());
- _map.put(ICSSPropertyID.ATTR_FONT_STYLE, new FontStyleMeta());
- _map.put(ICSSPropertyID.ATTR_FONT_WEIGHT, new FontWeightMeta());
-
- _map.put(ICSSPropertyID.ATTR_BACKGROUND_COLOR,
- new BackgroundColorMeta());
- _map.put(ICSSPropertyID.ATTR_COLOR, new ColorPropertyMeta());
- _map.put(ICSSPropertyID.ATTR_TEXTCOLOR, new ColorPropertyMeta());
-
- _map.put(ICSSPropertyID.ATTR_BORDER_COLLAPSE, new BorderCollapseMeta());
- _map.put(ICSSPropertyID.ATTR_BORDER_SPACING, new BorderSpacingMeta());
-
- _map.put(ICSSPropertyID.ATTR_LIST_STYLE_TYPE, new ListStyleTypeMeta());
- _map
- .put(ICSSPropertyID.ATTR_LIST_STYLE_IMAGE,
- new ListStyleImageMeta());
- _map.put(ICSSPropertyID.ATTR_LIST_STYLE_POSITION,
- new ListStylePositionMeta());
- _map.put(ICSSPropertyID.ATTR_COUNTER_RESET, new CounterResetMeta());
- _map.put(ICSSPropertyID.ATTR_COUNTER_INCREMENT,
- new CounterIncrementMeta());
-
- _map.put(ICSSPropertyID.ATTR_TOP, new PositionOffsetMeta());
- _map.put(ICSSPropertyID.ATTR_RIGHT, new PositionOffsetMeta());
- _map.put(ICSSPropertyID.ATTR_BOTTOM, new PositionOffsetMeta());
- _map.put(ICSSPropertyID.ATTR_LEFT, new PositionOffsetMeta());
- _map.put(ICSSPropertyID.ATTR_POSITION, new PositionMeta());
-
- _map.put(ICSSPropertyID.ATTR_EMPTY_CELLS, new EmptyCellsMeta());
- _map.put(ICSSPropertyID.ATTR_VISIBILITY, new VisibilityMeta());
- _map.put(ICSSPropertyID.ATTR_VERTICAL_ALIGN, new VerticalAlignMeta());
-
- _map.put(ICSSPropertyID.ATTR_OVERFLOW, new OverflowMeta());
- }
-
- /**
- * @param property
- * @return the meta
- */
- public ICSSPropertyMeta getMeta(String property) {
- return (ICSSPropertyMeta) _map.get(property);
- }
-
- /**
- * @return the singleton instance
- */
- public static final CSSMetaRegistry getInstance() {
- if (_instance == null) {
- _instance = new CSSMetaRegistry();
- }
- return _instance;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/CSSPropertyMeta.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/CSSPropertyMeta.java
deleted file mode 100644
index ad426a4..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/CSSPropertyMeta.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.property;
-
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.w3c.dom.Element;
-import org.w3c.dom.css.CSSValue;
-
-/**
- * @author mengbo
- */
-public abstract class CSSPropertyMeta implements ICSSPropertyMeta {
- static final String[] EMPTY_KEYWORDS = new String[0];
-
- boolean _inherited;
-
- Object _initialValue;
-
- /**
- * @param inherit
- * @param initvalue
- */
- public CSSPropertyMeta(boolean inherit, Object initvalue) {
- this._inherited = inherit;
- this._initialValue = initvalue;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyMeta#isInherited()
- */
- public boolean isInherited() {
- return _inherited;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyMeta#getHTMLElementInitialValue(org.w3c.dom.Element,
- * java.lang.String, java.lang.String)
- */
- public Object getHTMLElementInitialValue(Element element, String htmltag,
- String propertyName) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyMeta#getInitialValue()
- */
- public Object getInitialValue(String propertyName, ICSSStyle style) {
- return _initialValue;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyMeta#getPercentageType()
- */
- public int getPercentageType() {
- return PERCENTAGE_NONE;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyMeta#calculateHTMLAttributeOverride(org.w3c.dom.Element,
- * java.lang.String, java.lang.String,
- * org.eclipse.jst.pagedesigner.css2.ICSSStyle)
- */
- public Object calculateHTMLAttributeOverride(Element element,
- String htmltag, String propertyName, ICSSStyle style) {
- // child class should override this method!!!
- return null;
- }
-
- /**
- * for many properties, they have a set of keyword property values.
- *
- * @return the keyword values
- */
- protected abstract String[] getKeywordValues();
-
- /**
- * @param value
- * @return null if is not a keyword.
- */
- protected String checkKeywordValues(String value) {
- if (value == null)
- return null;
- String[] keywords = getKeywordValues();
- if (keywords != null) {
- for (int i = 0; i < keywords.length; i++) {
- if (keywords[i].equalsIgnoreCase(value)) {
- return keywords[i];
- }
- }
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyMeta#calculateCSSValueResult(org.w3c.dom.css.CSSValue,
- * java.lang.String,
- * org.eclipse.jst.pagedesigner.css2.property.AbstractStyle)
- */
- public Object calculateCSSValueResult(CSSValue value, String propertyName,
- ICSSStyle style) {
- String s = checkKeywordValues(value.getCssText());
- if (s != null) {
- return s;
- }
- return this.getInitialValue(propertyName, style);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/ColorPropertyMeta.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/ColorPropertyMeta.java
deleted file mode 100644
index 8562288..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/ColorPropertyMeta.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.property;
-
-import java.util.Arrays;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.color.CSSColorManager;
-import org.eclipse.jst.pagedesigner.utils.DOMUtil;
-import org.w3c.dom.Element;
-import org.w3c.dom.css.CSSValue;
-
-/**
- * "color" will be in this type
- *
- * @author mengbo
- */
-public class ColorPropertyMeta extends CSSPropertyMeta {
- private static final Object DEFAULT_COLOR = ColorConstants.black;
-
- private static final String[] KEYWORDS = new String[] {};
-
- private final static String[] NOTSUPPORT_TAG = { IHTMLConstants.TAG_H1,
- IHTMLConstants.TAG_H2, IHTMLConstants.TAG_H3,
- IHTMLConstants.TAG_H4, IHTMLConstants.TAG_H5, IHTMLConstants.TAG_H6 };
-
- /**
- */
- public ColorPropertyMeta() {
- super(true, DEFAULT_COLOR);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyMeta#calculateCSSValueResult(org.w3c.dom.css.CSSValue,
- * java.lang.String,
- * org.eclipse.jst.pagedesigner.css2.property.AbstractStyle)
- */
- public Object calculateCSSValueResult(CSSValue value, String propertyName,
- ICSSStyle style) {
-
- String text = value.getCssText();
- Object result = CSSColorManager.getInstance().getColor(text);
- if (result != null) {
- return result;
- }
- return this.getInitialValue(propertyName, style);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#getKeywordValues()
- */
- protected String[] getKeywordValues() {
- return KEYWORDS;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyMeta#calculateHTMLAttributeOverride(org.w3c.dom.Element,
- * java.lang.String, java.lang.String,
- * org.eclipse.jst.pagedesigner.css2.ICSSStyle)
- */
- public Object calculateHTMLAttributeOverride(Element element,
- String htmltag, String propertyName, ICSSStyle style) {
- if (Arrays.asList(NOTSUPPORT_TAG).contains(htmltag.toLowerCase())) {
- return null;
- }
- Object result;
- String colorAttr = null;
- // There are some conditions need to be dealt with hyperlink and text
- // properties.
- if (ICSSPropertyID.ATTR_COLOR.equalsIgnoreCase(propertyName)) {
- colorAttr = DOMUtil.getAttributeIgnoreCase(element,
- ICSSPropertyID.ATTR_COLOR);
- if (colorAttr == null
- && element.getLocalName().equalsIgnoreCase(
- IHTMLConstants.TAG_BODY)) {
- colorAttr = DOMUtil.getAttributeIgnoreCase(element,
- ICSSPropertyID.ATTR_TEXT);
- }
- }
- if (colorAttr != null) {
- colorAttr = colorAttr.trim();
- result = CSSColorManager.getInstance().getColor(colorAttr);
- return result;
- }
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/ContentMeta.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/ContentMeta.java
deleted file mode 100644
index 0b190e9..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/ContentMeta.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.property;
-
-/**
- * @author mengbo
- */
-public class ContentMeta extends CSSPropertyMeta {
- /**
- */
- public ContentMeta() {
- // why inherit this??
- super(false, null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#getKeywordValues()
- */
- protected String[] getKeywordValues() {
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/CounterIncrementMeta.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/CounterIncrementMeta.java
deleted file mode 100644
index 660c822..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/CounterIncrementMeta.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.property;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.list.CounterHelper;
-import org.eclipse.jst.pagedesigner.css2.list.IncrementObject;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPrimitiveValue;
-import org.w3c.dom.css.CSSValue;
-
-/**
- * For CounterIncrementMeta, the valid value could be the following: 1. NULL 2.
- * NOT_SPECIFIED 3. a List of IncrementObject.
- *
- * @author mengbo
- */
-public class CounterIncrementMeta extends CSSPropertyMeta {
- /**
- *
- */
- public CounterIncrementMeta() {
- super(false, null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#getKeywordValues()
- */
- protected String[] getKeywordValues() {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyMeta#calculateCSSValueResult(org.w3c.dom.css.CSSValue,
- * java.lang.String,
- * org.eclipse.jst.pagedesigner.css2.style.AbstractStyle)
- */
- public Object calculateCSSValueResult(CSSValue value, String propertyName,
- ICSSStyle style) {
- return getCounter(value);
- }
-
- /**
- * @param value
- * @return the counter
- */
- public List getCounter(CSSValue value) {
- if (value == null) {
- return null;
- }
- List result = new ArrayList();
- IncrementObject incrementObject = null;
- String identifier = null;
- Integer increment = null;
- ICSSNode cssValue = (ICSSNode) value;
- while (cssValue != null) {
- // find next idetifier.
- while (cssValue != null && !CounterHelper.isIdentifier(cssValue)) {
- cssValue = cssValue.getNextSibling();
- }
- if (cssValue == null) {
- return null;
- }
- // identifier:
- identifier = ((ICSSPrimitiveValue) value).getStringValue();
- cssValue = cssValue.getNextSibling();
- // value:
- if (CounterHelper.isNumber(cssValue)) {
- increment = new Integer((int) ((ICSSPrimitiveValue) value)
- .getFloatValue(ICSSPrimitiveValue.CSS_INTEGER));
- }
-
- if (identifier != null) {
- incrementObject = new IncrementObject(identifier, increment);
- result.add(incrementObject);
- }
- }
- return result;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/CounterResetMeta.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/CounterResetMeta.java
deleted file mode 100644
index ac51249..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/CounterResetMeta.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.property;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.list.CounterHelper;
-import org.eclipse.jst.pagedesigner.css2.list.ResetObject;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPrimitiveValue;
-import org.w3c.dom.css.CSSValue;
-
-/**
- * @author mengbo
- */
-public class CounterResetMeta extends CSSPropertyMeta {
- /**
- *
- */
- public CounterResetMeta() {
- super(false, null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#getKeywordValues()
- */
- protected String[] getKeywordValues() {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyMeta#calculateCSSValueResult(org.w3c.dom.css.CSSValue,
- * java.lang.String,
- * org.eclipse.jst.pagedesigner.css2.style.AbstractStyle)
- */
- public Object calculateCSSValueResult(CSSValue value, String propertyName,
- ICSSStyle style) {
- return getCounter(value);
- }
-
- /**
- * @param value
- * @return the counter
- */
- public List getCounter(CSSValue value) {
- if (value == null) {
- return null;
- }
- List result = new ArrayList();
- ResetObject resetObject = null;
- String identifier = null;
- Integer initial = null;
- ICSSNode cssValue = (ICSSNode) value;
- while (cssValue != null) {
- // find next idetifier.
- while (cssValue != null && !CounterHelper.isIdentifier(cssValue)) {
- cssValue = cssValue.getNextSibling();
- }
- if (cssValue == null) {
- return null;
- }
- // identifier:
- identifier = ((ICSSPrimitiveValue) value).getStringValue();
- cssValue = cssValue.getNextSibling();
- // value:
- if (CounterHelper.isNumber(cssValue)) {
- initial = new Integer((int) ((ICSSPrimitiveValue) value)
- .getFloatValue(ICSSPrimitiveValue.CSS_INTEGER));
- }
-
- if (identifier != null) {
- resetObject = new ResetObject(identifier, initial);
- result.add(resetObject);
- }
- }
- return result;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/DisplayMeta.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/DisplayMeta.java
deleted file mode 100644
index 8997129..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/DisplayMeta.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.property;
-
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.w3c.dom.css.CSSValue;
-
-/**
- * @author mengbo
- */
-public class DisplayMeta extends CSSPropertyMeta {
- static final String[] KEYWORDS = new String[] { ICSSPropertyID.VAL_INLINE,
- ICSSPropertyID.VAL_BLOCK, ICSSPropertyID.VAL_INLINE_BLOCK,
- ICSSPropertyID.VAL_LIST_ITEM, ICSSPropertyID.VAL_RUN_IN,
- ICSSPropertyID.VAL_COMPACT, ICSSPropertyID.VAL_MARKER,
- ICSSPropertyID.VAL_TABLE, ICSSPropertyID.VAL_INLINE_TABLE,
- ICSSPropertyID.VAL_TABLE_ROW_GROUP,
- ICSSPropertyID.VAL_TABLE_HEADER_GROUP,
- ICSSPropertyID.VAL_TABLE_FOOTER_GROUP,
- ICSSPropertyID.VAL_TABLE_ROW,
- ICSSPropertyID.VAL_TABLE_COLUMN_GROUP,
- ICSSPropertyID.VAL_TABLE_COLUMN, ICSSPropertyID.VAL_TABLE_CELL,
- ICSSPropertyID.VAL_TABLE_CAPTION, ICSSPropertyID.VAL_NONE };
-
- /**
- */
- public DisplayMeta() {
- super(false, ICSSPropertyID.VAL_INLINE);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#getKeywordValues()
- */
- protected String[] getKeywordValues() {
- return KEYWORDS;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyMeta#calculateCSSValueResult(org.w3c.dom.css.CSSValue,
- * java.lang.String,
- * org.eclipse.jst.pagedesigner.css2.property.AbstractStyle)
- */
- public Object calculateCSSValueResult(CSSValue value, String propertyName,
- ICSSStyle style) {
- String text = value.getCssText();
- if (text == null)
- return ICSSPropertyID.VAL_INLINE;
- String key = this.checkKeywordValues(text);
- if (key != null)
- return key;
- return ICSSPropertyID.VAL_INLINE;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/EmptyCellsMeta.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/EmptyCellsMeta.java
deleted file mode 100644
index b2d5654..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/EmptyCellsMeta.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.property;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class EmptyCellsMeta extends CSSPropertyMeta {
- private static final String SHOW = "show";
-
- static final String HIDE = "hide";
-
- private static final String[] _keywords = new String[] { SHOW, HIDE };
-
- /**
- */
- public EmptyCellsMeta() {
- // FIXME: on CSS spec, initial value should be "show".
- // but seemed IE's default is hide.
- super(true, HIDE);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#getKeywordValues()
- */
- protected String[] getKeywordValues() {
- return _keywords;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/FloatInfo.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/FloatInfo.java
deleted file mode 100644
index 6758aa3..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/FloatInfo.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.property;
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPrimitiveValue;
-import org.w3c.dom.css.CSSPrimitiveValue;
-
-/**
- * copied from wtp's internal code.
- *
- * @author mengbo
- */
-public final class FloatInfo {
- /**
- * @param text
- */
- public FloatInfo(String text) {
- parse(text);
- }
-
- /**
- *
- */
- void parse(String text) {
- StringBuffer bufValue = new StringBuffer();
- StringBuffer bufIdent = new StringBuffer();
- boolean bNum = true;
- int len = text.length();
- for (int i = 0; i < len; i++) {
- char c = text.charAt(i);
- if (bNum) {
- if ('0' <= c && c <= '9' || c == '.' || c == '+' || c == '-') {
- bufValue.append(c);
- } else {
- bufIdent.append(c);
- bNum = false;
- }
- } else {
- bufIdent.append(c);
- }
- }
- String valueStr = bufValue.toString();
- _value = Float.valueOf(valueStr).floatValue();
- _identifier = bufIdent.toString();
- _type = getFloatValueType(valueStr, _identifier);
- }
-
- /**
- * @return the value
- *
- */
- public float getValue() {
- return _value;
- }
-
- /**
- *
- */
- String getIdentifier() {
- return _identifier;
- }
-
- /**
- * @return the value type
- */
- public short getValueType() {
- return _type;
- }
-
- /**
- *
- */
- static short getFloatValueType(String value, String ident) {
- ident = ident.toLowerCase();
- short valueType;
- if (ident.length() == 0) {
- if (0 <= value.indexOf('.')) {
- valueType = CSSPrimitiveValue.CSS_NUMBER;
- } else {
- valueType = ICSSPrimitiveValue.CSS_INTEGER;
- }
- } else if (ident.equals("%")) {
- //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_PERCENTAGE;
- } else if (ident.equalsIgnoreCase("em")) {
- //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_EMS;
- } else if (ident.equalsIgnoreCase("ex")) {
- //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_EXS;
- } else if (ident.equalsIgnoreCase("px")) {
- //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_PX;
- } else if (ident.equalsIgnoreCase("cm")) {
- //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_CM;
- } else if (ident.equalsIgnoreCase("mm")) {
- //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_MM;
- } else if (ident.equalsIgnoreCase("in")) {
- //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_IN;
- } else if (ident.equalsIgnoreCase("pt")) {
- //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_PT;
- } else if (ident.equalsIgnoreCase("pc")) {
- //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_PC;
- } else if (ident.equalsIgnoreCase("deg")) {
- //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_DEG;
- } else if (ident.equalsIgnoreCase("rad")) {
- //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_RAD;
- } else if (ident.equalsIgnoreCase("grad")) {
- //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_GRAD;
- } else if (ident.equalsIgnoreCase("ms")) {
- //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_MS;
- } else if (ident.equalsIgnoreCase("s")) {
- //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_S;
- } else if (ident.equalsIgnoreCase("hz")) {
- //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_HZ;
- } else if (ident.equalsIgnoreCase("khz")) {
- //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_KHZ;
- } else {
- valueType = CSSPrimitiveValue.CSS_DIMENSION;
- }
- return valueType;
- }
-
- private float _value = 0.0f;
-
- private String _identifier = null;
-
- private short _type = CSSPrimitiveValue.CSS_UNKNOWN;
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/FontFamilyMeta.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/FontFamilyMeta.java
deleted file mode 100644
index c54b41d..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/FontFamilyMeta.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.property;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.StringTokenizer;
-
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.utils.DOMUtil;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.widgets.Display;
-import org.w3c.dom.Element;
-import org.w3c.dom.css.CSSValue;
-import org.w3c.dom.css.CSSValueList;
-
-/**
- * @author mengbo
- */
-public class FontFamilyMeta extends CSSPropertyMeta {
- /**
- * the default font name
- */
- public static final String DEFAULT_FONT = "Times New Roman";
-
- private static FontData[] _FontData;
-
- private static FontData[] getFontData() {
- if (_FontData == null) {
- ArrayList list = new ArrayList();
- list.addAll(Arrays.asList(Display.getCurrent().getFontList(null,
- false)));
- list.addAll(Arrays.asList(Display.getCurrent().getFontList(null,
- true)));
- _FontData = (FontData[]) list.toArray(new FontData[list.size()]);
- }
- return _FontData;
- }
-
- /**
- */
- public FontFamilyMeta() {
- super(true, DEFAULT_FONT);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#getKeywordValues()
- */
- protected String[] getKeywordValues() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#calculateCSSValueResult(org.w3c.dom.css.CSSValue,
- * java.lang.String,
- * org.eclipse.jst.pagedesigner.css2.style.AbstractStyle)
- */
- public Object calculateCSSValueResult(CSSValue value, String propertyName,
- ICSSStyle style) {
- if (value.getCssValueType() == CSSValue.CSS_VALUE_LIST) {
- CSSValueList valueList = (CSSValueList) value;
- for (int i = 0, count = valueList.getLength(); i < count; i++) {
- String name = valueList.item(i).getCssText();
- name = trimPadding(name);
- if (isSupportedFont(name)) {
- return name;
- }
- }
- }
- return trimPadding(value.getCssText());
- }
-
- private String trimPadding(String name) {
- String value = name;
- if (value != null) {
- value = value.replaceAll("\"", "");
- value = value.replaceAll("'", "");
- }
- return value;
- }
-
- private boolean isSupportedFont(String name) {
- FontData[] fontData = getFontData();
- for (int i = 0; i < fontData.length; i++) {
- if (fontData[i].getName().equalsIgnoreCase(name)) {
- return true;
- }
- }
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#calculateHTMLAttributeOverride(org.w3c.dom.Element,
- * java.lang.String, java.lang.String,
- * org.eclipse.jst.pagedesigner.css2.ICSSStyle)
- */
- public Object calculateHTMLAttributeOverride(Element element,
- String htmltag, String propertyName, ICSSStyle style) {
- if ("FONT".equalsIgnoreCase(htmltag)
- || "BASEFONT".equalsIgnoreCase(htmltag)) {
- String face = DOMUtil.getAttributeIgnoreCase(element, "face");
- if (face != null) {
- String[] names = getFontNameList(face);
- for (int i = 0; i < names.length; i++) {
- if (isSupportedFont(names[i])) {
- return names[i];
- }
- }
- } else {
- return null;
- }
- }
- return null;
- }
-
- private String[] getFontNameList(String face) {
- StringTokenizer tokenizer = new StringTokenizer(face, ",");
- String[] names = new String[tokenizer.countTokens()];
- for (int i = 0; i < names.length; i++) {
- names[i] = trimPadding(tokenizer.nextToken());
- }
- return names;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/FontSizeMeta.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/FontSizeMeta.java
deleted file mode 100644
index 498e52a..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/FontSizeMeta.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.property;
-
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.font.ICSSFont;
-import org.eclipse.jst.pagedesigner.css2.value.Length;
-import org.eclipse.jst.pagedesigner.utils.DOMUtil;
-import org.w3c.dom.Element;
-import org.w3c.dom.css.CSSValue;
-
-/**
- * The result value should be Length object only.
- *
- * @author mengbo
- */
-// XXX: in the future, we may add "unit" into Length, the one unit will be
-// "MEDIUM"
-// and specific for font. Means the relative size to MEDIUM. Then it is possible
-// for
-// the caller to decide the actual font size based on the style specific MEDIUM
-// size.
-public class FontSizeMeta extends LengthMeta {
- private static final String[] KEYWORDS = { ICSSPropertyID.VAL_XX_SMALL,
- ICSSPropertyID.VAL_X_SMALL, ICSSPropertyID.VAL_SMALL,
- ICSSPropertyID.VAL_MEDIUM, ICSSPropertyID.VAL_LARGE,
- ICSSPropertyID.VAL_X_LARGE, ICSSPropertyID.VAL_XX_LARGE,
- ICSSPropertyID.VAL_LARGER, ICSSPropertyID.VAL_SMALLER };
-
- /**
- * font size
- */
- public static final double MEDIUM_VAL_INT = 16;
-
- private static final double SCALING_FACTOR = 1.2;
-
- private static final double FACTORS[] = { 0.6, 0.89, 1, 1.2, 1.5, 2.0, 3.0 };
-
- // The scaling factors in IE is different from CSS definition. Here we
- // follow IE.
- private static final double CSS_ABSOLUTE_FACTORS[] = { 0.63, 0.82, 1, 1.12,
- 1.5, 2.0, 3.0 };
-
- private static final int MIN_SIZE_FOR_SMALLER = 1;
-
- private static final int MIN_SIZE_FOR_LARGER = 9;
-
- /**
- * Default constructor
- */
- public FontSizeMeta() {
- super(true, new Length((int) MEDIUM_VAL_INT, false));
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.LengthMeta#getBaseFont(org.eclipse.jst.pagedesigner.css2.property.AbstractStyle)
- */
- protected ICSSFont getBaseFont(ICSSStyle style) {
- return style.getParentStyle().getCSSFont();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#getKeywordValues()
- */
- protected String[] getKeywordValues() {
- return KEYWORDS;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#getPercentageType()
- */
- public int getPercentageType() {
- return PERCENTAGE_FONT;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.LengthMeta#calculateCSSValueResult(org.w3c.dom.css.CSSValue,
- * java.lang.String,
- * org.eclipse.jst.pagedesigner.css2.style.AbstractStyle)
- */
- public Object calculateCSSValueResult(CSSValue value, String propertyName,
- ICSSStyle style) {
- Object obj = super.calculateCSSValueResult(value, propertyName, style);
- if (obj instanceof Length) {
- return obj;
- }
- // otherwise, it is keyword.
- return convertKeyword(obj, style);
- }
-
- /**
- * @param fontsizeobj
- * @param style
- * @return the length
- */
- protected Length convertKeyword(Object fontsizeobj, ICSSStyle style) {
- int fontsize;
- int parentfontsize = style.getParentStyle().getCSSFont().getFontSize();
- if (fontsizeobj instanceof Length) {
- fontsize = ((Length) fontsizeobj).getValue();
- } else if (ICSSPropertyID.VAL_XX_SMALL.equals(fontsizeobj)) {
- fontsize = (int) (MEDIUM_VAL_INT * CSS_ABSOLUTE_FACTORS[0]);
- } else if (ICSSPropertyID.VAL_X_SMALL.equals(fontsizeobj)) {
- fontsize = (int) (MEDIUM_VAL_INT * CSS_ABSOLUTE_FACTORS[1]);
- } else if (ICSSPropertyID.VAL_SMALL.equals(fontsizeobj)) {
- fontsize = (int) (MEDIUM_VAL_INT * CSS_ABSOLUTE_FACTORS[2]);
- } else if (ICSSPropertyID.VAL_MEDIUM.equals(fontsizeobj)) {
- fontsize = (int) Math.round(MEDIUM_VAL_INT
- * CSS_ABSOLUTE_FACTORS[3]);
- } else if (ICSSPropertyID.VAL_LARGE.equals(fontsizeobj)) {
- fontsize = (int) (MEDIUM_VAL_INT * CSS_ABSOLUTE_FACTORS[4]);
- } else if (ICSSPropertyID.VAL_X_LARGE.equals(fontsizeobj)) {
- fontsize = (int) (MEDIUM_VAL_INT * CSS_ABSOLUTE_FACTORS[5]);
- } else if (ICSSPropertyID.VAL_XX_LARGE.equals(fontsizeobj)) {
- fontsize = (int) (MEDIUM_VAL_INT * CSS_ABSOLUTE_FACTORS[6]);
- } else if (ICSSPropertyID.VAL_SMALLER.equals(fontsizeobj)) {
- fontsize = (int) (parentfontsize / SCALING_FACTOR);
- if (fontsize < MIN_SIZE_FOR_SMALLER) {
- fontsize = MIN_SIZE_FOR_SMALLER;
- }
- } else if (ICSSPropertyID.VAL_LARGER.equals(fontsizeobj)) {
- fontsize = (int) (parentfontsize * SCALING_FACTOR);
- if (fontsize < MIN_SIZE_FOR_LARGER) {
- fontsize = MIN_SIZE_FOR_LARGER;
- }
- } else {
- fontsize = parentfontsize;
- }
-
- return new Length(fontsize, false);
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#calculateHTMLAttributeOverride(org.w3c.dom.Element,
- * java.lang.String, java.lang.String,
- * org.eclipse.jst.pagedesigner.css2.ICSSStyle)
- */
- public Object calculateHTMLAttributeOverride(Element element,
- String htmltag, String propertyName, ICSSStyle style) {
- if (IHTMLConstants.TAG_FONT.equalsIgnoreCase(htmltag)
- || ICSSPropertyID.ATTR_BASEFONT.equalsIgnoreCase(htmltag)) {
- String size = DOMUtil.getAttributeIgnoreCase(element,
- ICSSPropertyID.ATTR_SIZE);
- if (size != null) {
- size = size.trim();
- try {
- int fontSize = 0;
- if (size.startsWith("+")) //$NON-NLS-1$
- {
- fontSize = Integer.parseInt(size.substring(1)) + 3;
- } else if (size.startsWith("-")) //$NON-NLS-1$
- {
- fontSize = 3 - Integer.parseInt(size.substring(1));
- } else {
- fontSize = Integer.parseInt(size);
- }
- if (fontSize < 1) {
- fontSize = 1;
- }
- if (fontSize > 7) {
- fontSize = 7;
- }
- return new Length((int) (Math.round(FACTORS[fontSize - 1]
- * MEDIUM_VAL_INT)), false);
- } catch (Exception ex) {
- // Error in tag font attr calculating.
- // _log.error("Error.FontSizeMeta.0", ex); //$NON-NLS-1$
- return null;
- }
- }
- }
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/FontStyleMeta.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/FontStyleMeta.java
deleted file mode 100644
index 7d46ab2..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/FontStyleMeta.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.property;
-
-/**
- * @author mengbo
- */
-public class FontStyleMeta extends CSSPropertyMeta {
- static final String[] KEYWORDS = new String[] { ICSSPropertyID.VAL_NORMAL,
- ICSSPropertyID.VAL_ITALIC, ICSSPropertyID.VAL_OBLIQUE };
-
- /**
- * Default constructor
- */
- public FontStyleMeta() {
- super(true, ICSSPropertyID.VAL_NORMAL);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#getKeywordValues()
- */
- protected String[] getKeywordValues() {
- return KEYWORDS;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/FontWeightMeta.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/FontWeightMeta.java
deleted file mode 100644
index 3b333e9..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/FontWeightMeta.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.property;
-
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.w3c.dom.css.CSSValue;
-
-/**
- * The result value will always be integer, range 100-900 This class has already
- * translate things like "normal", "bold", "bolder", "lighter" into integer
- * value.
- *
- * @author mengbo
- */
-public class FontWeightMeta extends CSSPropertyMeta {
-
- /**
- * normal weight value
- */
- public static final Integer NORMAL_WEIGHT = new Integer(400);
-
- private static final Integer BOLD_WEIGHT = new Integer(700);
-
- private static final String[] KEYWORDS = new String[] { ICSSPropertyID.VAL_NORMAL,
- ICSSPropertyID.VAL_BOLD, ICSSPropertyID.VAL_BOLDER,
- ICSSPropertyID.VAL_LIGHTER };
-
-
- /**
- * Default constructor
- */
- public FontWeightMeta() {
- super(true, NORMAL_WEIGHT);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#getKeywordValues()
- */
- protected String[] getKeywordValues() {
- return KEYWORDS;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#calculateCSSValueResult(org.w3c.dom.css.CSSValue,
- * java.lang.String,
- * org.eclipse.jst.pagedesigner.css2.style.AbstractStyle)
- */
- public Object calculateCSSValueResult(CSSValue value, String propertyName,
- ICSSStyle style) {
- String text = value.getCssText();
- String result = checkKeywordValues(text);
- if (result == null) {
- try {
- int i = Integer.parseInt(text);
- if (i < 100) {
- i = 100;
- }
- if (i > 900) {
- i = 900;
- }
- return new Integer(i);
- } catch (Exception ex) {
- // Error in integer processing
- return NORMAL_WEIGHT;
- }
- } else if (ICSSPropertyID.VAL_NORMAL.equals(result)) {
- return NORMAL_WEIGHT;
- } else if (ICSSPropertyID.VAL_BOLD.equals(result)) {
- return BOLD_WEIGHT;
- } else if (ICSSPropertyID.VAL_BOLDER.equals(result)) {
- // int i = style.getParentStyle().getCSSFont().getWeight() + 100;
- // if (i < 100)
- // i = 100;
- // if (i > 900)
- // i = 900;
- // return new Integer(i);
- return BOLD_WEIGHT;
- } else if (ICSSPropertyID.VAL_LIGHTER.equals(result)) {
- int i = style.getParentStyle().getCSSFont().getWeight() - 100;
- if (i < 100) {
- i = 100;
- }
- if (i > 900) {
- i = 900;
- }
- return new Integer(i);
- }
- return NORMAL_WEIGHT;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/HeightMeta.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/HeightMeta.java
deleted file mode 100644
index 13860d3..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/HeightMeta.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.property;
-
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.utils.DOMUtil;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- */
-public class HeightMeta extends LengthMeta {
- /**
- * Default constructor
- */
- public HeightMeta() {
- super(false, ICSSPropertyID.VAL_AUTO);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#calculateHTMLAttributeOverride(org.w3c.dom.Element,
- * java.lang.String, java.lang.String,
- * org.eclipse.jst.pagedesigner.css2.ICSSStyle)
- */
- public Object calculateHTMLAttributeOverride(Element element,
- String htmltag, String propertyName, ICSSStyle style) {
- if (!"input".equalsIgnoreCase(htmltag)) //$NON-NLS-1$
- {
- String attributeName = ICSSPropertyID.ATTR_HEIGHT;
- if ("hr".equalsIgnoreCase(htmltag)) {
- attributeName = ICSSPropertyID.ATTR_SIZE;
- }
-
- String height = DOMUtil.getAttributeIgnoreCase(element,
- attributeName);
- if (height != null) {
- return LengthMeta.toLength(height, style, this
- .getPercentageType(), getBaseFont(style));
- }
- }
- return super.calculateHTMLAttributeOverride(element, htmltag,
- propertyName, style);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/HorizontalAlignMeta.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/HorizontalAlignMeta.java
deleted file mode 100644
index 6dd075c..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/HorizontalAlignMeta.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.property;
-
-import java.util.Arrays;
-
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.utils.DOMUtil;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- */
-public class HorizontalAlignMeta extends CSSPropertyMeta {
- static final String[] KEYWORDS = new String[] { ICSSPropertyID.VAL_LEFT,
- "bottom", "top", //$NON-NLS-1$ //$NON-NLS-2$
- ICSSPropertyID.VAL_RIGHT, ICSSPropertyID.VAL_CENTER,
- ICSSPropertyID.VAL_JUSTIFY };
-
- private static final String[] HOR_SLIGN_HTMLTAGS = new String[] {
- "TABLE", "HR", "LEGEND", "APPLET", "IFRAME", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- "IMG", "INPUT", "OBJECT", "CAPTION" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- };
-
- /**
- * default constructor
- */
- public HorizontalAlignMeta() {
- super(true, NOT_SPECIFIED);
- }
-
- /**
- * @param inherit
- * @param initvalue
- */
- public HorizontalAlignMeta(boolean inherit, Object initvalue) {
- super(inherit, initvalue);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#getKeywordValues()
- */
- protected String[] getKeywordValues() {
- return KEYWORDS;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#calculateHTMLAttributeOverride(org.w3c.dom.Element,
- * java.lang.String, java.lang.String,
- * org.eclipse.jst.pagedesigner.css2.ICSSStyle)
- */
- public Object calculateHTMLAttributeOverride(Element element,
- String htmltag, String propertyName, ICSSStyle style) {
-
- if (Arrays.asList(HOR_SLIGN_HTMLTAGS).contains(htmltag.toUpperCase())) {
- String align = DOMUtil.getAttributeIgnoreCase(element, "align"); //$NON-NLS-1$
- return checkKeywordValues(align);
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyMeta#getHTMLElementInitialValue(org.w3c.dom.Element,
- * java.lang.String, java.lang.String)
- */
- public Object getHTMLElementInitialValue(Element element, String htmltag,
- String propertyName) {
- if ("HR".equalsIgnoreCase(htmltag.toUpperCase())) //$NON-NLS-1$
- {
- return ICSSPropertyID.VAL_CENTER;
- } else if (Arrays.asList(HOR_SLIGN_HTMLTAGS).contains(
- htmltag.toUpperCase())) {
- return ICSSPropertyID.VAL_LEFT;
- }
-
- return super.getHTMLElementInitialValue(element, htmltag, propertyName);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/ICSSPropertyID.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/ICSSPropertyID.java
deleted file mode 100644
index efce31d..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/ICSSPropertyID.java
+++ /dev/null
@@ -1,922 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.property;
-
-/**
- * @author mengbo
- */
-public interface ICSSPropertyID {
- /**
- * display attribute name
- */
- public static final String ATTR_DISPLAY = "display";
-
- /**
- * whitespace attribute name
- */
- public static final String ATTR_WHITESPACE = "white-space";
-
- /**
- * text decoration attribute name
- */
- public static final String ATTR_TEXTDECORATION = "text-decoration";
-
- /**
- * text align attribute name
- */
- public static final String ATTR_TEXTALIGN = "text-align";
-
- /**
- * width attribute name
- */
- public static final String ATTR_WIDTH = "width";
-
- /**
- * min-width attribute name
- */
- public static final String ATTR_MIN_WIDTH = "min-width";
-
- /**
- * height attribute name
- */
- public static final String ATTR_HEIGHT = "height";
-
- /**
- * min height attribute name
- */
- public static final String ATTR_MIN_HEIGHT = "min-height";
-
- /**
- * border-left-width attribute name
- */
- public static final String ATTR_BORDER_LEFT_WIDTH = "border-left-width";
-
- /**
- * border-right-width attribute name
- */
- public static final String ATTR_BORDER_RIGHT_WIDTH = "border-right-width";
-
- /**
- * border bottom width
- */
- public static final String ATTR_BORDER_BOTTOM_WIDTH = "border-bottom-width";
-
- /**
- * css style attribute
- */
- public static final String ATTR_BORDER_TOP_WIDTH = "border-top-width";
-
- /**
- * css style attribute
- */
- public static final String ATTR_FONT_FAMILY = "font-family";
-
- /**
- * css style attribute
- */
- public static final String ATTR_FONT_SIZE = "font-size";
-
- /**
- * css style attribute
- */
- public static final String ATTR_FONT_STYLE = "font-style";
-
- /**
- * css style attribute
- */
- public static final String ATTR_FONT_WEIGHT = "font-weight";
-
- /**
- * css style attribute
- */
- public static final String ATTR_BORDER_LEFT_STYLE = "border-left-style";
-
- /**
- * css style attribute
- */
- public static final String ATTR_BORDER_RIGHT_STYLE = "border-right-style";
-
- /**
- * css style attribute
- */
- public static final String ATTR_BORDER_BOTTOM_STYLE = "border-bottom-style";
-
- /**
- * css style attribute
- */
- public static final String ATTR_BORDER_TOP_STYLE = "border-top-style";
-
- /**
- * css style attribute
- */
- public static final String ATTR_BORDER_LEFT_COLOR = "border-left-color";
-
- /**
- * css style attribute
- */
- public static final String ATTR_BORDER_RIGHT_COLOR = "border-right-color";
-
- /**
- * css style attribute
- */
- public static final String ATTR_BORDER_BOTTOM_COLOR = "border-bottom-color";
-
- /**
- * css style attribute
- */
- public static final String ATTR_BORDER_TOP_COLOR = "border-top-color";
-
- /**
- * css style attribute
- */
- public static final String ATTR_PADDING_RIGHT = "padding-right";
-
- /**
- * css style attribute
- */
- public static final String ATTR_PADDING_BOTTOM = "padding-bottom";
-
- /**
- * css style attribute
- */
- public static final String ATTR_PADDING_LEFT = "padding-left";
-
- /**
- * css style attribute
- */
- public static final String ATTR_PADDING_TOP = "padding-top";
-
- /**
- * css style attribute
- */
- public static final String ATTR_MARGIN_RIGHT = "margin-right";
-
- /**
- * css style attribute
- */
- public static final String ATTR_MARGIN_BOTTOM = "margin-bottom";
-
- /**
- * css style attribute
- */
- public static final String ATTR_MARGIN_LEFT = "margin-left";
-
- /**
- * css style attribute
- */
- public static final String ATTR_MARGIN_TOP = "margin-top";
-
- /**
- * css style attribute
- */
- public static final String ATTR_BACKGROUND_COLOR = "background-color";
-
- /**
- * css style attribute
- */
- public static final String ATTR_COLOR = "color";
-
- /**
- * css style attribute
- */
- public static final String ATTR_TEXTCOLOR = "text";
-
- /**
- * css style attribute
- */
- public static final String ATTR_BORDER_COLLAPSE = "border-collapse";
-
- /**
- * css style attribute
- */
- public static final String ATTR_BORDER_SPACING = "border-spacing";
-
- /**
- * css style attribute
- */
- public static final String ATTR_LIST_STYLE_TYPE = "list-style-type";
-
- /**
- * css style attribute
- */
- public static final String ATTR_LIST_STYLE_POSITION = "list-style-position";
-
- /**
- * css style attribute
- */
- public static final String ATTR_LIST_STYLE_IMAGE = "list-style-image";
-
- /**
- * css style attribute
- */
- public static final String ATTR_COUNTER_RESET = "counter-reset";
-
- /**
- * css style attribute
- */
- public static final String ATTR_COUNTER_INCREMENT = "counter-increment";
-
- /**
- * css style attribute
- */
- public static final String ATTR_EMPTY_CELLS = "empty-cells";
-
- /**
- * css style attribute
- */
- public static final String ATTR_VISIBILITY = "visibility";
-
- /**
- * css style attribute
- */
- public static final String ATTR_VERTICAL_ALIGN = "vertical-align";
-
- /**
- * css style attribute
- */
- public static final String ATTR_HORIZONTAL_ALIGN = "horizontal-align";
-
- /**
- * css style attribute
- */
- public static final String ATTR_CONTENT = "content";
-
- /**
- * css style attribute
- */
- public static final String ATTR_BGCOLOR = "bgcolor";
-
- /**
- * css style attribute
- */
- public static final String ATTR_TEXT = "text";
-
- /**
- * css style attribute
- */
- public final static String ATTR_MULTIPLE = "multiple";
-
- /**
- * css style attribute
- */
- public final static String ATTR_ITEMLABEL = "itemLabel";
-
- /**
- * css style attribute
- */
- public final static String ATTR_BINDING = "binding";
-
- /**
- * css style attribute
- */
- public final static String ATTR_ITEMVALUE = "itemValue";
-
- /**
- * css style attribute
- */
- public final static String ATTR_VALUE = "value";
-
- /**
- * css style attribute
- */
- public static final String ATTR_URI = "uri";
-
- /**
- * css style attribute
- */
- public static final String ATTR_PREFIX = "prefix";
-
- /**
- * css style attribute
- */
- public static final String ATTR_STYLECLASS = "styleClass";
-
- /**
- * css style attribute
- */
- public static final String ATTR_SIZE = "size";
-
- /**
- * css style attribute
- */
- public static final String ATTR_BASEFONT = "basefont";
-
- /**
- * css style attribute
- */
- public static final String ATTR_ROWSPAN = "rowSpan";
-
- /**
- * css style attribute
- */
- public static final String ATTR_COLSPAN = "colSpan";
-
- /**
- * css style attribute
- */
- public static final String ATTR_TYPE = "type";
-
- /**
- * css style attribute
- */
- public static final String ATTR_URL = "url";
-
- /**
- * css style attribute
- */
- public static final String ATTR_SRC = "src";
-
- /**
- * css style attribute
- */
- public static final String ATTR_TAGLIB_LOCATION = "taglib-location";
-
- /**
- * css style attribute
- */
- public static final String ATTR_TAGLIB_URI = "taglib-uri";
-
- /**
- * css style attribute
- */
- public static final String ATTR_IMAGE = "image";
-
- /**
- * css style attribute
- */
- public static final String ATTR_RESET = "reset";
-
- /**
- * css style attribute
- */
- public static final String ATTR_FOOTER = "footer";
-
- /**
- * css style attribute
- */
- public static final String ATTR_HEADER = "header";
-
- /**
- * css style attribute
- */
- public static final String ATTR_COLUMNS = "columns";
-
- /**
- * css style attribute
- */
- public static final String ATTR_COLUMNCLASSES = "columnClasses";
-
- /**
- * css style attribute
- */
- public static final String ATTR_CLASS = "class";
-
- /**
- * css style attribute
- */
- public static final String ATTR_STYLE = "style";
-
- /**
- * css style attribute
- */
- public static final String ATTR_PAGE = "page";
-
- /**
- * css style attribute
- */
- public static final String ATTR_HREF = "href";
-
- /**
- * css style attribute
- */
- public static final String ATTR_NAME = "name";
-
- /**
- * css style attribute
- */
- public static final String ATTR_BASENAME = "basename";
-
- /**
- * css style attribute
- */
- public static final String ATTR_ACTION = "action";
-
- /**
- * css style attribute
- */
- public static final String ATTR_TARGET = "target";
-
- /**
- * css style attribute
- */
- public static final String ATTR_TOP = "top";
-
- /**
- * css style attribute
- */
- public static final String ATTR_BOTTOM = "bottom";
-
- /**
- * css style attribute
- */
- public static final String ATTR_LEFT = "left";
-
- /**
- * css style attribute
- */
- public static final String ATTR_RIGHT = "right";
-
- /**
- * css style attribute
- */
- public static final String ATTR_POSITION = "position";
-
- /**
- * css style value
- */
- public static final String VAL_TRANSPARENT = "transparent";
-
- /**
- * css style value
- */
- public static final String VAL_COLLAPSE = "collapse";
-
- /**
- * css style value
- */
- public static final String VAL_SEPARATE = "separate";
-
- /**
- * css style value
- */
- public static final String ATTR_OVERFLOW = "overflow";
-
- /**
- * css style value
- */
- // border style values
- public static final String VAL_HIDDEN = "hidden";
-
- /**
- * css style value
- */
- public static final String VAL_DOTTED = "dotted";
-
- /**
- * css style value
- */
- public static final String VAL_DASHED = "dashed";
-
- /**
- * css style value
- */
- public static final String VAL_SOLID = "solid";
-
- /**
- * css style value
- */
- public static final String VAL_DOUBLE = "double";
-
- /**
- * css style value
- */
- public static final String VAL_GROOVE = "groove";
-
- /**
- * css style value
- */
- public static final String VAL_RIDGE = "ridge";
-
- /**
- * css style value
- */
- public static final String VAL_INSET = "inset";
-
- /**
- * css style value
- */
- public static final String VAL_OUTSET = "outset";
-
- // XXX: we introduce a new style for TD default border style, since it
- // seemed IE
- // is using none of the above style for td.
- /**
- * css style value
- */
- public static final String VAL_TDBORDERSTYLE = "__td_border_style__";
-
- /**
- * css style value
- */
- public static final String VAL_THIN = "thin";
-
- /**
- * css style value
- */
- public static final String VAL_THICK = "thick";
-
- /**
- * css style value
- */
- public static final String VAL_INLINE = "inline";
-
- /**
- * css style value
- */
- public static final String VAL_BLOCK = "block";
-
- /**
- * css style value
- */
- public static final String VAL_INLINE_BLOCK = "inline-block";
-
- /**
- * css style value
- */
- public static final String VAL_LIST_ITEM = "list-item";
-
- /**
- * css style value
- */
- public static final String VAL_RUN_IN = "run-in";
-
- /**
- * css style value
- */
- public static final String VAL_COMPACT = "compact";
-
- /**
- * css style value
- */
- public static final String VAL_MARKER = "marker";
-
- /**
- * css style value
- */
- public static final String VAL_TABLE = "table";
-
- /**
- * css style value
- */
- public static final String VAL_INLINE_TABLE = "inline-table";
-
- /**
- * css style value
- */
- public static final String VAL_TABLE_ROW_GROUP = "table-row-group";
-
- /**
- * css style value
- */
- public static final String VAL_TABLE_HEADER_GROUP = "table-header-group";
-
- /**
- * css style value
- */
- public static final String VAL_TABLE_FOOTER_GROUP = "table-footer-group";
-
- /**
- * css style value
- */
- public static final String VAL_TABLE_ROW = "table-row";
-
- /**
- * css style value
- */
- public static final String VAL_TABLE_COLUMN_GROUP = "table-column-group";
-
- /**
- * css style value
- */
- public static final String VAL_TABLE_COLUMN = "table-column";
-
- /**
- * css style value
- */
- public static final String VAL_TABLE_CELL = "table-cell";
-
- /**
- * css style value
- */
- public static final String VAL_TABLE_CAPTION = "table-caption";
-
- /**
- * css style value
- */
- public static final String VAL_NONE = "none";
-
- /**
- * css style value
- */
- public static final String VAL_XX_SMALL = "xx-small";
-
- /**
- * css style value
- */
- public static final String VAL_X_SMALL = "x-small";
-
- /**
- * css style value
- */
- public static final String VAL_SMALL = "small";
-
- /**
- * css style value
- */
- public static final String VAL_MEDIUM = "medium";
-
- /**
- * css style value
- */
- public static final String VAL_LARGE = "large";
-
- /**
- * css style value
- */
- public static final String VAL_X_LARGE = "x-large";
-
- /**
- * css style value
- */
- public static final String VAL_XX_LARGE = "xx-large";
-
- /**
- * css style value
- */
- public static final String VAL_LARGER = "larger";
-
- /**
- * css style value
- */
- public static final String VAL_SMALLER = "smaller";
-
- /**
- * css style value
- */
- public static final String VAL_ITALIC = "italic";
-
- /**
- * css style value
- */
- public static final String VAL_OBLIQUE = "oblique";
-
- /**
- * css style value
- */
- public static final String VAL_NORMAL = "normal";
-
- /**
- * css style value
- */
- public static final String VAL_BOLD = "bold";
-
- /**
- * css style value
- */
- public static final String VAL_BOLDER = "bolder";
-
- /**
- * css style value
- */
- public static final String VAL_LIGHTER = "lighter";
-
- /**
- * css style value
- */
- public static final String VAL_AUTO = "auto";
-
- /**
- * css style value
- */
- public static final String VAL_OUTSIDE = "outside";
-
- /**
- * css style value
- */
- public static final String VAL_INSIDE = "inside";
-
- /**
- * css style value
- */
- public static final String VAL_LEFT = "left";
-
- /**
- * css style value
- */
- public static final String VAL_RIGHT = "right";
-
- /**
- * css style value
- */
- public static final String VAL_CENTER = "center";
-
- /**
- * css style value
- */
- public static final String VAL_JUSTIFY = "justify";
-
- /**
- * css style value
- */
- public static final String VAL_UNDERLINE = "underline";
-
- /**
- * css style value
- */
- public static final String VAL_OVERLINE = "overline";
-
- /**
- * css style value
- */
- public static final String VAL_LINETHROUGH = "line-through";
-
- /**
- * css style value
- */
- public static final String VAL_BLINK = "blink";
-
- /**
- * css style value
- */
- public static final String VAL_PRE = "pre";
-
- /**
- * css style value
- */
- public static final String VAL_NOWRAP = "nowrap";
-
- /**
- * css style value
- */
- public final static String VAL_DISC = "disc"; //$NON-NLS-1$
-
- /**
- * css style value
- */
- public final static String VAL_CIRCLE = "circle"; //$NON-NLS-1$
-
- /**
- * css style value
- */
- public final static String VAL_DECIMAL = "decimal"; //$NON-NLS-1$
-
- /**
- * css style value
- */
- public final static String VAL_CJK_IDEOGRAPHIC = "cjk-ideographic"; //$NON-NLS-1$
-
- /**
- * css style value
- */
- public final static String VAL_DECIMAL_LEADING_ZERO = "decimal-leading-zero"; //$NON-NLS-1$
-
- /**
- * css style value
- */
- public final static String VAL_ARMENIAN = "armenian"; //$NON-NLS-1$
-
- /**
- * css style value
- */
- public final static String VAL_LOWER_ALPHA = "lower-alpha"; //$NON-NLS-1$
-
- /**
- * css style value
- */
- public final static String VAL_LOWER_GREEK = "lower-greek"; //$NON-NLS-1$
-
- /**
- * css style value
- */
- public final static String VAL_LOWER_LATIN = "lower-latin"; //$NON-NLS-1$
-
- /**
- * css style value
- */
- public final static String VAL_LOWER_ROMAN = "lower-roman"; //$NON-NLS-1$
-
- /**
- * css style value
- */
- public final static String VAL_UPPER_ALPHA = "upper-alpha"; //$NON-NLS-1$
-
- /**
- * css style value
- */
- public final static String VAL_UPPER_LATIN = "upper-latin"; //$NON-NLS-1$
-
- /**
- * css style value
- */
- public final static String VAL_UPPER_ROMAN = "upper-roman"; //$NON-NLS-1$
-
- /**
- * css style value
- */
- public final static String VAL_HIRAGANA = "hiragana"; //$NON-NLS-1$
-
- /**
- * css style value
- */
- public final static String VAL_HIRAGANA_IROHA = "hiragana-iroha"; //$NON-NLS-1$
-
- /**
- * css style value
- */
- public final static String VAL_HEBREW = "hebrew"; //$NON-NLS-1$
-
- /**
- * css style value
- */
- public final static String VAL_GEORGIAN = "georgian"; //$NON-NLS-1$
-
- /**
- * css style value
- */
- public final static String VAL_KATAKANA = "katakana"; //$NON-NLS-1$
-
- /**
- * css style value
- */
- public final static String VAL_KATAKANA_IROHA = "katakana-iroha"; //$NON-NLS-1$
-
- /**
- * css style value
- */
- public final static String VAL_SQUARE = "square"; //$NON-NLS-1$
-
- /**
- * css style value
- */
- public final static String VAL_IMAGE = "image"; //$NON-NLS-1$
-
- /**
- * css style value
- */
- public static final String VAL_MULTIPLE = "multiple";
-
- /**
- * css style value
- */
- public static final String VAL_BUTTON = "button";
-
- /**
- * css style value
- */
- public static final String VAL_CHECKBOX = "checkbox";
-
- /**
- * css style value
- */
- public static final String VAL_RADIO = "radio";
-
- /**
- * css style value
- */
- public static final String VAL_FILE = "file";
-
- /**
- * css style value
- */
- public static final String VAL_RESET = "reset";
-
- /**
- * css style value
- */
- public static final String VAL_SUBMIT = "submit";
-
- /**
- * css style value
- */
- public static final String VAL_PASSWORD = "password";
-
- /**
- * css style value
- */
- public static final String VAL_TEXT = "text";
-
- /**
- * css style value
- */
- public static final String VAL_VISIBLE = "visible";
-
- /**
- * css style value
- */
- public static final String VAL_SCROLL = "scroll";
-
- /**
- * css style value
- */
- public static final String TAG_TAGLIB = "taglib";
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/ICSSPropertyMeta.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/ICSSPropertyMeta.java
deleted file mode 100644
index 74ae04f..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/ICSSPropertyMeta.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.property;
-
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.w3c.dom.Element;
-import org.w3c.dom.css.CSSValue;
-
-/**
- * @author mengbo
- */
-public interface ICSSPropertyMeta {
- /**
- *
- */
- static final int PERCENTAGE_NONE = 0;
-
- /**
- *
- */
- static final int PERCENTAGE_BOXSIZE = 1;
-
- /**
- *
- */
- static final int PERCENTAGE_HEIGHT_CONTAININGBLOCK = 2;
-
- /**
- *
- */
- static final int PERCENTAGE_FONT = 3;
-
- /**
- *
- */
- static final int PERCENTAGE_WIDTH_CONTAININGBLOCK = 4;
-
- /**
- *
- */
- static final Object NOT_SPECIFIED = "NOT_SPECIFIED";
-
- /**
- * whether default inherit.
- *
- * @return true if is inherited
- */
- public boolean isInherited();
-
- /**
- * @param propertyName
- * @param style
- *
- * @return the initial value object
- */
- public Object getInitialValue(String propertyName, ICSSStyle style);
-
- /**
- * @param element
- * @param htmltag
- * @param propertyName
- * @return the initial value object
- */
- public Object getHTMLElementInitialValue(Element element, String htmltag,
- String propertyName);
-
- /**
- * what's percentage value based on.
- *
- * @return the percentage value
- */
- public int getPercentageType();
-
- /**
- * for many CSS property, there is corresponding HTML attribute can also
- * specify value for them. This method should check whether the element has
- * corresponding HTML attribute provide value.
- *
- * @param element
- * the element
- * @param htmltag
- * the html tag name. This is for in case element is jsp/jsf
- * element, and have non html tag name.
- * @param propertyName
- * the property name.
- * @param style
- * the style
- * @return null if no attribute override.
- */
- public Object calculateHTMLAttributeOverride(Element element,
- String htmltag, String propertyName, ICSSStyle style);
-
- /**
- * @param value
- * @param propertyName
- * @param style
- * @return the value result
- */
- public Object calculateCSSValueResult(CSSValue value, String propertyName,
- ICSSStyle style);
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/LengthMeta.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/LengthMeta.java
deleted file mode 100644
index ec9f9e5..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/LengthMeta.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.property;
-
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.font.ICSSFont;
-import org.eclipse.jst.pagedesigner.css2.value.Length;
-import org.eclipse.swt.widgets.Display;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.CSSValue;
-
-/**
- * @author mengbo
- */
-public class LengthMeta extends CSSPropertyMeta {
- private static final String[] KEYWORDS = new String[] { ICSSPropertyID.VAL_AUTO };
-
- /**
- * @param inherit
- * @param initvalue
- */
- public LengthMeta(boolean inherit, Object initvalue) {
- super(inherit, initvalue);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#getKeywordValues()
- */
- protected String[] getKeywordValues() {
- return KEYWORDS;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyMeta#calculateCSSValueResult(org.w3c.dom.css.CSSValue,
- * java.lang.String,
- * org.eclipse.jst.pagedesigner.css2.property.AbstractStyle)
- */
- public Object calculateCSSValueResult(CSSValue value, String propertyName,
- ICSSStyle style) {
- if (value == null || value.getCssValueType() == CSSValue.CSS_VALUE_LIST
- || value.getCssValueType() == CSSValue.CSS_CUSTOM) {
- return ICSSPropertyID.VAL_AUTO;
- }
- if (value.getCssValueType() == CSSValue.CSS_INHERIT) {
- return ICSSPropertyID.VAL_AUTO;
- }
- CSSPrimitiveValue primitive = (CSSPrimitiveValue) value;
- String key = checkKeywordValues(primitive.getCssText());
- if (key != null) {
- return key;
- }
- short unitType = primitive.getPrimitiveType();
- float fvalue;
- try {
- fvalue = primitive.getFloatValue(unitType);
- } catch (DOMException ex) {
-// Hide this info. Consider adding DEBUG option
-// _log.info("Get length failed, use auto value instead ("
-// + value.getCssText() + ")");
- return ICSSPropertyID.VAL_AUTO;
- }
- return toLength(fvalue, unitType, style, this.getPercentageType(),
- getBaseFont(style));
- }
-
- /**
- * @param lengthStr
- * @param style
- * @param percenttype
- * @param font
- * @return the object
- */
- public static Object toLength(String lengthStr, ICSSStyle style,
- int percenttype, ICSSFont font) {
- try {
- FloatInfo floatinfo = new FloatInfo(lengthStr);
- return toLength(floatinfo.getValue(), floatinfo.getValueType(),
- style, percenttype, font);
- } catch (Exception e) {
- return ICSSPropertyID.VAL_AUTO;
- }
- }
-
- /**
- * Will not calculate percentage value. Used for calculate the "width" and
- * "height" css property
- * @param result
- * @param unitType
- * @param style
- * @param percenttype
- * @param font
- * @return an object?
- */
- public static Object toLength(float result, short unitType,
- ICSSStyle style, int percenttype, ICSSFont font) {
- switch (unitType) {
- case CSSPrimitiveValue.CSS_PERCENTAGE:
- if (percenttype == PERCENTAGE_FONT) {
- result = (int) ((result * font.getFontSize()) / 100.0);
- break;
- }
- return new Length((int) result, true);
- case CSSPrimitiveValue.CSS_PX: // no more calculation needed
- case CSSPrimitiveValue.CSS_NUMBER:
- break;
- case CSSPrimitiveValue.CSS_EMS:
- result *= font.getFontSize();
- break;
- case CSSPrimitiveValue.CSS_EXS:
- result *= font.getXHeight();
- break;
- case CSSPrimitiveValue.CSS_CM:
- result = cmToPixel(result);
- break;
- case CSSPrimitiveValue.CSS_IN:
- result = inToPixel(result);
- break;
- case CSSPrimitiveValue.CSS_MM:
- result = mmToPixel(result);
- break;
- case CSSPrimitiveValue.CSS_PT:
- result = ptToPixel(result);
- break;
- case CSSPrimitiveValue.CSS_PC:
- result = pcToPixel(result);
- break;
- case CSSPrimitiveValue.CSS_STRING:
- return ICSSPropertyID.VAL_AUTO;
- // FIXME:every thing is delt with?
- }
- // ok, when reach here, means we get the float value "result"
- return new Length((int) result, false);
- }
-
- /**
- * child class can override this method. e.g: font-size style's base font is
- * parent style's font.
- *
- * @param style
- * @return the base font
- */
- protected ICSSFont getBaseFont(ICSSStyle style) {
- return style.getCSSFont();
- }
-
- private static float pcToPixel(float value) {
- return ptToPixel(12 * value);
- }
-
- /**
- * @param floatValue
- * @return
- */
- private static float ptToPixel(float floatValue) {
- // the points used by CSS 2.1 are equal to 1/72th of an inch.
- return inToPixel(floatValue / 72);
- }
-
- /**
- * @param floatValue
- * @return
- */
- private static float mmToPixel(float floatValue) {
- return cmToPixel(floatValue / 10);
- }
-
- /**
- * @param floatValue
- * @return
- */
- private static float inToPixel(float floatValue) {
- return getDPI() * floatValue;
- }
-
- /**
- * @param floatValue
- * @return
- */
- private static float cmToPixel(float floatValue) {
- // 1 inch is equal to 2.54 centimeters
- return inToPixel((float) (floatValue / 2.54));
- }
-
- /**
- * @return
- */
- private static float getDPI() {
- // XXX: cache the value?
- return Display.getCurrent().getDPI().x;
- }
-
- /**
- * @param result
- * @return true if is auto
- */
- public static boolean isAuto(Object result) {
- if (result == ICSSPropertyID.VAL_AUTO) {
- return true;
- }
- if (result instanceof Length && ((Length) result).getValue() <= 0) {
- return true;
- }
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/ListStyleImageMeta.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/ListStyleImageMeta.java
deleted file mode 100644
index c275340..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/ListStyleImageMeta.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.property;
-
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.utils.DOMUtil;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- */
-public class ListStyleImageMeta extends CSSPropertyMeta {
- private static final String INITIAL_VALUE = ICSSPropertyID.VAL_NONE;
-
- /**
- * Default constructor
- */
- public ListStyleImageMeta() {
- super(true, INITIAL_VALUE);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#getKeywordValues()
- */
- protected String[] getKeywordValues() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyMeta#calculateHTMLAttributeOverride(org.w3c.dom.Element,
- * java.lang.String, java.lang.String,
- * org.eclipse.jst.pagedesigner.css2.ICSSStyle)
- */
- public Object calculateHTMLAttributeOverride(Element element,
- String htmltag, String propertyName, ICSSStyle style) {
- return DOMUtil.getAttributeIgnoreCase(element,
- ICSSPropertyID.ATTR_LIST_STYLE_IMAGE);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/ListStylePositionMeta.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/ListStylePositionMeta.java
deleted file mode 100644
index 355a173..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/ListStylePositionMeta.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.property;
-
-/**
- * @author mengbo
- */
-public class ListStylePositionMeta extends CSSPropertyMeta {
- private static final String INITIAL_VALUE = ICSSPropertyID.VAL_OUTSIDE;
-
- /**
- * Default constructor
- */
- public ListStylePositionMeta() {
- super(true, INITIAL_VALUE);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#getKeywordValues()
- */
- protected String[] getKeywordValues() {
- // TODO Auto-generated method stub
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/ListStyleTypeMeta.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/ListStyleTypeMeta.java
deleted file mode 100644
index 78ee887..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/ListStyleTypeMeta.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.property;
-
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.utils.DOMUtil;
-import org.w3c.dom.Element;
-import org.w3c.dom.css.CSSValue;
-
-/**
- * @author mengbo
- */
-public class ListStyleTypeMeta extends CSSPropertyMeta {
- private static final String INITIAL_VALUE = ICSSPropertyID.VAL_DISC;
-
- /**
- * Default constructor
- */
- public ListStyleTypeMeta() {
- super(true, INITIAL_VALUE);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#getKeywordValues()
- */
- protected String[] getKeywordValues() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyMeta#calculateCSSValueResult(org.w3c.dom.css.CSSValue,
- * java.lang.String,
- * org.eclipse.jst.pagedesigner.css2.style.AbstractStyle)
- */
- public Object calculateCSSValueResult(CSSValue value, String propertyName,
- ICSSStyle style) {
- return value.getCssText();
- }
-
- // /*
- // * (non-Javadoc)
- // *
- // * @see
- // org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyMeta#calculateHTMLAttributeOverride(org.w3c.dom.Element,
- // java.lang.String, java.lang.String,
- // org.eclipse.jst.pagedesigner.css2.ICSSStyle)
- // */
- public Object calculateHTMLAttributeOverride(Element element,
- String htmltag, String propertyName, ICSSStyle style) {
- String listStyle = DOMUtil.getAttributeIgnoreCase(element, "type");
- if (listStyle == null && element != null
- && element.getParentNode() != null) {
- listStyle = DOMUtil.getAttributeIgnoreCase((Element) element
- .getParentNode(), "type");
- }
- if (listStyle != null) {
- listStyle = listStyle.trim();
- if (listStyle.equals("1")) {
- return ICSSPropertyID.VAL_DECIMAL;
- } else if (listStyle.equals("a")) {
- return ICSSPropertyID.VAL_LOWER_ALPHA;
- } else if (listStyle.equals("A")) {
- return ICSSPropertyID.VAL_UPPER_ALPHA;
- } else if (listStyle.equals("i")) {
- return ICSSPropertyID.VAL_LOWER_ROMAN;
- } else if (listStyle.equals("I")) {
- return ICSSPropertyID.VAL_UPPER_ROMAN;
- }
- return listStyle;
- }
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/MarginWidthMeta.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/MarginWidthMeta.java
deleted file mode 100644
index fddf276..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/MarginWidthMeta.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.property;
-
-/**
- * @author mengbo
- */
-public class MarginWidthMeta extends LengthMeta {
-
- /**
- * Default constructor
- */
- public MarginWidthMeta() {
- super(false, ICSSPropertyID.VAL_AUTO);
- }
-
- /**
- * @param propertyName
- * @return true if the property is the margin width
- */
- public static boolean isMarginWidth(String propertyName) {
- return ICSSPropertyID.ATTR_MARGIN_BOTTOM.equalsIgnoreCase(propertyName)
- || ICSSPropertyID.ATTR_MARGIN_TOP
- .equalsIgnoreCase(propertyName)
- || ICSSPropertyID.ATTR_MARGIN_LEFT
- .equalsIgnoreCase(propertyName)
- || ICSSPropertyID.ATTR_MARGIN_RIGHT
- .equalsIgnoreCase(propertyName);
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/OverflowMeta.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/OverflowMeta.java
deleted file mode 100644
index 23a0038..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/OverflowMeta.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.property;
-
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.w3c.dom.css.CSSValue;
-
-/**
- *
- * @author mengbo
- * @version 1.5
- */
-public class OverflowMeta extends CSSPropertyMeta {
- static final String[] KEYWORDS = new String[] { ICSSPropertyID.VAL_VISIBLE,
- ICSSPropertyID.VAL_HIDDEN, ICSSPropertyID.VAL_SCROLL,
- ICSSPropertyID.VAL_AUTO };
-
- /**
- * Default constructor
- */
- public OverflowMeta() {
- super(false, ICSSPropertyID.VAL_VISIBLE);
- }
-
- protected String[] getKeywordValues() {
- return KEYWORDS;
- }
-
- public Object calculateCSSValueResult(CSSValue value, String propertyName,
- ICSSStyle style) {
- String display = style.getDisplay();
- // we only support overflow for "block". Which means we don't support it
- // for table/inline-block, etc.
- if (!"block".equalsIgnoreCase(display)) {
- return ICSSPropertyID.VAL_VISIBLE;
- }
- return super.calculateCSSValueResult(value, propertyName, style);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/PaddingWidthMeta.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/PaddingWidthMeta.java
deleted file mode 100644
index dd295e6..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/PaddingWidthMeta.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.property;
-
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.value.Length;
-import org.eclipse.jst.pagedesigner.utils.DOMUtil;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- */
-public class PaddingWidthMeta extends LengthMeta {
-
- private static int MIN_PADDING_THRESHOLD = 4;
-
- /**
- * Default constructor
- */
- public PaddingWidthMeta() {
- super(false, ICSSPropertyID.VAL_AUTO);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#calculateHTMLAttributeOverride(org.w3c.dom.Element,
- * java.lang.String, java.lang.String,
- * org.eclipse.jst.pagedesigner.css2.ICSSStyle)
- */
- public Object calculateHTMLAttributeOverride(Element element,
- String htmltag, String propertyName, ICSSStyle style) {
- if (IHTMLConstants.TAG_TD.equalsIgnoreCase(htmltag)
- || IHTMLConstants.TAG_TH.equalsIgnoreCase(htmltag)) {
- Node parent = element;
- Element tableEle = null;
- while ((parent = parent.getParentNode()) != null
- && parent instanceof Element) {
- if (((Element) parent).getTagName().equalsIgnoreCase(
- IHTMLConstants.TAG_TABLE)) {
- tableEle = (Element) parent;
- break;
- }
- }
- if (tableEle != null) {
- //TODO: Why is only cellpadding being checked? Why does this class even exist? What is difference with BorderWidthMeta?
- String padding = DOMUtil.getAttributeIgnoreCase(tableEle,
- "cellpadding");//$NON-NLS-1$
- if (padding != null && padding.trim().length() > 0) {//fix for 200592
- Object length = LengthMeta.toLength(padding, style, this
- .getPercentageType(), getBaseFont(style));
- if (length instanceof Length && ((Length)length).getValue() >= MIN_PADDING_THRESHOLD)
- return length;
-
- }
- // TODO should not be hardcoded value. Either should change to a pref
- // or a per-component customization.
- return new Length(MIN_PADDING_THRESHOLD, false);
- }
- }
- return super.calculateHTMLAttributeOverride(element, htmltag,
- propertyName, style);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/PositionMeta.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/PositionMeta.java
deleted file mode 100644
index f99dcfe..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/PositionMeta.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.property;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class PositionMeta extends CSSPropertyMeta {
- /**
- * static keyword
- */
- public static final String STATIC = "static";
-
- /**
- * absolute keyword
- */
- public static final String ABSOLUTE = "absolute";
-
- private static final String RELATIVE = "relative";
-
- /**
- * fixed keyword
- */
- public static final String FIXED = "fixed";
-
- private static final String[] _keywords = new String[] { STATIC, ABSOLUTE,
- RELATIVE, FIXED };
-
- /**
- * Default constructor
- */
- public PositionMeta() {
- super(false, STATIC);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#getKeywordValues()
- */
- protected String[] getKeywordValues() {
- return _keywords;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/PositionOffsetMeta.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/PositionOffsetMeta.java
deleted file mode 100644
index 81147cc..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/PositionOffsetMeta.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.property;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class PositionOffsetMeta extends LengthMeta {
- /**
- * Default constructor
- */
- public PositionOffsetMeta() {
- super(false, ICSSPropertyID.VAL_AUTO);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/TableUtil.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/TableUtil.java
deleted file mode 100644
index 1366164..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/TableUtil.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.property;
-
-import org.eclipse.jst.pagedesigner.utils.HTMLUtil;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class TableUtil {
- static final String TOP = "top";
-
- static final String BOTTOM = "bottom";
-
- static final String LEFT = "left";
-
- static final String RIGHT = "right";
-
- /**
- * @param edge
- * @param frame
- * @return true if there is a match
- */
- public static boolean matchFrame(String edge, String frame) {
- if ("above".equalsIgnoreCase(frame)) {
- return TOP.equalsIgnoreCase(edge);
- } else if ("below".equalsIgnoreCase(frame)) {
- return BOTTOM.equalsIgnoreCase(edge);
- } else if ("hsides".equalsIgnoreCase(frame)) {
- return TOP.equalsIgnoreCase(edge) || BOTTOM.equalsIgnoreCase(edge);
- } else if ("vsides".equalsIgnoreCase(frame)) {
- return LEFT.equalsIgnoreCase(edge) || RIGHT.equalsIgnoreCase(edge);
- } else if ("lhs".equalsIgnoreCase(frame)) {
- return LEFT.equalsIgnoreCase(edge);
- } else if ("rhs".equalsIgnoreCase(frame)) {
- return RIGHT.equalsIgnoreCase(edge);
- } else if ("box".equalsIgnoreCase(frame)
- || "border".equalsIgnoreCase(frame)) {
- return true;
- } else {
- return false;
- }
- }
-
- /**
- * @param edge
- * @param rules
- * @return true if rules match
- */
- public static boolean matchRules(String edge, String rules) {
- // TODO: "groups" not supported.
-
- if ("rows".equalsIgnoreCase(rules)) {
- return TOP.equalsIgnoreCase(edge) || BOTTOM.equalsIgnoreCase(edge);
- } else if ("cols".equalsIgnoreCase(rules)) {
- return LEFT.equalsIgnoreCase(edge) || RIGHT.equalsIgnoreCase(edge);
- } else if ("all".equalsIgnoreCase(rules)) {
- return true;
- } else {
- return false;
- }
-
- }
-
- /**
- * @param element
- * @return true if cell is empty
- * see http://www.w3.org/TR/CSS21/tables.html#empty-cells
- */
- public static boolean isEmptyCell(Element element) {
- NodeList children = element.getChildNodes();
- if (children.getLength() == 0) {
- return true;
- }
- // we only do simple checking here. When the element has one child
- // and is text and is whitespace only, then we also treat as empty cell
- if (children.getLength() == 1) {
- Node child = children.item(0);
- if (child instanceof Text) {
- String text = child.getNodeValue();
- if (HTMLUtil.isHTMLWhitespaceString(text)) {
- return true;
- }
- }
- }
-
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/TextAlignMeta.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/TextAlignMeta.java
deleted file mode 100644
index e4e537e..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/TextAlignMeta.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.property;
-
-import java.util.Arrays;
-
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.utils.DOMUtil;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- */
-public class TextAlignMeta extends CSSPropertyMeta {
- static final String[] KEYWORDS = new String[] { ICSSPropertyID.VAL_LEFT,
- ICSSPropertyID.VAL_RIGHT, ICSSPropertyID.VAL_CENTER,
- ICSSPropertyID.VAL_JUSTIFY };
-
- private static final String[] HOR_SLIGN_HTMLTAGS = new String[] {
- IHTMLConstants.TAG_TABLE, IHTMLConstants.TAG_HR,
- IHTMLConstants.TAG_LEGEND, IHTMLConstants.TAG_APPLET,
- IHTMLConstants.TAG_IFRAME, IHTMLConstants.TAG_IMG,
- IHTMLConstants.TAG_INPUT, IHTMLConstants.TAG_OBJECT,
- IHTMLConstants.TAG_CAPTION };
-
- /**
- * Default constructor
- */
- public TextAlignMeta() {
- super(true, NOT_SPECIFIED);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#getKeywordValues()
- */
- protected String[] getKeywordValues() {
- return KEYWORDS;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#calculateHTMLAttributeOverride(org.w3c.dom.Element,
- * java.lang.String, java.lang.String,
- * org.eclipse.jst.pagedesigner.css2.ICSSStyle)
- */
- public Object calculateHTMLAttributeOverride(Element element,
- String htmltag, String propertyName, ICSSStyle style) {
- // /for td, it may look for the attribute value up to tr, but must stop
- // at table.
- // so for table,set _inherited=false to stop it.
- if (IHTMLConstants.TAG_TABLE.equalsIgnoreCase(htmltag)) {
- this._inherited = false;
- } else {
- this._inherited = true;
- }
- if (Arrays.asList(HOR_SLIGN_HTMLTAGS).contains(htmltag.toLowerCase())) {
- return null;
- }
-
- String align = DOMUtil.getAttributeIgnoreCase(element,
- IHTMLConstants.ATTR_ALIGN);
- String value = checkKeywordValues(align);
- if (value != null) {
- return value;
- }
- if ("middle".equalsIgnoreCase(align)) {
- return ICSSPropertyID.VAL_CENTER;
- }
-
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/TextDecorationMeta.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/TextDecorationMeta.java
deleted file mode 100644
index 7813463..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/TextDecorationMeta.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.property;
-
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.w3c.dom.css.CSSValue;
-import org.w3c.dom.css.CSSValueList;
-
-/**
- * @author mengbo
- */
-public class TextDecorationMeta extends CSSPropertyMeta {
- private static final int NONE = 0;
-
- /**
- *
- */
- public static final int UNDERLINE = 1;
-
- /**
- *
- */
- public static final int OVERLINE = 1 << 1;
-
- /**
- *
- */
- public static final int LINETHROUGH = 1 << 2;
-
- private static final int BLINK = 1 << 3;
-
- static final String[] KEYWORDS = new String[] { ICSSPropertyID.VAL_NONE,
- ICSSPropertyID.VAL_UNDERLINE, ICSSPropertyID.VAL_OVERLINE,
- ICSSPropertyID.VAL_LINETHROUGH, ICSSPropertyID.VAL_BLINK };
-
- /**
- * Default constructor
- */
- public TextDecorationMeta() {
- // the spec say text-decoration is not inherited. but the description
- // seemed to make use inherit easier.
- // It seems that the property is inherited in IE and Mozilla.
- super(true, new Integer(NONE));
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#getKeywordValues()
- */
- protected String[] getKeywordValues() {
- return KEYWORDS;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#calculateCSSValueResult(org.w3c.dom.css.CSSValue,
- * java.lang.String,
- * org.eclipse.jst.pagedesigner.css2.property.AbstractStyle)
- */
- public Object calculateCSSValueResult(CSSValue value, String propertyName,
- ICSSStyle style) {
- String[] decorations = null;
- if (value.getCssValueType() == CSSValue.CSS_VALUE_LIST) {
- CSSValueList valueList = (CSSValueList) value;
- decorations = new String[valueList.getLength()];
- for (int i = 0; i < decorations.length; i++) {
- decorations[i] = valueList.item(i).getCssText();
- }
- } else {
- decorations = new String[1];
- decorations[0] = value.getCssText();
- }
-
- int intvalue = 0;
- for (int i = 0; i < decorations.length; i++) {
- String key = super.checkKeywordValues(decorations[i]);
- if (key == ICSSPropertyID.VAL_NONE) {
- intvalue = NONE;
- } else if (key == ICSSPropertyID.VAL_UNDERLINE) {
- intvalue |= UNDERLINE;
- } else if (key == ICSSPropertyID.VAL_OVERLINE) {
- intvalue |= OVERLINE;
- } else if (key == ICSSPropertyID.VAL_LINETHROUGH) {
- intvalue |= LINETHROUGH;
- } else if (key == ICSSPropertyID.VAL_BLINK) {
- intvalue |= BLINK;
- }
- }
-
- return new Integer(intvalue);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/VerticalAlignMeta.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/VerticalAlignMeta.java
deleted file mode 100644
index d4bb569..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/VerticalAlignMeta.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.property;
-
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.utils.DOMUtil;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- */
-public class VerticalAlignMeta extends LengthMeta {
- /**
- * baseline keyword
- */
- public static final String BASELINE = "baseline"; //$NON-NLS-1$
-
- /**
- * middle keyword
- */
- public static final String MIDDLE = "middle"; //$NON-NLS-1$
-
- /**
- * sub keyword
- */
- public static final String SUB = "sub"; //$NON-NLS-1$
-
- /**
- * super keyword
- */
- public static final String SUPER = "super"; //$NON-NLS-1$
-
- /**
- * text-top keyword
- */
- public static final String TEXT_TOP = "text-top"; //$NON-NLS-1$
-
- /**
- * text-bottom keyword
- */
- public static final String TEXT_BOTTOM = "text-bottom"; //$NON-NLS-1$
-
- /**
- * top keyword
- */
- public static final String TOP = "top"; //$NON-NLS-1$
-
- /**
- * bottom keyword
- */
- public static final String BOTTOM = "bottom"; //$NON-NLS-1$
-
- /**
- * center keyword
- */
- public static final String CENTER = "center"; //$NON-NLS-1$
-
- /**
- * default vertical align
- */
- public static final String DEFAULT_VERTICAL_ALIGN = BASELINE;
-
- private static final String[] KEYWORDS = new String[] { BASELINE, MIDDLE,
- SUB, SUPER, TEXT_TOP, TEXT_BOTTOM, TOP, BOTTOM };
-
- private static final String[] htmlAttributes = new String[] { IHTMLConstants.ATTR_VALIGN };
-
- /**
- * Default constructor
- */
- public VerticalAlignMeta() {
- super(true, DEFAULT_VERTICAL_ALIGN);
- }
-
- /**
- * @param inherit
- * @param initvalue
- */
- public VerticalAlignMeta(boolean inherit, Object initvalue) {
- super(inherit, initvalue);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#getKeywordValues()
- */
- protected String[] getKeywordValues() {
- return KEYWORDS;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#calculateHTMLAttributeOverride(org.w3c.dom.Element,
- * java.lang.String, java.lang.String,
- * org.eclipse.jst.pagedesigner.css2.ICSSStyle)
- */
- public Object calculateHTMLAttributeOverride(Element element,
- String htmltag, String propertyName, ICSSStyle style) {
- for (int i = 0; i < htmlAttributes.length; i++) {
- String align = DOMUtil.getAttributeIgnoreCase(element,
- htmlAttributes[i]);
- if (TOP.equalsIgnoreCase(align)) {
- return TOP;
- }
- if (MIDDLE.equalsIgnoreCase(align)) {
- return MIDDLE;
- }
- if (BOTTOM.equalsIgnoreCase(align)) {
- return BOTTOM;
- }
- if (BASELINE.equalsIgnoreCase(align)) {
- return BASELINE;
- }
- if (CENTER.equalsIgnoreCase(align)) {
- return MIDDLE;
- }
- }
- return null;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/VisibilityMeta.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/VisibilityMeta.java
deleted file mode 100644
index 17236d6..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/VisibilityMeta.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.property;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class VisibilityMeta extends CSSPropertyMeta {
- /**
- * visible keyword
- */
- public static final String VISIBLE = "visible";
-
- /**
- * hidden keyword
- */
- public static final String HIDDEN = "hidden";
-
- /**
- * collapse keyword
- */
- public static final String COLLAPSE = "collapse";
-
- private static final String[] KEYWORDS = new String[] { VISIBLE, HIDDEN,
- COLLAPSE };
-
- /**
- * Default constructor
- */
- public VisibilityMeta() {
- super(true, VISIBLE);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#getKeywordValues()
- */
- protected String[] getKeywordValues() {
- return KEYWORDS;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/WhiteSpaceMeta.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/WhiteSpaceMeta.java
deleted file mode 100644
index c94481f..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/WhiteSpaceMeta.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.property;
-
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.utils.DOMUtil;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- */
-public class WhiteSpaceMeta extends CSSPropertyMeta {
- static final String[] KEYWORDS = new String[] { ICSSPropertyID.VAL_NORMAL,
- ICSSPropertyID.VAL_PRE, ICSSPropertyID.VAL_NOWRAP };
-
- /**
- * Default constructor
- */
- public WhiteSpaceMeta() {
- super(true, ICSSPropertyID.VAL_NORMAL);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#getKeywordValues()
- */
- protected String[] getKeywordValues() {
- return KEYWORDS;
- }
-
- public Object calculateHTMLAttributeOverride(Element element,
- String htmltag, String propertyName, ICSSStyle style) {
- if (IHTMLConstants.TAG_TD.equalsIgnoreCase(htmltag)
- || IHTMLConstants.TAG_TH.equalsIgnoreCase(htmltag)) {
- String noWrap = DOMUtil.getAttributeIgnoreCase(element,
- IHTMLConstants.ATTR_NOWRAP);
- if (Boolean.TRUE.toString().equalsIgnoreCase(noWrap)) {
- return ICSSPropertyID.VAL_NOWRAP;
- }
- }
- return super.calculateHTMLAttributeOverride(element, htmltag,
- propertyName, style);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/WidthMeta.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/WidthMeta.java
deleted file mode 100644
index f38e765..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/WidthMeta.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.property;
-
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.utils.DOMUtil;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- */
-public class WidthMeta extends LengthMeta {
- /**
- * Default constructor
- */
- public WidthMeta() {
- super(false, ICSSPropertyID.VAL_AUTO);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#calculateHTMLAttributeOverride(org.w3c.dom.Element,
- * java.lang.String, java.lang.String,
- * org.eclipse.jst.pagedesigner.css2.ICSSStyle)
- */
- public Object calculateHTMLAttributeOverride(Element element,
- String htmltag, String propertyName, ICSSStyle style) {
- if (!IHTMLConstants.TAG_INPUT.equalsIgnoreCase(htmltag)
- && !IHTMLConstants.TAG_BUTTON.equalsIgnoreCase(htmltag)) {
- String width = DOMUtil
- .getAttributeIgnoreCase(element, propertyName);
- if (width != null) {
- return LengthMeta.toLength(width, style, this
- .getPercentageType(), getBaseFont(style));
- }
- }
- return super.calculateHTMLAttributeOverride(element, htmltag,
- propertyName, style);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/provider/DimensionInfo.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/provider/DimensionInfo.java
deleted file mode 100644
index 4531ace..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/provider/DimensionInfo.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.provider;
-
-import org.eclipse.draw2d.geometry.Dimension;
-
-/**
- * This is a struct, include a dimension and a ascent info.
- *
- * @author mengbo
- * @version 1.5
- */
-public class DimensionInfo {
- private final Dimension _dimension;
-
- private final int _ascent;
-
- /**
- *
- * @param d
- * @param ascent
- * -1 means ascent is same as dimension height
- */
- public DimensionInfo(Dimension d, int ascent) {
- this._dimension = d;
- this._ascent = ascent;
- }
-
- /**
- * @param width
- * @param height
- * @param i
- */
- public DimensionInfo(int width, int height, int i) {
- this(new Dimension(width, height), i);
- }
-
- /**
- * @return the dimension
- */
- public Dimension getDimension() {
- return _dimension;
- }
-
- /**
- * @return the ascent
- */
- public int getAscent() {
- return _ascent;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/provider/ICSSTextProvider.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/provider/ICSSTextProvider.java
deleted file mode 100644
index c646cc9..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/provider/ICSSTextProvider.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.provider;
-
-/**
- * This class behave as the information provider of CSSTextFigure.
- *
- * @author mengbo
- */
-public interface ICSSTextProvider {
- /**
- * get the style.
- *
- * @return can't be null
- */
- // public ICSSStyle getCSSStyle();
- /**
- * this is the final data to be displayed. There is no need for the
- * CSSTextFigure to normalize it.
- *
- * @return the text data
- */
- public String getTextData();
-
- /**
- * get the selected information.
- *
- * @return the selected range
- */
- public int[] getSelectedRange();
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/provider/ICSSWidgetProvider.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/provider/ICSSWidgetProvider.java
deleted file mode 100644
index 81e7b9c..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/provider/ICSSWidgetProvider.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.provider;
-
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-
-/**
- * @author mengbo
- */
-public interface ICSSWidgetProvider {
- /**
- * can be null
- *
- * @return the style
- */
- public ICSSStyle getCSSStyle();
-
- /**
- * @return true if is handling border
- */
- public boolean isHandlingBorder();
-
- /**
- * whether the parameter and return value includes border depends on the
- * isHandlingBorder
- *
- * @param width
- * -1 means no suggested value
- * @param height
- * -1 means no suggested value
- * @return the dimension info
- */
- public DimensionInfo getPreferredDimension(int width, int height);
-
- /**
- * if isHandlingBorder return false, then "rect" will be the rect without
- * border, and this method should not paint border.
- *
- * If isHandlingBorder returns true, then "rect" include border, and this
- * method should also paint its own border.
- * @param g
- * @param rect
- */
- public void paintFigure(Graphics g, Rectangle rect);
-
- /**
- * @return true if is inline
- */
- public boolean isInline();
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/style/AbstractStyle.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/style/AbstractStyle.java
deleted file mode 100644
index db251dd..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/style/AbstractStyle.java
+++ /dev/null
@@ -1,686 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.style;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.css2.CSSUtil;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.font.CSSFontManager;
-import org.eclipse.jst.pagedesigner.css2.font.ICSSFont;
-import org.eclipse.jst.pagedesigner.css2.font.ICSSFontManager;
-import org.eclipse.jst.pagedesigner.css2.list.CounterHelper;
-import org.eclipse.jst.pagedesigner.css2.list.CounterValueGenerator;
-import org.eclipse.jst.pagedesigner.css2.list.ICounterValueGenerator;
-import org.eclipse.jst.pagedesigner.css2.property.CSSMetaRegistry;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyMeta;
-import org.eclipse.jst.pagedesigner.css2.value.Length;
-import org.eclipse.jst.pagedesigner.utils.DOMUtil;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.css.CSSStyleDeclaration;
-import org.w3c.dom.css.CSSValue;
-
-/**
- * @author mengbo
- */
-public class AbstractStyle implements ICSSStyle
-{
- private final Element _element;
-
- private Map _cachedValues = new HashMap();
-
- private ICSSFont _font = null;
-
- private CSSStyleDeclaration _cache;
-
- private CSSStyleDeclaration _defaultCache;
-
- private boolean _cssDeclareWasSearched = false;
-
- private boolean _cssDefaultDeclareWasSearched = false;
-
- private Insets _borderInsets, _marginInsets, _paddingInsets;
-
- private ICSSStyle _parentStyle;
-
- private HashMap _counters = null;
-
- /**
- * @return the element this style if for
- */
- public Element getElement() {
- return _element;
- }
-
- /**
- * @param element
- */
- public AbstractStyle(Element element) {
- _element = element;
- }
-
- /**
- * reset all the cache.
- */
- public void reset() {
- _cachedValues.clear();
- _font = null;
- _cache = null;
- _defaultCache = null;
- _cssDeclareWasSearched = false;
- _cssDefaultDeclareWasSearched = false;
- // if (_counters != null)
- // {
- // unregistCounter();
- // _counters.clear();
- // _counters = null;
- // }
- _borderInsets = _marginInsets = _paddingInsets = null;
- }
-
- /**
- * this is a hook method so caller can use it to override default
- * calculation. Note, after the call to <code>reset</code>, it will be
- * lost.
- *
- * @param property
- * @param value
- */
- public void setStyleProperty(String property, Object value) {
- _cachedValues.put(property, value);
- }
-
- /**
- * get a style property value.
- *
- * @param property
- * @return the style property
- */
- public Object getStyleProperty(String property) {
- Object value = _cachedValues.get(property);
- if (value == null) {
- value = calculateProperty(property);
- if (value != null) {
- _cachedValues.put(property, value);
- }
- }
- return value;
- }
-
- /**
- * in this method, should first check the "style" attribute, then combine
- * that with document style.
- *
- * @return the style
- */
- protected CSSStyleDeclaration calculateDeclaration() {
- String name = getHtmlElement().getAttribute("id");
- if (name == null || name.length() == 0) {
- name = getHtmlElement().getAttribute("name");
- }
- return CSSUtil.getCSSDeclaration(this.getHtmlElement(), name);
- }
-
- /**
- * @return the style
- */
- protected CSSStyleDeclaration calculateDefaultDeclaration() {
- return CSSUtil.getDefaultCSSDeclaration(this.getHtmlElement(), null);
- }
-
- /**
- * @return the style declaration
- */
- public CSSStyleDeclaration getDeclaration() {
- // FIXME:may need to be change, boolean variable is not a best way.
- if (!_cssDeclareWasSearched) {
- _cache = calculateDeclaration();
- _cssDeclareWasSearched = true;
- }
- return _cache;
- }
-
- /**
- * @return the default declaration
- */
- public CSSStyleDeclaration getDefaultDeclaration() {
- // FIXME:may need to be change, boolean variable is not a best way.
- if (!_cssDefaultDeclareWasSearched) {
- _defaultCache = calculateDefaultDeclaration();
- _cssDefaultDeclareWasSearched = true;
- }
- return _defaultCache;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.css2.ICSSStyle#getHTMLelementInitValue(java.lang.String)
- */
- public Object getHTMLelementInitValue(String propertyName) {
- ICSSPropertyMeta meta = getPropertyMeta(propertyName);
- if (meta != null) {
- Object obj = meta.getHTMLElementInitialValue(_element,
- getHTMLTag(), propertyName);
- if (obj == null) {
- obj = meta.getInitialValue(propertyName, this);
- }
- return obj;
- }
- return ICSSPropertyMeta.NOT_SPECIFIED;
- }
-
- /**
- * @param propertyName
- * @return the property
- */
- protected Object calculateProperty(String propertyName) {
- ICSSPropertyMeta meta = getPropertyMeta(propertyName);
- Object result = null;
- // get declaration
- CSSStyleDeclaration decl = getDeclaration();
- CSSValue value = decl == null ? null : decl
- .getPropertyCSSValue(propertyName);
- if (value == null) {
- if (meta != null) {
- result = meta.calculateHTMLAttributeOverride(_element,
- getHTMLTag(), propertyName, this);
- if (result != null) {
- return result;
- }
- }
- decl = getDefaultDeclaration();
- }
- value = decl == null ? null : decl.getPropertyCSSValue(propertyName);
-
- if (value != null && value.getCssValueType() == CSSValue.CSS_INHERIT) {
- result = getParentResultValue(meta, propertyName);
- } else if (value == null) {
- if (meta != null) {
- result = meta.calculateHTMLAttributeOverride(_element,
- getHTMLTag(), propertyName, this);
- }
- if (result == null) {
- result = calculateLocalOverride(meta, propertyName);
- }
- if (result == null) {
- if (meta == null) {
- result = ICSSPropertyMeta.NOT_SPECIFIED;
- } else {
- if (meta.isInherited()) {
- result = getParentResultValue(meta, propertyName);
- } else {
- result = meta.getInitialValue(propertyName, this);
- }
- }
- }
- } else {
- result = calculateCSSValueResult(meta, value, propertyName);
- }
- return result;
- }
-
- /**
- * get the corresponding HTML tag for this style. This is for certain HTML
- * tag can also provide style information.
- *
- * @return the html tag
- */
- protected String getHTMLTag() {
- return _element.getTagName();
- }
-
- /**
- * @param propertyName
- * @return the property meta for property name
- */
- protected ICSSPropertyMeta getPropertyMeta(String propertyName) {
- return CSSMetaRegistry.getInstance().getMeta(propertyName);
- }
-
- /**
- * convert the CSSValue to the property type specified data result.
- *
- * @param meta
- * @param value
- * @param propertyName
- * @return should not return null.
- */
- protected Object calculateCSSValueResult(ICSSPropertyMeta meta,
- CSSValue value, String propertyName) {
- if (meta == null) {
- return ICSSPropertyMeta.NOT_SPECIFIED;
- }
- return meta.calculateCSSValueResult(value, propertyName, this);
- }
-
- /**
- * it is possible that some attribute of the element may provide style
- * information. child class should override this method. Also, some element
- * type may have internally build style, such as input-submit may use
- * special border. NOTE: it is very important that in calculateLocalOverride
- * you don't directly or indirectly call getStyleProperty() to avoid
- * deadloop.
- *
- * @param meta
- * @param propertyName
- * @return null means no style information in other attributes. Otherwise
- * return property specific data result -- normally will use meta to
- * convert the attribute.
- */
- protected Object calculateLocalOverride(ICSSPropertyMeta meta,
- String propertyName) {
- // // do some default margin thing.
- // if (ICSSPropertyID.ATTR_MARGIN_RIGHT.equalsIgnoreCase(propertyName)
- // || ICSSPropertyID.ATTR_MARGIN_BOTTOM.equalsIgnoreCase(propertyName))
- // {
- // return MARGIN_LENGTH;
- // }
- // else if
- // (ICSSPropertyID.ATTR_MARGIN_LEFT.equalsIgnoreCase(propertyName))
- // {
- // // to make a little room, so it is possible for user to position the
- // // mouse before the first element in a block.
- // return MARGIN_LEFT;
- // }
- return null;
- }
-
- /**
- * This is only called when inherit value from parent.
- *
- * @param meta
- * @param propertyName
- * @return the result value
- */
- protected Object getParentResultValue(ICSSPropertyMeta meta,
- String propertyName) {
- ICSSStyle style = getParentStyle();
- return style.getStyleProperty(propertyName);
- }
-
- /**
- * @param parentStyle
- */
- public void setParentStyle(ICSSStyle parentStyle) {
- this._parentStyle = parentStyle;
- reset();
- }
-
- public ICSSStyle getParentStyle() {
- if (_parentStyle != null) {
- return _parentStyle;
- }
- Node node = _element.getParentNode();
- while (node instanceof Element && node instanceof INodeNotifier) {
- ICSSStyle parentStyle = (ICSSStyle) ((INodeNotifier) node)
- .getAdapterFor(ICSSStyle.class);
- if (parentStyle != null) {
- return parentStyle;
- }
- node = node.getParentNode();
- }
- return DefaultStyle.getInstance();
- }
-
- /**
- * Will not return null
- *
- * @return the font
- */
- public ICSSFont getCSSFont() {
- if (_font == null) {
- _font = getFontManager().createFont(this);
- }
- return _font;
- }
-
- /**
- * @return
- */
- private ICSSFontManager getFontManager() {
- return CSSFontManager.getInstance();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.ICSSStyle#dispose()
- */
- public void dispose() {
- // TODO: anything to dispose?
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.ICSSStyle#getMarginInsets()
- */
- public Insets getMarginInsets() {
- if (_marginInsets == null) {
- int top = getInsetProperty(ICSSPropertyID.ATTR_MARGIN_TOP);
- int left = getInsetProperty(ICSSPropertyID.ATTR_MARGIN_LEFT);
- int bottom = getInsetProperty(ICSSPropertyID.ATTR_MARGIN_BOTTOM);
- int right = getInsetProperty(ICSSPropertyID.ATTR_MARGIN_RIGHT);
- _marginInsets = new Insets(top, left, bottom, right);
- }
- return _marginInsets;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.ICSSStyle#getPaddingInsets()
- */
- public Insets getPaddingInsets() {
- if (_paddingInsets == null) {
- int top = getInsetProperty(ICSSPropertyID.ATTR_PADDING_TOP)+ARTIFICIAL_BORDER_OFFSET;
- int left = getInsetProperty(ICSSPropertyID.ATTR_PADDING_LEFT)+ARTIFICIAL_BORDER_OFFSET;
- int bottom = getInsetProperty(ICSSPropertyID.ATTR_PADDING_BOTTOM)+ARTIFICIAL_BORDER_OFFSET;
- int right = getInsetProperty(ICSSPropertyID.ATTR_PADDING_RIGHT)+ARTIFICIAL_BORDER_OFFSET;
- _paddingInsets = new Insets(top, left, bottom, right);
- }
- return _paddingInsets;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.ICSSStyle#getBorderInsets()
- */
- public Insets getBorderInsets() {
- if (_borderInsets == null) {
- int top = getInsetProperty(ICSSPropertyID.ATTR_BORDER_TOP_WIDTH);
- int left = getInsetProperty(ICSSPropertyID.ATTR_BORDER_LEFT_WIDTH);
- int bottom = getInsetProperty(ICSSPropertyID.ATTR_BORDER_BOTTOM_WIDTH);
- int right = getInsetProperty(ICSSPropertyID.ATTR_BORDER_RIGHT_WIDTH);
- _borderInsets = new Insets(top, left, bottom, right);
- }
- return _borderInsets;
- }
-
- /**
- * @param border_top_width
- * @return
- */
- private int getInsetProperty(String propertyName) {
- Object obj = this.getStyleProperty(propertyName);
- if (obj instanceof Length) {
- Length l = (Length) obj;
- if (l.isPercentage()) {
- return 0; // FIXME:
- }
- return l.getValue();
- }
-
- return 0;
- }
-
- public boolean isAdapterForType(Object type) {
- return (type == ICSSStyle.class);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.ICSSStyle#isSizeIncludeBorderPadding()
- */
- public boolean isSizeIncludeBorderPadding() {
- String display = this.getDisplay();
- if ("table-cell".equalsIgnoreCase(display)) {
- return false;
- }
- String tag = this.getHTMLTag();
- if ("img".equalsIgnoreCase(tag)) {
- return false;
- }
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.INodeAdapter#notifyChanged(com.ibm.sse.model.INodeNotifier,
- * int, java.lang.Object, java.lang.Object, java.lang.Object, int)
- */
- public void notifyChanged(INodeNotifier notifier, int eventType,
- Object changedFeature, Object oldValue, Object newValue, int pos) {
- // do nothing
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.ICSSStyle#getBackgroundColor()
- */
- public Object getColor() {
- Object _color = null;
- if (_color == null) {
- _color = getStyleProperty(ICSSPropertyID.ATTR_COLOR);
- if (_color == null) {
- _color = getStyleProperty(ICSSPropertyID.ATTR_TEXTCOLOR);
- }
- }
- return _color;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.ICSSStyle#getColor()
- */
- public Object getBackgroundColor() {
- Object _backgroundColor = null;
- if (_backgroundColor == null) {
- _backgroundColor = getStyleProperty(ICSSPropertyID.ATTR_BACKGROUND_COLOR);
- }
- return _backgroundColor;
- }
-
- /**
- * @return the html element
- */
- public Element getHtmlElement() {
- // if (_element instanceof IDOMElement)
- // {
- // EditPart part = (EditPart) ((IDOMElement)
- // _element).getAdapterFor(EditPart.class);
- // if (part instanceof ElementEditPart)
- // {
- // ElementEditPart elementPart = (ElementEditPart) part;
- // ITagHandler h = elementPart.getTagHandler();
- // if (h != null)
- // {
- // return h.mapCustomElement(_element);
- // }
- // }
- //
- // }
- return _element;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.ICSSStyle#getDisplay()
- */
- public String getDisplay() {
- Object display = this.getStyleProperty(ICSSPropertyID.ATTR_DISPLAY);
- String displayStr;
- if (display == null) {
- displayStr = ICSSPropertyID.VAL_INLINE;
- } else if (display instanceof String) {
- displayStr = (String) display;
- } else {
- displayStr = display.toString();
- }
- if (ICSSPropertyID.VAL_INLINE.equalsIgnoreCase(displayStr)
- && IHTMLConstants.TAG_TABLE.equalsIgnoreCase(getHTMLTag())) {
- return ICSSPropertyID.VAL_INLINE_TABLE;
- }
- if (ICSSPropertyID.VAL_INLINE.equalsIgnoreCase(displayStr)) {
- Object width = this.getStyleProperty(ICSSPropertyID.ATTR_WIDTH);
- if (width instanceof Length) {
- return ICSSPropertyID.VAL_INLINE_BLOCK;
- }
- Object height = this.getStyleProperty(ICSSPropertyID.ATTR_HEIGHT);
- if (height instanceof Length) {
- return ICSSPropertyID.VAL_INLINE_BLOCK;
- }
- return displayStr;
- }
- return displayStr;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.ICSSStyle#getListStyle()
- */
- public Map getCounters() {
- if (_counters == null) {
- _counters = new HashMap();
- CounterHelper.processCounterReset(this, _counters);
- }
- return _counters;
- }
-
- /**
- * Get named counter from counters.
- *
- * see org.eclipse.jst.pagedesigner.css2.ICSSStyle#getCounter(java.lang.String)
- */
- public ICounterValueGenerator findCounter(String name, boolean must) {
- Map counters = getCounters();
- if (counters == null || !counters.containsKey(name)) {
- if (getParentStyle() != null
- && !(getParentStyle() instanceof DefaultStyle)) {
- // ensure it is registered somewhere.
- return getParentStyle().findCounter(name, must);
- }
- // must is called by counter-increment
- else if (must) {
- // the caller should do the other setting.
- ICounterValueGenerator counter = new CounterValueGenerator(
- name, null, null, this);
- counter.resetCount();
- counters.put(name, counter);
- }
- }
- return (ICounterValueGenerator) counters.get(name);
- }
-
- /**
- * @param buffer
- */
- public void dumpDebugInfo(StringBuffer buffer) {
- if (_cache != null) {
- buffer.append("cache:\n");
- buffer.append(_cache.getCssText()).append("\n");
- }
- if (_defaultCache != null) {
- buffer.append("default cache:\n");
- buffer.append(_defaultCache.getCssText()).append("\n");
- }
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.ICSSStyle#getColSpan()
- */
- public int getColSpan() {
- int colspan = DOMUtil.getIntAttributeIgnoreCase(getHtmlElement(),
- "colspan", 1);
- // if span == 0, means span all col from the current column to end
- // colume
- if (colspan < 0) {
- return 1;
- }
- return colspan;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.ICSSStyle#getRowSpan()
- */
- public int getRowSpan() {
- int rowspan = DOMUtil.getIntAttributeIgnoreCase(getHtmlElement(),
- "rowspan", 1);
- if (rowspan < 0) {
- return 1;
- }
- return rowspan;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.ICSSStyle#isInSelection()
- */
- public boolean isInSelection() {
- IRangeSelectionProxy proxy = (IRangeSelectionProxy) getAdapter(IRangeSelectionProxy.class);
- if (proxy != null) {
- return proxy.isRangeSelected();
- }
- ICSSStyle parentStyle = getParentStyle();
- if (parentStyle != null) {
- return parentStyle.isInSelection();
- }
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class adapter) {
- if (this._element instanceof INodeNotifier) {
- Object ret = ((INodeNotifier) _element).getAdapterFor(adapter);
- if (ret != null && adapter.isInstance(ret)) {
- return ret;
- }
- }
- return null;
- }
-
- // private void unregistCounter()
- // {
- // if (_counters != null)
- // {
- // Collection c = _counters.values();
- // Iterator iter = c.iterator();
- // while (iter.hasNext())
- // {
- // Counter2 counter = (Counter2) iter.next();
- // counter.unregist(this);
- // }
- // }
- // }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.ICSSStyle#resetCounters()
- */
- public void processCounters() {
- this._counters = null;
- CounterHelper.processCounterIncrement(this);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/style/DefaultStyle.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/style/DefaultStyle.java
deleted file mode 100644
index 2a2d482..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/style/DefaultStyle.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.style;
-
-import java.util.Map;
-
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.font.CSSFontManager;
-import org.eclipse.jst.pagedesigner.css2.font.ICSSFont;
-import org.eclipse.jst.pagedesigner.css2.list.ICounterValueGenerator;
-import org.eclipse.jst.pagedesigner.css2.property.CSSMetaRegistry;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyMeta;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-
-/**
- * @author mengbo
- *
- * TODO: why doesn't this sub-class AbstractStyle
- */
-public class DefaultStyle implements ICSSStyle {
-
- private static final Insets EMPTY_INSETS = new Insets();
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.ICSSStyle#reset()
- */
- public void reset() {
- // TODO: dead?
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.ICSSStyle#getStyleProperty(java.lang.String)
- */
- public Object getStyleProperty(String property) {
- ICSSPropertyMeta meta = CSSMetaRegistry.getInstance().getMeta(property);
- if (meta == null) {
- return ICSSPropertyMeta.NOT_SPECIFIED;
- }
- return meta.getInitialValue(property, this);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.ICSSStyle#getMarginInsets()
- */
- public Insets getMarginInsets() {
- return EMPTY_INSETS;
- //return new Insets(0, 0, 0, 0);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.ICSSStyle#getBorderInsets()
- */
- public Insets getBorderInsets() {
- return EMPTY_INSETS;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.ICSSStyle#getPaddingInsets()
- */
- public Insets getPaddingInsets() {
- return new Insets(ARTIFICIAL_BORDER_OFFSET, ARTIFICIAL_BORDER_OFFSET, ARTIFICIAL_BORDER_OFFSET, ARTIFICIAL_BORDER_OFFSET);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.ICSSStyle#isSizeIncludeBorderPadding()
- */
- public boolean isSizeIncludeBorderPadding() {
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.ICSSStyle#dispose()
- */
- public void dispose() {
- // TODO: anything to dispose
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.INodeAdapter#isAdapterForType(java.lang.Object)
- */
- public boolean isAdapterForType(Object type) {
- return type == ICSSStyle.class;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.INodeAdapter#notifyChanged(com.ibm.sse.model.INodeNotifier,
- * int, java.lang.Object, java.lang.Object, java.lang.Object, int)
- */
- public void notifyChanged(INodeNotifier notifier, int eventType,
- Object changedFeature, Object oldValue, Object newValue, int pos) {
- // TODO: do nothing?
- }
-
- private ICSSFont defaultFont = CSSFontManager.getInstance().createDefaultFont();
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.ICSSStyle#getCSSFont()
- */
- public ICSSFont getCSSFont() {
- return defaultFont;
- }
-
- /**
- * @return the singleton instance
- */
- public static ICSSStyle getInstance() {
- if (_instance == null) {
- _instance = new DefaultStyle();
- }
- return _instance;
- }
-
- static DefaultStyle _instance;
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.ICSSStyle#getParentStyle()
- */
- public ICSSStyle getParentStyle() {
- // return this;
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.ICSSStyle#getBackgroundColor()
- */
- public Object getBackgroundColor() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.ICSSStyle#getColor()
- */
- public Object getColor() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.ICSSStyle#getDisplay()
- */
- public String getDisplay() {
- return "inline";
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.ICSSStyle#getListStyle()
- */
- public Map getCounters() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.ICSSStyle#getCounter(java.lang.String)
- */
- public ICounterValueGenerator findCounter(String name, boolean must) {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.ICSSStyle#getColSpan()
- */
- public int getColSpan() {
- return 1;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.ICSSStyle#getRowSpan()
- */
- public int getRowSpan() {
- return 1;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.ICSSStyle#isInSelection()
- */
- public boolean isInSelection() {
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class adapter) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.ICSSStyle#resetCounters()
- */
- public void processCounters() {
- // do nothing.
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.ICSSStyle#getHTMLelementValue(java.lang.String)
- */
- public Object getHTMLelementInitValue(String propertyName) {
- ICSSPropertyMeta meta = CSSMetaRegistry.getInstance().getMeta(
- propertyName);
- if (meta == null) {
- return ICSSPropertyMeta.NOT_SPECIFIED;
- }
- return meta.getInitialValue(propertyName, this);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/style/HiddenElementStyle.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/style/HiddenElementStyle.java
deleted file mode 100644
index f5783f6..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/style/HiddenElementStyle.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.style;
-
-import org.eclipse.jst.pagedesigner.parts.EditProxyAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.w3c.dom.Element;
-
-/**
- * A style for hidden elements
- *
- */
-public class HiddenElementStyle extends DefaultStyle {
- private EditProxyAdapter _editProxyAdapter;
-
- private Element _convertedElement;
-
- private static ITagEditInfo _tagEditInfo = new ITagEditInfo() {
-
- public boolean isWidget() {
- return true;
- }
-
- public boolean needBorderDecorator() {
- return false;
- }
-
- public boolean needTableDecorator() {
- return false;
- }
-
- public int getMinWidth() {
- return 0;
- }
-
- public int getMinHeight() {
- return 0;
- }
- };
-
- /**
- * @param adapter
- */
- public HiddenElementStyle(EditProxyAdapter adapter) {
- this._editProxyAdapter = adapter;
- }
-
- /**
- * @param convertedElement
- */
- public HiddenElementStyle(Element convertedElement) {
- this._convertedElement = convertedElement;
- }
-
- public boolean isInSelection() {
- if (_convertedElement instanceof INodeNotifier) {
- Object ret = ((INodeNotifier) _convertedElement)
- .getAdapterFor(AbstractStyle.class);
- if (ret instanceof AbstractStyle) {
- return ((AbstractStyle) ret).isInSelection();
- }
- }
-
- if (_editProxyAdapter != null) {
- return _editProxyAdapter.isRangeSelected();
- }
-
- return false;
- }
-
- public Object getAdapter(Class adapter) {
- if (_convertedElement instanceof INodeNotifier) {
- Object ret = ((INodeNotifier) _convertedElement)
- .getAdapterFor(AbstractStyle.class);
- if (ret instanceof AbstractStyle) {
- return ((AbstractStyle) ret).getAdapter(adapter);
- }
- }
- if (_editProxyAdapter != null && adapter == ITagEditInfo.class) {
- return _tagEditInfo;
- }
- return null;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/style/IRangeSelectionProxy.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/style/IRangeSelectionProxy.java
deleted file mode 100644
index 5bf6fb8..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/style/IRangeSelectionProxy.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.style;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public interface IRangeSelectionProxy {
-
- /**
- * @return true if the range is selected
- */
- boolean isRangeSelected();
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/style/ITagEditInfo.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/style/ITagEditInfo.java
deleted file mode 100644
index e2ac601..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/style/ITagEditInfo.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.style;
-
-/**
- * TODO: TagConversion decorator should augment/replace
- * @author mengbo
- * @version 1.5
- */
-public interface ITagEditInfo
-{
- /**
- * @return true if is a widget
- */
- public boolean isWidget();
-
- /**
- * @return true if a border decorator is needed
- */
- public boolean needBorderDecorator();
-
- /**
- * @return true if a table decorator is needed
- */
- public boolean needTableDecorator();
-
- /**
- * for some element in design mode we want to them to have a default min
- * size.
- *
- * @return positive value means an expected min size.
- */
- public int getMinWidth();
-
- /**
- * @return the minimum height
- */
- public int getMinHeight();
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/style/StyleUtil.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/style/StyleUtil.java
deleted file mode 100644
index 635576f..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/style/StyleUtil.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.style;
-
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public final class StyleUtil {
- /**
- * @param style
- * @return true if the style is in a widget
- */
- public static boolean isInWidget(ICSSStyle style) {
- while (style != null && style != DefaultStyle.getInstance()) {
- ITagEditInfo info = (ITagEditInfo) style
- .getAdapter(ITagEditInfo.class);
- if (info != null && info.isWidget()) {
- return true;
- }
-
- style = style.getParentStyle();
- }
- return false;
- }
-
- private StyleUtil()
- {
- // util class
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/value/Length.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/value/Length.java
deleted file mode 100644
index be19387..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/value/Length.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.value;
-
-/**
- * @author mengbo
- */
-public class Length {
- /**
- * Constant for 0 length
- */
- public static final Length LENGTH_0 = new Length(0, false);
-
- /**
- * Constant for 1 length
- */
- public static final Length LENGTH_1 = new Length(1, false);
-
- /**
- * Constant for 2 length
- */
- public static final Length LENGTH_2 = new Length(2, false);
-
- /**
- * Constant for 3 length
- */
- public static final Length LENGTH_3 = new Length(3, false);
-
- /**
- * Constant for 8 length
- */
- public static final Length LENGTH_8 = new Length(8, false);
-
- private final boolean _percentage;
-
- private final int _value;
-
- /**
- * @param value
- * @param percentage
- */
- public Length(int value, boolean percentage) {
- _value = value;
- _percentage = percentage;
- }
-
- /**
- * @return true if value is a percentage
- */
- public boolean isPercentage() {
- return _percentage;
- }
-
- /**
- * @return the length value
- */
- public int getValue() {
- return _value;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/AbstractWidgetProvider.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/AbstractWidgetProvider.java
deleted file mode 100644
index c29d39f..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/AbstractWidgetProvider.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.widget;
-
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.provider.ICSSWidgetProvider;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public abstract class AbstractWidgetProvider implements ICSSWidgetProvider {
- final static int BORDERTHICK = 2;
-
- private final ICSSStyle _style;
-
- /**
- * @param style
- */
- public AbstractWidgetProvider(ICSSStyle style) {
- _style = style;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.provider.ICSSWidgetProvider#getCSSStyle()
- */
- public ICSSStyle getCSSStyle() {
- return _style;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.provider.ICSSWidgetProvider#isHandlingBorder()
- */
- public boolean isHandlingBorder() {
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.provider.ICSSWidgetProvider#isInline()
- */
- public boolean isInline() {
- return true;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/BorderUtil.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/BorderUtil.java
deleted file mode 100644
index 65659f6..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/BorderUtil.java
+++ /dev/null
@@ -1,315 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.widget;
-
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.jst.pagedesigner.css2.layout.CSSFigure;
-import org.eclipse.jst.pagedesigner.css2.layout.FlowBox;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public final class BorderUtil {
- /**
- * vertical bar style
- */
- public final static int VERTICAL_BAR = 0;
-
- /**
- * horizontal bar style
- */
- public final static int HORIZONTAL_BAR = 1;
-
- /**
- * both scroll bar style
- */
- public final static int BOTH = 2;
-
- /**
- * The scroll width
- */
- public final static int SCROLL_WIDTH = 16;
-
- /**
- * the border thickness
- */
- public final static int BORDER_THICK = 2;
-
- /**
- * draw a mask to a rectangle
- *
- * @param g
- * @param rect
- * @param color
- *
- */
- public static void maskRectangle(Graphics g, Rectangle rect, Color color) {
- // set default if one not provided
- if (color == null) {
- color = ColorConstants.blue;
- }
-
- // get old information and keep them
- int lineStyle = g.getLineStyle();
- Color foregroundColor = g.getForegroundColor();
-
- g.setLineStyle(SWT.LINE_SOLID);
- g.setForegroundColor(color);
- for (int i = 0, n = rect.height; i < n; i++, i++) {
- for (int j = 0, m = rect.width; j < m; j++, j++) {
- g.drawLine(rect.x + j, rect.y + i, rect.x + j, rect.y + i);
- }
- }
-
- // restore to the old state
- g.setLineStyle(lineStyle);
- g.setForegroundColor(foregroundColor);
- }
-
- /**
- * @param g
- * @param rect
- * @param thick
- * @param inset
- */
- public static void drawBorder(Graphics g, Rectangle rect, int thick,
- boolean inset) {
- drawBorder(g, rect.x, rect.y, rect.width, rect.height, thick, inset);
- }
-
- /**
- * draw a standard border.
- *
- * @param g
- * @param left
- * @param top
- * @param width
- * @param height
- * @param thick
- * @param inset
- */
- public static void drawBorder(Graphics g, int left, int top, int width,
- int height, int thick, boolean inset) {
- Color[] ltColors = new Color[] {
- Display.getCurrent().getSystemColor(
- SWT.COLOR_WIDGET_LIGHT_SHADOW),
- Display.getCurrent().getSystemColor(
- SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW) };
- if (inset) {
- ltColors = new Color[] { ColorConstants.buttonDarker,
- ColorConstants.buttonDarkest };
- }
- for (int i = 0; i < thick; i++) {
- g.setForegroundColor(ltColors[ltColors.length * i / thick]);
- g.drawLine(left + i, top + i, left + width - 1 - i, top + i);
- g.drawLine(left + i, top + i, left + i, top + height - i - i);
- }
-
- Color[] rbColors = new Color[] {
- Display.getCurrent().getSystemColor(
- SWT.COLOR_WIDGET_DARK_SHADOW),
- Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GRAY) };
- if (inset) {
- rbColors = new Color[] { ColorConstants.buttonLightest,
- ColorConstants.button };
- }
- for (int i = 0; i < thick; i++) {
- g.setForegroundColor(rbColors[ltColors.length * i / thick]);
- g.drawLine(left + i, top - i + height - 1, left + width - 1 - i,
- top - i + height - 1);
- g.drawLine(left + width - 1 - i, top + i, left + width - 1 - i, top
- + height - 1 - i);
- }
- }
-
- /**
- * @param g
- * @param scrollWidth
- * @param rect
- * @param style
- */
- public static void drawScrollBar(Graphics g, int scrollWidth,
- Rectangle rect, int style) {
- drawScrollBar(g, scrollWidth, BORDER_THICK, rect, style);
- }
-
- /**
- * @param g
- * @param scrollWidth
- * @param borderThick
- * @param rect
- * @param style
- */
- public static void drawScrollBar(Graphics g, int scrollWidth,
- int borderThick, Rectangle rect, int style) {
- if (style == BOTH) {
- int width = scrollWidth;
- int left = rect.x + rect.width - width;
- int top = rect.y;
- int height = rect.height;
- Rectangle barRect = new Rectangle(left, top, width, height);
- fillBar(g, barRect);
- barRect = new Rectangle(left, top, width, height - scrollWidth);
- drawVerticalPart(g, scrollWidth, borderThick, barRect);
-
- left = rect.x + borderThick;
- top = top + height - scrollWidth;
- width = rect.width;
- height = scrollWidth;
- barRect = new Rectangle(left, top, width, height);
- fillBar(g, barRect);
- barRect = new Rectangle(left, top, width - scrollWidth - 2, height);
- drawHorizontalPart(g, scrollWidth, borderThick, barRect);
- } else if (style == VERTICAL_BAR) {
- int width = scrollWidth;
- int left = rect.x + rect.width - width;
- int top = rect.y;
- int height = rect.height;
- Rectangle barRect = new Rectangle(left, top, width, height);
- fillBar(g, barRect);
- drawVerticalPart(g, scrollWidth, borderThick, barRect);
- } else if (style == HORIZONTAL_BAR) {
- int left = rect.x + borderThick;
- int top = rect.y + rect.height - scrollWidth;
- int width = rect.width;
- int height = scrollWidth;
- Rectangle barRect = new Rectangle(left, top, width, height);
- fillBar(g, barRect);
- drawHorizontalPart(g, scrollWidth, borderThick, barRect);
- }
- }
-
- private static void fillBar(Graphics g, Rectangle rect) {
- g.setBackgroundColor(ColorConstants.button);
- g.fillRectangle(rect);
- }
-
- private static void drawVerticalPart(Graphics g, int arrawLength,
- int borderThick, Rectangle rect) {
- int left = rect.x;
- int top = rect.y;
- int width = Math.min(arrawLength, rect.width);
- int height = Math.min(arrawLength, rect.height / 2);
-
- Rectangle borderRect = new Rectangle(left, top, width, height);
- BorderUtil.drawBorder(g, borderRect, borderThick, false);
-
- g.setForegroundColor(ColorConstants.black);
- int decoratorWidth = (width - borderThick * 2) / 2;
- int length = decoratorWidth / 2 + 1;
- int leftX = rect.x + (width - decoratorWidth) / 2 - 1;
- int bottomY = rect.y + (height + length) / 2 - 1;
- for (int i = 0; i < length; i++) {
- g.drawLine(leftX + i, bottomY - i, leftX - i + decoratorWidth,
- bottomY - i);
- }
-
- top = rect.y + rect.height - height;
- borderRect = new Rectangle(left, top, width, height);
- BorderUtil.drawBorder(g, borderRect, borderThick, false);
-
- int topY = top + (height - length) / 2;
- g.setForegroundColor(ColorConstants.black);
- for (int i = 0; i < length; i++) {
- g.drawLine(leftX + i, topY + i, leftX - i + decoratorWidth, topY
- + i);
- }
- }
-
- private static void drawHorizontalPart(Graphics g, int arrawLength,
- int borderThick, Rectangle rect) {
- int left = rect.x;
- int top = rect.y;
- int width = Math.min(arrawLength, rect.width / 2);
- int height = Math.min(arrawLength, rect.height);
-
- Rectangle borderRect = new Rectangle(left, top, width, height);
- BorderUtil.drawBorder(g, borderRect, borderThick, false);
-
- g.setForegroundColor(ColorConstants.black);
- int decoratorHeight = (height - borderThick * 2) / 2;
- int length = decoratorHeight / 2 + 1;
- int leftX = rect.x + (width + length) / 2 - 1;
- int bottomY = rect.y + (height - length) / 2 - 1;
- for (int i = 0; i < length; i++) {
- g.drawLine(leftX - i, bottomY + i, leftX - i, bottomY - i
- + decoratorHeight);
- }
-
- left = rect.x + rect.width - width;
- borderRect = new Rectangle(left, top, width, height);
- BorderUtil.drawBorder(g, borderRect, borderThick, false);
-
- leftX = left + (width - length) / 2;
- g.setForegroundColor(ColorConstants.black);
- for (int i = 0; i < length; i++) {
- g.drawLine(leftX + i, bottomY + i, leftX + i, bottomY - i
- + decoratorHeight);
- }
- }
-
- /**
- * @param g
- * @param arrawWidth
- * @param arrawHeight
- * @param borderThick
- * @param rect
- */
- public static void drawVertialBar(Graphics g, int arrawWidth,
- int arrawHeight, int borderThick, Rectangle rect) {
- drawScrollBar(g, arrawWidth, borderThick, rect, VERTICAL_BAR);
- }
-
- /**
- * @param figure
- * @param graphics
- */
- public static void drawBorderDecorator(CSSFigure figure, Graphics graphics) {
- graphics.setLineWidth(1);
- graphics.setLineStyle(Graphics.LINE_DASH);
- graphics.setForegroundColor(ColorConstants.lightGray);
- List fragments = figure.getFragmentsForRead();
- for (int i = 0, size = fragments.size(); i < size; i++) {
- FlowBox box = (FlowBox) fragments.get(i);
- // XXX: why -1?
- graphics.drawRectangle(box.getX(), box.getY(), box.getWidth() - 1, box
- .getHeight() - 1);
- }
- graphics.restoreState();
- }
-
- /**
- * @param figure
- * @param g
- */
- public static void maskFigure(CSSFigure figure, Graphics g) {
- List fragments = figure.getFragmentsForRead();
- for (int i = 0, size = fragments.size(); i < size; i++) {
- FlowBox box = (FlowBox) fragments.get(i);
- maskRectangle(g, new Rectangle(box.getX(), box.getY(), box.getWidth(), box
- .getHeight()), null);
- }
- }
-
- private BorderUtil()
- {
- // util class, no instantiation
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/ButtonWidgetProvider.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/ButtonWidgetProvider.java
deleted file mode 100644
index 98bfaf9..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/ButtonWidgetProvider.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.widget;
-
-import java.util.StringTokenizer;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.FigureUtilities;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.font.ICSSFont;
-import org.eclipse.jst.pagedesigner.css2.layout.TextLayoutSupport;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyMeta;
-import org.eclipse.jst.pagedesigner.css2.provider.DimensionInfo;
-import org.eclipse.jst.pagedesigner.css2.style.DefaultStyle;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * For ButtonWidget, it displays some text value in it. And lays the text with
- * nowrap.
- *
- * @author mengbo
- * @version 1.5
- */
-public class ButtonWidgetProvider extends AbstractWidgetProvider {
- // The button width should include the label length and padding,
- // to let the button looks fine, we set the padding 0.46 width as the label
- // length.
- private final static double HORIZONTAL_RATE = 1.46;
-
- // The button height should include the label height and padding,
- // to let the button looks fine, we set the padding 0.36 height as the
- // character height.
- private final static double VERTICAL_PADDING_RATE = 0.36;
-
- private static final String[] DEFAULTLINES = new String[] { " " };
-
- private String _value = "";
-
- private String[] _lines = DEFAULTLINES;
-
- /**
- * @param style
- */
- public ButtonWidgetProvider(ICSSStyle style) {
- super(style);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.provider.ICSSWidgetProvider#getPreferredDimension(int,
- * int)
- */
- public DimensionInfo getPreferredDimension(int width, int height) {
- if (width <= 0) {
- width = getDefaultWidth();
- }
- if (height <= 0) {
- height = getDefaultHeight();
- }
- return new DimensionInfo(new Dimension(width, height), -1);
- }
-
- /**
- * by default, the combo's width will be calculated from the longest option
- * value.
- *
- * @return the default width value
- */
- public int getDefaultWidth() {
- int longestStringWidth = 0;
- if (_lines != null) {
- ICSSStyle style = this.getCSSStyle();
- if (style == null) {
- style = DefaultStyle.getInstance();
- }
- ICSSFont font = style.getCSSFont();
- Font swtFont = font.getSwtFont();
- for (int i = 0; i < _lines.length; i++) {
- int width = FigureUtilities.getTextWidth(_lines[i], swtFont);
- if (width > longestStringWidth) {
- longestStringWidth = width;
- }
- }
- }
- // text area width + padding
- return (int) ((longestStringWidth) * HORIZONTAL_RATE);
- }
-
- /**
- *
- * @return the default height value
- * @see TextInputWidgetProvider#getDefaultHeight()
- */
- public int getDefaultHeight() {
- ICSSStyle style = this.getCSSStyle();
- if (style == null) {
- style = DefaultStyle.getInstance();
- }
- ICSSFont font = style.getCSSFont();
- Font swtfont = font.getSwtFont();
- int fontHeight = FigureUtilities.getFontMetrics(swtfont).getHeight();
- return (int) ((fontHeight) * (_lines.length + VERTICAL_PADDING_RATE));
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.provider.ICSSWidgetProvider#paintFigure(org.eclipse.draw2d.Graphics,
- * org.eclipse.draw2d.geometry.Rectangle)
- */
- public void paintFigure(Graphics g, Rectangle rect) {
- ICSSStyle style = this.getCSSStyle();
- if (style == null) {
- style = DefaultStyle.getInstance();
- }
- Object textAlign = style
- .getStyleProperty(ICSSPropertyID.ATTR_TEXTALIGN);
- if (ICSSPropertyMeta.NOT_SPECIFIED == textAlign) {
- textAlign = "center";
- }
- Font font = style.getCSSFont().getSwtFont();
- g.setFont(font);
- int fontHeight = FigureUtilities.getFontMetrics(font).getHeight();
-
- Color newColor = null;
- Object color = style.getColor();
- if (color instanceof Color) {
- g.setForegroundColor((Color) color);
- } else if (color instanceof RGB) {
- newColor = new Color(Display.getCurrent(), (RGB) color);
- g.setForegroundColor(newColor);
- } else {
- g.setForegroundColor(ColorConstants.black);
- }
-
- g.clipRect(rect);
-
- int y = rect.y + (int) (fontHeight * VERTICAL_PADDING_RATE / 2);
- if (rect.height > fontHeight * _lines.length) {
- y = rect.y + (rect.height - fontHeight * _lines.length) / 2;
- }
-
- for (int i = 0; i < _lines.length && y < rect.y + rect.height; i++) {
- int width = FigureUtilities.getTextWidth(_lines[i], font);
- int x = TextLayoutSupport.getBeginX(textAlign, rect, width);
- g.drawString(_lines[i], x, y);
- TextLayoutSupport.paintTextDecoration(g, new Rectangle(x, y, width,
- fontHeight), ((Integer) getCSSStyle().getStyleProperty(
- ICSSPropertyID.ATTR_TEXTDECORATION)).intValue());
- y += fontHeight;
- }
-
- if (newColor != null) {
- newColor.dispose();
- }
- }
-
- /**
- * @param value
- */
- public void setValue(String value) {
- if (value == null) {
- value = "";
- }
- _value = value;
- _lines = splitValue(_value);
- }
-
- /**
- * Split the value to multiple lines.
- *
- * @param _value2
- * @return
- */
- private String[] splitValue(String _value2) {
- if (_value2 == null || "".equals(_value2)) {
- return DEFAULTLINES;
- }
-
- StringTokenizer tokenizer = new StringTokenizer(_value2, "\r\n");
- String[] result = new String[tokenizer.countTokens()];
- for (int i = 0; i < result.length; i++) {
- result[i] = tokenizer.nextToken().replaceAll("\t", " ");
- }
- return result;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/CheckboxWidgetProvider.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/CheckboxWidgetProvider.java
deleted file mode 100644
index 54e319e..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/CheckboxWidgetProvider.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.widget;
-
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.provider.DimensionInfo;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class CheckboxWidgetProvider extends AbstractWidgetProvider {
- private boolean isChecked;
-
- /**
- * @param style
- */
- public CheckboxWidgetProvider(ICSSStyle style) {
- super(style);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.provider.ICSSWidgetProvider#getPreferredDimension(int,
- * int)
- */
- public DimensionInfo getPreferredDimension(int width, int height) {
- if (width <= 0) {
- width = getDefaultWidth();
- }
- if (height <= 0) {
- height = getDefaultWidth();
- }
- return new DimensionInfo(new Dimension(width, height), height * 4 / 5);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.provider.ICSSWidgetProvider#paintFigure(org.eclipse.draw2d.Graphics,
- * org.eclipse.draw2d.geometry.Rectangle)
- */
- public void paintFigure(Graphics g, Rectangle rect) {
- int centerX = rect.x + rect.width / 2;
- int centerY = rect.y + rect.height / 2;
-
- // we always draw it as a square.
- int width = Math.min(rect.width, rect.height);
- int innerWidth = width * 4 / 5;
-
- int left = centerX - innerWidth / 2;
- int top = centerY - innerWidth / 2;
- BorderUtil.drawBorder(g, left, top, innerWidth, innerWidth, 2, true);
- if (isChecked()) {
- g.pushState();
- Display display = Display.getCurrent();
- g.setForegroundColor(display.getSystemColor(SWT.COLOR_BLACK));
- g.drawLine(left + 3, top + 2, left + innerWidth - 3, top
- + innerWidth - 4);
- g.drawLine(left + 2, top + 2, left + innerWidth - 3, top
- + innerWidth - 3);
-
- g.drawLine(left + innerWidth - 4, top + 2, left + 2, top
- + innerWidth - 4);
- g.drawLine(left + innerWidth - 3, top + 2, left + 2, top
- + innerWidth - 3);
- g.popState();
- }
- }
-
- /**
- * @return the default width
- */
- private int getDefaultWidth() {
- // FIXME: don't know the how to define the default width yet.
- return 15;
- }
-
- /**
- * @return Returns the checked.
- */
- public boolean isChecked() {
- return isChecked;
- }
-
- /**
- * @param checked
- */
- public void setChecked(boolean checked) {
- this.isChecked = checked;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/ComboWidgetProvider.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/ComboWidgetProvider.java
deleted file mode 100644
index 645ac6f..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/ComboWidgetProvider.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.widget;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.FigureUtilities;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.font.ICSSFont;
-import org.eclipse.jst.pagedesigner.css2.provider.DimensionInfo;
-import org.eclipse.jst.pagedesigner.css2.style.DefaultStyle;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class ComboWidgetProvider extends AbstractWidgetProvider {
- private static final int VERTICAL_PADDING = 6;
-
- private static final int HORIZONTAL_PADDING = 12;
-
- private static int ARRAWWIDTH = 16;
-
- //private static int ARROWHEIGHT = 16;
-
- private String _firstString;
-
- private String _longestString;
-
- private String _label;
-
- /**
- * @param style
- */
- public ComboWidgetProvider(ICSSStyle style) {
- super(style);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.provider.ICSSWidgetProvider#getPreferredDimension(int,
- * int)
- */
- public DimensionInfo getPreferredDimension(int width, int height) {
- if (width <= 0) {
- width = getDefaultWidth();
-
- }
- if (height <= 0) {
- height = getDefaultHeight();
- }
- return new DimensionInfo(new Dimension(width, height), -1);
- }
-
- /**
- * by default, the combo's width will be calculated from the longest option
- * value.
- *
- * @return the default width
- */
- private int getDefaultWidth() {
- int textareaWidth;
- if (this._longestString == null || this._longestString.length() == 0) {
- textareaWidth = 20;
- } else {
- ICSSStyle style = this.getCSSStyle();
- if (style == null) {
- style = DefaultStyle.getInstance();
- }
- ICSSFont font = style.getCSSFont();
-
- textareaWidth = FigureUtilities.getTextWidth(_longestString, font
- .getSwtFont());
- }
- return textareaWidth + ARRAWWIDTH + HORIZONTAL_PADDING;
- }
-
- /**
- *
- * @return the default height
- * @see TextInputWidgetProvider#getDefaultHeight()
- */
- public int getDefaultHeight() {
- ICSSStyle style = this.getCSSStyle();
- if (style == null) {
- style = DefaultStyle.getInstance();
- }
- ICSSFont font = style.getCSSFont();
- Font swtfont = font.getSwtFont();
- int fontSize = FigureUtilities.getFontMetrics(swtfont).getHeight();
- return fontSize + VERTICAL_PADDING;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.provider.ICSSWidgetProvider#paintFigure(org.eclipse.draw2d.Graphics,
- * org.eclipse.draw2d.geometry.Rectangle)
- */
- public void paintFigure(Graphics g, Rectangle rect) {
- if (this._firstString != null) {
- ICSSStyle style = this.getCSSStyle();
- if (style == null) {
- style = DefaultStyle.getInstance();
- }
- ICSSFont font = style.getCSSFont();
- g.setFont(font.getSwtFont());
-
- Color newColor = null;
- Object color = style.getColor();
- if (color instanceof Color) {
- g.setForegroundColor((Color) color);
- } else if (color instanceof RGB) {
- newColor = new Color(Display.getCurrent(), (RGB) color);
- g.setForegroundColor(newColor);
- } else {
- g.setForegroundColor(ColorConstants.black);
- }
- g.clipRect(rect);
- String label = _label != null ? _label : _firstString;
- label = label.replaceAll("[ \r\n]+", " ");
- if (label.endsWith(" ")) {
- label = label.substring(0, label.length() - 1);
- }
- g.drawString(label, rect.x + HORIZONTAL_PADDING / 2, rect.y
- + VERTICAL_PADDING / 2);
- if (newColor != null) {
- newColor.dispose();
- }
-
- }
-
- BorderUtil.drawBorder(g, rect.x, rect.y, rect.width, rect.height,
- BORDERTHICK, true);
- // next the drop down button
- int width = ARRAWWIDTH;
- int left = rect.x + rect.width - width - BORDERTHICK;
- int top = rect.y + BORDERTHICK;
- int height = rect.height - BORDERTHICK * 2;
- g.setBackgroundColor(ColorConstants.button);
- g.fillRectangle(left, top, width, height);
-
- Rectangle borderRect = new Rectangle(left, top, width, height);
- BorderUtil.drawBorder(g, borderRect.x, borderRect.y, borderRect.width,
- borderRect.height, BORDERTHICK, false);
-
- g.setForegroundColor(ColorConstants.black);
-
- int decoratorWidth = (width - BORDERTHICK * 2) / 2;
- int length = decoratorWidth / 2 + 1;
- int leftX = left + (width - decoratorWidth) / 2 - 1;
- int topY = top + (height - length) / 2 + 1;
- for (int i = 0; i < length; i++) {
- g.drawLine(leftX + i, topY + i, leftX - i + decoratorWidth, topY
- + i);
- }
- }
-
- /**
- * set the options to be displayed in this combo box. Will calculate out the
- * first string and the longest string.
- *
- * @param options
- */
- public void setOptions(String[] options) {
- if (options == null || options.length == 0) {
- this._firstString = null;
- this._longestString = null;
- } else {
- this._firstString = options[0];
- this._longestString = (options[0] == null ? "" : options[0]);
- for (int i = 1; i < options.length; i++) {
- if (options[i] == null) {
- continue;
- }
- if (options[i].length() > this._longestString.length()) {
- this._longestString = options[i];
- }
- }
- }
- }
-
- /**
- * @param label
- */
- public void setSelectedLabel(String label) {
- this._label = label;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.provider.ICSSWidgetProvider#isHandlingBorder()
- */
- public boolean isHandlingBorder() {
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/HiddenProvider.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/HiddenProvider.java
deleted file mode 100644
index 965d7ac..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/HiddenProvider.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.widget;
-
-import org.eclipse.draw2d.FigureUtilities;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.jst.pagedesigner.css2.provider.DimensionInfo;
-import org.eclipse.jst.pagedesigner.css2.style.HiddenElementStyle;
-import org.eclipse.jst.pagedesigner.parts.EditProxyAdapter;
-import org.eclipse.jst.pagedesigner.parts.ElementEditPart;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontMetrics;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- */
-public class HiddenProvider extends ImageWidgetProvider {
- private final static int GAP = 3;
-
- private String _label = null;
-
- private boolean _labelVisible = true;
-
- private FontMetrics _fontMetrics;
-
- /**
- * @param image
- * @param convertedElement
- */
- public HiddenProvider(Image image, Element convertedElement) {
- super(image, new HiddenElementStyle(convertedElement));
- }
-
- /**
- * @param image
- * @param editPart
- */
- public HiddenProvider(Image image, ElementEditPart editPart) {
- super(image, new HiddenElementStyle(new EditProxyAdapter(editPart)));
- }
-
- // public HiddenProvider(Image image, String label)
- // {
- // this(image);
- // this._label = label;
- // }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.provider.ICSSWidgetProvider#getPreferredDimension(int,
- * int)
- */
- public DimensionInfo getPreferredDimension(int width, int height) {
- int preWidth = width;
- int preHeight = height;
- _fontMetrics = getFontMetrics();
- if (width <= 0) {
- preWidth = getLabelWidth() + _imageWidth;
- }
- if (height <= 0) {
- preHeight = Math.max(getLabelHeight(), _imageHeight);
- }
- return new DimensionInfo(preWidth, preHeight, -1);
- }
-
- private FontMetrics getFontMetrics() {
- Font swtfont = Display.getCurrent().getSystemFont();
- return FigureUtilities.getFontMetrics(swtfont);
- }
-
- private int getLabelHeight() {
- if (_labelVisible && (_label != null) && (!_label.equals(""))
- && (_fontMetrics != null)) {
- return _fontMetrics.getHeight();
- }
- return 0;
- }
-
- /**
- * @return the label width
- */
- public int getLabelWidth() {
- if (_labelVisible && _label != null && !_label.equals("")
- && _fontMetrics != null) {
- Font swtfont = Display.getCurrent().getSystemFont();
- return FigureUtilities.getTextWidth(_label, swtfont) + GAP;
- }
- return 0;
- }
-
- public void paintFigure(Graphics g,
- org.eclipse.draw2d.geometry.Rectangle rect) {
- g.fillRectangle(rect);
- g.setClip(rect);
- int imageAreaWidth = Math.min(rect.width, _imageWidth);
- int imageAreaHeight = Math.min(rect.height, _imageHeight);
- if (_image != null && !_image.isDisposed()) {
- g.drawImage(_image, 0, 0, _imageWidth, _imageHeight, rect.x, rect.y
- + (rect.height - imageAreaHeight) / 2, imageAreaWidth,
- imageAreaHeight);
- }
- if (_label != null && _labelVisible) {
- int leading = 0;
- if (_fontMetrics != null) {
- leading = _fontMetrics.getLeading();
- }
- // TODO: adapt to bg: go lighter on colors that darker() would make black
- // TODO: color registry
- Color fg = FigureUtilities.darker(g.getBackgroundColor());
- g.setForegroundColor(fg);
- g.drawString(_label, imageAreaWidth + GAP, rect.y
- + (rect.height - getLabelHeight()) / 2 + leading);
- fg.dispose();
- }
- }
-
- /**
- * @return the label text
- */
- public String getLabel() {
- return _label;
- }
-
- /**
- * @param label
- */
- public void setLabel(String label) {
- this._label = label;
- }
-
- /**
- * @return whether the label is visible
- */
- public boolean isLabelVisible() {
- return _labelVisible;
- }
-
- /**
- * @param labelVisible
- */
- public void setLabelVisible(boolean labelVisible) {
- this._labelVisible = labelVisible;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/ImageWidgetProvider.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/ImageWidgetProvider.java
deleted file mode 100644
index 03d41b8..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/ImageWidgetProvider.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.widget;
-
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.provider.DimensionInfo;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * @author mengbo
- */
-public class ImageWidgetProvider extends AbstractWidgetProvider {
- private static final String NOPIC_IMAGE_NAME = "PD_nopic.jpg";
-
- private static Image _noPicImage;
-
- private static int _noPicWidth;
-
- private static int _noPicHeight;
-
- /**
- * the image
- */
- protected Image _image;
-
- /**
- * image width
- */
- protected int _imageWidth;
-
- /**
- * image height
- */
- protected int _imageHeight;
-
- /**
- * @param image
- * @param style
- */
- public ImageWidgetProvider(Image image, ICSSStyle style) {
- super(style);
-
- // set up image and image width/height
- org.eclipse.swt.graphics.Rectangle rect = null;
- if (image != null) {
- rect = image.getBounds();
- if (rect.width <= 0 || rect.height <= 0) {
- useNoPicImage();
- } else {
- _image = image;
- _imageWidth = rect.width;
- _imageHeight = rect.height;
- }
- } else {
- useNoPicImage();
- }
- }
-
- /**
- *
- */
- private void useNoPicImage() {
- if (_noPicImage == null || _noPicImage.isDisposed()) {
- ImageDescriptor noPicImageDesc = PDPlugin.getDefault()
- .getImageDescriptor(NOPIC_IMAGE_NAME);
- _noPicImage = noPicImageDesc.createImage();
- org.eclipse.swt.graphics.Rectangle rect = _noPicImage.getBounds();
- _noPicWidth = rect.width;
- _noPicHeight = rect.height;
- }
- _image = _noPicImage;
- _imageWidth = _noPicWidth;
- _imageHeight = _noPicHeight;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.provider.ICSSWidgetProvider#getPreferredDimension(int,
- * int)
- */
- public DimensionInfo getPreferredDimension(int width, int height) {
- if (width <= 0 && height <= 0) {
- // we are free, so use image size
- org.eclipse.swt.graphics.Rectangle a = _image.getBounds();
- return new DimensionInfo(a.width, a.height, -1);
- } else if (width > 0 && height > 0) {
- return new DimensionInfo(width, height, -1);
- } else if (height > 0) {
- width = (int) ((double) _imageWidth * height / _imageHeight);
- return new DimensionInfo(width, height, -1);
- } else {
- height = (int) ((double) _imageHeight * width / _imageWidth);
- return new DimensionInfo(width, height, -1);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.provider.ICSSWidgetProvider#paintFigure(org.eclipse.draw2d.geometry.Rectangle)
- */
- public void paintFigure(Graphics g, Rectangle rect) {
- if (_image != null) {
- g.drawImage(_image, 0, 0, _imageWidth, _imageHeight, rect.x,
- rect.y, rect.width, rect.height);
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/InputFileWidgetProvider.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/InputFileWidgetProvider.java
deleted file mode 100644
index af8704d..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/InputFileWidgetProvider.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.widget;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.border.CSSBorder;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.jst.pagedesigner.css2.provider.DimensionInfo;
-import org.eclipse.jst.pagedesigner.css2.provider.ICSSWidgetProvider;
-import org.eclipse.jst.pagedesigner.editors.pagedesigner.MessageFormater;
-
-/**
- * @author mengbo
- */
-public class InputFileWidgetProvider extends AbstractWidgetProvider {
- private static final String BODER_QUERY_TEMPLETE = "border-{0}-style";
-
- private static final int GAP = 2;
-
- private ICSSWidgetProvider _sub1;
-
- private ICSSWidgetProvider _sub2;
-
- /**
- * @param style
- * @param sub1
- * @param sub2
- */
- public InputFileWidgetProvider(ICSSStyle style, ICSSWidgetProvider sub1,
- ICSSWidgetProvider sub2) {
- super(style);
- _sub1 = sub1;
- _sub2 = sub2;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.provider.ICSSWidgetProvider#getPreferredDimension(int,
- * int)
- */
- public DimensionInfo getPreferredDimension(int width, int height) {
- Insets borderInset = new Insets();
- Insets borderPaddingInset = new Insets();
- ICSSStyle style = getCSSStyle();
- if (style != null) {
- borderInset = style.getBorderInsets();
- borderPaddingInset = borderInset.getAdded(style.getPaddingInsets());
- }
-
- Dimension d1 = _sub1.getPreferredDimension(-1, -1).getDimension();
- Dimension d2 = _sub2.getPreferredDimension(-1, -1).getDimension();
-
- int minWidth = d2.width + 2 * (borderInset.left + borderInset.right)
- + GAP;
- int prefWidth = d1.width + d2.width + 2
- * (borderPaddingInset.left + borderPaddingInset.right) + GAP;
- int minHeight = borderInset.top + borderInset.bottom;
- int prefHeight = Math.max(d1.height, d2.height)
- + borderPaddingInset.top + borderPaddingInset.bottom;
-
- if (width > 0 && minWidth > width) {
- prefWidth = minWidth;
- } else if (width != 0) {
- prefWidth = width;
- }
-
- if (height > 0 && minHeight > height) {
- prefHeight = minHeight;
- } else if (height != 0) {
- prefHeight = height;
- }
- return new DimensionInfo(prefWidth, prefHeight, -1);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.provider.ICSSWidgetProvider#paintFigure(org.eclipse.draw2d.Graphics,
- * org.eclipse.draw2d.geometry.Rectangle)
- */
- public void paintFigure(Graphics g, Rectangle rect) {
- Rectangle rect1, rect2;
-
- Insets borderInset = new Insets();
- Insets paddingInset = new Insets();
- Insets borderPaddingInset = new Insets();
- ICSSStyle style = getCSSStyle();
- if (style != null) {
- borderInset = style.getBorderInsets();
- paddingInset = style.getPaddingInsets();
- borderPaddingInset.add(borderInset).add(paddingInset);
- }
-
- Dimension d1 = _sub1.getPreferredDimension(-1, -1).getDimension();
- Dimension d2 = _sub2.getPreferredDimension(-1, -1).getDimension();
- int prefWidth = d1.width + d2.width + 2 * borderPaddingInset.left + 2
- * borderPaddingInset.right + GAP;
- if (rect.width < prefWidth) {
- paddingInset.left = 0;
- paddingInset.right = 0;
- }
- int prefHeight = Math.max(d1.height, d2.height)
- + borderPaddingInset.top + borderPaddingInset.bottom;
- if (rect.height < prefHeight) {
- paddingInset.top = 0;
- paddingInset.bottom = 0;
- }
-
- int width = rect.width
- - d2.width
- - (borderInset.left + borderInset.right + paddingInset.left + paddingInset.right)
- - GAP;
- rect1 = new Rectangle(rect.x - 1, rect.y, width, rect.height);
- rect2 = new Rectangle(rect.x + rect1.width + 2, rect.y, rect.width
- - rect1.width - 3, rect.height);
- Rectangle innerRect1 = rect1.getCopy().crop(borderInset);
- Rectangle innerRect2 = rect2.getCopy().crop(borderInset);
-
- g.pushState();
- g.setBackgroundColor(ColorConstants.button);
- g.fillRectangle(innerRect2);
- g.popState();
-
- CSSBorder cssBorder = new CSSBorder(style);
- String[] edges = new String[] { ICSSStyle.LEFT, ICSSStyle.RIGHT,
- ICSSStyle.TOP, ICSSStyle.BOTTOM };
- for (int i = 0; i < edges.length; i++) {
- cssBorder.paintEdge(g, rect1, innerRect1, edges[i],
- getBorderStyle(edges[i]));
- }
- for (int i = 0; i < edges.length; i++) {
- String borderStyle = getBorderStyle(edges[i]);
- if (ICSSPropertyID.VAL_INSET.equals(borderStyle)) {
- borderStyle = ICSSPropertyID.VAL_OUTSET;
- }
- cssBorder.paintEdge(g, rect2, innerRect2, edges[i], borderStyle);
- }
-
- _sub2.paintFigure(g, innerRect2.getCopy().crop(paddingInset));
- // _sub1.paintFigure(g, innerRect1.crop(paddingInset));
- }
-
- private String getBorderStyle(String edge) {
- ICSSStyle style = getCSSStyle();
- if (style != null) {
- String property = MessageFormater
- .format(BODER_QUERY_TEMPLETE, edge);
- String borderStyle = style.getStyleProperty(property).toString();
- return borderStyle;
- }
- return ICSSPropertyID.VAL_HIDDEN;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.provider.ICSSWidgetProvider#isHandlingBorder()
- */
- public boolean isHandlingBorder() {
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/ListWidgetProvider.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/ListWidgetProvider.java
deleted file mode 100644
index 23cee34..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/ListWidgetProvider.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.widget;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.FigureUtilities;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.font.ICSSFont;
-import org.eclipse.jst.pagedesigner.css2.provider.DimensionInfo;
-import org.eclipse.jst.pagedesigner.css2.style.DefaultStyle;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class ListWidgetProvider extends AbstractWidgetProvider {
- private static int DEFAULTSIZE = 4;
-
- private static final int VERTICAL_PADDING = 6;
-
- private static final int HORIZONTAL_PADDING = 12;
-
- private static int ARRAWWIDTH = 16;
-
- private static int ARROWHEIGHT = 16;
-
- private String[] _options;
-
- private int _rows = DEFAULTSIZE;
-
- /**
- * @param style
- */
- public ListWidgetProvider(ICSSStyle style) {
- super(style);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.provider.ICSSWidgetProvider#getPreferredDimension(int,
- * int)
- */
- public DimensionInfo getPreferredDimension(int width, int height) {
- if (width <= 0) {
- width = getDefaultWidth();
- }
- if (height <= 0) {
- height = getDefaultHeight();
- }
- return new DimensionInfo(width, height, -1);
- }
-
- /**
- * by default, the combo's width will be calculated from the longest option
- * value.
- *
- * @return the default width
- */
- public int getDefaultWidth() {
- int longestStringWidth = 0;
- if (_options != null) {
- ICSSStyle style = this.getCSSStyle();
- if (style == null) {
- style = DefaultStyle.getInstance();
- }
- ICSSFont font = style.getCSSFont();
- Font swtFont = font.getSwtFont();
- for (int i = 0; i < _options.length; i++) {
- int width = FigureUtilities.getTextWidth(_options[i], swtFont);
- if (width > longestStringWidth) {
- longestStringWidth = width;
- }
- }
- }
- // text area width + borderWidth + vertical scroll width
- return (longestStringWidth) + HORIZONTAL_PADDING + ARRAWWIDTH;
- }
-
- /**
- *
- * @return the default height
- * @see TextInputWidgetProvider#getDefaultHeight()
- */
- public int getDefaultHeight() {
- ICSSStyle style = this.getCSSStyle();
- if (style == null) {
- style = DefaultStyle.getInstance();
- }
- ICSSFont font = style.getCSSFont();
- Font swtfont = font.getSwtFont();
- int fontHeight = FigureUtilities.getFontMetrics(swtfont).getHeight();
- return (fontHeight) * _rows + VERTICAL_PADDING;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.provider.ICSSWidgetProvider#paintFigure(org.eclipse.draw2d.Graphics,
- * org.eclipse.draw2d.geometry.Rectangle)
- */
- public void paintFigure(Graphics g, Rectangle rect) {
- BorderUtil.drawBorder(g, rect.x, rect.y, rect.width, rect.height,
- BORDERTHICK, true);
- if (_options != null) {
- ICSSStyle style = this.getCSSStyle();
- if (style == null) {
- style = DefaultStyle.getInstance();
- }
- ICSSFont font = style.getCSSFont();
- Font swtfont = font.getSwtFont();
- g.setFont(swtfont);
-
- Color newColor = null;
- Object color = style.getColor();
- if (color instanceof Color) {
- g.setForegroundColor((Color) color);
- } else if (color instanceof RGB) {
- newColor = new Color(Display.getCurrent(), (RGB) color);
- g.setForegroundColor(newColor);
- } else {
- g.setForegroundColor(ColorConstants.black);
- }
- int fontHeight = FigureUtilities.getFontMetrics(swtfont)
- .getHeight();
- int x = rect.x + HORIZONTAL_PADDING / 2;
- int y = rect.y + VERTICAL_PADDING / 2;
-
- g.clipRect(rect);
- for (int i = 0; i < _options.length
- && (i * fontHeight < rect.height - VERTICAL_PADDING); i++) {
- g.drawString(_options[i], x, y);
- y += fontHeight;
- }
- if (newColor != null) {
- newColor.dispose();
- }
-
- int borderThick = 2;
- Rectangle barRect = new Rectangle(rect.x, rect.y + borderThick,
- rect.width - borderThick, rect.height - 2 * borderThick);
- BorderUtil.drawVertialBar(g, ARRAWWIDTH, ARROWHEIGHT, borderThick,
- barRect);
- }
- }
-
- /**
- * @param string
- * @param x
- * @param y
- * @return
- */
- private String normalize(String string) {
- if (string == null) {
- return "";
- }
- int index = string.indexOf('\r');
- if (index >= 0) {
- string = string.substring(0, index);
- }
- index = string.indexOf('\n');
- if (index >= 0) {
- string = string.substring(0, index);
- }
- return string;
- }
-
- /**
- * set the options to be displayed in this combo box.
- *
- * @param options
- */
- public void setOptions(String[] options) {
- this._options = options;
- if (_options != null) {
- for (int i = 0; i < _options.length; i++) {
- _options[i] = normalize(_options[i]);
- }
- }
- }
-
- /**
- * set the default number of rows to be displayed.
- *
- * @param rows
- */
- public void setRows(int rows) {
- _rows = (rows > 0 ? rows : DEFAULTSIZE);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.provider.ICSSWidgetProvider#isHandlingBorder()
- */
- public boolean isHandlingBorder() {
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/RadioWidgetProvider.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/RadioWidgetProvider.java
deleted file mode 100644
index 980171f..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/RadioWidgetProvider.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.widget;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.provider.DimensionInfo;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class RadioWidgetProvider extends AbstractWidgetProvider {
- private boolean isChecked;
-
- /**
- * @param style
- */
- public RadioWidgetProvider(ICSSStyle style) {
- super(style);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.provider.ICSSWidgetProvider#getPreferredDimension(int,
- * int)
- */
- public DimensionInfo getPreferredDimension(int width, int height) {
- if (width <= 0) {
- width = getDefaultWidth();
- }
- if (height <= 0) {
- height = getDefaultWidth();
- }
- return new DimensionInfo(width, height, height * 4 / 5);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.provider.ICSSWidgetProvider#paintFigure(org.eclipse.draw2d.Graphics,
- * org.eclipse.draw2d.geometry.Rectangle)
- */
- public void paintFigure(Graphics g, Rectangle rect) {
- int centerX = rect.x + rect.width / 2;
- int centerY = rect.y + rect.height / 2;
-
- // we always draw it as a circle.
- int width = Math.min(rect.width, rect.height);
- int cycleWidth = width * 3 / 5;
-
- // FIXME: when the size of the radio is big, the line width may need
- // calculate to be bigger.
- int lineWidth = 2;
- g.setLineWidth(lineWidth);
-
- g.setForegroundColor(ColorConstants.buttonDarker);
- g.drawArc(centerX - cycleWidth / 2, centerY - cycleWidth + 1,
- cycleWidth, cycleWidth, 45, 180);
-
- g.setForegroundColor(ColorConstants.button);
- g.drawArc(centerX - cycleWidth / 2, centerY - cycleWidth + 1,
- cycleWidth, cycleWidth, 225, 180);
-
- // since the two cycle may not overlap very well, some space between
- // them will be displayed.
- // so we make the bigger cycle to be a little thicker.
- cycleWidth += (2 * lineWidth - 2);
- lineWidth += 1;
-
- if (cycleWidth < width) {
- g.setForegroundColor(ColorConstants.buttonDarkest);
- g.drawArc(centerX - cycleWidth / 2, centerY - cycleWidth + 1,
- cycleWidth, cycleWidth, 45, 180);
- }
-
- if (isChecked()) {
- g.setBackgroundColor(ColorConstants.black);
- g.fillArc(centerX - 1, centerY - cycleWidth / 2 - 1, 4, 4, 0, 360);
- }
- }
-
- /**
- * @return the default width
- */
- public final int getDefaultWidth() {
- // FIXME: don't know the how to define the default width yet.
- return 15;
- }
-
- /**
- * @return Returns the checked.
- */
- public boolean isChecked() {
- return isChecked;
- }
-
- /**
- * @param checked
- */
- public void setChecked(boolean checked) {
- this.isChecked = checked;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/TextAreaWidgetProvider.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/TextAreaWidgetProvider.java
deleted file mode 100644
index 77aea65..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/TextAreaWidgetProvider.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.widget;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.FigureUtilities;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.font.ICSSFont;
-import org.eclipse.jst.pagedesigner.css2.layout.TextLayoutSupport;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.jst.pagedesigner.css2.provider.DimensionInfo;
-import org.eclipse.jst.pagedesigner.css2.style.DefaultStyle;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class TextAreaWidgetProvider extends AbstractWidgetProvider {
- private static final int DEFAULTCOLUMN = 20;
-
- private static final int DEFAULTROWS = 2;
-
- private static final int VERTICAL_PADDING = 2;
-
- private static final int HORIZONTAL_PADDING = 2;
-
- private static int ARRAWWIDTH = 16;
-
- private static int ARROWHEIGHT = 16;
-
- private int _columns = DEFAULTCOLUMN;
-
- private int _rows = DEFAULTROWS;
-
- private String _value;
-
- /**
- * @param style
- */
- public TextAreaWidgetProvider(ICSSStyle style) {
- super(style);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.provider.ICSSWidgetProvider#getPreferredDimension(int,
- * int)
- */
- public DimensionInfo getPreferredDimension(int width, int height) {
- if (width <= 0) {
- width = getDefaultWidth();
- }
- if (height <= 0) {
- height = getDefaultHeight();
- }
- return new DimensionInfo(width, height, -1);
- }
-
- /**
- * @return
- */
- private int getDefaultHeight() {
- ICSSStyle style = this.getCSSStyle();
- if (style == null) {
- style = DefaultStyle.getInstance();
- }
- ICSSFont font = style.getCSSFont();
- Font swtfont = font.getSwtFont();
- int fontHeight = FigureUtilities.getFontMetrics(swtfont).getHeight();
-
- return (fontHeight) * _rows + VERTICAL_PADDING;
- }
-
- /**
- * @return
- */
- private int getDefaultWidth() {
- ICSSStyle style = this.getCSSStyle();
- if (style == null) {
- style = DefaultStyle.getInstance();
- }
- ICSSFont font = style.getCSSFont();
-
- int fontWidth = FigureUtilities.getFontMetrics(font.getSwtFont())
- .getAverageCharWidth();
- return _columns * fontWidth + ARRAWWIDTH + HORIZONTAL_PADDING;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.provider.ICSSWidgetProvider#paintFigure(org.eclipse.draw2d.Graphics,
- * org.eclipse.draw2d.geometry.Rectangle)
- */
- public void paintFigure(Graphics g, Rectangle rect) {
- if (_value != null) {
- g.clipRect(rect);
- ICSSStyle style = this.getCSSStyle();
- if (style == null) {
- style = DefaultStyle.getInstance();
- }
- int decoration = ((Integer) style
- .getStyleProperty(ICSSPropertyID.ATTR_TEXTDECORATION))
- .intValue();
- ICSSFont font = style.getCSSFont();
- g.setFont(font.getSwtFont());
-
- Color newColor = null;
- Object color = style.getColor();
- if (color instanceof Color) {
- g.setForegroundColor((Color) color);
- } else if (color instanceof RGB) {
- newColor = new Color(Display.getCurrent(), (RGB) color);
- g.setForegroundColor(newColor);
- } else {
- g.setForegroundColor(ColorConstants.black);
- }
-
- Object textAlign = style
- .getStyleProperty(ICSSPropertyID.ATTR_TEXTALIGN);
- int begin = 0;
- int end = 0;
- int fontHeight = FigureUtilities.getFontMetrics(font.getSwtFont())
- .getHeight();
-
- int fontWidth = FigureUtilities.getFontMetrics(font.getSwtFont())
- .getAverageCharWidth();
- int columns = (rect.width - HORIZONTAL_PADDING) / fontWidth;
-
- int i = 0;
- while (true) {
- int y = rect.y + VERTICAL_PADDING / 2 + fontHeight * i;
- if (y >= rect.bottom()) {
- break;
- }
- end += columns;
- if (end > _value.length()) {
- end = _value.length();
- }
- end = getTextCount(begin, end, g.getFont(), rect.width
- - ARRAWWIDTH);
-
- String text = _value.substring(begin, end);
-
- int width = FigureUtilities.getTextWidth(text, g.getFont());
- int x = TextLayoutSupport.getBeginX(textAlign, rect, width);
- g.drawString(text, x, y);
-
- TextLayoutSupport.paintTextDecoration(g, new Rectangle(x, y,
- width, fontHeight), decoration);
- begin = end;
-
- if (end == _value.length()) {
- break;
- }
- i++;
- }
- if (newColor != null) {
- newColor.dispose();
- }
- }
- int borderThick = 2;
- BorderUtil
- .drawVertialBar(g, ARRAWWIDTH, ARROWHEIGHT, borderThick, rect);
- }
-
- private int getTextCount(int begin, int end, Font swtFont, int textWidth) {
- while (FigureUtilities.getTextWidth(_value.substring(begin, end),
- swtFont) > textWidth) {
- end--;
- }
- return end;
- }
-
- /**
- * @param columns
- */
- public void setColumns(int columns) {
- this._columns = (columns > 0 ? columns : DEFAULTCOLUMN);
- }
-
- /**
- * @param rows
- */
- public void setRows(int rows) {
- this._rows = (rows > 0 ? rows : DEFAULTROWS);
- }
-
- /**
- * @param value
- */
- public void setValue(String value) {
- this._value = value;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/TextInputWidgetProvider.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/TextInputWidgetProvider.java
deleted file mode 100644
index 966c5b8..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/TextInputWidgetProvider.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.css2.widget;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.FigureUtilities;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.font.ICSSFont;
-import org.eclipse.jst.pagedesigner.css2.layout.TextLayoutSupport;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.jst.pagedesigner.css2.provider.DimensionInfo;
-import org.eclipse.jst.pagedesigner.css2.style.DefaultStyle;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class TextInputWidgetProvider extends AbstractWidgetProvider {
- private static final int VERTICAL_INCREMENT = 2;
-
- /**
- * password size
- */
- public static final int PWD_SIZE = 18;
-
- private int DEFAULTSIZE = 20;
-
- private int _size = DEFAULTSIZE;
-
- private String _value;
-
- /**
- * @param style
- */
- public TextInputWidgetProvider(ICSSStyle style) {
- this(style, 20);
- }
-
- /**
- * @param style
- * @param size
- */
- public TextInputWidgetProvider(ICSSStyle style, int size) {
- super(style);
- DEFAULTSIZE = size;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.provider.ICSSWidgetProvider#getPreferredDimension(int,
- * int)
- */
- public DimensionInfo getPreferredDimension(int width, int height) {
- if (width <= 0) {
- width = getDefaultWidth();
-
- }
- if (height <= 0) {
- height = getDefaultHeight();
- }
- return new DimensionInfo(width, height, -1);
- }
-
- /**
- * @return
- */
- private int getDefaultHeight() {
- ICSSStyle style = this.getCSSStyle();
- if (style == null) {
- style = DefaultStyle.getInstance();
- }
- ICSSFont font = style.getCSSFont();
- Font swtfont = font.getSwtFont();
- int fontSize = FigureUtilities.getFontMetrics(swtfont).getHeight();
- return fontSize + VERTICAL_INCREMENT;
- }
-
- /**
- * @return the default width
- */
- public int getDefaultWidth() {
- ICSSStyle style = this.getCSSStyle();
- if (style == null) {
- style = DefaultStyle.getInstance();
- }
- return computeWidth(style.getCSSFont());
- }
-
- private int computeWidth(ICSSFont font) {
- int fontWidth = FigureUtilities
- .getTextWidth("abcde", font.getSwtFont());//$NON-NLS-1$
- return (fontWidth + 1) * _size / 5;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.provider.ICSSWidgetProvider#paintFigure(org.eclipse.draw2d.Graphics,
- * org.eclipse.draw2d.geometry.Rectangle)
- */
- public void paintFigure(Graphics g, Rectangle rect) {
- String value = getValue();
- if (value != null) {
- ICSSStyle style = this.getCSSStyle();
- if (style == null) {
- style = DefaultStyle.getInstance();
- }
- Object textAlign = style
- .getStyleProperty(ICSSPropertyID.ATTR_TEXTALIGN);
-
- Font font = style.getCSSFont().getSwtFont();
- g.setFont(font);
-
- Color newColor = null;
- Object color = style.getColor();
- if (color instanceof Color) {
- g.setForegroundColor((Color) color);
- } else if (color instanceof RGB) {
- newColor = new Color(Display.getCurrent(), (RGB) color);
- g.setForegroundColor(newColor);
- } else {
- g.setForegroundColor(ColorConstants.black);
- }
- g.clipRect(rect);
- int width = FigureUtilities.getTextWidth(value, g.getFont());
- int x = TextLayoutSupport.getBeginX(textAlign, rect, width);
- int y = rect.y + VERTICAL_INCREMENT / 2;
-
- g.drawString(value, x, y);
- TextLayoutSupport.paintTextDecoration(g, new Rectangle(x, y, width,
- g.getFontMetrics().getHeight()), ((Integer) getCSSStyle()
- .getStyleProperty(ICSSPropertyID.ATTR_TEXTDECORATION))
- .intValue());
- if (newColor != null) {
- newColor.dispose();
- }
- }
- }
-
- /**
- * set the value in this text input control
- *
- * @param value
- */
- public void setValue(String value) {
- this._value = value;
- }
-
- /**
- * @param size
- */
- public void setSize(int size) {
- this._size = (size <= 0 ? DEFAULTSIZE : size);
- }
-
- /**
- * get current value in this text input control
- *
- * @return the value
- */
- public String getValue() {
- return _value;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/FeedBackInfo.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/FeedBackInfo.java
deleted file mode 100644
index f405bbc..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/FeedBackInfo.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dnd;
-
-/**
- * @author mengbo
- */
-public class FeedBackInfo {
- private String _description;
-
- private int _order;
-
- /**
- * @param desc
- * @param order
- */
- public FeedBackInfo(String desc, int order) {
- this._description = desc;
- }
-
- /**
- * the description may be used in tooltip or wizard dialog selection to tell
- * user the effect of the drop.
- *
- * @return the description
- */
- public String getDescription() {
- return _description;
- }
-
- /**
- * how important this feedback is. This information may be used when we
- * ordering the choices in the wizard.
- *
- * range from 0-10, the bigger, the more important.
- *
- * @return the order
- */
- public int getOrder() {
- return _order;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/ILocalDropHandler.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/ILocalDropHandler.java
deleted file mode 100644
index 11378a1..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/ILocalDropHandler.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dnd;
-
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- */
-public interface ILocalDropHandler {
- /**
- * whether this handler will use wizard for user to config detail
- *
- * @return true if should use wizard
- */
- public boolean useWizard();
-
- /**
- * @param localData
- * @param viewer
- * @return true if should use wizard
- */
- public boolean useWizard(Object localData, IHTMLGraphicalViewer viewer);
-
- /**
- *
- * @param localData
- * @param widget
- * @return the feed back info
- */
- public FeedBackInfo supportUpdateWidget(Object localData, Node widget);
-
- /**
- * This method will only be called when <code>supportUpdateWidget</code>
- * return true and <code>useWizard</code> return true.
- *
- * @param localData
- * @param widget
- * @param viewer
- * @return the wizard
- */
- public IWizard getWizard(Object localData, Node widget,
- IHTMLGraphicalViewer viewer);
-
- /**
- * this method is called when the handler don't support wizard.
- *
- * @param localData
- * @param widget
- * @param viewer
- */
- public void doUpdateWidget(Object localData, Node widget,
- IHTMLGraphicalViewer viewer);
-
- /**
- *
- * @param localData
- * @param position
- * @return the feedback info
- */
- public FeedBackInfo supportInsertElements(Object localData,
- IDOMPosition position);
-
- /**
- *
- * @param localData
- * @param position
- * @param viewer
- * @return the wizard
- */
- public IWizard getWizard(Object localData, IDOMPosition position,
- IHTMLGraphicalViewer viewer);
-
- /**
- * @param localData
- * @param position
- * @param viewer
- */
- public void doInsertElements(Object localData, IDOMPosition position,
- IHTMLGraphicalViewer viewer);
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/LocalDropRequest.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/LocalDropRequest.java
deleted file mode 100644
index bcb165d..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/LocalDropRequest.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dnd;
-
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DropRequest;
-
-/**
- * @author mengbo
- */
-public class LocalDropRequest extends Request implements DropRequest {
- // XXX: need move this constant to somewhere else.
- /**
- * the request name for local drops
- */
- public static final String REQ_LOCAL_DROP = "Local Drop";
-
- private Point _location;
-
- private Object _localObject;
-
- /**
- *
- */
- public LocalDropRequest() {
- super(REQ_LOCAL_DROP);
- }
-
- /**
- * Returns the location of the object to be created.
- *
- * @return the location
- */
- public Point getLocation() {
- return _location;
- }
-
- /**
- * Sets the location where the new object will be placed.
- *
- * @param location
- * the location
- */
- public void setLocation(Point location) {
- this._location = location;
- }
-
- /**
- * @return the local object
- */
- public Object getLocalObject() {
- return _localObject;
- }
-
- /**
- * @param local
- */
- public void setLocalObject(Object local) {
- this._localObject = local;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/DesignerSourceDropTargetListener.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/DesignerSourceDropTargetListener.java
deleted file mode 100644
index bd19857..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/DesignerSourceDropTargetListener.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dnd.internal;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.dnd.TemplateTransfer;
-import org.eclipse.jst.pagedesigner.commands.PaletteDropInsertCommand;
-import org.eclipse.jst.pagedesigner.editors.pagedesigner.PageDesignerResources;
-import org.eclipse.jst.pagedesigner.editors.palette.TagToolPaletteEntry;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.dnd.DropTargetEvent;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.ui.texteditor.ITextEditorDropTargetListener;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.sse.ui.internal.ExtendedEditorDropTargetAdapter;
-
-/**
- * @author mengbo
- */
-public class DesignerSourceDropTargetListener extends
- ExtendedEditorDropTargetAdapter implements
- ITextEditorDropTargetListener {
- private int _location;
-
- private StructuredTextEditor _textEditor;
-
- /**
- * @param textEditor
- */
- public DesignerSourceDropTargetListener(StructuredTextEditor textEditor) {
- super(false);
- _textEditor = textEditor;
- setTextViewer(_textEditor.getTextViewer());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.ITextEditorDropTargetListener#getTransfers()
- */
- public Transfer[] getTransfers() {
- return new Transfer[] { TemplateTransfer.getInstance(),
- TextTransfer.getInstance() };
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.swt.dnd.DropTargetListener#dragOperationChanged(org.eclipse.swt.dnd.DropTargetEvent)
- */
- public void dragOperationChanged(DropTargetEvent event) {
- super.dragOperationChanged(event);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.swt.dnd.DropTargetListener#dragOver(org.eclipse.swt.dnd.DropTargetEvent)
- */
- public void dragOver(DropTargetEvent event) {
- StyledText text = null;
- if (_textEditor.getTextViewer() != null) {
- text = _textEditor.getTextViewer().getTextWidget();
- if (TemplateTransfer.getInstance().isSupportedType(
- event.currentDataType)) {
- if (_textEditor.getTextViewer() != null) {
- Point p = new Point(event.x, event.y);
- SourceViewerDragDropHelper.getInstance().updateCaret(
- _textEditor, p);
- _location = text.getCaretOffset();
- if (TemplateTransfer.getInstance().isSupportedType(
- event.currentDataType)) {
- _location = SourceViewerDragDropHelper.getInstance()
- .getValidLocation(_textEditor, _location);
- }
- SourceViewerDragDropHelper.getInstance().showCaret(
- _textEditor, _location);
- }
- } else if (TextTransfer.getInstance().isSupportedType(
- event.currentDataType)) {
- super.dragOver(event);
- _location = text.getCaretOffset();
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.swt.dnd.DropTargetListener#drop(org.eclipse.swt.dnd.DropTargetEvent)
- */
- public void drop(DropTargetEvent event) {
- StyledText text = null;
- if (_textEditor.getTextViewer() != null) {
- text = _textEditor.getTextViewer().getTextWidget();
- }
- text.setCaretOffset(_location);
- Command command = getCommand(event);
- if (command == null) {
- return;
- }
- command.execute();
- }
-
- private Command getCommand(DropTargetEvent event) {
- if (TextTransfer.getInstance().isSupportedType(event.currentDataType)) {
- Object data = event.data;
- if (data instanceof String) {
- SourceViewLocalDropCommand command = new SourceViewLocalDropCommand(
- _textEditor, data, _location);
- return command;
- }
- } else if (TemplateTransfer.getInstance().isSupportedType(
- event.currentDataType)) {
- Object data = event.data;
- PaletteDropInsertCommand command = null;
- if (data instanceof TagToolPaletteEntry) {
- TagToolPaletteEntry tagItem = (TagToolPaletteEntry) data;
- // "Create new item"
- command = new PaletteDropInsertCommand(
- PageDesignerResources
- .getInstance()
- .getString(
- "DesignerSourceDropTargetListener.InserCommandLabel"), _textEditor, tagItem, _location); //$NON-NLS-1$
- }
- return command;
- }
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/DesignerSourceMouseTrackAdapter.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/DesignerSourceMouseTrackAdapter.java
deleted file mode 100644
index 636460b..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/DesignerSourceMouseTrackAdapter.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dnd.internal;
-
-import org.eclipse.gef.EditDomain;
-import org.eclipse.gef.palette.ToolEntry;
-import org.eclipse.jst.pagedesigner.commands.PaletteDropInsertCommand;
-import org.eclipse.jst.pagedesigner.commands.SourceViewerCommand;
-import org.eclipse.jst.pagedesigner.editors.pagedesigner.PageDesignerResources;
-import org.eclipse.jst.pagedesigner.editors.palette.TagToolPaletteEntry;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.events.MouseMoveListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.sse.ui.internal.ExtendedEditorDropTargetAdapter;
-
-/**
- * @author mengbo
- */
-public class DesignerSourceMouseTrackAdapter extends
- ExtendedEditorDropTargetAdapter implements MouseListener,
- MouseMoveListener {
- private int _location;
-
- private StructuredTextEditor _textEditor;
-
- private EditDomain _domain;
-
- /**
- * @param textEditor
- * @param domain
- */
- public DesignerSourceMouseTrackAdapter(StructuredTextEditor textEditor,
- EditDomain domain) {
- super(false);
- _textEditor = textEditor;
- _domain = domain;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.swt.events.MouseMoveListener#mouseMove(org.eclipse.swt.events.MouseEvent)
- */
- public void mouseMove(MouseEvent event) {
- Object object = getPaletteObject();
- StyledText text = null;
- if (_textEditor.getTextViewer() != null) {
- text = _textEditor.getTextViewer().getTextWidget();
- } else {
- return;
- }
- if (object == null) {
- // set to default cusror
- text.setCursor(null);
- return;
- }
- Point p = new Point(event.x, event.y);
- p = _textEditor.getTextViewer().getTextWidget().toDisplay(p);
- SourceViewerDragDropHelper.getInstance().updateCaret(_textEditor, p);
- _location = text.getCaretOffset();
- _location = SourceViewerDragDropHelper.getInstance().getValidLocation(
- _textEditor, _location);
- _location = SourceViewerDragDropHelper.getInstance().showCaret(
- _textEditor, _location);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.swt.events.MouseListener#mouseUp(org.eclipse.swt.events.MouseEvent)
- */
- public void mouseUp(MouseEvent event) {
- if (event.button != 1) {
- if (_domain.getPaletteViewer() != null) {
- _domain.getPaletteViewer().setActiveTool(null);
- }
- return;
- }
- SourceViewerCommand command = getCommand(event);
- if (command != null) {
- command.execute();
- resetPalette();
- }
- _location = 0;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.palette.PaletteListener#activeToolChanged(org.eclipse.gef.ui.palette.PaletteViewer,
- * org.eclipse.gef.palette.ToolEntry)
- */
- private Object getPaletteObject() {
- if (_domain.getPaletteViewer() != null) {
- Object tool = _domain.getPaletteViewer().getActiveTool();
- if (tool instanceof TagToolPaletteEntry) {
- return tool;
- }
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.swt.events.MouseListener#mouseDoubleClick(org.eclipse.swt.events.MouseEvent)
- */
- public void mouseDoubleClick(MouseEvent e) {
- // do nothing
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.swt.events.MouseListener#mouseDown(org.eclipse.swt.events.MouseEvent)
- */
- public void mouseDown(MouseEvent e) {
- // do nothing
- }
-
- private PaletteDropInsertCommand getCommand(MouseEvent event) {
- Object data = getPaletteObject();
- PaletteDropInsertCommand command = null;
- if (data instanceof TagToolPaletteEntry) {
- TagToolPaletteEntry descriptor = (TagToolPaletteEntry) data;
- // "Create new item"
- command = new PaletteDropInsertCommand(
- PageDesignerResources
- .getInstance()
- .getString(
- "DesignerSourceDropTargetListener.InserCommandLabel"),
- _textEditor, descriptor, _location);
- }
- return command;
- }
-
- private void resetPalette() {
- if (_domain.getPaletteViewer() != null) {
- ToolEntry tool = _domain.getPaletteViewer().getPaletteRoot()
- .getDefaultEntry();
- if (tool != null) {
- _domain.getPaletteViewer().setActiveTool(tool);
- }
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/DesignerTemplateTransferDragSourceListener.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/DesignerTemplateTransferDragSourceListener.java
deleted file mode 100644
index c1d3868..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/DesignerTemplateTransferDragSourceListener.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dnd.internal;
-
-import java.util.List;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.dnd.TemplateTransferDragSourceListener;
-import org.eclipse.jst.pagedesigner.editors.palette.TagToolPaletteEntry;
-
-/**
- * @author mengbo
- */
-public class DesignerTemplateTransferDragSourceListener extends
- TemplateTransferDragSourceListener {
-
- /**
- * @param viewer
- */
- public DesignerTemplateTransferDragSourceListener(EditPartViewer viewer) {
- super(viewer);
- }
-
- protected Object getTemplate() {
- Object object = super.getTemplate();
- if (object == null) {
- List selection = getViewer().getSelectedEditParts();
- if (selection.size() == 1) {
- EditPart editpart = (EditPart) getViewer()
- .getSelectedEditParts().get(0);
- Object model = editpart.getModel();
- if (model instanceof TagToolPaletteEntry) {
- return model;
- }
- }
- }
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/DropSelectionWizard.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/DropSelectionWizard.java
deleted file mode 100644
index 8960639..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/DropSelectionWizard.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dnd.internal;
-
-import java.util.Map;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.dnd.ILocalDropHandler;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- */
-public class DropSelectionWizard extends Wizard {
- private final String INTIAL_DEFAULT_PAGE_IMAGE = "newsuade_wiz.gif";
-
- private Object _localData;
-
- private IHTMLGraphicalViewer _viewer;
-
- private Map _feedbackToHandlers;
-
- private boolean _updateWidget;
-
- private Node _widget;
-
- private IDOMPosition _position;
-
- private SimpleWizardSelectionPage _firstPage;
-
- private DropSelectionWizard(IHTMLGraphicalViewer viewer, Object localData,
- Map handlers) {
- this.setWindowTitle(Messages.getString("DropSelectionWizard.Title")); //$NON-NLS-1$
- ImageDescriptor desc = PDPlugin.getDefault().getImageDescriptor(
- INTIAL_DEFAULT_PAGE_IMAGE);
- setDefaultPageImageDescriptor(desc);
- this._viewer = viewer;
- this._localData = localData;
- this._feedbackToHandlers = handlers;
-
- _firstPage = new SimpleWizardSelectionPage(_viewer, _localData,
- _feedbackToHandlers);
- }
-
- /**
- * @param viewer
- * @param localData
- * @param handlers
- * @param widget
- */
- public DropSelectionWizard(IHTMLGraphicalViewer viewer, Object localData,
- Map handlers, Node widget) {
- this(viewer, localData, handlers);
- _updateWidget = true;
- _widget = widget;
-
- _firstPage.setWidget(widget);
- }
-
- /**
- * @param viewer
- * @param localData
- * @param handlers
- * @param position
- */
- public DropSelectionWizard(IHTMLGraphicalViewer viewer, Object localData,
- Map handlers, IDOMPosition position) {
- this(viewer, localData, handlers);
- _updateWidget = false;
- _position = position;
-
- _firstPage.setPosition(position);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.wizard.Wizard#addPages()
- */
- public void addPages() {
- addPage(_firstPage);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.wizard.Wizard#needsPreviousAndNextButtons()
- */
- public boolean needsPreviousAndNextButtons() {
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.wizard.Wizard#canFinish()
- */
- public boolean canFinish() {
- if (getContainer().getCurrentPage() == _firstPage) {
- Object obj = _firstPage.getCurrentHandler();
- if (obj instanceof ILocalDropHandler)
- {
- return true;
- }
- return false;
- }
- return super.canFinish();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.wizard.IWizard#performFinish()
- */
- public boolean performFinish() {
- if (getContainer().getCurrentPage() == _firstPage) {
- Object obj = _firstPage.getCurrentHandler();
- if (obj instanceof ILocalDropHandler) {
- ILocalDropHandler handler = (ILocalDropHandler) obj;
- if (_updateWidget) {
- handler.doUpdateWidget(_localData, _widget, _viewer);
- } else {
- handler.doInsertElements(_localData, _position, _viewer);
- }
- return true;
- }
- }
- return true;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/LocalDropCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/LocalDropCommand.java
deleted file mode 100644
index 6b6a802..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/LocalDropCommand.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dnd.internal;
-
-import java.util.Map;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jst.jsf.common.ui.internal.dialogs.CommonWizardDialog;
-import org.eclipse.jst.pagedesigner.dnd.ILocalDropHandler;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.eclipse.swt.widgets.Shell;
-import org.w3c.dom.Node;
-
-/**
- * This is the command that performs the drop operation. There is no need for
- * this command to go into command stack, it simply open wizards, and let
- * wizards to handle the remaining things.
- *
- * @author mengbo
- */
-public class LocalDropCommand extends Command {
- /**
- * the map from feedback to ILocalDropHandler
- */
- private Map _feedbackToHandlers;
-
- private IHTMLGraphicalViewer _viewer;
-
- private Object _localObject;
-
- private Node _widget;
-
- private IDOMPosition _position;
-
- /**
- * constructor
- * @param viewer
- * @param localObject
- * @param feedbackHandlers
- */
- public LocalDropCommand(IHTMLGraphicalViewer viewer, Object localObject,
- Map feedbackHandlers) {
- _viewer = viewer;
- _localObject = localObject;
- _feedbackToHandlers = feedbackHandlers;
- }
-
- /**
- * @param widget
- */
- public void setWidget(Node widget) {
- _widget = widget;
- }
-
- /**
- * @param position
- */
- public void setDOMPosition(IDOMPosition position) {
- _position = position;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.commands.Command#execute()
- */
- public void execute() {
- if (_feedbackToHandlers.size() == 1) {
- // only have one choice.
- ILocalDropHandler handler = (ILocalDropHandler) _feedbackToHandlers
- .values().toArray()[0];
- if (handler.useWizard(_localObject, _viewer)) {
- IWizard wizard;
- if (_widget != null) {
- wizard = handler.getWizard(_localObject, _widget, _viewer);
- } else {
- wizard = handler
- .getWizard(_localObject, _position, _viewer);
- }
- CommonWizardDialog wizardDialog = new CommonWizardDialog(
- getShell(), wizard);
- wizardDialog.setTitle(Messages
- .getString("LocalDropCommand.DropHandler"));
- wizardDialog.create();
- wizardDialog.open();
- } else {
- if (_widget != null) {
- handler.doUpdateWidget(_localObject, _widget, _viewer);
- } else {
- handler.doInsertElements(_localObject, _position, _viewer);
- }
- }
- } else {
- CommonWizardDialog wizardDialog = new CommonWizardDialog(
- getShell(), getWizard());
- wizardDialog.setTitle(Messages
- .getString("LocalDropCommand.DropHandler"));
- wizardDialog.setBlockOnOpen(false);
- wizardDialog.create();
- wizardDialog.open();
- }
- }
-
- /**
- * @return
- */
- private IWizard getWizard() {
- if (_widget != null) {
- return new DropSelectionWizard(_viewer, _localObject,
- _feedbackToHandlers, _widget);
- }
- return new DropSelectionWizard(_viewer, _localObject,
- _feedbackToHandlers, _position);
- }
-
- /**
- * @return
- */
- private Shell getShell() {
- return _viewer.getControl().getShell();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/LocalDropEditPolicy.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/LocalDropEditPolicy.java
deleted file mode 100644
index 5076d6c..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/LocalDropEditPolicy.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dnd.internal;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.GraphicalEditPolicy;
-import org.eclipse.jst.pagedesigner.dnd.FeedBackInfo;
-import org.eclipse.jst.pagedesigner.dnd.ILocalDropHandler;
-import org.eclipse.jst.pagedesigner.dnd.LocalDropRequest;
-import org.eclipse.jst.pagedesigner.dom.DOMPositionHelper;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.jst.pagedesigner.editpolicies.LocationHelper;
-import org.eclipse.jst.pagedesigner.parts.ElementEditPart;
-import org.eclipse.jst.pagedesigner.parts.NodeEditPart;
-import org.eclipse.jst.pagedesigner.tools.ExposeHelper;
-import org.eclipse.jst.pagedesigner.validation.caret.ActionData;
-import org.eclipse.jst.pagedesigner.validation.caret.DnDPositionValidator;
-import org.eclipse.jst.pagedesigner.viewer.DesignPosition;
-import org.eclipse.jst.pagedesigner.viewer.EditPartPositionHelper;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.w3c.dom.Node;
-
-/**
- * This is the editpolicy to handle LocalSelectionDrop
- *
- * @author mengbo
- */
-public class LocalDropEditPolicy extends GraphicalEditPolicy {
- private RectangleFigure _feedbackFigure;
-
- // indicate whether update is checked
- private static boolean _checkUpdate = true;
-
- /**
- * @param widgetEditPart
- * @param request
- * @param results
- * @return true if should update widget
- */
- public boolean checkUpdateWidget(EditPart widgetEditPart,
- LocalDropRequest request, Map results) {
- if (!(widgetEditPart instanceof ElementEditPart)) {
- return false;
- }
- Node widget = ((ElementEditPart) widgetEditPart).getIDOMNode();
- ILocalDropHandler[] handlers = RegistryReader.getAllHandlers();
- Object localData = request.getLocalObject();
- for (int i = 0; i < handlers.length; i++) {
- FeedBackInfo feedback = handlers[i].supportUpdateWidget(localData,
- widget);
- if (feedback != null) {
- results.put(feedback, handlers[i]);
- }
- }
- return !results.isEmpty();
- }
-
- /**
- * @param request
- * @param host
- * @param results
- * @param dpHolder
- * @param position
- * @return true if should insert element
- */
- public boolean checkInsertElement(LocalDropRequest request,
- EditPart[] host, Map results, DesignPosition[] dpHolder,
- IDOMPosition[] position) {
- DesignPosition designPosition = EditPartPositionHelper
- .findEditPartPosition(host[0], request.getLocation(),
- new DnDPositionValidator(new ActionData(
- ActionData.DATABINDING_DND, request)));
- dpHolder[0] = designPosition;
- if (designPosition == null) {
- return false;
- }
-
- host[0] = designPosition.getContainerPart();
- position[0] = DOMPositionHelper.toDOMPosition(designPosition);
- ILocalDropHandler[] handlers = RegistryReader.getAllHandlers();
- Object localData = request.getLocalObject();
- for (int i = 0; i < handlers.length; i++) {
- FeedBackInfo feedback = handlers[i].supportInsertElements(
- localData, position[0]);
- if (feedback != null) {
- results.put(feedback, handlers[i]);
- }
- }
- return !results.isEmpty();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editpolicies.AbstractEditPolicy#getTargetEditPart(org.eclipse.gef.Request)
- */
- public EditPart getTargetEditPart(Request request) {
- if (request instanceof LocalDropRequest) {
- LocalDropRequest r = (LocalDropRequest) request;
- EditPart host = getHost();
- if (_checkUpdate && checkUpdateWidget(host, r, new HashMap())) {
- return host;
- }
- EditPart[] hostHolder = new EditPart[] { host };
- if (checkInsertElement(r, hostHolder, new HashMap(),
- new DesignPosition[1], new IDOMPosition[1])) {
- return hostHolder[0];
- }
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editpolicies.AbstractEditPolicy#getCommand(org.eclipse.gef.Request)
- */
- public Command getCommand(Request request) {
- if (request instanceof LocalDropRequest) {
- LocalDropRequest r = (LocalDropRequest) request;
- EditPart host = getHost();
-
- Map result = new HashMap();
- if (_checkUpdate && checkUpdateWidget(host, r, result)) {
- LocalDropCommand command = new LocalDropCommand(
- getViewer(host), r.getLocalObject(), result);
- command.setWidget(((NodeEditPart) host).getIDOMNode());
- return command;
- }
- result.clear();
-
- EditPart[] hostHolder = new EditPart[] { host };
- IDOMPosition[] positionHolder = new IDOMPosition[1];
- if (checkInsertElement(r, hostHolder, result,
- new DesignPosition[1], positionHolder)) {
- LocalDropCommand command = new LocalDropCommand(
- getViewer(host), r.getLocalObject(), result);
- command.setDOMPosition(positionHolder[0]);
- return command;
- }
- }
- return null;
- }
-
- /**
- * @param host
- * @return
- */
- private IHTMLGraphicalViewer getViewer(EditPart host) {
- return (IHTMLGraphicalViewer) ((GraphicalEditPart) host).getViewer();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editpolicies.AbstractEditPolicy#eraseTargetFeedback(org.eclipse.gef.Request)
- */
- public void eraseTargetFeedback(Request request) {
- if (_feedbackFigure != null) {
- removeFeedback(_feedbackFigure);
- _feedbackFigure = null;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editpolicies.AbstractEditPolicy#showTargetFeedback(org.eclipse.gef.Request)
- */
- public void showTargetFeedback(Request request) {
- if (request instanceof LocalDropRequest) {
- LocalDropRequest r = (LocalDropRequest) request;
- EditPart host = getHost();
- if (_checkUpdate && checkUpdateWidget(host, r, new HashMap())) {
- Rectangle rect = LocationHelper
- .getAbsoluteBounds((GraphicalEditPart) host);
- showFeedbackRect(rect);
- return;
- }
- EditPart[] hostHolder = new EditPart[] { host };
- DesignPosition[] holder = new DesignPosition[1];
- if (checkInsertElement(r, hostHolder, new HashMap(), holder,
- new IDOMPosition[1])) {
- Rectangle rect = EditPartPositionHelper
- .convertToAbsoluteCaretRect(holder[0]);
- showFeedbackRect(rect);
- if (getHost() instanceof GraphicalEditPart) {
- ExposeHelper exposeHelper = new ExposeHelper(
- getViewer(getHost()));
- exposeHelper.adjustVertical(r.getLocation());
- }
- return;
- }
- }
- }
-
- /**
- * @return the feedback figure
- */
- protected RectangleFigure getFeedbackFigure() {
- if (_feedbackFigure == null) {
- _feedbackFigure = new RectangleFigure();
- _feedbackFigure.setFill(true);
- _feedbackFigure.setOutline(true);
- _feedbackFigure.setLineWidth(1);
- _feedbackFigure.setForegroundColor(ColorConstants.red);
- _feedbackFigure.setBounds(new Rectangle(0, 0, 0, 0));
- _feedbackFigure.setXOR(true);
- addFeedback(_feedbackFigure);
- }
- return _feedbackFigure;
- }
-
- /**
- * @param rect
- */
- protected void showFeedbackRect(Rectangle rect) {
- RectangleFigure pf = getFeedbackFigure();
- pf.translateToRelative(rect);
- pf.setBounds(rect);
- }
-
- /**
- * @return Returns the _forUpdate.
- */
- public static boolean isCheckUpdate() {
- return _checkUpdate;
- }
-
- /**
- * @param update
- * The _forUpdate to set.
- */
- public static void setCheckUpdate(boolean update) {
- _checkUpdate = update;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/LocalSelectionDropTargetListener.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/LocalSelectionDropTargetListener.java
deleted file mode 100644
index 14fcf31..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/LocalSelectionDropTargetListener.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dnd.internal;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.dnd.AbstractTransferDropTargetListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.jsf.common.ui.internal.guiutils.Alerts;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.dnd.LocalDropRequest;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.DropTargetEvent;
-import org.eclipse.ui.views.navigator.LocalSelectionTransfer;
-
-/**
- * @author mengbo
- */
-public class LocalSelectionDropTargetListener extends
- AbstractTransferDropTargetListener {
- /**
- * @param viewer
- */
- public LocalSelectionDropTargetListener(EditPartViewer viewer) {
- super(viewer, LocalSelectionTransfer.getInstance());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.dnd.AbstractTransferDropTargetListener#createTargetRequest()
- */
- protected Request createTargetRequest() {
- LocalDropRequest request = new LocalDropRequest();
- request.setLocation(getDropLocation());
- request.setLocalObject(getCurrentLocalObject());
- return request;
- }
-
- /**
- * @return the current local object
- */
- private Object getCurrentLocalObject() {
- ISelection sel = LocalSelectionTransfer.getInstance().getSelection();
- if (sel instanceof IStructuredSelection) {
- return ((IStructuredSelection) sel).getFirstElement();
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.dnd.AbstractTransferDropTargetListener#updateTargetRequest()
- */
- protected void updateTargetRequest() {
- LocalDropRequest dropRequest = (LocalDropRequest) getTargetRequest();
- dropRequest.setLocation(getDropLocation());
- dropRequest.setLocalObject(getCurrentLocalObject());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.dnd.AbstractTransferDropTargetListener#setCurrentEvent(org.eclipse.swt.dnd.DropTargetEvent)
- */
- public void setCurrentEvent(DropTargetEvent currentEvent) {
- super.setCurrentEvent(currentEvent);
- if (currentEvent != null) {
- if (currentEvent.detail != DND.DROP_NONE) {
- currentEvent.detail = DND.DROP_COPY;
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.swt.dnd.DropTargetListener#dragOperationChanged(org.eclipse.swt.dnd.DropTargetEvent)
- */
- public void dragOperationChanged(DropTargetEvent event) {
- // switch the insert or update
- if ((event.detail & (DND.DROP_COPY)) != 0) {
- LocalDropEditPolicy.setCheckUpdate(false);
- } else {
- LocalDropEditPolicy.setCheckUpdate(true);
- }
- super.dragOperationChanged(event);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.swt.dnd.DropTargetListener#drop(org.eclipse.swt.dnd.DropTargetEvent)
- */
- public void drop(DropTargetEvent event) {
- String path = ((IHTMLGraphicalViewer) getViewer()).getModel()
- .getBaseLocation();
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- IWorkspaceRoot root = workspace.getRoot();
- IPath filePath = new Path(path);
- if (root.getFile(filePath).exists()) {
- getViewer().getControl().setFocus();
- super.drop(event);
- LocalDropEditPolicy.setCheckUpdate(true);
- } else {
- Alerts alert = PDPlugin.getAlerts();
- alert.info("LocalSelectionDropTargetListener.MessageDialog.Title",
- "LocalSelectionDropTargetListener.MessageDialog.Message");
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/Messages.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/Messages.java
deleted file mode 100644
index f7baa6e..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/Messages.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dnd.internal;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * A message bundle for dnd
- *
- */
-/*package*/ class Messages {
- private static final String BUNDLE_NAME = "org.eclipse.jst.pagedesigner.dnd.internal.messages"; //$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
- .getBundle(BUNDLE_NAME);
-
- private Messages() {
- // no external instantiation
- }
-
- /**
- * @param key
- * @return the message for key
- */
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/PDTemplateTransferDropTargetListener.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/PDTemplateTransferDropTargetListener.java
deleted file mode 100644
index a251045..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/PDTemplateTransferDropTargetListener.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dnd.internal;
-
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.dnd.AbstractTransferDropTargetListener;
-import org.eclipse.gef.dnd.TemplateTransfer;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.editors.palette.TagToolPaletteEntry;
-import org.eclipse.jst.pagedesigner.itemcreation.ItemCreationRequest;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.DropTargetEvent;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class PDTemplateTransferDropTargetListener extends
- AbstractTransferDropTargetListener {
-
- /**
- * @param viewer
- */
- public PDTemplateTransferDropTargetListener(EditPartViewer viewer) {
- super(viewer, TemplateTransfer.getInstance());
- }
-
- /**
- * @see org.eclipse.gef.dnd.AbstractTransferDropTargetListener#createTargetRequest()
- */
- protected Request createTargetRequest() {
- ItemCreationRequest request = new ItemCreationRequest();
- /*TODO: nothing is done with this var. Does the method have a side-effect? TagToolPaletteEntry tagItem =*/TemplateTransfer.getInstance().getTemplate();
- return request;
- }
-
- /**
- * A helper method that casts the target Request to a CreateRequest.
- *
- * @return CreateRequest
- */
- protected final Request getCreateRequest() {
- return getTargetRequest();
- }
-
- /**
- * The purpose of a template is to be copied. Therefore, the drop operation
- * can't be anything but <code>DND.DROP_COPY</code>.
- *
- * @see AbstractTransferDropTargetListener#handleDragOperationChanged()
- */
- protected void handleDragOperationChanged() {
- getCurrentEvent().detail = DND.DROP_COPY;
- super.handleDragOperationChanged();
- }
-
- /**
- * The purpose of a template is to be copied. Therefore, the Drop operation
- * is set to <code>DND.DROP_COPY</code> by default.
- *
- * @see org.eclipse.gef.dnd.AbstractTransferDropTargetListener#handleDragOver()
- */
- protected void handleDragOver() {
- getCurrentEvent().detail = DND.DROP_COPY;
- getCurrentEvent().feedback = DND.FEEDBACK_SCROLL | DND.FEEDBACK_EXPAND;
- super.handleDragOver();
- }
-
- /**
- * Assumes that the target request is a {@link org.eclipse.gef.requests.CreateRequest}.
- */
- protected void updateTargetRequest() {
- // We should never see request that is not of ItemCreationRequest type,
- // but there is an error case that Eclipse send out other types
- // requests.
- // Add this test to avoid potential error.
- if (getCreateRequest() instanceof ItemCreationRequest) {
- ItemCreationRequest request = (ItemCreationRequest) getCreateRequest();
- Object transferObj = TemplateTransfer.getInstance().getObject();
-
- if (transferObj instanceof TagToolPaletteEntry)
- {
- TagToolPaletteEntry tagItem =
- (TagToolPaletteEntry) transferObj;
-
- request.setTagToolPaletteEntry(tagItem);
- request.setLocation(getDropLocation());
- }
- else
- {
- PDPlugin.getLogger(this.getClass()).error("Unexpected transfer object on palette drag:"+transferObj, new Throwable("Artificial throwable for stack tracing"));
- }
- }
- }
-
- public void drop(DropTargetEvent event) {
- if (getCreateRequest() instanceof ItemCreationRequest) {
- getViewer().getControl().setFocus();
- super.drop(event);
- }
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/RegistryReader.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/RegistryReader.java
deleted file mode 100644
index c364c7f..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/RegistryReader.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dnd.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.pagedesigner.IJMTConstants;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.dnd.ILocalDropHandler;
-
-/**
- * Read the registry to find out all the LocalDropHandlers.
- *
- * @author mengbo
- */
-public class RegistryReader {
- final private static Logger _log = PDPlugin.getLogger(RegistryReader.class);
-
- private static ILocalDropHandler[] _handlers = null;
-
- /**
- * @return all registered drop handlers
- */
- public static synchronized ILocalDropHandler[] getAllHandlers() {
- if (_handlers == null) {
- _handlers = readAllHandlers();
- }
- return _handlers;
-
- }
-
- private static ILocalDropHandler[] readAllHandlers() {
- List result = new ArrayList();
- IExtensionPoint extensionPoint = Platform.getExtensionRegistry()
- .getExtensionPoint(PDPlugin.getPluginId(),
- IJMTConstants.EXTENSION_POINT_PAGEDESIGNER);
- IExtension[] extensions = extensionPoint.getExtensions();
-
- for (int i = 0; i < extensions.length; i++) {
- IExtension ext = extensions[i];
- IConfigurationElement[] dropHandlers = ext
- .getConfigurationElements();
-
- for (int j = 0; j < dropHandlers.length; j++) {
- if (dropHandlers[j].getName().equals(
- IJMTConstants.LOCAL_DROP_HANDLER)) {
- dropHandlers[j].getAttribute("class");
- Object obj;
- try {
- obj = dropHandlers[j]
- .createExecutableExtension("class");
-
- if (obj instanceof ILocalDropHandler) {
- result.add(obj);
- }
- } catch (CoreException e) {
- _log.info("CoreException", e);
- }
- }
- }
- }
- ILocalDropHandler[] ret = new ILocalDropHandler[result.size()];
- result.toArray(ret);
- return ret;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/ResouceDropTargetListener.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/ResouceDropTargetListener.java
deleted file mode 100644
index 873c641..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/ResouceDropTargetListener.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dnd.internal;
-
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.dnd.AbstractTransferDropTargetListener;
-import org.eclipse.jst.pagedesigner.dnd.LocalDropRequest;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.DropTargetEvent;
-import org.eclipse.swt.dnd.FileTransfer;
-
-/**
- * The drop target listener for DnD from Windows explorer.
- *
- * @author mengbo
- * @version 1.5
- */
-public class ResouceDropTargetListener extends
- AbstractTransferDropTargetListener {
-
- /**
- * @param viewer
- */
- public ResouceDropTargetListener(EditPartViewer viewer) {
- super(viewer, FileTransfer.getInstance());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.dnd.AbstractTransferDropTargetListener#createTargetRequest()
- */
- protected Request createTargetRequest() {
- LocalDropRequest request = new LocalDropRequest();
- request.setLocation(getDropLocation());
- request.setLocalObject(getCurrentLocalObject());
- return request;
- }
-
- private Object getCurrentLocalObject() {
- Object result = null;
- try {
- Object data = ((FileTransfer) getTransfer())
- .nativeToJava(getCurrentEvent().currentDataType);
- if (data instanceof String[]) {
- result = ((String[]) data)[0];
- }
- } catch (Exception e) {
- // Don't know the tag type.
- }
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.dnd.AbstractTransferDropTargetListener#updateTargetRequest()
- */
- protected void updateTargetRequest() {
- LocalDropRequest dropRequest = (LocalDropRequest) getTargetRequest();
- dropRequest.setLocation(getDropLocation());
- dropRequest.setLocalObject(getCurrentLocalObject());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.dnd.AbstractTransferDropTargetListener#setCurrentEvent(org.eclipse.swt.dnd.DropTargetEvent)
- */
- public void setCurrentEvent(DropTargetEvent currentEvent) {
- super.setCurrentEvent(currentEvent);
- if (currentEvent != null) {
- if (currentEvent.detail != DND.DROP_NONE) {
- currentEvent.detail = DND.DROP_COPY;
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.swt.dnd.DropTargetListener#dragOperationChanged(org.eclipse.swt.dnd.DropTargetEvent)
- */
- public void dragOperationChanged(DropTargetEvent event) {
- // switch the insert or update
- if ((event.detail & (DND.DROP_COPY)) != 0) {
- LocalDropEditPolicy.setCheckUpdate(false);
- } else {
- LocalDropEditPolicy.setCheckUpdate(true);
- }
- super.dragOperationChanged(event);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.swt.dnd.DropTargetListener#drop(org.eclipse.swt.dnd.DropTargetEvent)
- */
- public void drop(DropTargetEvent event) {
- getViewer().getControl().setFocus();
- super.drop(event);
- LocalDropEditPolicy.setCheckUpdate(true);
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/SimpleWizardSelectionPage.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/SimpleWizardSelectionPage.java
deleted file mode 100644
index c507c2a..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/SimpleWizardSelectionPage.java
+++ /dev/null
@@ -1,274 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dnd.internal;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.ListViewer;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.IWizardNode;
-import org.eclipse.jface.wizard.WizardSelectionPage;
-import org.eclipse.jst.pagedesigner.dnd.FeedBackInfo;
-import org.eclipse.jst.pagedesigner.dnd.ILocalDropHandler;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.w3c.dom.Node;
-
-/**
- * UI wizard selection page. To let user select which ILocalDropHandler to use
- * to handle the drop.
- *
- * @author mengbo
- */
-public class SimpleWizardSelectionPage extends WizardSelectionPage implements
- ISelectionChangedListener {
- private Object _localData;
-
- private IHTMLGraphicalViewer _viewer;
-
- private boolean _updateWidget;
-
- private Node _widget;
-
- private IDOMPosition _position;
-
- /**
- * for those handler that support wizard, then map to WizardNode, otherwise
- * still map to the handler
- */
- private Map _objToWizardNodeOrHandler = new HashMap();
-
- private Map _feedbackToHandlers;
-
- private Object _currentHandler = null; // IWizardNode or a
-
- // ILocalDropHandler that don't
- // useWizard.
-
- /**
- * @param viewer
- * @param localData
- * @param handlers
- */
- public SimpleWizardSelectionPage(IHTMLGraphicalViewer viewer,
- Object localData, Map handlers) {
- super(Messages.getString("SimpleWizardSelectionPage.PageName")); //$NON-NLS-1$
- this.setTitle(Messages.getString("SimpleWizardSelectionPage.Title")); //$NON-NLS-1$
- this.setDescription(Messages
- .getString("SimpleWizardSelectionPage.Description")); //$NON-NLS-1$
- this
- .setMessage(Messages
- .getString("SimpleWizardSelectionPage.Message")); //$NON-NLS-1$
-
- this._viewer = viewer;
- this._localData = localData;
- this._feedbackToHandlers = handlers;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
- */
- public void createControl(Composite parent) {
- Composite container = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.verticalSpacing = 10;
- container.setLayout(layout);
- container.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- Label label = new Label(container, SWT.NONE);
- label
- .setText(Messages
- .getString("SimpleWizardSelectionPage.Operation")); //$NON-NLS-1$
- GridData gd = new GridData();
- label.setLayoutData(gd);
-
- final ListViewer listViewer = new ListViewer(container);
- listViewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
-
- listViewer.setContentProvider(new IStructuredContentProvider() {
- public Object[] getElements(Object inputElement) {
- return ((List) inputElement).toArray();
- }
-
- public void dispose() {
- // nothing to dispose
- }
-
- public void inputChanged(Viewer viewer, Object oldInput,
- Object newInput) {
- // no input changing
- }
- });
- listViewer.setLabelProvider(new LabelProvider() {
- public String getText(Object element) {
- return SimpleWizardSelectionPage.this.getText(element);
- }
- });
- listViewer.addDoubleClickListener(new IDoubleClickListener() {
- public void doubleClick(DoubleClickEvent event) {
- selectionChanged(new SelectionChangedEvent(listViewer,
- listViewer.getSelection()));
- advanceToNextPage();
- }
- });
- listViewer.setSorter(new ViewerSorter());
- listViewer.setInput(getElements());
- listViewer.addSelectionChangedListener(this);
- Dialog.applyDialogFont(container);
- setControl(container);
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
- */
- public void selectionChanged(SelectionChangedEvent event) {
- ISelection sel = event.getSelection();
- if (sel instanceof IStructuredSelection) {
- Object obj = ((IStructuredSelection) sel).getFirstElement();
- if (obj != null) {
- _currentHandler = this._objToWizardNodeOrHandler.get(obj);
- if (_currentHandler == null) {
- _currentHandler = getWizardNodeOrHandler(obj);
- this._objToWizardNodeOrHandler.put(obj, _currentHandler);
- }
-
- if (_currentHandler instanceof IWizardNode) {
- this.setSelectedNode((IWizardNode) _currentHandler);
- } else {
- this.getWizard().getContainer().updateButtons();
- }
- }
- }
- }
-
- /**
- * @param obj
- * @return
- */
- private Object getWizardNodeOrHandler(Object obj) {
- final ILocalDropHandler dropHandler = (ILocalDropHandler) _feedbackToHandlers
- .get(obj);
- if (dropHandler.useWizard(_localData, _viewer)) {
- return new IWizardNode() {
- IWizard _wizard = null;
-
- public void dispose() {
- // nothing to dispose
- }
-
- public Point getExtent() {
- return null;
- }
-
- public IWizard getWizard() {
- if (_wizard == null) {
- if (_updateWidget) {
- _wizard = dropHandler.getWizard(_localData,
- _widget, _viewer);
- } else {
- _wizard = dropHandler.getWizard(_localData,
- _position, _viewer);
- }
- }
- return _wizard;
- }
-
- public boolean isContentCreated() {
- return _wizard != null;
- }
- };
- }
- return dropHandler;
- }
-
- /**
- * could be have next page or just directly perform the action.
- *
- */
- public void advanceToNextPage() {
-
- getContainer().showPage(getNextPage());
- }
-
- /**
- * @param element
- * @return the text
- */
- protected String getText(Object element) {
- return ((FeedBackInfo) element).getDescription();
- }
-
- /**
- * @return the elements
- */
- protected List getElements() {
- return new ArrayList(this._feedbackToHandlers.keySet());
- }
-
- /**
- * @param widget
- */
- public void setWidget(Node widget) {
- _updateWidget = true;
- _widget = widget;
- }
-
- /**
- * @param position
- */
- public void setPosition(IDOMPosition position) {
- _updateWidget = false;
- _position = position;
- }
-
- /**
- * @return the current handler
- */
- public Object getCurrentHandler() {
- return _currentHandler;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.wizard.WizardSelectionPage#canFlipToNextPage()
- */
- public boolean canFlipToNextPage() {
- return getCurrentHandler() instanceof IWizardNode
- && super.canFlipToNextPage();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/SourceViewLocalDropCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/SourceViewLocalDropCommand.java
deleted file mode 100644
index b4e7fd4..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/SourceViewLocalDropCommand.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dnd.internal;
-
-import org.eclipse.jst.pagedesigner.commands.SourceViewerCommand;
-import org.eclipse.jst.pagedesigner.editors.pagedesigner.PageDesignerResources;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-
-/**
- * @author mengbo
- */
-public class SourceViewLocalDropCommand extends SourceViewerCommand {
- /**
- * the map from feedback to ILocalDropHandler
- */
- private int _location;
-
- private StructuredTextEditor _textEditor;
-
- private Object _data;
-
- /**
- * @param textEditor
- * @param data
- * @param location
- *
- */
- public SourceViewLocalDropCommand(StructuredTextEditor textEditor,
- Object data, int location) {
- super(PageDesignerResources.getInstance().getString(
- "SourceViewLocalDropCommand.Label.InsertSyntax"), textEditor); //$NON-NLS-1$
- _textEditor = textEditor;
- _data = data;
- _location = location;
- }
-
- public void doExecute() {
- _textEditor.getTextViewer().getTextWidget().insert((String) _data);
- }
-
- public void setSelection() {
- _textEditor.getTextViewer().setSelectedRange(_location,
- ((String) _data).length());
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/SourceViewerDragDropHelper.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/SourceViewerDragDropHelper.java
deleted file mode 100644
index d596a2c..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/SourceViewerDragDropHelper.java
+++ /dev/null
@@ -1,394 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dnd.internal;
-
-import org.eclipse.gef.SharedCursors;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.TextViewer;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.eclipse.jst.pagedesigner.dom.EditValidateUtil;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.ST;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Caret;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- * This class will 1. determine it's insertion or update 2. call validator
- * corresponding helper to resolve it.
- *
- * @author mengbo
- */
-public final class SourceViewerDragDropHelper {
- private static SourceViewerDragDropHelper _instance;
-
- /**
- * @return the singleton instance
- */
- public static SourceViewerDragDropHelper getInstance() {
- if (_instance == null) {
- _instance = new SourceViewerDragDropHelper();
- }
- return _instance;
- }
-
- private SourceViewerDragDropHelper()
- {
- // singleton, no external instantiation
- }
-
- private Point toControl(TextViewer textViewer, Point point) {
- return (textViewer != null ? textViewer.getTextWidget()
- .toControl(point) : point);
- }
-
- private int getDropOffset(StructuredTextEditor ste, Point pt) {
- StyledText st = ste.getTextViewer().getTextWidget();
- int offset = st.getCaretOffset();
- try {
- offset = st.getOffsetAtLocation(pt);
- } catch (IllegalArgumentException e) {
- boolean found = false;
- Point p = new Point((pt.x > 0 ? pt.x : 0), pt.y);
- // search nearest character
- for (; p.x > -1; p.x--) {
- try {
- offset = st.getOffsetAtLocation(p);
-
- /*
- * Now that a valid offset has been found, try to place at
- * the end of the line
- */
- if (ste.getTextViewer() != null
- && ste.getTextViewer().getDocument() != null) {
- IRegion lineInfo = null;
- try {
- lineInfo = ste.getTextViewer().getDocument()
- .getLineInformationOfOffset(offset);
- } catch (BadLocationException e1) {
- // ignore exception and fall-through with lineInfo == null
- }
- if (lineInfo != null)
- offset = lineInfo.getOffset()
- + lineInfo.getLength();
- }
-
- found = true;
- break;
- } catch (IllegalArgumentException ex) {
- // for trying location, no need to catch.
- }
- }
- if (!found) {
- offset = st.getCharCount();
- }
- }
- return offset;
- }
-
- /**
- * @param textEditor
- * @param location
- * @param caret
- */
- public void updateCaret(StructuredTextEditor textEditor, Point location,
- Point caret) {
- TextViewer textViewer = textEditor.getTextViewer();
- if (textViewer != null) {
- Point pt = toControl(textViewer, location);
- StyledText st = textViewer.getTextWidget();
-
- // auto scroll
- Rectangle ca = st.getClientArea();
- int margin = st.getLineHeight();
-
- if (pt.y < margin) { // up
- st.invokeAction(ST.LINE_UP);
- } else if (pt.y > ca.height - margin) { // down
- st.invokeAction(ST.LINE_DOWN);
- }
-
- // draw insertion point
- int offset = getDropOffset(textEditor, pt);
- if (offset != st.getCaretOffset()) {
- st.setCaretOffset(offset);
- st.setSelection(offset);
- }
-
- Point newCaret = st.getLocationAtOffset(offset);
- if (newCaret.equals(caret)) {
- return;
- }
-
- Caret ct = st.getCaret();
- Point size = ct.getSize();
-
- GC gc = new GC(st);
- //gc.setXORMode(true);
- gc.setLineWidth(size.x);
-
- // erase old caret
- if (caret != null) {
- Color originalForeground = gc.getForeground();
- gc.setForeground(st.getBackground());
- gc.drawLine(caret.x, caret.y, caret.x, caret.y + size.y);
- gc.setForeground(originalForeground);
- }
-
- st.redraw();
- st.update();
-
- // draw new caret
- if (caret == null) {
- caret = newCaret;
- } else {
- caret.x = newCaret.x;
- caret.y = newCaret.y;
- }
- if (ct.getImage() != null) {
- gc.drawImage(ct.getImage(), caret.x, caret.y);
- } else {
- gc.drawLine(caret.x, caret.y, caret.x, caret.y + size.y);
- }
-
- gc.dispose();
- }
- }
-
- /**
- * @param textEditor
- * @param location
- */
- public void updateCaret(StructuredTextEditor textEditor, Point location) {
- TextViewer textViewer = textEditor.getTextViewer();
- if (textViewer != null) {
- Point pt = toControl(textViewer, location);
- StyledText st = textViewer.getTextWidget();
-
- // auto scroll
- Rectangle ca = st.getClientArea();
- int margin = st.getLineHeight();
-
- if (pt.y < margin) { // up
- st.invokeAction(ST.LINE_UP);
- } else if (pt.y > ca.height - margin) { // down
- st.invokeAction(ST.LINE_DOWN);
- }
-
- // draw insertion point
- int offset = getDropOffset(textEditor, pt);
- if (offset != st.getCaretOffset()) {
- st.setCaretOffset(offset);
- st.setSelection(offset);
- }
- }
- }
-
- /**
- * @param textEditor
- * @param location
- * @return the caret offset
- */
- public int showCaret(StructuredTextEditor textEditor, int location) {
- StyledText text = textEditor.getTextViewer().getTextWidget();
- text.setCursor(SharedCursors.CURSOR_TREE_ADD);
- text.setCaretOffset(location);
- if (!text.isFocusControl()) {
- text.setFocus();
- }
- return text.getCaretOffset();
- }
-
- /**
- * @param node
- * @return the model query for the node or null if not available
- */
- protected ModelQuery getModelQuery(Node node) {
- if (node.getNodeType() == Node.DOCUMENT_NODE) {
- return ModelQueryUtil.getModelQuery((Document) node);
- }
- return ModelQueryUtil.getModelQuery(node.getOwnerDocument());
- }
-
- /**
- * @param caretPos
- * @param element
- * @return the position
- */
- public IDOMPosition findPosition(int caretPos, Node element) {
- EditValidateUtil.validNode(element);
- IDOMPosition position = EditModelQuery.getInstance().createDomposition(
- ((IDOMNode) element).getModel(), caretPos, false);
- return position;
- }
-
- /**
- * @param viewer
- * @param node
- */
- public void format(TextViewer viewer, Node node) {
- if (node == null) {
- return;
- }
- Node tmp;
- int start, offset;
- if (node.getPreviousSibling() != null) {
- tmp = node.getPreviousSibling();
- start = ((IndexedRegion) tmp).getEndOffset();
- } else {
- tmp = node;
- start = ((IndexedRegion) tmp).getStartOffset();
- }
- if (node.getNextSibling() != null) {
- tmp = node.getNextSibling();
- offset = ((IndexedRegion) tmp).getStartOffset() - start;
- } else {
- tmp = node;
- offset = ((IndexedRegion) tmp).getEndOffset() - start;
- }
- viewer.setSelectedRange(start, offset);
- viewer.doOperation(ISourceViewer.FORMAT);
- }
-
- /**
- * @param textEditor
- * @param reset
- */
- public void changeCaret(StructuredTextEditor textEditor, boolean reset) {
- if (reset) {
- StyledText text = textEditor.getTextViewer().getTextWidget();
- text.setCursor(new Cursor(null, SWT.CURSOR_IBEAM));
- }
- }
-
- /**
- * @param textEditor
- * @param locationOffset
- * @return the location offset
- */
- public int getValidLocation(StructuredTextEditor textEditor,
- int locationOffset) {
- Node node = getCaretNode(textEditor, locationOffset);
- if (node == null) {
- // empty page?
- return 0;
- }
- if (node.getNodeType() == Node.TEXT_NODE) {
- return locationOffset;
- }
- return calculateCaretLocation(node, locationOffset);
- }
-
- /**
- * @param textEditor
- * @param location
- * @return the offset
- */
- public int getOffset(StructuredTextEditor textEditor, Point location) {
- StyledText text = textEditor.getTextViewer().getTextWidget();
- return text.getOffsetAtLocation(location);
- }
-
- // private IStructuredModel getModel(StructuredTextEditor textEditor)
- // {
- // IStructuredModel model = null;
- // if (textEditor.getDocumentProvider() != null)
- // {
- // if (textEditor.getDocumentProvider() instanceof IModelProvider)
- // {
- // model = ((IModelProvider)
- // textEditor.getDocumentProvider()).getModel(textEditor.getEditorInput());
- // }
- // else
- // {
- // IDocument doc =
- // textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
- // if (doc instanceof IDocument)
- // {
- // model =
- // StructuredModelManager.getModelManager().getExistingModelForEdit(doc);
- // if (model == null)
- // {
- // model =
- // StructuredModelManager.getModelManager().getExistingModelForEdit((IDocument)
- // doc);
- // }
- // }
- // }
- // }
- // return model;
- // }
-
- /**
- * @param textEditor
- * @param pos
- * @return the node
- */
- public Node getCaretNode(StructuredTextEditor textEditor, int pos) {
- // TODO: getModel is deprecated
- IStructuredModel model = textEditor.getModel();
- // getModel(textEditor);
- if (model == null) {
- return null;
- }
- IndexedRegion inode = model.getIndexedRegion(pos);
- if (inode == null) {
- inode = model.getIndexedRegion(pos - 1);
- }
- return (inode instanceof Node) ? (Node) inode : null;
- }
-
- /**
- * Calculate and adjust the location in compare with Node.
- *
- * @param node
- * @param location
- * @return the location
- */
- public int calculateCaretLocation(Node node, int location) {
- int pos[][] = new int[2][2];
- pos[0][0] = EditModelQuery.getNodeStartIndex(node);
- pos[0][1] = EditModelQuery.getNodeStartNameEndIndex(node);
- pos[1][0] = EditModelQuery.getNodeEndNameStartIndex(node);
- pos[1][1] = EditModelQuery.getNodeEndIndex(node);
- if (pos[0][0] >= location || pos[1][0] == location
- || pos[1][1] <= location) {
- return location;
- } else if (pos[0][0] <= location && pos[0][1] >= location) {
- if (((pos[0][1] + pos[0][0]) / 2) >= location) {
- return pos[0][0];
- }
- return pos[0][1];
- } else if (pos[1][0] <= location && pos[1][1] >= location) {
- if (((pos[1][1] + pos[1][0]) / 2) >= location) {
- return pos[1][0];
- }
- return pos[1][1];
- }
- return location;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/TextEditorDropTargetListenerFactory.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/TextEditorDropTargetListenerFactory.java
deleted file mode 100644
index 538bb97..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/TextEditorDropTargetListenerFactory.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dnd.internal;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.jst.pagedesigner.editors.DesignerStructuredTextEditorJSP;
-import org.eclipse.ui.texteditor.ITextEditorDropTargetListener;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-
-/**
- * @author mengbo
- */
-public class TextEditorDropTargetListenerFactory implements IAdapterFactory {
-
- /**
- *
- */
- public TextEditorDropTargetListenerFactory() {
- super();
- // TODO Auto-generated constructor stub
- }
-
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- if (ITextEditorDropTargetListener.class.equals(adapterType)) {
- if (adaptableObject instanceof DesignerStructuredTextEditorJSP) {
- DesignerSourceDropTargetListener listener = new DesignerSourceDropTargetListener(
- (StructuredTextEditor) adaptableObject);
- return listener;
- }
-
- }
- return null;
-
- }
-
- public Class[] getAdapterList() {
- Class[] classes = new Class[1];
- classes[0] = ITextEditorDropTargetListener.class;
- return classes;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/messages.properties b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/messages.properties
deleted file mode 100644
index 654d9ee..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dnd/internal/messages.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2007 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are 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:
-# Oracle Corporation - initial API and implementation
-###############################################################################
-DropSelectionWizard.Title=Drop Operation Handling
-SimpleWizardSelectionPage.PageName=Select Operation
-SimpleWizardSelectionPage.Title=Select Operation
-SimpleWizardSelectionPage.Description=Select Action
-SimpleWizardSelectionPage.Message=Select the operation you want to perform from the following list
-SimpleWizardSelectionPage.Operation=Operations:
-LocalDropCommand.DropHandler=Drop Handler
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/CaretMoveIterator.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/CaretMoveIterator.java
deleted file mode 100644
index d4e8d63..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/CaretMoveIterator.java
+++ /dev/null
@@ -1,271 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dom;
-
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.utils.HTMLUtil;
-import org.eclipse.jst.pagedesigner.validation.caret.IMovementMediator;
-import org.eclipse.jst.pagedesigner.validation.caret.Target;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-import org.w3c.dom.traversal.NodeIterator;
-
-/**
- * @author mengbo
- */
-public class CaretMoveIterator {
- private final static Logger _log = PDPlugin
- .getLogger(CaretMoveIterator.class);
-
- private final boolean INNER_DEBUG = false;
-
- private NodeIterator _nodeIterator;
-
- private IMovementMediator _validator;
-
- private IDOMPosition _currentPosition;
-
- private boolean _forward;
-
- /**
- * @param nodeIterator
- * @param validator
- * @param position
- * @param forward
- */
- public CaretMoveIterator(NodeIterator nodeIterator,
- IMovementMediator validator, IDOMPosition position, boolean forward) {
- super();
- _nodeIterator = nodeIterator;
- _validator = validator;
- _currentPosition = position;
- _forward = forward;
- }
-
- /**
- * @return the node iterator
- */
- public NodeIterator getNodeIterator() {
- return _nodeIterator;
- }
-
- /**
- * @return Returns the _currentPosition.
- */
- public IDOMPosition getCurrentPosition() {
- return _currentPosition;
- }
-
- /**
- * @param position
- * The _currentPosition to set.
- */
- public void setCurrentPosition(IDOMPosition position) {
- _currentPosition = position;
- }
-
- // assume the currentPosition is invalid
- private IDOMPosition moveOut(Node container) {
- IDOMPosition result = new DOMRefPosition(container, _forward);
- String name = container.getNodeName();
- if (name != null
- && EditModelQuery.HTML_STYLE_NODES.contains(name.toLowerCase())) {
- result = moveToNextPosition(result, _validator);
- }
- return result;
- }
-
- /**
- * @param node
- * @return the dom position
- */
- public IDOMPosition moveIn(Node node) {
- IDOMPosition result = null;
- if (INNER_DEBUG) {
- _log.info("- Move into: " + node.getLocalName());
- }
- if (_validator.isEditable(new Target(node))) {
- int index;
- // Transparent text is not editable, so this is not transparent.
- if (EditModelQuery.isText(node)) {
- index = (_forward) ? 0 : ((Text) node).getData().length();
- result = new DOMPosition(node, index);
- // move ahead one pos.
- IDOMPosition pos = getNextTextPosition(result);
- if (pos != null) {
- result = pos;
- }
- } else {
- if (node.hasChildNodes()) {
- index = _forward ? 0 : node.getChildNodes().getLength();
- result = new DOMPosition(node, index); // DOMRefPosition(next,
- // !_forward);
- } else {
- result = new DOMPosition(node, 0);
- }
- }
- } else {
- if (node.hasChildNodes()) {
- Node child = _forward ? node.getFirstChild() : node
- .getLastChild();
- result = new DOMRefPosition(child, _forward);
- while (child != null) {
- if (_validator.allowsMoveIn(new Target(child))) {
- result = moveIn(child);
- break;
- }
- child = _forward ? child.getNextSibling() : child
- .getPreviousSibling();
- }
- } else {
- // Should be impposible to reach here.
- result = new DOMPosition(node, 0);
- }
- }
- return result;
- }
-
- private IDOMPosition getNextTextPosition(IDOMPosition position) {
- IDOMPosition result = null;
- String value = position.getContainerNode().getNodeValue();
- int i = position.getOffset();
- if (_forward) {
- if (i < value.length()) {
- if (HTMLUtil.isHTMLWhitespace(value.charAt(i))) {
- while (i < value.length()
- && HTMLUtil.isHTMLWhitespace(value.charAt(i))) {
- i++;
- }
- result = new DOMPosition(position.getContainerNode(), i);
- } else if (i < value.length()) {
- result = new DOMPosition(position.getContainerNode(), i + 1);
- }
- }
- } else {
- if (i > 0) {
- if (HTMLUtil.isHTMLWhitespace(value.charAt(i - 1))) {
- while (i > 0
- && HTMLUtil.isHTMLWhitespace(value.charAt(i - 1))) {
- i--;
- }
- result = new DOMPosition(position.getContainerNode(), i);
- } else if (i > 0) {
- result = new DOMPosition(position.getContainerNode(), i - 1);
- }
- }
- }
- return result;
- }
-
- /**
- * Assume the original position are valid.
- *
- * @param position
- * @param validator
- * @param _forward
- * @param referenceImediatly
- * @return
- */
- private IDOMPosition moveToNextPosition(IDOMPosition position,
- IMovementMediator validator) {
- IDOMPosition currentPosition = null;
- if (validator.isValidPosition(position) && position.isText()) {
- currentPosition = getNextTextPosition(position);
- }
- if (currentPosition == null) {
- Node nextNode = EditModelQuery.getInstance().getSibling(position,
- _forward);
- while (EditModelQuery.isText(nextNode)
- && ((Text) nextNode).getData().length() == 0) {
- nextNode = EditModelQuery.getInstance().getSibling(nextNode,
- _forward);
- }
- if (nextNode != null) {
- // move in?
- if (validator.allowsMoveIn(new Target(nextNode))) {
- currentPosition = moveIn(nextNode);
- // Stop when it is in table. For others we continue search
- // for text.
- if (!canStopHere(nextNode) && //
- EditModelQuery.getInstance().getSibling(
- currentPosition, _forward) != null) {
- currentPosition = moveToNextPosition(currentPosition,
- validator);
- }
- }
- // not allowed to move in. e.g. it's empty string.
- else {
- currentPosition = new DOMRefPosition(nextNode, _forward);// skip(position);
- }
- } else {
- if (validator.allowsMoveOut(new Target(
- getNaviContainer(position)))) {
- currentPosition = moveOut(getNaviContainer(position));
- }
- }
- }
- currentPosition = EditHelper.ensureDOMPosition(currentPosition);
- if (currentPosition != null
- && !validator.isValidPosition(currentPosition)) {
- currentPosition = moveToNextPosition(currentPosition, validator);
- }
- return currentPosition;
- }
-
- /**
- * When the tag starts from new line, or in table, then caret can be put at
- * 0 offset.
- *
- * @param node
- * @return
- */
- private boolean canStopHere(Node node) {
- boolean result = false;
- if (EditModelQuery.isText(node)) {
- result = true;
- } else if (node != null && node.getNodeName() != null) {
- result |= node.getNodeName().equals(IHTMLConstants.TAG_TD);
- result |= EditModelQuery.isBlockNode(node);
- }
- return result;
- }
-
- /**
- * Move operation position to next edit position. We may need rule to valid
- * it based on operation ID and direction. We need to pack transparent
- * string.
- *
- * @param currentPosition
- * @param forward
- * @param validator
- * @return the dom position
- */
- public IDOMPosition moveToNextEditPosition(IDOMPosition currentPosition,
- boolean forward, IMovementMediator validator) {
- IDOMPosition result = null;
- if ((currentPosition = moveToNextPosition(currentPosition, validator)) != null) {
- result = currentPosition;
- } else {
- result = _currentPosition;
- }
- return result;
- }
-
- private Node getNaviContainer(IDOMPosition position) {
- if (position.isText()) {
- return position.getContainerNode().getParentNode();
- }
- return position.getContainerNode();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/DOMPosition.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/DOMPosition.java
deleted file mode 100644
index ca840d2..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/DOMPosition.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dom;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-/**
- * @author mengbo
- */
-public class DOMPosition implements IDOMPosition {
- Node _containerNode;
-
- int _offset;
-
- /**
- * @param containerNode
- * @param offset
- */
- public DOMPosition(Node containerNode, int offset) {
- _containerNode = containerNode;
- _offset = offset;
- }
-
- /**
- * this is the offset in the DOM tree. When parent node is text node, the
- * offset if the offset into the actual displayed data of the text node.
- *
- * when parent is not text node, then the offset is the index in
- * getIDOMNode().getChildNodes()
- *
- * @return the offset
- */
- public int getOffset() {
- return _offset;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.range.IDOMPosition#getNextSiblingNode()
- */
- public Node getNextSiblingNode() {
- if (isText())
- return null;
- NodeList children = _containerNode.getChildNodes();
- int length = children.getLength();
- if (_offset >= length || _offset < 0)
- return null;
- return children.item(_offset);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.range.IDOMPosition#getPreviousSiblingNode()
- */
- public Node getPreviousSiblingNode() {
- if (isText())
- return null;
- NodeList children = _containerNode.getChildNodes();
- int length = children.getLength();
- if (_offset > length || _offset <= 0)
- return null;
- return children.item(_offset - 1);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.range.IDOMPosition#getContainerNode()
- */
- public Node getContainerNode() {
- return _containerNode;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.range.IDOMPosition#isText()
- */
- public boolean isText() {
- return _containerNode instanceof Text;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.range.IDOMPosition#getSibling(boolean)
- */
- public Node getSibling(boolean forward) {
- if (forward)
- return getNextSiblingNode();
- return getPreviousSiblingNode();
- }
-
- public IDOMPosition handleReplacement(Node original, Node replacement) {
- if (original == this._containerNode) {
- return new DOMPosition(replacement, this._offset);
- }
- return this;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return "DOMPosition: (" + _containerNode + " : " + _offset + ")";
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/DOMPositionHelper.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/DOMPositionHelper.java
deleted file mode 100644
index d0e77f8..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/DOMPositionHelper.java
+++ /dev/null
@@ -1,395 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dom;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.gef.EditPart;
-import org.eclipse.jst.pagedesigner.parts.NodeEditPart;
-import org.eclipse.jst.pagedesigner.parts.TextEditPart;
-import org.eclipse.jst.pagedesigner.utils.HTMLUtil;
-import org.eclipse.jst.pagedesigner.viewer.DesignPosition;
-import org.eclipse.jst.pagedesigner.viewer.DesignRefPosition;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-/**
- * @author mengbo
- */
-public class DOMPositionHelper {
- /**
- * @param position
- * @return the design position
- */
- public static DesignPosition toDesignRefPosition(DOMRefPosition position) {
- Node node = position.getReferenceNode();
- do {
- IDOMNode container = (IDOMNode) node.getParentNode();
- EditPart part = (EditPart) container.getAdapterFor(EditPart.class);
- if (part != null) {
- // XXX: what if the node has not corresponding part?
- EditPart child = DOMPositionHelper.findEditPart(part, node);
- if (child != null) {
- return new DesignRefPosition(child, position.isForward());
- }
- return DesignPosition.INVALID;
- }
- node = node.getParentNode();
- } while (true);
- }
-
- /**
- *
- * @param position
- * if it is null, then will return null
- * @return null if position is null or invalid.
- */
- public static DesignPosition toDesignPosition(IDOMPosition position) {
- if (position == null) {
- return null;
- }
- if (position instanceof DOMRefPosition) {
- return toDesignRefPosition((DOMRefPosition) position);
- }
- do {
- IDOMNode container = (IDOMNode) position.getContainerNode();
- EditPart part = (EditPart) container.getAdapterFor(EditPart.class);
- if (part != null) {
- if (container instanceof Text) {
- String textData = ((Text) container).getData();
- String displayData = ((TextEditPart) part).getTextData();
- return new DesignPosition(part,
- textDataOffsetToDisplayOffset(textData,
- displayData, position.getOffset()));
- }
- Node pre = position.getPreviousSiblingNode();
- while (pre != null) {
- int index = findChildEditPartIndex(part, pre);
- if (index != -1) {
- return new DesignPosition(part, index + 1);
- }
- pre = pre.getPreviousSibling();
- }
- return new DesignPosition(part, 0);
- }
- position = new DOMRefPosition(position.getContainerNode(),
- false);
- } while (true);
- }
-
- /**
- * Here is the position is not currect, currently it will returns invalid
- * pos.
- *
- * @param position
- * @return the design position
- */
- public static DesignPosition toDesignPosition1(IDOMPosition position) {
- if (position instanceof DOMRefPosition) {
- return toDesignRefPosition((DOMRefPosition) position);
- }
- do {
- IDOMNode container = (IDOMNode) position.getContainerNode();
- EditPart part = (EditPart) container.getAdapterFor(EditPart.class);
- if (part != null) {
- if (container instanceof Text) {
- String textData = ((Text) container).getData();
- String displayData = ((TextEditPart) part).getTextData();
- return new DesignPosition(part,
- textDataOffsetToDisplayOffset(textData,
- displayData, position.getOffset()));
- }
- Node pre = position.getPreviousSiblingNode();
- while (pre != null) {
- int index = findChildEditPartIndex(part, pre);
- if (index != -1) {
- return new DesignPosition(part, index + 1);
- }
- pre = pre.getPreviousSibling();
- }
- return new DesignPosition(part, 0);
- }
- return DesignPosition.INVALID;
- } while (true);
- }
-
- static int findChildEditPartIndex(EditPart parent, Node node) {
- List children = parent.getChildren();
- for (int i = 0; i < children.size(); i++) {
- if (((EditPart) children.get(i)).getModel() == node) {
- return i;
- }
- }
- return -1;
- }
-
- static EditPart findEditPart(EditPart parent, Node node) {
- List children = parent.getChildren();
- EditPart part;
- for (int i = 0; i < children.size(); i++) {
- if ((part = (EditPart) children.get(i)).getModel() == node) {
- return part;
- }
- }
- return null;
- }
-
- /**
- * convert a DesignPosition into DOMPosition.
- *
- * @param position
- * @return the dom position
- */
- public static IDOMPosition toDOMRefPosition(DesignRefPosition position) {
- // ok, it is not text.
- EditPart sibling = position.getRefPart();
- if (sibling != null) {
- return new DOMRefPosition((Node) sibling.getModel(), position
- .caretIsAtRight());
- }
- // should never happens
- Assert.isTrue(false);
- return null;
- }
-
- /**
- * convert a DesignPosition into DOMPosition.
- *
- * @param position
- * @return the dom position
- */
- public static IDOMPosition toDOMPosition(DesignPosition position) {
- if (!EditValidateUtil.validPosition(position)) {
- return null;
- } else if (position instanceof DesignRefPosition) {
- return toDOMRefPosition((DesignRefPosition) position);
- }
- EditPart part = position.getContainerPart();
- if (part instanceof TextEditPart) {
- Text text = (Text) ((TextEditPart) part).getIDOMNode();
- int offset = position.getOffset();
- if (offset == 0) {
- return new DOMPosition(text, 0);
- }
- String displayData = ((TextEditPart) part).getTextData();
- String nodeData = text.getData();
- if (offset >= displayData.length()) {
- // point to end of the text node.
- return new DOMPosition(text, nodeData.length());
- }
- // we need to calculate it out.
- int index = displayOffsetToTextDataOffset(displayData,
- nodeData, offset);
- return new DOMPosition(text, index);
- }
- // ok, it is not text.
- EditPart sibling = position.getSiblingEditPart(true);
- if (sibling instanceof NodeEditPart) {
- return new DOMRefPosition(((NodeEditPart) sibling).getDOMNode(), false);
- }
-
- sibling = position.getSiblingEditPart(false);
- if (sibling instanceof NodeEditPart) {
- return new DOMRefPosition(((NodeEditPart) sibling).getDOMNode(), true);
- }
-
- // no previous sibling, no next sibling, the parent node must be
- // empty
- return new DOMPosition(((NodeEditPart) part).getDOMNode(), 0);
- }
-
- /**
- * if "position" is inside a text node, then split the text node and return
- * a new IDOMPosition semantically equal to the position in the two
- * splitted text. If the "position" is not a text position, then no action
- * will be taken and will return the original position.
- *
- * @param position
- * @return IDOMPosition
- */
- public static IDOMPosition splitText(IDOMPosition position) {
- Node container = position.getContainerNode();
- if (container instanceof Text) {
- int offset = position.getOffset();
- if (offset <= 0) {
- // at beginning of text node. no need to split
- return new DOMRefPosition(container, false);
- }
- String textData = ((Text) container).getData();
- if (offset >= textData.length()) {
- // at end of text node. no need to split
- return new DOMRefPosition(container, true);
- }
- // ok, we need split
- ((Text) container).splitText(offset);
- return new DOMRefPosition(container, true);
- }
- return position;
- }
-
- /**
- * Remove all the content in the range. And return the new position.
- *
- * @param range
- * @return the dom position
- */
- public static IDOMPosition removeRange(DOMRange range) {
- boolean ordered = range.isOrdered();
-// IDOMPosition start = ordered ? range.getStartPosition() : range
-// .getEndPosition();
- IDOMPosition end = ordered ? range.getEndPosition() : range
- .getStartPosition();
-
- // FIXME: Not DONE:
- return end;
- }
-
- /**
- * try to merge the position in adjacent text node (if it is not already in)
- *
- * @param position
- * @return the dom position
- */
- public static IDOMPosition mergeIntoText(IDOMPosition position) {
- if (position.getContainerNode() instanceof Text)
- return position;
- Node pre = position.getPreviousSiblingNode();
- if (pre instanceof Text) {
- return new DOMPosition(pre, ((Text) pre).getData().length());
- }
- Node after = position.getNextSiblingNode();
- if (after instanceof Text) {
- return new DOMPosition(after, 0);
- }
- return position;
- }
-
- /**
- * @param displayData
- * @param nodeData
- * @param offset
- * @return the offset
- */
- // FIXME: this method is still buggy
- public static int displayOffsetToTextDataOffset(String displayData,
- String nodeData, int offset) {
- char[] display = displayData.toCharArray();
- if (offset >= display.length) {
- // offset is already at end
- return nodeData.length();
- }
- char[] node = nodeData.toCharArray();
- int nodeDataLength = node.length;
- int displayIndex = 0;
- int nodeIndex = 0;
-
- while (displayIndex < offset && nodeIndex < nodeDataLength) {
- if (display[displayIndex] == node[nodeIndex]) {
- displayIndex++;
- nodeIndex++;
- continue;
- }
- if (HTMLUtil.isHTMLWhitespace(node[nodeIndex])) {
- if (HTMLUtil.isHTMLWhitespace(display[displayIndex])) {
- displayIndex++;
- nodeIndex++;
- } else {
- nodeIndex++;
- }
- continue;
- }
- // should not happen!
- displayIndex++;
- nodeIndex++;
- }
-
- if (nodeIndex >= nodeDataLength)
- return nodeDataLength;
- // else means displayIndex == offset
- // since we already checked that offset < displayLength, so we can get
- // the next char
- if (display[offset] != ' ') {
- // we may need to skip whitespaces after nodeIndex
- while (nodeIndex < nodeDataLength
- && HTMLUtil.isHTMLWhitespace(node[nodeIndex])) {
- nodeIndex++;
- }
- }
- return nodeIndex;
- }
-
- /**
- * @param nodeData
- * @param displayData
- * @param offset
- * @return the offset
- */
- // FIXME: this method is still buggy
- public static int textDataOffsetToDisplayOffset(String nodeData,
- String displayData, int offset) {
- if (offset >= nodeData.length()) {
- return displayData.length();
- }
- char[] node = nodeData.toCharArray();
- char[] display = displayData.toCharArray();
-
- int displayIndex = 0;
- int nodeIndex = 0;
- int displayDataLength = display.length;
-
- while (nodeIndex < offset && displayIndex < displayDataLength) {
- if (display[displayIndex] == node[nodeIndex]) {
- displayIndex++;
- nodeIndex++;
- continue;
- }
- if (HTMLUtil.isHTMLWhitespace(node[nodeIndex])) {
- if (HTMLUtil.isHTMLWhitespace(display[displayIndex])) {
- displayIndex++;
- nodeIndex++;
- } else {
- nodeIndex++;
- }
- continue;
- }
- // should not happen!
- displayIndex++;
- nodeIndex++;
- }
- return displayIndex;
- }
-
- /**
- * Convert a IDOMPosition to IDOMRefPosition. If can't convert to
- * IDOMRefPosition, will return the original one.
- *
- * @param position
- * @return IDOMPosition
- */
- public static IDOMPosition toDOMRefPosition(IDOMPosition position) {
- if (position.isText()) {
- return position; // can't convert Text node.
- }
- if (position instanceof IDOMRefPosition) {
- return position;
- }
- if (position.getNextSiblingNode() != null) {
- return new DOMRefPosition(position.getNextSiblingNode(), false);
- }
- if (position.getPreviousSiblingNode() != null) {
- return new DOMRefPosition(position.getPreviousSiblingNode(), true);
- }
- return new DOMRefPosition2(position.getContainerNode(), true);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/DOMRange.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/DOMRange.java
deleted file mode 100644
index f35dfda..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/DOMRange.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dom;
-
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- */
-public class DOMRange {
- IDOMPosition _start;
-
- IDOMPosition _end;
-
- /**
- * @param p1
- * @param p2
- */
- public DOMRange(IDOMPosition p1, IDOMPosition p2) {
- _start = p1;
- _end = p2;
- }
-
- /**
- * @return the start position
- */
- public IDOMPosition getStartPosition() {
- return _start;
- }
-
- /**
- * @return the end position
- */
- public IDOMPosition getEndPosition() {
- return _end;
- }
-
- /**
- * @return true if is empty
- */
- public boolean isEmpty() {
- return _start.getContainerNode() == _end.getContainerNode()
- && _start.getOffset() == _end.getOffset();
- }
-
- /**
- * @return true if is ordered
- */
- public boolean isOrdered() {
- Node common = DOMUtil.findCommonAncester(_start.getContainerNode(),
- _end.getContainerNode());
- if (common == null) {
- return true;
- }
- IDOMPosition s = moveUp(_start, common);
- IDOMPosition e = moveUp(_end, common);
- return e.getOffset() >= s.getOffset();
- }
-
- private IDOMPosition moveUp(IDOMPosition p, Node ancester) {
- while (p.getContainerNode() != ancester) {
- p = new DOMRefPosition(p.getContainerNode(), false);
- }
- return p;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/DOMRangeHelper.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/DOMRangeHelper.java
deleted file mode 100644
index 1c7a33c..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/DOMRangeHelper.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dom;
-
-import org.eclipse.jst.pagedesigner.viewer.DesignPosition;
-import org.eclipse.jst.pagedesigner.viewer.DesignRange;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- */
-public final class DOMRangeHelper {
- /**
- * @param range
- * @return the dom range
- */
- public static DOMRange toDOMRange(DesignRange range) {
- if (range.getStartPosition() == range.getEndPosition()) {
- IDOMPosition dp = DOMPositionHelper.toDOMPosition(range
- .getStartPosition());
- return new DOMRange(dp, dp);
- }
- return new DOMRange(DOMPositionHelper.toDOMPosition(range
- .getStartPosition()), DOMPositionHelper.toDOMPosition(range
- .getEndPosition()));
- }
-
- /**
- * @param range
- * @return the design range
- */
- public static DesignRange toDesignRange(DOMRange range) {
- if (range.getStartPosition() == range.getEndPosition()) {
- DesignPosition dp = DOMPositionHelper.toDesignPosition(range
- .getStartPosition());
- return new DesignRange(dp, dp);
- }
- return new DesignRange(DOMPositionHelper.toDesignPosition(range
- .getStartPosition()), DOMPositionHelper.toDesignPosition(range
- .getEndPosition()));
- }
-
- /**
- * @param range
- * @param original
- * @param replacement
- * @return the dom range
- */
- public static DOMRange handleReplacement(DOMRange range, Node original,
- Node replacement) {
- if (range.getStartPosition() == range.getEndPosition()) {
- IDOMPosition pos = range.getStartPosition().handleReplacement(
- original, replacement);
- return new DOMRange(pos, pos);
- }
- return new DOMRange(range.getStartPosition().handleReplacement(
- original, replacement), range.getEndPosition()
- .handleReplacement(original, replacement));
- }
-
- private DOMRangeHelper()
- {
- // util class, no instantiation
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/DOMRefPosition.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/DOMRefPosition.java
deleted file mode 100644
index 634e855..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/DOMRefPosition.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dom;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * DOMRefPosition is another way to identify a position in the document tree. It
- * has the advantage against the DOMPosition, that even something change in the
- * document, DOMRefPosition may still reference the correct position.
- *
- * @author mengbo
- */
-public class DOMRefPosition implements IDOMRefPosition {
- Node _refNode;
-
- boolean _forward;
-
- /**
- * @param refNode
- * @param forward
- * true means the position after refNode. false means the
- * position before refNode
- */
- public DOMRefPosition(Node refNode, boolean forward) {
- _refNode = refNode;
- _forward = forward;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.range.IDOMPosition#getSibling(boolean)
- */
- public Node getSibling(boolean forward) {
- if (forward != _forward)
- {
- return _refNode;
- }
- if (forward)
- {
- return _refNode.getNextSibling();
- }
- return _refNode.getPreviousSibling();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.range.IDOMPosition#getNextSiblingNode()
- */
- public Node getNextSiblingNode() {
- return getSibling(true);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.range.IDOMPosition#getPreviousSiblingNode()
- */
- public Node getPreviousSiblingNode() {
- return getSibling(false);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.range.IDOMPosition#getContainerNode()
- */
- public Node getContainerNode() {
- return _refNode.getParentNode();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.range.IDOMPosition#getOffset()
- */
- public int getOffset() {
- Node parent = _refNode.getParentNode();
- if (parent == null) {
- return _forward ? 1 : 0;
- }
- NodeList list = parent.getChildNodes();
- for (int i = 0, n = list.getLength(); i < n; i++) {
- if (list.item(i) == _refNode) {
- return _forward ? (i + 1) : i;
- }
- }
- // should not happen.
- return -1;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.range.IDOMPosition#isText()
- */
- public boolean isText() {
- return false;
- }
-
- public IDOMPosition handleReplacement(Node original, Node replacement) {
- if (this._refNode == original) {
- return new DOMRefPosition(replacement, this._forward);
- }
- return this;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return "DOMRefPosition: (" + (_forward ? "after " : "before ")
- + _refNode + ")";
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.dom.IDOMRefPosition#getReferenceNode()
- */
- public Node getReferenceNode() {
- return _refNode;
- }
-
- /**
- * @return true if is forward
- */
- public boolean isForward() {
- return _forward;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/DOMRefPosition2.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/DOMRefPosition2.java
deleted file mode 100644
index 3da9127..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/DOMRefPosition2.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dom;
-
-import org.w3c.dom.Node;
-
-/**
- * This ref position use a parent node as reference. And provide whether this
- * location is at the beginning of its parent or last of its parent.
- *
- * @author mengbo
- * @version 1.5
- */
-public class DOMRefPosition2 implements IDOMRefPosition {
- Node _parentNode;
-
- boolean _last;
-
- /**
- * @param parent
- * @param last
- */
- public DOMRefPosition2(Node parent, boolean last) {
- _parentNode = parent;
- _last = last;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.dom.IDOMRefPosition#getReferenceNode()
- */
- public Node getReferenceNode() {
- return _parentNode;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.dom.IDOMPosition#getSibling(boolean)
- */
- public Node getSibling(boolean forward) {
- if (forward) {
- if (_last) {
- return null;
- }
- return _parentNode.getFirstChild();
- } else if (_last) {
- return _parentNode.getLastChild();
- } else {
- return null;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.dom.IDOMPosition#getNextSiblingNode()
- */
- public Node getNextSiblingNode() {
- return getSibling(true);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.dom.IDOMPosition#getPreviousSiblingNode()
- */
- public Node getPreviousSiblingNode() {
- return getSibling(false);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.dom.IDOMPosition#getContainerNode()
- */
- public Node getContainerNode() {
- return _parentNode;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.dom.IDOMPosition#getOffset()
- */
- public int getOffset() {
- if (!_last) {
- return 0;
- }
- return _parentNode.getChildNodes().getLength();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.dom.IDOMPosition#isText()
- */
- public boolean isText() {
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.dom.IDOMPosition#handleReplacement(org.w3c.dom.Node,
- * org.w3c.dom.Node)
- */
- public IDOMPosition handleReplacement(Node original, Node replacement) {
- if (original == _parentNode) {
- return new DOMRefPosition2(replacement, _last);
- }
- return this;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/DOMStyleUtil.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/DOMStyleUtil.java
deleted file mode 100644
index 637d6d4..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/DOMStyleUtil.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dom;
-
-import java.util.Iterator;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-import org.eclipse.jst.jsf.core.internal.tld.CMUtil;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.w3c.dom.Element;
-import org.w3c.dom.css.CSSStyleDeclaration;
-import org.w3c.dom.css.ElementCSSInlineStyle;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public final class DOMStyleUtil {
- /**
- * @param original
- * @param cssProperty
- * @return the inline style property
- */
- public static String getInlineStyleProperty(Element original,
- String cssProperty) {
- if (original instanceof ElementCSSInlineStyle) {
- CSSStyleDeclaration styledecl = ((ElementCSSInlineStyle) original)
- .getStyle();
- if (styledecl == null) {
- if (original.getAttribute("style") == null) {
- return null;
- }
- // else mean it has style attribute.
- }
-
- if (styledecl != null) {
- return styledecl.getPropertyValue(cssProperty);
- }
- }
-
- // when we reach here, means we can't use the CSSStyleDeclaration API to
- // get style, we'll take the
- // pain to do the parsing and replacing.
- // normally should not happen. But anyway, we need to have a fail safe
- // path.
-
- String oldstyle = original.getAttribute("style");
- if (oldstyle == null || oldstyle.length() == 0) {
- return null;
- }
- StringTokenizer tokenizer = new StringTokenizer(oldstyle, ";");
-
- while (tokenizer.hasMoreTokens()) {
- String token = tokenizer.nextToken().trim();
- if (token.length() == 0) {
- continue;
- }
- int index = token.indexOf(':');
- if (index == -1) {
- continue;
- }
- String propertyName = token.substring(0, index).trim();
- if (cssProperty.equals(propertyName)) {
- // ok, we found the property
- return token.substring(index + 1).trim();
- }
- }
- return null;
- }
-
- /**
- * insert style into element
- *
- * @param original
- * @param map
- */
- public static void insertStyle(Element original, Map map) {
- if (original instanceof ElementCSSInlineStyle) {
- CSSStyleDeclaration styledecl = ((ElementCSSInlineStyle) original)
- .getStyle();
- if (styledecl == null) {
- if (original.getAttribute("style") == null) {
- original.setAttribute("style", "");
- styledecl = ((ElementCSSInlineStyle) original).getStyle();
- }
- }
-
- if (styledecl != null) {
- for (Iterator iter = map.keySet().iterator(); iter.hasNext();) {
- String key = (String) iter.next();
- String value = (String) map.get(key);
- if (value == null) {
- styledecl.removeProperty(key);
- } else {
- styledecl.setProperty(key, value, null);
- }
- }
-
- return;
- }
- }
-
- // when we reach here, means we can't use the CSSStyleDeclaration API to
- // change style, we'll take the
- // pain to do the parsing and replacing.
- // normally should not happen. But anyway, we need to have a fail safe
- // path.
-
- String oldstyle = original.getAttribute("style");
- if (oldstyle == null) {
- oldstyle = "";
- }
- StringTokenizer tokenizer = new StringTokenizer(oldstyle, ";");
-
- StringBuffer buffer = new StringBuffer();
- while (tokenizer.hasMoreTokens()) {
- String token = tokenizer.nextToken().trim();
- if (token.length() == 0) {
- continue;
- }
- int index = token.indexOf(':');
- if (index == -1) {
- // wrong property? ignore.
- buffer.append(token).append("; ");
- continue;
- }
- String propertyName = token.substring(0, index).trim();
-
- if (map.containsKey(propertyName)) {
- String propertyValue = (String) map.remove(propertyName);
- if (propertyValue == null) {
- // we want to remove this css property. so don't append
- // anything here
- } else {
- buffer.append(propertyName).append(": ").append(
- propertyValue).append("; ");
- }
- } else {
- buffer.append(token).append("; ");
- }
- }
- // ok, we have loop through existing properties and did replacement.
- // now _styleProperties only contain those new CSS properties we need to
- for (Iterator iter = map.keySet().iterator(); iter.hasNext();) {
- String key = (String) iter.next();
- String value = (String) map.get(key);
- if (value != null) {
- buffer.append(key).append(": ").append(value).append("; ");
- }
- }
- original.setAttribute("style", buffer.toString());
- }
-
- /**
- * @param ele
- * @return true if supports the style attribute
- */
- public static boolean supportStyleAttribute(IDOMElement ele) {
- CMElementDeclaration decl = CMUtil.getElementDeclaration(ele);
- if (decl != null && decl.getAttributes().getNamedItem("style") != null) {
- return true;
- }
- return false;
- }
-
- private DOMStyleUtil()
- {
- // util class, no external instantiation
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/DOMUtil.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/DOMUtil.java
deleted file mode 100644
index eec0a33..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/DOMUtil.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dom;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-/**
- * @author mengbo
- */
-public class DOMUtil {
- private static Logger _logger = PDPlugin.getLogger(DOMUtil.class);
-
- /**
- * Get a list of ancester nodes starting from the Document till the node.
- *
- * @param node
- * @return
- */
- private static List getAncesters(Node node) {
- List list = new ArrayList();
- while (node != null) {
- list.add(node);
- if (node instanceof Document) {
- break;
- }
- node = node.getParentNode();
- }
- if (node == null) {
- // if part ==null, means we didn't find a DocumentEditPart,
- // something must be wrong.
- return null;
- }
- // reverse to make it starting from the docuemnteditpart node.
- Collections.reverse(list);
- list.add(null); // add an null terminator.
- return list;
- }
-
- /**
- * find the smallest common ancester of two edit part.
- *
- * @param node1
- * @param node2
- * @return the common ancestor
- */
- public static Node findCommonAncester(Node node1, Node node2) {
- List list1 = getAncesters(node1);
- if (list1 == null) {
- return null;
- }
- List list2 = getAncesters(node2);
- if (list2 == null) {
- return null;
- }
- if (list1.get(0) != list2.get(0)) {
- return null;
- }
- Node common = (Node) list1.get(0);
- for (int i = 1;; i++) {
- Node p1 = (Node) list1.get(i);
- Node p2 = (Node) list2.get(i);
- if (p1 == null || p2 == null) {
- return common;
- }
- if (p1 != p2) {
- return common;
- }
- common = p1;
- }
-
- }
-
- /**
- * this method is almost same as <code>cloneNodeDeep()</code>. The
- * difference is that this method will try to ignore all kinds of error.
- *
- * In SSE, if the document model enforce some kinds of validation, then the
- * clone may fail. During some cases, we want to ignore the validation
- * errors.
- *
- * @param destDoc
- * @param sourceNode
- * @return the node
- */
- public static Node cloneNodeDeepIgnoreError(Document destDoc,
- Node sourceNode) {
- switch (sourceNode.getNodeType()) {
- case Node.ELEMENT_NODE:
- Element sourceEle = (Element) sourceNode;
- Element resultEle = destDoc.createElement(sourceEle.getTagName());
- NamedNodeMap attrs = sourceEle.getAttributes();
- for (int i = 0, size = attrs.getLength(); i < size; i++) {
- Attr a = (Attr) attrs.item(i);
- try {
- resultEle.setAttribute(a.getName(), a.getValue());
- } catch (Exception ex) {
- // ignore
- _logger.info("Exception", ex);
- }
- }
- NodeList children = sourceEle.getChildNodes();
- for (int i = 0, size = children.getLength(); i < size; i++) {
- Node n = children.item(i);
- Node d = cloneNodeDeepIgnoreError(destDoc, n);
- if (d != null) {
- try {
- resultEle.appendChild(d);
- } catch (Exception ex) {
- // ignore
- _logger.info("Exception", ex);
- }
- }
- }
- return resultEle;
- case Node.TEXT_NODE:
- Text txt = destDoc.createTextNode(sourceNode.getNodeValue());
- if (txt instanceof IDOMText && sourceNode instanceof IDOMText) {
- try {
- ((IDOMText) txt).setSource(((IDOMText) sourceNode)
- .getSource());
- } catch (Exception ex) {
- // ignore
- }
- }
- return txt;
- case Node.CDATA_SECTION_NODE:
- return destDoc.createCDATASection(sourceNode.getNodeValue());
- default:
- return null; // not support.
- }
- }
-
- /**
- * @param destDoc
- * @param sourceNode
- * @return the node
- */
- public static Node cloneNodeDeep(Document destDoc, Node sourceNode) {
- switch (sourceNode.getNodeType()) {
- case Node.ELEMENT_NODE:
- Element sourceEle = (Element) sourceNode;
- Element resultEle = destDoc.createElement(sourceEle.getTagName());
- NamedNodeMap attrs = sourceEle.getAttributes();
- for (int i = 0, size = attrs.getLength(); i < size; i++) {
- Attr a = (Attr) attrs.item(i);
- resultEle.setAttribute(a.getName(), a.getValue());
- }
- NodeList children = sourceEle.getChildNodes();
- for (int i = 0, size = children.getLength(); i < size; i++) {
- Node n = children.item(i);
- Node d = cloneNodeDeep(destDoc, n);
- if (d != null) {
- resultEle.appendChild(d);
- }
- }
- return resultEle;
- case Node.TEXT_NODE:
- Text txt = destDoc.createTextNode(sourceNode.getNodeValue());
- if (txt instanceof IDOMText && sourceNode instanceof IDOMText) {
- try {
- ((IDOMText) txt).setSource(((IDOMText) sourceNode)
- .getSource());
- } catch (Exception ex) {
- // ignore
- _logger.info("Exception", ex);
- }
- }
- return txt;
- case Node.CDATA_SECTION_NODE:
- return destDoc.createCDATASection(sourceNode.getNodeValue());
- default:
- return null; // not support.
- }
- }
-
- /**
- * check whether the ancester relationship exist for the two nodes.
- *
- * @param ancester
- * @param child
- * @return true if ancester is an ancestor of child
- */
- public static boolean isAncester(Node ancester, Node child) {
- while (child != null) {
- if (child == ancester) {
- return true;
- }
- child = child.getParentNode();
- }
- return false;
- }
-
- /**
- * insert the node at specified position.
- *
- * @param domPosition
- * @param node
- * @return null if fail, otherwise return the inserted node.
- */
- public static Node insertNode(IDOMPosition domPosition, Node node) {
- IDOMPosition position = DOMPositionHelper.splitText(domPosition);
- if (position == null || position.getContainerNode() == null) {
- return null;
- }
- if (position.getNextSiblingNode() == null) {
- position.getContainerNode().appendChild(node);
- } else {
- position.getContainerNode().insertBefore(node,
- position.getNextSiblingNode());
- }
-
- return node;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/EditHelper.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/EditHelper.java
deleted file mode 100644
index e8e2171..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/EditHelper.java
+++ /dev/null
@@ -1,504 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dom;
-
-import java.util.List;
-import java.util.Stack;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.gef.EditPart;
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.commands.range.WorkNode;
-import org.eclipse.jst.pagedesigner.parts.TextEditPart;
-import org.eclipse.jst.pagedesigner.utils.HTMLUtil;
-import org.eclipse.jst.pagedesigner.validation.caret.ActionData;
-import org.eclipse.jst.pagedesigner.validation.caret.IMovementMediator;
-import org.eclipse.jst.pagedesigner.validation.caret.InlineEditingNavigationMediator;
-import org.eclipse.jst.pagedesigner.viewer.DesignPosition;
-import org.eclipse.jst.pagedesigner.viewer.DesignRefPosition;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-/**
- * @author mengbo
- */
-public class EditHelper {
-// public final static boolean INNER_DEBUG = false;
-
- private final static int OUT_OF_LEFT = 1;
-
- private final static int LEFT_NAME = 2;
-
- /**
- * indicates a position in the middle
- */
- public final static int IN_MIDDLE = 3;
-
- private final static int RIGHT_NAME = 4;
-
- private final static int OUT_OF_RIGHT = 5;
-
- private static final EditHelper _instance = new EditHelper();
-
- //private static Logger _log = PDPlugin.getLogger(EditHelper.class);
-
- private EditHelper() {
- // no external instantiation
- }
-
- /**
- * Move operation position infront of next non-blank and non-transparent
- * char. The caller should ensure position's container node is not
- * tranparent text node.
- *
- * @param position
- * @param forward
- * @param forEmpty
- * @return the offset
- */
- public int getTextNextOffset(IDOMPosition position, boolean forward,
- boolean forEmpty) {
- EditValidateUtil.validPosition(position);
- Assert.isTrue(!EditModelQuery.isTransparentText(position
- .getContainerNode()));
- Text text = (Text) position.getContainerNode();
- int offset = position.getOffset();
- String data = text.getNodeValue();
- if (forward) {
- while (offset < data.length()
- && HTMLUtil.isHTMLWhitespace(data.charAt(offset))) {
- offset++;
- }
- } else {
- while (offset > 0
- && HTMLUtil.isHTMLWhitespace(data.charAt(offset - 1))) {
- offset--;
- }
- }
- return offset;
-
- }
-
- /**
- * @return the singleton instance
- */
- public static EditHelper getInstance() {
- return _instance;
- }
-
- /**
- * This caret from current operation postion to next position, this method
- * will convert DesignPosition in to DOMPosition, then call dom function to
- * move dom position. Here we might insert some complex rules to see whether
- * move is valid.
- *
- * @param action
- * @param currentPosition
- * @param forward
- * @return the dom position
- */
- public static DesignPosition moveToNextEditPosition(int action,
- DesignPosition currentPosition, boolean forward) {
- IDOMPosition position;
- position = DOMPositionHelper.toDOMPosition(currentPosition);
- position = moveToNextEditPosition(position, forward,
- new InlineEditingNavigationMediator(
- new ActionData(action, null)));
- if (position == null) {
- return currentPosition;
- }
-
- EditValidateUtil.validPosition(position);
- return DOMPositionHelper.toDesignPosition(position);
- }
-
- /**
- * Move operation position to next edit position. We may need rule to valid
- * it based on operation ID and direction. We need to pack transparent
- * string.
- *
- * @param currentPosition
- * @param forward
- * @param validator
- * @return the dom position
- */
- public static IDOMPosition moveToNextEditPosition(
- IDOMPosition currentPosition, boolean forward,
- IMovementMediator validator) {
- IDOMPosition result = null;
- CaretMoveIterator moveIterator = new CaretMoveIterator(null, validator,
- currentPosition, forward);
- if ((result = moveIterator.moveToNextEditPosition(currentPosition,
- forward, validator)) == null) {
- result = currentPosition;
- }
- return result;
- }
-
- /**
- * Delete a node, in case it is 'body' or 'html', it won't perform delete.
- *
- * @param node
- * @return the node
- */
- public static Node deleteNode(Node node) {
- if (node == null || node.getNodeName() == null) {
- return null;
- }
- String name = node.getLocalName();
-
- if (name != null
- && (name.equalsIgnoreCase(IHTMLConstants.TAG_BODY)
- || name.equalsIgnoreCase(IHTMLConstants.TAG_HEAD) || name
- .equalsIgnoreCase(IHTMLConstants.TAG_HTML))) {
- return null;
- }
- Node parent = node.getParentNode();
- name = parent.getNodeName();
- if (parent != null
- && name != null
- && parent.getNodeName().equalsIgnoreCase(
- IHTMLConstants.TAG_HEAD)) {
- return null;
- }
- return parent.removeChild(node);
- }
-
- /**
- * Order the IDOMPositions in a range in ascending order.
- *
- * @param range
- * @return the dom range
- */
- public static DOMRange normal(DOMRange range) {
- EditValidateUtil.validRange(range);
- IDOMPosition p1 = range.getStartPosition();
- IDOMPosition p2 = range.getEndPosition();
- if (EditModelQuery.getIndexedRegionLocation(p1) > EditModelQuery
- .getIndexedRegionLocation(p2)) {
- return new DOMRange(p2, p1);
- }
- return range;
- }
-
- /**
- * Move position in to node from its outside, the node should be breakble.
- *
- * @param node
- * @param validator
- * @param forward
- * @return the dom position
- */
- public static IDOMPosition moveInto(Node node, IMovementMediator validator,
- boolean forward) {
- CaretMoveIterator moveIterator = new CaretMoveIterator(null, validator,
- new DOMRefPosition(node, !forward), forward);
- return moveIterator.moveIn(node);
- }
-
- /**
- * Convert a DomRefPosition into DOMPosition.
- *
- * @param position
- * @return the dom position
- */
- public static IDOMPosition ensureDOMPosition(IDOMPosition position) {
- if (position instanceof DOMRefPosition) {
- return new DOMPosition(position.getContainerNode(), position
- .getOffset());
- }
- return position;
- }
-
- /**
- * @param currentNode
- * @param pos1
- * @param pos2
- * @param top
- * @param workNode
- */
- public void processText(Text currentNode, final int pos1, final int pos2,
- Node top, Stack workNode) {
- // the text could be tranparent, or 0 length.
- Assert.isTrue(pos1 <= pos2);
- if (pos1 == pos2) {
- return;
- }
- // int left = EditModelQuery.getNodeStartIndex(currentNode);
- // int right = EditModelQuery.getNodeEndIndex(currentNode);
- int location1 = getLocation(currentNode, pos1, false);
- int location2 = getLocation(currentNode, pos2, false);
- if (location1 <= IN_MIDDLE && location2 >= IN_MIDDLE) {
- workNode.push(new WorkNode(currentNode, pos1, pos2));
- }
- }
-
- /**
- * @param currentNode
- * @param pos1
- * @param pos2
- * @param top
- * @param result
- */
- public void collectNodes(Node currentNode, final int pos1, final int pos2,
- Node top, Stack result) {
- Assert.isTrue(pos1 <= pos2);
- if (pos1 == pos2) {
- return;
- }
- if (EditModelQuery.isText(currentNode)) {
- processText((Text) currentNode, pos1, pos2, top, result);
- } else {
- int location1 = getLocation(currentNode, pos1, false);
- int location2 = getLocation(currentNode, pos2, false);
- if (location1 < IN_MIDDLE && location2 > IN_MIDDLE) {
- // TODO: push the node into result.--
- result.push(new WorkNode(currentNode, pos1, pos2));
- } else if (location1 <= IN_MIDDLE && location2 >= IN_MIDDLE) {
- if (currentNode.hasChildNodes()) {
- Node child = currentNode.getFirstChild();
- Stack myResult = new Stack();
- while (child != null) {
- collectNodes(child, pos1, pos2, top, myResult);
- child = child.getNextSibling();
- }
- if (location1 < IN_MIDDLE && location2 >= IN_MIDDLE
- || location1 <= IN_MIDDLE && location2 > IN_MIDDLE) {
- WorkNode workNode = new WorkNode(currentNode, pos1,
- pos2);
- while (myResult.size() > 0) {
- WorkNode w = (WorkNode) myResult.remove(0);
- if (w.getNode().getParentNode() == workNode
- .getNode()) {
- w.setParent(workNode);
- }
- result.push(w);
- }
- // TODO: push parent into result.--
- result.push(workNode);
- }
- } else {
- if (!(location1 == IN_MIDDLE && location2 == IN_MIDDLE)) {
- // TODO: push this node into result.
- result.push(new WorkNode(currentNode, pos1, pos2));
- }
- }
- }
- }
- }
-
- /**
- * @param currentNode
- * @param pos
- * @param isOffset
- * @return the location
- */
- public int getLocation(Node currentNode, int pos, boolean isOffset) {
- if (EditModelQuery.getInstance().isSingleRegionNode(currentNode)) {
- // if (EditModelQuery.isText(currentNode))
- {
-
- int left = EditModelQuery.getNodeStartIndex(currentNode);
- int right = EditModelQuery.getNodeEndIndex(currentNode);
- if (isOffset) {
- pos += left;
- }
- if (pos <= left) {
- return OUT_OF_LEFT;
- } else if (left < pos && pos < right) {
- return IN_MIDDLE;
- } else {
- return OUT_OF_RIGHT;
- }
- }
- }
- int left = EditModelQuery.getNodeStartIndex(currentNode);
- int left1 = EditModelQuery.getNodeStartNameEndIndex(currentNode);
- int right = EditModelQuery.getNodeEndNameStartIndex(currentNode);
- int right1 = EditModelQuery.getNodeEndIndex(currentNode);
- if (isOffset) {
- pos += left;
- }
- if (pos <= left) {
- return OUT_OF_LEFT;
- } else if (left < pos && pos < left1) {
- return LEFT_NAME;
- } else if (left1 <= pos && pos <= right) {
- return IN_MIDDLE;
- } else if (right < pos && pos < right1) {
- return RIGHT_NAME;
- } else {
- return OUT_OF_RIGHT;
- }
-
- }
-
- // TODO: dead?
-// private Node cutCurrentNode(int pos[], Node currentNode,
-// IDOMPosition position) {
-// // at right edge
-// int curpos = EditModelQuery.getIndexedRegionLocation(position);
-// if (pos[0] <= curpos) {
-// pos[1] = EditModelQuery.getNodeStartIndex(currentNode);
-// currentNode = deleteNode(currentNode);
-// if (INNER_DEBUG) {
-// _log.info("cut:" + currentNode);
-// }
-// return currentNode;
-// } else if (pos[1] >= curpos) {
-// pos[0] = EditModelQuery.getNodeEndIndex(currentNode);
-// currentNode = deleteNode(currentNode);
-// if (INNER_DEBUG) {
-// _log.info("cut:" + currentNode);
-// }
-// return currentNode;
-// }
-// return null;
-// }
-
- //TODO: dead?
-// private int getPos(DOMRange range, boolean forStart) {
-// if (forStart) {
-// return EditModelQuery.getIndexedRegionLocation(range
-// .getStartPosition());
-// } else {
-// return EditModelQuery.getIndexedRegionLocation(range
-// .getEndPosition());
-// }
-// }
-
- /**
- * @param position
- * @param forward
- * @return the edit part for position
- */
- public EditPart getEditPart(DesignPosition position, boolean forward) {
- if (position instanceof DesignRefPosition) {
- return ((DesignRefPosition) position).getRefPart();
- }
- EditPart container = position.getContainerPart();
- if (container instanceof TextEditPart) {
- return container;
- }
- if (container != null) {
- List children = container.getChildren();
- for (int i = 0, n = children.size(); i < n; i++) {
- if (i == position.getOffset()) {
- int index = (forward) ? i - 1 : i + 1;
- if (index < 0) {
- index = 0;
- }
- if (index >= children.size()) {
- index = children.size() - 1;
- }
-
- return (EditPart) children.get(index);
- }
- }
- }
- return null;
- }
-
- /**
- * @param position
- * @return the resulting dom position
- */
- public static IDOMPosition splitNode(IDOMPosition position) {
- if (EditValidateUtil.validPosition(position)) {
- Node container = null;
- // Avoid to split tag at its edge
- if (position.getOffset() > 0) {
- if (position.isText()) {
- container = position.getContainerNode();
- if (position.getOffset() < ((Text) container).getLength()) {
- position = DOMPositionHelper.splitText(position);
- } else {
- // position = new
- // DOMRefPosition(position.getContainerNode(), true);
- }
- } else {
- if (position.getNextSiblingNode() != null) {
- container = position.getContainerNode();
- Node parent = container.getParentNode();
-
- Document document = EditModelQuery
- .getDocumentNode(container);
- Node newContainer = document.createElement(container
- .getNodeName());
- Node node = position.getPreviousSiblingNode();
- Node refNode = null;
- while (node != null) {
- Node prev = node.getPreviousSibling();
- node = node.getParentNode().removeChild(node);
-
- newContainer.insertBefore(node, refNode);
- refNode = node;
- node = prev;
- }
- parent.insertBefore(newContainer, container);
- // set the newContainer node align attribute to the
- // original align attribue
- // copy nodes under container node to container node's
- // parent node
- if (container.getNodeName().equalsIgnoreCase(
- IHTMLConstants.TAG_P)) {
- Element pNode = (Element) container;
- String align = pNode
- .getAttribute(IHTMLConstants.ATTR_ALIGN);
- if (align != null && !"".equalsIgnoreCase(align)) {
- ((Element) newContainer).setAttribute(
- IHTMLConstants.ATTR_ALIGN, align);
- }
- NodeList nodeList = pNode.getChildNodes();
- for (int i = 0, size = nodeList.getLength(); i < size; i++) {
- Node tempNode = nodeList.item(i);
- parent.insertBefore(tempNode, container);
- }
- }
- return new DOMRefPosition(newContainer, true);
- }
-// position = new
-// DOMRefPosition(position.getContainerNode(), true);
- }
- } else {
- // container = position.getContainerNode();
- // position = new DOMRefPosition(container, false);
- }
- }
- return position;
- }
-
- /**
- * @param position
- * @return the position of this 'position' in relative to it's container.
- */
- public static int getLocation(IDOMPosition position) {
- if (position.getOffset() == 0) {
- return -1;
- }
- if (position.isText()) {
- if (position.getOffset() == ((Text) position.getContainerNode())
- .getLength()) {
- return 1;
- }
- return 0;
- }
- if (position.getOffset() == position.getContainerNode()
- .getChildNodes().getLength()) {
- return 1;
- }
- return 0;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/EditModelQuery.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/EditModelQuery.java
deleted file mode 100644
index 54668b1..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/EditModelQuery.java
+++ /dev/null
@@ -1,1840 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dom;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.gef.EditPart;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.jsf.core.internal.tld.IJSFConstants;
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.jst.pagedesigner.parts.ElementEditPart;
-import org.eclipse.jst.pagedesigner.parts.HTMLEditPartsFactory;
-import org.eclipse.jst.pagedesigner.parts.NodeEditPart;
-import org.eclipse.jst.pagedesigner.utils.HTMLUtil;
-import org.eclipse.jst.pagedesigner.validation.caret.Target;
-import org.eclipse.jst.pagedesigner.viewer.DesignPosition;
-import org.eclipse.jst.pagedesigner.viewer.DesignRange;
-import org.eclipse.swt.SWT;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-/**
- * @author mengbo
- */
-public final class EditModelQuery {
- private static Logger _log = PDPlugin.getLogger(EditModelQuery.class);
-
- private static EditModelQuery _instance;
-
- private static final int START_INDEX_BEFORE_TAG = 1;
-
- private static final int END_INDEX_WITHIN_TAG = 2;
-
- private static final HashSet SPECIAL_EMPTY_CHARS = new HashSet();
-
- /**
- * Maps unicode Characters to html equivalents
- */
- public static final HashMap CHAR_NODE_MAP = new HashMap();
-
- // Cursor can't go outside of these container.
- private static final HashSet HTML_CONSTRAINED_CONTAINERS = new HashSet();
-
- /**
- * HTML tags that control style
- */
- public static final HashSet HTML_STYLE_NODES = new HashSet();
-
- static final HashSet UNREMOVEBLE_TAGS = new HashSet();
-
- // Nodes that can hold other nodes.
- static final String[] HTML_CONTAINER_NODES = {
- //
- IHTMLConstants.TAG_BODY, //
- IHTMLConstants.TAG_HTML, //
- IHTMLConstants.TAG_SPAN, //
- IHTMLConstants.TAG_FORM, //
- IHTMLConstants.TAG_P,//
- IHTMLConstants.TAG_SPAN,//
- IHTMLConstants.TAG_DIV,//
- IHTMLConstants.TAG_LI,//
- IHTMLConstants.TAG_OL,//
- IHTMLConstants.TAG_UL //
- };
-
- static final String[] NON_HTML_CONTAINER_NODES = {
- IJSFConstants.TAG_VIEW, //
- IJSFConstants.TAG_PANELGRID, //
- IJSFConstants.TAG_PANELGROUP, //
- IJSFConstants.TAG_SUBVIEW };
- static {
- UNREMOVEBLE_TAGS.add(IHTMLConstants.TAG_HTML);
- UNREMOVEBLE_TAGS.add(IHTMLConstants.TAG_HEAD);
- UNREMOVEBLE_TAGS.add(IHTMLConstants.TAG_BODY);
- EditModelQuery.CHAR_NODE_MAP.put(new Character(SWT.CR),
- IHTMLConstants.TAG_BR);
- EditModelQuery.CHAR_NODE_MAP.put(new Character(SWT.LF),
- IHTMLConstants.TAG_BR);
- EditModelQuery.SPECIAL_EMPTY_CHARS.add(" ");
- EditModelQuery.SPECIAL_EMPTY_CHARS.add("\t");
- EditModelQuery.SPECIAL_EMPTY_CHARS.add("\r");
- EditModelQuery.SPECIAL_EMPTY_CHARS.add("\n");
- EditModelQuery.HTML_CONSTRAINED_CONTAINERS.add(IHTMLConstants.TAG_TD);
- EditModelQuery.HTML_CONSTRAINED_CONTAINERS.add(IHTMLConstants.TAG_TR);
- EditModelQuery.HTML_CONSTRAINED_CONTAINERS
- .add(IHTMLConstants.TAG_TABLE);
- EditModelQuery.HTML_STYLE_NODES.add(IHTMLConstants.TAG_B);
- EditModelQuery.HTML_STYLE_NODES.add(IHTMLConstants.TAG_EM);
- EditModelQuery.HTML_STYLE_NODES.add(IHTMLConstants.TAG_H1);
- EditModelQuery.HTML_STYLE_NODES.add(IHTMLConstants.TAG_H2);
- EditModelQuery.HTML_STYLE_NODES.add(IHTMLConstants.TAG_H3);
- EditModelQuery.HTML_STYLE_NODES.add(IHTMLConstants.TAG_H4);
- EditModelQuery.HTML_STYLE_NODES.add(IHTMLConstants.TAG_H5);
- EditModelQuery.HTML_STYLE_NODES.add(IHTMLConstants.TAG_H6);
- EditModelQuery.HTML_STYLE_NODES.add(IHTMLConstants.TAG_A);
- EditModelQuery.HTML_STYLE_NODES.add(IHTMLConstants.TAG_U);
- EditModelQuery.HTML_STYLE_NODES.add(IHTMLConstants.TAG_I);
- EditModelQuery.HTML_STYLE_NODES.add(IHTMLConstants.TAG_S);
- EditModelQuery.HTML_STYLE_NODES.add(IHTMLConstants.TAG_STRONG);
- EditModelQuery.HTML_STYLE_NODES.add(IHTMLConstants.TAG_TT);
- EditModelQuery.HTML_STYLE_NODES.add(IHTMLConstants.TAG_BIG);
- EditModelQuery.HTML_STYLE_NODES.add(IHTMLConstants.TAG_SMALL);
- EditModelQuery.HTML_STYLE_NODES.add(IHTMLConstants.TAG_FONT);
- }
-
- private EditModelQuery() {
- // no external instantiation
- }
-
- /**
- * @return the singleton instance
- */
- public static EditModelQuery getInstance() {
- if (_instance == null) {
- _instance = new EditModelQuery();
- }
- return _instance;
- }
-
- /**
- * Get previous sibling, or if sibling is null then get previous neighbor.
- *
- * @param node
- * @return the node
- */
- public Node getPreviousNeighbor(Node node) {
- if (!EditValidateUtil.validNode(node)) {
- return null;
- }
- while (node != null && node.getNodeType() != Node.DOCUMENT_NODE
- && node.getPreviousSibling() == null) {
- node = node.getParentNode();
- }
- return (node != null && node.getNodeType() != Node.DOCUMENT_NODE) ? node
- .getPreviousSibling()
- : null;
- }
-
- /**
- * Get privous sibling, or if sibling is null then get previous neighor's
- * rightmost child, which is adjacent to 'node'.
- *
- * @param node
- * @return the node
- */
- public Node getPreviousLeafNeighbor(Node node) {
- return getLastLeafChild(getPreviousNeighbor(node));
- }
-
- /**
- * Get next sibling, or if sibling is null get next neighbor.
- *
- * @param node
- * @return the node
- */
- public Node getNextNeighbor(Node node) {
- if (!EditValidateUtil.validNode(node)) {
- return null;
- }
-
- while (node != null && node.getNodeType() != Node.DOCUMENT_NODE
- && node.getNextSibling() == null) {
- node = node.getParentNode();
- }
- return (node != null && node.getNodeType() != Node.DOCUMENT_NODE) ? node
- .getNextSibling()
- : null;
- }
-
- /**
- * Get next sibling, or if sibling is null get next neighbor's leftmost leaf
- * child which will be adjacent to 'node'.
- *
- * @param node
- * @return the node
- */
- public Node getNextLeafNeighbor(Node node) {
- return getFirstLeafChild(getNextNeighbor(node));
- }
-
- /**
- * Get node's rightmost leaf child.
- *
- * @param node
- * @return the node
- */
- private Node getLastLeafChild(Node node) {
- if (node == null) {
- return null;
- }
- if (node.getLastChild() != null) {
- return getLastLeafChild(node.getLastChild());
- }
- return node;
- }
-
- /**
- * Get node's leftmost leaf child.
- *
- * @param node
- * @return the node
- */
- private Node getFirstLeafChild(Node node) {
- if (node == null) {
- return null;
- }
-
- if (node.getFirstChild() != null) {
- return getFirstLeafChild(node.getFirstChild());
- }
- return node;
- }
-
- /**
- * To see if node is within a indexed region that is started from 'start',
- * ended at 'end'
- */
- static boolean within(int start, int end, Node theNode) {
- return getNodeStartIndex(theNode) >= start
- && getNodeEndIndex(theNode) <= end;
- }
-
- /**
- * To see whether the 'position' is within indexed location (start, end)
- *
- * @param start
- * @param end
- * @param position
- * @return
- */
- boolean within(int start, int end, IDOMPosition position) {
- int pos = getIndexedRegionLocation(position);
- return start <= pos && pos <= end;
- }
-
- /**
- * To see whether the 'theNode' is not within indexed region (start, end)
- *
- * @param start
- * @param end
- * @param theNode
- * @return
- */
- static boolean outOf(int start, int end, Node theNode) {
- if (getNodeLenth(theNode) > 0) {
- return getNodeStartIndex(theNode) >= end
- || getNodeEndIndex(theNode) <= start;
- }
- return !((getNodeStartIndex(theNode) >= start && getNodeEndIndex(theNode) <= end));
- }
-
- /**
- * Determine whether the position is at node's edge. When the offset is at
- * edge, it is in the leftmost or rightmost offset of node's region.
- *
- * @param position
- * @param forward
- * @return true if at edge
- */
- boolean atEdge(IDOMPosition position, boolean forward) {
- Node node = position.getContainerNode();
- int offset = position.getOffset();
- if (forward) {
- if (EditModelQuery.isText(node)) {
- return offset == node.getNodeValue().length();
- }
- return offset == node.getChildNodes().getLength();
- }
- return offset == 0;
- }
-
- /**
- * Get node's neighbor on the node tree, if forward, then get next,
- * otherwise go backward.
- *
- * @param node
- * @param forward
- * @return the node
- */
- Node getNeighbor(Node node, boolean forward) {
- if (forward) {
- return getNextNeighbor(node);
- }
- return getPreviousNeighbor(node);
- }
-
- /**
- * Get neighbor which is descendent of root.
- *
- * @param node
- * @param root
- * @return the node
- */
- Node getPreviousNeighbor(Node node, Node root) {
- if (!EditValidateUtil.validNode(node)) {
- return null;
- }
- while (node != null && node != root
- && node.getNodeType() != Node.DOCUMENT_NODE
- && node.getPreviousSibling() == null) {
- node = node.getParentNode();
- }
- return (node != null && node != root && node.getNodeType() != Node.DOCUMENT_NODE) ? node
- .getPreviousSibling()
- : null;
- }
-
- /**
- * Get neighbor which is descendent of root.
- *
- * @param node
- * @param root
- * @return the node
- */
- Node getNextNeighbor(Node node, Node root) {
- if (!EditValidateUtil.validNode(node)) {
- return null;
- }
-
- while (node != null && node != root
- && node.getNodeType() != Node.DOCUMENT_NODE
- && node.getNextSibling() == null) {
- node = node.getParentNode();
- }
- return (node != null && node != root && node.getNodeType() != Node.DOCUMENT_NODE) ? node
- .getNextSibling()
- : null;
- }
-
- /**
- * Get neighbor which is descendent of root.
- *
- * @param node
- * @param forward
- * @param root
- * @return the node
- */
- Node getNeighbor(Node node, boolean forward, Node root) {
- Assert.isTrue(root != null);
- if (forward) {
- return getNextNeighbor(node, root);
- }
- return getPreviousNeighbor(node, root);
- }
-
- /**
- * Get node's leaf child which is adjacent to 'node', according to
- * 'forward', it will search backward or forward.
- *
- * @param node
- * @param forward
- * @return the node
- */
- Node getLeafNeighbor(Node node, boolean forward) {
- if (node == null) {
- return null;
- }
- if (forward) {
- return getNextLeafNeighbor(node);
- }
- return getPreviousLeafNeighbor(node);
- }
-
- /**
- * Get neighbor's leaf child, which is adjacent to 'node'
- *
- * @param node
- * @param childIndex
- * @param forward
- * @return the node
- */
- Node getLeafNeighbor(Node node, int childIndex, boolean forward) {
- if (node == null) {
- return null;
- }
- Node neighbor = getNeighbor(node, childIndex, forward);
- if (neighbor != null) {
- if (forward) {
- return getFirstLeafChild(neighbor);
- }
- return getLastLeafChild(neighbor);
- }
- return null;
- }
-
- /**
- * First try sibling, if it retruns null, try search neighbor.
- *
- * @param parent
- * @param childIndex
- * @param forward
- * @return the node
- */
- Node getNeighbor(Node parent, int childIndex, boolean forward) {
- if (!EditValidateUtil.validNode(parent)) {
- return null;
- }
-
- NodeList nodeList = parent.getChildNodes();
- if (nodeList != null && nodeList.getLength() > 0) {
- if (nodeList.getLength() < childIndex) {
- return null;
- }
- Node childNode = null;
- if (!forward) {
- --childIndex;
- }
- childNode = nodeList.item(childIndex);
- if (childNode != null) {
- return childNode;
- }
- return getNeighbor(parent, forward);
- }
- if (parent.getNodeType() == Node.TEXT_NODE) {
- return getNeighbor(parent, forward);
- }
- return null;
- }
-
- /**
- * To see whether the textSelection start and end are on the same.
- *
- * @param model
- * @param textSelection
- * @return the node
- */
- static boolean isSame(IStructuredModel model,
- TextSelection textSelection) {
- if (model != null && textSelection != null) {
- int t1 = textSelection.getOffset();
- int t2 = textSelection.getLength() + t1;
- return model.getIndexedRegion(t1) == model.getIndexedRegion(t2);
- }
- return false;
- }
-
- /**
- * To see if the range and text selection covered the same range.
- *
- * @param model
- * @param range
- * @param textSelection
- * @return true if same
- */
- static boolean isSame(IStructuredModel model, DesignRange range,
- TextSelection textSelection) {
- if (model != null && range != null && textSelection != null) {
- int t1 = textSelection.getOffset();
- int t2 = textSelection.getLength() + t1;
- int r1 = getIndexedRegionLocation(DOMRangeHelper.toDOMRange(range)
- .getStartPosition());
- int r2 = getIndexedRegionLocation(DOMRangeHelper.toDOMRange(range)
- .getEndPosition());
- return (model.getIndexedRegion(t1) == model.getIndexedRegion(r1) && //
- model.getIndexedRegion(t2) == model.getIndexedRegion(r2))
- || (model.getIndexedRegion(t2) == model
- .getIndexedRegion(r1) && //
- model.getIndexedRegion(t1) == model.getIndexedRegion(r2));
- }
- return false;
- }
-
- /**
- * To see whether the selection is single point.
- *
- * @param textSelection
- * @return true if same point
- */
- static boolean isSamePoint(TextSelection textSelection) {
- return textSelection.getLength() == 0;
- }
-
- /**
- * To see whether two IDOMPosition are pointed to a same location.
- *
- * @param p1
- * @param p2
- * @return true if same
- */
- public static boolean isSame(IDOMPosition p1, IDOMPosition p2) {
- if (p1 == p2
- || (p1.getContainerNode() == p2.getContainerNode() && p1
- .getOffset() == p2.getOffset())) {
- return true;
- }
- return false;
- }
-
- /**
- * To see whether the range's start and end position are pointed to a same
- * location.
- *
- * @param range
- * @return true if is same
- */
- public static boolean isSame(DOMRange range) {
- EditValidateUtil.validRange(range);
- return isSame(range.getStartPosition(), range.getEndPosition());
- }
-
- /**
- * @param range
- * @return true if same
- */
- public static boolean isSame(DesignRange range) {
- return isSame(range.getStartPosition(), range.getEndPosition());
- }
-
- /**
- * @param p1
- * @param p2
- * @return true if same
- */
- public static boolean isSame(DesignPosition p1, DesignPosition p2) {
- if (p1 == p2) {
- return true;
- }
- if (p1.getContainerNode() == p2.getContainerNode()
- && p1.getOffset() == p2.getOffset()) {
- return true;
- }
- return false;
- }
-
- /**
- * @param p1
- * @param p2
- * @return true if p1 and p2 are within same text node
- */
- final boolean isWithinSameText(IDOMPosition p1, IDOMPosition p2) {
- if (p1 == null || p2 == null) {
- return false;
- }
- return p1.isText() && p2.isText()
- && p1.getContainerNode() == p2.getContainerNode();
- }
-
- /**
- * Get the node absolute start location in its residing IStructuredModel.
- *
- * @param p
- * @return the location
- */
- public static int getIndexedRegionLocation(IDOMPosition p) {
- if (!EditValidateUtil.validPosition(p)) {
- return -1;
- }
- Node parent = p.getContainerNode();
- if (p.isText()) {
- return ((IndexedRegion) parent).getStartOffset() + p.getOffset();
- }
- int index = p.getOffset();
- if (!parent.hasChildNodes()) {
- // Element:
- if (!isDocument(parent)) {
- IStructuredDocumentRegion region = ((IDOMNode) parent)
- .getStartStructuredDocumentRegion();
- return region.getEnd();
- }
- // Document node:
- int offset = ((IndexedRegion) parent).getStartOffset();
- return offset;
- }
- NodeList children = parent.getChildNodes();
- // After rightmost child
- if (children.getLength() == index) {
- if (!isDocument(parent)) {
- int pos = getNodeEndNameStartIndex(parent);
- return pos;
- }
- int offset = ((IndexedRegion) parent).getEndOffset();
- return offset;
- }
- Node node = children.item(index);
- return ((IndexedRegion) node).getStartOffset();
- }
-
- /**
- * To determine whether the position is at the edge of a node. TODO: temp
- * func for later combination
- * @param nodePos
- *
- * @param position
- * @param left
- * @return true if linked
- */
- boolean isLinked(IDOMPosition nodePos, IDOMPosition position,
- boolean left) {
- int index = getIndexedRegionLocation(position);
- if (left) {
- int pos = getIndexedRegionLocation(nodePos);
- return pos == index;
- }
- Node node = null;
- int end;
- if (nodePos.isText()) {
- node = nodePos.getContainerNode();
- end = ((IndexedRegion) node).getEndOffset();
- } else {
- node = nodePos.getNextSiblingNode();
- Assert.isTrue(node != null);
- end = ((IndexedRegion) node).getEndOffset();
- }
- return end == index;
- }
-
- /**
- * To see if the location is at the node's indexed pos, posType can be
- * START_INDEX_BEFORE_TAG, END_INDEX_WITHIN_TAG When location is at these
- * two position, webtools returns the container tag name, so we need to know
- * these.
- *
- * @param location
- * @param node
- * @return true if at edge
- */
- boolean isAtNodeNameEdge(int location, Node node, int posType) {
- int start = getNodeEndNameStartIndex(node);
- return location == start;
- }
-
- /**
- * @param location
- * @param node
- * @return true if at edge
- */
- public boolean isAtNodeNameEdge(int location, Node node) {
- return isAtNodeNameEdge(location, node, START_INDEX_BEFORE_TAG)
- || isAtNodeNameEdge(location, node, END_INDEX_WITHIN_TAG);
- }
-
- /**
- * If text only contains chars '\r' or '\n', it is considered to be
- * transparent.
- *
- * @param node
- * @return true if transparent text
- */
- public static boolean isTransparentText(Node node) {
- // should valid non null?
- Assert.isTrue(node != null);
- if (node == null || !isText(node)) {
- return false;
- }
- if (!EditValidateUtil.validText(node)) {
- return false;
- }
-
- Text text = (Text) node;
- if (text.getLength() == 0) {
- return true;
- }
- String value = text.getNodeValue();
- int i = 0;
- while (i < value.length() && HTMLUtil.isHTMLWhitespace(value.charAt(i))) {
- i++;
- }
- return i == value.length();
- }
-
- /**
- * Get node index in its parent's children.
- *
- * @param node
- * @return the node index or -1 if not found
- */
- static int getNodeIndex(Node node) {
- EditValidateUtil.validNode(node);
- Node parent = node.getParentNode();
- int index = 0;
- for (Node child = parent.getFirstChild(); child != null; child = child
- .getNextSibling()) {
- if (child == node) {
- return index;
- }
- index++;
- }
- return -1; // error
- }
-
- /**
- * If parent has more than one children of which each node's localName is
- * the same as of 'node', return the index of 'node' in the same type
- * children list.
- *
- * @param node
- * @return the index
- */
- public int getSameTypeNodeIndex(Node node) {
- EditValidateUtil.validNode(node);
- int i = 0;
- while (node != null) {
- Node sibling = node.getPreviousSibling();
- if (sibling != null && sibling.getLocalName() != null
- && sibling.getLocalName().equals(node.getLocalName())) {
- i++;
- }
- node = sibling;
- }
- return i; // error
- }
-
- /**
- * Start from position, skip transparent chars, and returns the first
- * non-transparent char's index. based on 'forward', go previously or next .
- *
- * @param value
- * @param position
- * @param forward
- * @return the position
- */
- int getNextConcretePosition(String value, int position,
- boolean forward) {
- if (value == null) {
- return -1;
- }
- if (value.length() == 0) {
- return 0;
- }
- // validate
- Assert.isTrue(position >= 0 && position <= value.length());
- int i = -1;
- if (forward) {
- i = position;
- while (i < value.length()
- && (value.charAt(i) == SWT.CR || value.charAt(i) == SWT.LF)) {
- i++;
- }
- return i;
- }
- i = position - 1;
- while (i >= 0
- && (value.charAt(i) == SWT.CR || value.charAt(i) == SWT.LF)) {
- i--;
- }
- return i + 1;
- }
-
- /**
- * Get two nodes' lowest common ancestor.
- *
- * @param node1
- * @param node2
- * @return the node
- */
- public Node getCommonAncestor(Node node1, Node node2) {
- if (node1 == null || node2 == null) {
- return null;
- }
-
- for (Node na = node1; na != null; na = na.getParentNode()) {
- for (Node ta = node2; ta != null; ta = ta.getParentNode()) {
- if (ta == na)
- return ta;
- }
- }
- return null; // not found
- }
-
- /**
- * Get lowest common ancestor of two IDOMPositions' container nodes..
- *
- * @param p1
- * @param p2
- * @return the nodeh
- */
- public Node getCommonAncestor(IDOMPosition p1, IDOMPosition p2) {
- Node n1 = p1.getContainerNode();
- Node n2 = p2.getContainerNode();
- return getCommonAncestor(n1, n2);
- }
-
- /**
- * Get lowest ancestor of a 'node' which is block type.
- *
- * @param node
- * @return the node
- */
- Node getBlockAncestor(Node node) {
- if (!EditValidateUtil.validNode(node)) {
- return null;
- }
- while (node != null && isChild(IHTMLConstants.TAG_BODY, node, true)) {
- if (isBlockNode(node)) {
- return node;
- }
- node = node.getParentNode();
- }
- return null;
- }
-
- /**
- * To see whether a node is block type.
- *
- * @param node
- * @return true if is a block node
- */
- public static boolean isBlockNode(Node node) {
- return !isInline(node);
- }
-
- /**
- * @param node
- * @return true if is table cell
- */
- static boolean isTableCell(Node node) {
- if (node instanceof INodeNotifier) {
- Object adapter = ((INodeNotifier) node)
- .getAdapterFor(ICSSStyle.class);
- if (adapter != null) {
- ICSSStyle style = (ICSSStyle) adapter;
- String display = style.getDisplay();
- return display.equalsIgnoreCase(ICSSPropertyID.VAL_TABLE_CELL);
- }
- }
- return false;
- }
-
- /**
- * To see if a node's display type is inline.
- *
- * @param refNode
- * @return true if is inline
- */
- public static boolean isInline(Node refNode) {
- Node node = refNode;
- EditPart part = Target.resolvePart(node);
- if (part instanceof ElementEditPart) {
- node = ((ElementEditPart) part).getTagConvert().getResultElement();
- }
- if (isText(node)) {
- return true;
- } else if (node instanceof INodeNotifier) {
- Object adapter = ((INodeNotifier) node)
- .getAdapterFor(ICSSStyle.class);
- if (adapter != null) {
- ICSSStyle style = (ICSSStyle) adapter;
- String display = style.getDisplay();
- return (display.equalsIgnoreCase(ICSSPropertyID.VAL_INLINE)
- || //
- display
- .equalsIgnoreCase(ICSSPropertyID.VAL_INLINE_TABLE)
- || //
- display.equalsIgnoreCase(ICSSPropertyID.VAL_COMPACT) || //
- display.equalsIgnoreCase(ICSSPropertyID.VAL_RUN_IN));
- }
- }
- return false;
- }
-
- /**
- * @param node
- * @return true if is list item
- */
- public static boolean isListItem(Node node) {
- if (node instanceof INodeNotifier) {
- Object adapter = ((INodeNotifier) node)
- .getAdapterFor(ICSSStyle.class);
- if (adapter != null) {
- ICSSStyle style = (ICSSStyle) adapter;
- String display = style.getDisplay();
- return (display.equalsIgnoreCase(ICSSPropertyID.VAL_LIST_ITEM));
- }
- }
- return false;
- }
-
- /**
- * The net effect of this method is that (subject to flags), true
- * is returned if 'node' is the descendant (not really a child)
- * of a tag with a local name in the list of 'names'.
- *
- * TODO C.B: I hate method. Need to rename and possibly rewrite
- *
- * @param names -- check this list for valid local names
- * @param node -- the node to check
- * @param ignoreCase -- if true, each node name has toLowerCase applied to
- * it before checking for it names. NOTE: this assumes that names is already
- * in lowercase. TODO: this is crappy assumption
- * @param noSame -- if true, then node is skipped and only its parent nodes are
- * checked
- * @return true if the local name of node or one of its parents
- * is in the array of Strings called names.
- */
- public static boolean isChild(final String names[], Node node,
- boolean ignoreCase, boolean noSame) {
- if (node == null) {
- return false;
- }
- if (noSame) {
- node = node.getParentNode();
- }
-
- final List namesAsList = Arrays.asList(names);
-
- while (node != null && !isDocument(node)) {
- String nodeName = node.getLocalName();
-
- if (nodeName != null)
- {
- if (ignoreCase)
- {
- nodeName = nodeName.toLowerCase();
- }
-
- if (namesAsList.contains(nodeName))
- {
- return true;
- }
- }
- Node oldNode = node;
- node = node.getParentNode();
- if (oldNode == node)
- {
- throw new IllegalStateException("Infinite loop discovered in DOM tree");
- }
- }
- return false;
- }
-
- /**
- * Determine whether a node is a child of node that is named as 'name', if
- * the node itself is named as 'name' return true also.
- *
- * @param name
- * @param node
- * @param ignoreCase
- * @return true if is child
- */
- public static boolean isChild(String name, Node node, boolean ignoreCase) {
- if (node == null) {
- return false;
- }
-
- while (node != null && node.getNodeType() != Node.DOCUMENT_NODE) {
- String nodeName = node.getLocalName();
- if (nodeName != null
- && (ignoreCase && name.equalsIgnoreCase(nodeName) || !ignoreCase
- && name.equalsIgnoreCase(nodeName))) {
- return true;
- }
- node = node.getParentNode();
- }
- return false;
- }
-
- /**
- * To see whether 'node' is 'ancestor's child.
- *
- * @param ancestor
- * @param node
- * @return true if is child
- */
- public static boolean isChild(Node ancestor, Node node) {
- if (node == null || ancestor == null) {
- return false;
- }
-
- if (isDocument(ancestor)) {
- return true;
- }
- while (node != null && !isDocument(ancestor)) {
- if (node == null) {
- break;
- }
- if (node == ancestor) {
- return true;
- }
- node = node.getParentNode();
- }
- return false;
- }
-
- /**
- * Get next sibling node to position's container node.
- *
- * @param position
- * @return the node
- */
- Node getNextSibling(IDOMPosition position) {
- if (position.isText()) {
- return position.getContainerNode().getNextSibling();
- }
- return position.getNextSiblingNode();
- }
-
- /**
- * Get previous sibling node to position's container node.
- *
- * @param position
- * @return the node
- */
- Node getPreviousSibling(IDOMPosition position) {
- if (position.isText()) {
- return position.getContainerNode().getPreviousSibling();
- }
- return position.getPreviousSiblingNode();
- }
-
- /**
- * Get position's container node's parent.
- *
- * @param position
- * @return the parent node
- */
- Node getParent(IDOMPosition position) {
- if (position.isText()) {
- return position.getContainerNode().getParentNode();
- }
- return position.getContainerNode();
- }
-
- /**
- * Get node's sibling according to 'forward' direction
- *
- * @param node
- * @param forward
- * @return the node
- */
- public Node getSibling(Node node, boolean forward) {
- EditValidateUtil.validNode(node);
- if (forward) {
- return node.getNextSibling();
- }
- return node.getPreviousSibling();
- }
-
- /**
- * Get position's container node's sibling.
- *
- * @param position
- * @param forward
- * @return the node
- */
- public Node getSibling(IDOMPosition position, boolean forward) {
- if (forward) {
- return getNextSibling(position);
- }
- return getPreviousSibling(position);
- }
-
- /**
- * Get position's container node's editable items number. this is temp
- * functions for future use.
- *
- * @param position
- * @return the size
- */
- int getSize(IDOMPosition position) {
- EditValidateUtil.validPosition(position);
- if (position.isText()) {
- return ((Text) position.getContainerNode()).getLength();
- }
- if (position.getContainerNode().hasChildNodes()) {
- return position.getContainerNode().getChildNodes().getLength();
- }
- return 0;
- }
-
- /**
- * Valid position and return text, if it contains text node.
- *
- * @param position
- * @return the text
- */
- public Text getText(IDOMPosition position) {
- if (position.isText()) {
- if (position.getContainerNode() != null) {
- return (Text) position.getContainerNode();
- }
- }
- return null;
- }
-
- /**
- * @param node
- * @return the document for node
- */
- public static Document getDocumentNode(Node node) {
- if (node != null) {
- return isDocument(node) ? (Document) node : node.getOwnerDocument();
- }
- return null;
- }
-
- /**
- * To see whether a node is empty, here we can insert rules to see whether
- * it is empty, for delete operation, it could be deleted.
- *
- * @param node
- * @return true if node empty
- */
- static boolean isEmptyNode(Node node) {
- if (node.getNodeType() == Node.TEXT_NODE) {
- return isTransparentText(node);
- }
- if (node.getChildNodes() == null
- || node.getChildNodes().getLength() == 0) {
- return true;
- }
- return false;
- }
-
- /**
- * To see whther a node is text node.
- *
- * @param node
- * @return true if the node is a text node
- */
- public static boolean isText(Node node) {
- return node != null && node.getNodeType() == Node.TEXT_NODE;
- }
-
- /**
- * To see whether a node is Document node.
- *
- * @param node
- * @return true if the node is a doc node
- */
- public static boolean isDocument(Node node) {
- return node != null && node.getNodeType() == Node.DOCUMENT_NODE;
- }
-
- /**
- * Get style from parent node. from first paret 'firstF', we will traverse
- * the tree up untile reaching Document node, get all style node's, we may
- * insert rules here to stop the search at a before paricular node. Style
- * nodes could <b>, <u>...
- *
- * @param children
- * @param firstF
- */
- void assignFather(Vector children, Node firstF) {
- if (children.size() == 0) {
- return;
- }
- if (firstF != null && !isDocument(firstF)) {
- String name = firstF.getNodeName();
- // To see whether it is a style node that is our anticipated node.
- if (name != null && HTML_STYLE_NODES.contains(name.toLowerCase())) {
- Node newParent = firstF.cloneNode(false);
- while (children.size() > 0) {
- newParent.appendChild((Node) children.remove(0));
- }
- children.add(newParent);
- }
- assignFather(children, firstF.getParentNode());
- }
- }
-
- /**
- * Get a node that is at Indexed position 'pos' in 'model'.
- *
- * @param model
- * @param pos
- * @return the
- */
- IndexedRegion getPosNode(IStructuredModel model, int pos) {
- IndexedRegion inode = model.getIndexedRegion(pos);
- return inode;
- }
-
- /**
- * If the pos is at right edge within container.
- *
- * @param node
- * @param pos
- * @return true is at right edge
- */
- boolean isAtRightMostWithin(Node node, int pos) {
- return getNodeEndNameStartIndex(node) == pos;
- }
-
- /**
- * Create the node, if 'refNode' is null, then position is at the edge of
- * 'container'. otherwize calculate refNode's related index in its parent's
- * children list and return DOMPosition.
- *
- * @param container
- * @param refNode
- * @param forward
- * @return the dom position
- */
- IDOMPosition createDomposition(Node container, Node refNode,
- boolean forward) {
- if (refNode == null) {
- if (forward && container.hasChildNodes()) {
- return new DOMPosition(container, container.getChildNodes()
- .getLength());
- }
- return new DOMPosition(container, 0);
- }
- Assert.isTrue(refNode.getParentNode() == container);
- int index = getNodeIndex(refNode);
- if (!forward) {
- index++;
- }
- return new DOMPosition(container, index);
- }
-
- /**
- * @param fModel
- * @param textSelection
- * @return the design range
- */
- static DesignRange convertToDesignRange(IStructuredModel fModel,
- TextSelection textSelection) {
- int start = textSelection.getOffset();
- int end = textSelection.getLength() + start;
- IDOMPosition startDomPos = EditModelQuery.getInstance()
- .createDomposition((IDOMModel) fModel, start, false);
- IDOMPosition endDomPos = EditModelQuery.getInstance()
- .createDomposition((IDOMModel) fModel, end, false);
- if (startDomPos == null) {
- startDomPos = endDomPos;
- } else if (endDomPos == null) {
- endDomPos = startDomPos;
- }
- if (startDomPos != null) {
- DesignPosition startPos = null, endPos = null;
- startPos = DOMPositionHelper.toDesignPosition(startDomPos);
- endPos = DOMPositionHelper.toDesignPosition(endDomPos);
- if (startPos != null) {
- return new DesignRange(startPos, endPos);
- }
- }
- return null;
- }
-
- /**
- * Create IDOMPosition based on Indexed 'position' in model. If node at
- * position is text, use position to calculate DOMPosition offset,
- * otherwize, simply create position pointed to container's children list's
- * edge.
- *
- * @param model
- * @param position
- * @param adjust
- * @return the dom position
- */
- public IDOMPosition createDomposition(IDOMModel model, int position,
- boolean adjust) {
- return createDomposition1(model, position, adjust);
- }
-
- /**
- * Create IDOMPosition based on Indexed 'position' in model. If node at
- * position is text, use position to calculate DOMPosition offset,
- * otherwize, simply create position pointed to container's children list's
- * edge.
- *
- * @param model
- * @param position
- * @param adjust
- * @return the dom position
- */
- public IDOMPosition createDomposition1(IDOMModel model, int position,
- boolean adjust) {
- try {
- // get the container
- Object object = getPosNode(model, position);
- if (object == null && position > 0) {
- // The end of file?
- object = getPosNode(model, position - 1);
- }
- Node container = null;
- if (object == null) {
- // empty file?
- return new DOMPosition(model.getDocument(), 0);
- }
- container = (Node) object;
- Object oppNode = getPosNode(model, position - 1);
- if (oppNode != null
- && !EditModelQuery.isChild((Node) oppNode, container)
- && //
- !EditModelQuery.isInline(container)
- && EditModelQuery.isInline((Node) oppNode)) {
- container = (Node) oppNode;
- }
- int location = EditHelper.getInstance().getLocation(container,
- position, false);
- IDOMPosition result = null;
- switch (location) {
- case 1:
- case 2:
- result = new DOMRefPosition(container, false);
- break;
- case 4:
- case 5:
- result = new DOMRefPosition(container, true);
- break;
- case 3:
- if (EditModelQuery.isText(container)) {
- result = new DOMPosition(container, position
- - EditModelQuery.getNodeStartIndex(container));
- } else {
- result = new DOMPosition(container, container
- .getChildNodes().getLength());
- }
- }
- return result;
- } catch (Exception e) {
- // "Error in position creation"
- _log.error("Error.EditModelQuery.0" + e); //$NON-NLS-1$
- return null;
- }
- }
-
- /**
- * Calculate node's Indexed length in model.
- *
- * @param node
- * @return the node length
- */
- public static int getNodeLenth(Node node) {
- if (node != null
- && EditValidateUtil.validNode(node)) {
- return ((IndexedRegion) node).getEndOffset()
- - ((IndexedRegion) node).getStartOffset();
- }
- return 0;
- }
-
- /**
- * Return 'node' indexed start position Example: |<a></a>, the position is
- * indicated by '|'
- *
- * @param node
- * @return the start index
- */
- public static int getNodeStartIndex(Node node) {
- if (EditValidateUtil.validNode(node) && node instanceof IndexedRegion) {
- return ((IndexedRegion) node).getStartOffset();
- }
- return -1;
- }
-
- /**
- * Return 'node' indexed end position Example: <a></a>|, the position is
- * indicated by '|'
- *
- * @param node
- * @return the end index
- */
- public static int getNodeEndIndex(Node node) {
- if (EditValidateUtil.validNode(node) && node instanceof IndexedRegion) {
- return ((IndexedRegion) node).getEndOffset();
- }
- return -1;
- }
-
- /**
- * Get node at indexed position.
- *
- * @param model
- * @param position
- * @return the node at position
- */
- static Node getNodeAt(IStructuredModel model, int position) {
- try {
- IndexedRegion region = model.getIndexedRegion(position);
- if (region instanceof Node) {
- return (Node) region;
- }
- return null;
- } catch (Exception e) {
- // "Error in region node creation"
- _log.error("Error.EditModelQuery.1", e); //$NON-NLS-1$
- return null;
- }
- }
-
- /**
- * Return 'node' indexed start name's end position Example: <a>|aaa </a>,
- * the position is indicated by '|'
- *
- * @param node
- * @return the index
- */
- public static int getNodeStartNameEndIndex(Node node) {
- if (isText(node)) {
- return getNodeStartIndex(node);
- }
- if (EditValidateUtil.validNode(node) && node instanceof IDOMNode) {
- IStructuredDocumentRegion region = ((IDOMNode) node)
- .getStartStructuredDocumentRegion();
- if (region != null) {
- return region.getEndOffset();
- }
- // else
- // {
- // // if (node.hasChildNodes())
- // // {
- // // // Node should always have start name, so this part should
- // never reach,
- // // // the assert is for inner debug.
- // // Assert.isTrue(false);
- // // return getNodeStartIndex(node);
- // // }
- // }
- }
- // This should never happen.
- return getNodeStartIndex(node);
- }
-
- /**
- * Return 'node' indexed end name' start position Example: <a>aaa| </a>, the
- * position is indicated by '|' If node is <a /> style or there is no </a>
- * to pair with <a>, the function return -1.
- *
- * @param node
- * @return the start index
- */
- public static int getNodeEndNameStartIndex(Node node) {
- if (isText(node)) {
- return getNodeEndIndex(node);
- }
- if (EditValidateUtil.validNode(node) && node instanceof IDOMNode) {
- IStructuredDocumentRegion region = ((IDOMNode) node)
- .getEndStructuredDocumentRegion();
- if (region != null) {
- return region.getStartOffset();
- }
- // else
- // {
- // if (node.hasChildNodes())
- // {
- // return getNodeEndIndex(node);
- // }
- // }
- }
- return getNodeEndIndex(node);
- }
-
- /**
- * To see if a node is <a/>style.
- *
- * @param node
- * @return the single region node
- */
- public boolean isSingleRegionNode(Node node) {
- if (getNodeEndNameStartIndex(node) == getNodeEndIndex(node)
- && !node.hasChildNodes()) {
- return true;
- }
- return false;
- }
-
- /**
- * To see if a node has child that is not transparent child only.
- *
- * @param node
- * @return true if node has transparent children
- */
- boolean hasNonTransparentChild(Node node) {
- NodeList children = node.getChildNodes();
- for (int i = 0, n = children.getLength(); i < n; i++) {
- Object child = children.item(i);
- if (isText((Node) child)) {
- if (!isTransparentText((Node) child)) {
- return true;
- }
- } else {
- return true;
- }
- }
- return false;
- }
-
- /**
- * To see if a node has child that is not transparent child only.
- *
- * @param node
- * @param excludes
- * @return true if has transparent child
- */
- public boolean hasNonTransparentChild(Node node, String[] excludes) {
- if (!node.hasChildNodes()) {
- return false;
- }
- NodeList children = node.getChildNodes();
- for (int i = 0, n = children.getLength(); i < n; i++) {
- Object child = children.item(i);
- if (isText((Node) child)) {
- if (!isTransparentText((Node) child)) {
- return true;
- }
- } else if (!Arrays.asList(excludes).contains(
- ((Node) child).getLocalName())) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * To see whether tag has whitespace char.
- *
- * @param node
- * @return true if has whitespace neighbor
- */
- public boolean hasWhitespaceNeighbor(Node node) {
- node = getNeighbor(node, true);
- if (isWidget(node)) {
- return false;
- }
- node = getFirstLeafChild(node);
- return isTransparentText(node);
-
- }
-
- /**
- * @param host
- * @return true if host is a widget
- */
- public static boolean isWidget(Object host) {
- boolean result = false;
- EditPart part = null;
- if (host instanceof EditPart) {
- part = (EditPart) host;
- } else if (host instanceof Node) {
- part = Target.resolvePart((Node) host);
- if (part == null) {
- part = new HTMLEditPartsFactory(
- (IDOMDocument) getDocumentNode((Node) host))
- .createEditPart(null, host);
- }
- }
- if (part instanceof NodeEditPart) {
- result = ((NodeEditPart) part).isWidget();
- }
- return result;
- }
-
- /**
- * To combind whitespace chars, only one whitespace string should be create.
- *
- * @param node
- * @return true if node is redundant whitespace
- */
- boolean isRedundantWightspaces(Node node) {
- if (isTransparentText(node) && hasWhitespaceNeighbor(node)) {
- return true;
- }
- return false;
- }
-
- /**
- * @param node
- * @param names
- * @param ignoreCase
- * @return true if node has ancestors in the name list
- * TODO: bad practice
- */
- public static boolean hasAncestor(Node node, String names[],
- boolean ignoreCase) {
- Assert.isTrue(names != null);
- while (node != null && !EditModelQuery.isDocument(node)) {
- if (isElement(node))
- if (containItem(names, node, ignoreCase)) {
- return true;
- }
- node = node.getParentNode();
- }
- return false;
- }
-
- /**
- * To see if 'node' has ancestor that has name as 'name'
- *
- * @param node
- * @param name
- * @param ignoreCase
- * @return true if node has the named ancestor
- */
- public static boolean hasAncestor(Node node, String name, boolean ignoreCase) {
- Assert.isTrue(name != null);
- while (node != null && !EditModelQuery.isDocument(node)) {
- if (node.getNodeName() != null)
- if ((ignoreCase && name.equalsIgnoreCase(node.getNodeName())) || //
- (!ignoreCase && name.equals(node.getNodeName()))) {
- return true;
- }
- node = node.getParentNode();
- }
- return false;
- }
-
- /**
- * To see if 'node' has direct ancestors that has names listed in 'name[]'
- *
- * @param node
- * @param top
- * @param ignoreCase
- * @return the list of ancestors
- */
- public static List getAncestors(Node node, String top, boolean ignoreCase) {
- List result = new ArrayList();
- Assert.isTrue(node != null);
- while (node != null && !EditModelQuery.isDocument(node)) {
- result.add(node);
- String name = node.getLocalName();
- if (ignoreCase && top.equalsIgnoreCase(name) || //
- (!ignoreCase && top.equals(name))) {
- break;
- }
- node = node.getParentNode();
- }
- return result;
- }
-
- /**
- * Copy old node's children to newNode.If the newNode is the father of the
- * old node,then the old node's children will be inserted before the old
- * node,otherwise,the old node's children just append to the newNode.
- *
- * @param old
- * @param newNode
- */
- public static void copyChildren(Node old, Node newNode) {
- Node child = old.getFirstChild();
- while (child != null) {
- Node next = child.getNextSibling();
- child = old.removeChild(child);
- if (old.getParentNode() == newNode) {
- newNode.insertBefore(child, old);
- } else {
- newNode.appendChild(child);
- }
- child = next;
- }
- }
-
- /**
- * @param node
- * @return true if node is an element
- */
- private static boolean isElement(Node node) {
- return node.getNodeType() == Node.ELEMENT_NODE;
- }
-
- /**
- * Return a offspring of ancestor, the offsprint has a name listed in
- * childrenNames.
- *
- * @param ancestor
- * @param childrenNames
- * @param maxLevelToSearch
- * the max level from ancestor to the offspring in family tree.
- * @param ignoreCase
- * @return the node
- */
- public static Node getChild(Node ancestor, String childrenNames[],
- int maxLevelToSearch, boolean ignoreCase) {
- if (ancestor == null || maxLevelToSearch < 0) {
- return null;
- }
- if (ancestor.getLocalName() != null
- && ignoreCase
- && Arrays.asList(childrenNames).contains(
- ancestor.getLocalName().toLowerCase())
- || !ignoreCase
- && Arrays.asList(childrenNames).contains(
- ancestor.getLocalName())) {
- return ancestor;
- }
- NodeList children = ancestor.getChildNodes();
- for (int i = 0, n = children.getLength(); i < n; i++) {
- Node result = getChild(children.item(i), childrenNames,
- maxLevelToSearch - 1, ignoreCase);
- if (result != null) {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Return a offspring of ancestor, the nodes on the tree are type of
- * DeferredElementImpl, the offsprint has a name listed in childrenNames.
- *
- * @param ancestor
- * @param childrenNames
- * @param maxLevelToSearch
- * the max level from ancestor to the offspring in family tree.
- * @param ignoreCase
- * @return the node
- */
- static Node getChildDeferredNode(Node ancestor,
- String childrenNames[], int maxLevelToSearch, boolean ignoreCase) {
- if (ancestor == null || maxLevelToSearch < 0) {
- return null;
- }
- String nodeName = ancestor.getNodeName();
- if (nodeName != null && ignoreCase
- && Arrays.asList(childrenNames).contains(nodeName)
- || !ignoreCase
- && Arrays.asList(childrenNames).contains(nodeName)) {
- return ancestor;
- }
- NodeList children = ancestor.getChildNodes();
- for (int i = 0, n = children.getLength(); i < n; i++) {
- Node result = getChildDeferredNode(children.item(i), childrenNames,
- maxLevelToSearch - 1, ignoreCase);
- if (result != null) {
- return result;
- }
- }
- return null;
- }
-
- /**
- * @param node
- * @return if has tranparent node only
- */
- public static boolean hasTransparentNodeOnly(Node node) {
- NodeList children = node.getChildNodes();
- for (int i = 0, n = children.getLength(); i < n; i++) {
- if (!EditModelQuery.isTransparentText(children.item(i))) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * @param name
- * @param node
- * @param ignoreCase
- * @return the node
- */
- public static Node getParent(String name, Node node, boolean ignoreCase) {
- if (node == null) {
- return null;
- }
-
- while (node != null && node.getNodeType() != Node.DOCUMENT_NODE) {
- String nodeName = node.getLocalName();
- if (nodeName != null
- && (ignoreCase && name.equalsIgnoreCase(nodeName) || !ignoreCase
- && name.equalsIgnoreCase(nodeName))) {
- return node;
- }
- node = node.getParentNode();
- }
- return null;
- }
-
- /**
- * get Elements with the same localName as the input localName under the
- * rootNode,it is a recursive computation.
- *
- * @param rootNode
- * @param localName
- * @param caseSensitive
- * @param list
- * The input list to hold the matched elements.
- */
- public static void getElementByLocalName(Node rootNode, String localName,
- boolean caseSensitive, List list) {
- if (list == null) {
- return;
- }
- NodeList nodeList = rootNode.getChildNodes();
- if (nodeList != null && nodeList.getLength() > 0) {
- for (int i = 0, size = nodeList.getLength(); i < size; i++) {
- Node node = nodeList.item(i);
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- String nodeLocalName = node.getLocalName();
- if (caseSensitive && localName.equals(nodeLocalName)) {
- list.add(node);
- } else if (!caseSensitive
- && localName.equalsIgnoreCase(nodeLocalName)) {
- list.add(node);
- }
- getElementByLocalName(node, localName, true, list);
- }
-
- }
- }
- }
-
- /**
- * @param tags
- * @param node
- * @param ignoreCase
- * @return the true if contains item
- */
- public static boolean containItem(String[] tags, Node node,
- boolean ignoreCase) {
- if (ignoreCase) {
- for (int i = 0, size = tags.length; i < size; i++) {
- if (tags[i] == null) {
- continue;
- }
- if (tags[i].equalsIgnoreCase(node.getNodeName())) {
- return true;
- }
- }
- } else {
- for (int i = 0, size = tags.length; i < size; i++) {
- if (tags[i] == null) {
- continue;
- }
- if (tags[i].equals(node.getNodeName())) {
- return true;
- }
- }
- }
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/EditValidateUtil.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/EditValidateUtil.java
deleted file mode 100644
index 46409de..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/EditValidateUtil.java
+++ /dev/null
@@ -1,385 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dom;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.viewer.DesignPosition;
-import org.eclipse.jst.pagedesigner.viewer.DesignRefPosition;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-/**
- * This class is used for debug purpose, and can be used to test some invalid
- * status in the functions. Generally all the methods here will throw exception
- * when invalid status happens.
- *
- * @author mengbo
- */
-public final class EditValidateUtil {
- private static final Logger _logger = PDPlugin
- .getLogger(EditValidateUtil.class);
-
- private static final boolean ALERT = false;
-
- private static final boolean REPORT = false;
-
- /**
- * A valid position means container node, offset are all valid.
- *
- * @param position
- * @return true if the position is valid
- */
- public static boolean validPosition(IDOMPosition position) {
- try {
- boolean result = true;
- Assert.isTrue(position != null
- && position.getContainerNode() != null
- && position.getOffset() >= 0);
- Node container = position.getContainerNode();
- result &= validNode(container);
- int offset = position.getOffset();
- if (position.isText()) {
- int length = ((Text) container).getLength();
- Assert.isTrue(offset <= length);
- } else {
- if (position instanceof DOMPosition && offset > 0) {
- Assert.isTrue(container.hasChildNodes()
- && container.getChildNodes().getLength() >= offset);
- }
- }
- return result;
- } catch (Exception e) {
- // "error", "Error in validPosition"
- if (ALERT) {
- PDPlugin
- .getAlerts()
- .confirm(
- "Alert.EditValidateUtil.Title", "Alert.EditValidateUtil.Position", e); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (REPORT) {
- // "Invalid position:"
- _logger.error("Error.EditValidateUtil.Position", e); //$NON-NLS-1$
- }
- return false;
- }
- }
-
- /**
- * @param position
- * @return true if position is valid
- */
- public static boolean validPosition(DesignPosition position) {
- try {
- boolean result = true;
- Assert.isTrue(position != null
- && position.getContainerPart() != null
- && position.getContainerNode() != null
- && position.getOffset() >= 0);
- Node container = position.getContainerNode();
- result &= validNode(container);
- int offset = position.getOffset();
- if (EditModelQuery.isText(container)) {
- int length = ((Text) container).getLength();
- Assert.isTrue(offset <= length);
- } else {
- if (position instanceof DesignRefPosition && offset > 0) {
- Assert.isTrue(container.hasChildNodes()
- && container.getChildNodes().getLength() >= offset);
- }
- }
- return result;
- } catch (Exception e) {
- // "error", "Error in validPosition"
- if (ALERT) {
- PDPlugin
- .getAlerts()
- .confirm(
- "Alert.EditValidateUtil.Title", "Alert.EditValidateUtil.Position", e); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (REPORT) {
- // "Invalid position:"
- _logger.error("Error.EditValidateUtil.Position", e); //$NON-NLS-1$
- }
- return false;
- }
- }
-
- /**
- * Valid node is TextNode and it's valid node.
- *
- * @param node
- * @return true if node is valid
- */
- public static boolean validText(Node node) {
- try {
- boolean result = true;
- Assert.isTrue(node.getNodeType() == Node.TEXT_NODE);
- Assert.isTrue(((Text) node).getData() != null);
- result &= validNode(node);
- return result;
- } catch (Exception e) {
- // "Error", "Error in validText"
- if (ALERT) {
- PDPlugin
- .getAlerts()
- .confirm(
- "Alert.EditValidateUtil.Title", "Alert.EditValidateUtil.Text", e); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (REPORT) {
- // "Invalid Text:"
- _logger.error("Error.EditValidateUtil.Text", e); //$NON-NLS-1$
- }
- return false;
- }
- }
-
- /**
- * A valid node is resided in the model tree
- *
- * @param node
- * @return true if node is valid
- */
- public static boolean validNode(Node node) {
- try {
- Assert.isTrue(node instanceof IDOMNode);
- Assert.isTrue((node.getNodeType() == Node.DOCUMENT_NODE)
- || (node.getParentNode() != null));
- // What's this?
- return true;
- } catch (Exception e) {
- // "Error", "Error in validNode"
- if (ALERT) {
- PDPlugin
- .getAlerts()
- .confirm(
- "Alert.EditValidateUtil.Title", "Alert.EditValidateUtil.Node", e); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (REPORT) {
- // "Invalid node:"
- _logger.error("Error.EditValidateUtil.Node", e); //$NON-NLS-1$
- }
- return false;
- }
- }
-
- /**
- * A valid DOMRange contains valid IDOMPosition, and it should not be within
- * node like 'HEAD'. The later one might not be suitble to valid in this
- * util, it should be checked by some edit valid helper.
- *
- * @param range
- * @return true if range is valid
- */
- public static boolean validRange(DOMRange range) {
- try {
- // TODO: never read EditModelQuery modelQuery = EditModelQuery.getInstance();
- boolean result = true;
- IDOMPosition start = range.getStartPosition();
- IDOMPosition end = range.getEndPosition();
- result &= validPosition(start);
- result &= validPosition(end);
- // TODO: never read
-// Node startContainer = start.getContainerNode();
-// Node endContainer = end.getContainerNode();
- // Assert.isTrue(isValidForEditing(modelQuery.getCommonAncestor(startContainer,
- // endContainer)));
- return result;
- } catch (Exception e) {
- // "Error", "Error in validRange"
- if (ALERT) {
- PDPlugin
- .getAlerts()
- .confirm(
- "Alert.EditValidateUtil.Title", "Alert.EditValidateUtil.Range", e); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (REPORT) {
- // "Invalid Range:"
- _logger.error("Error.EditValidateUtil.Range", e); //$NON-NLS-1$
- }
- return false;
- }
- }
-
- /**
- * @param text
- * @param index
- * @return true if the index is valid
- */
- public static boolean validStringIndex(Node text, int index) {
- try {
- Assert.isTrue(index >= 0 && ((Text) text).getLength() >= index);
- return validText(text);
- } catch (Exception e) {
- // "Error", "Error in validStringIndex"
- if (ALERT) {
- PDPlugin
- .getAlerts()
- .confirm(
- "Alert.EditValidateUtil.Title", "Alert.EditValidateUtil.StringIndex", e); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (REPORT) {
- // "Invalid Index in String:"
- _logger.error("Error.EditValidateUtil.StringIndex", e); //$NON-NLS-1$
- }
- return false;
- }
- }
-
- /**
- * @param text
- * @param index
- * @param offset
- * @return true if the index offset is valid
- */
- public static boolean validStringIndexOffset(Node text, int index,
- int offset) {
- try {
- Assert.isTrue(index >= 0 && (index + offset) >= 0
- && ((Text) text).getLength() >= (index + offset)
- && ((Text) text).getLength() >= index);
- return validText(text);
- } catch (Exception e) {
- // "error", "Error in validStringIndex"
- if (ALERT) {
- PDPlugin
- .getAlerts()
- .confirm(
- "Alert.EditValidateUtil.Title", "Alert.EditValidateUtil.IndexOffset", e); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (REPORT) {
- // "Invalid index or offset in String:"
- _logger.error("Error.EditValidateUtil.IndexOffset", e); //$NON-NLS-1$
- }
- return false;
- }
- }
-
-// private static void dumpPosition(String message, IDOMPosition position,
-// boolean forward) {
- // for future internal debug
- // message(message);
- // _logger.debug("vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv");
- // if (position != null)
- // {
- // Node container = position.getContainerNode();
- // Node node = null;
- // String text = null;
- // if (getContainerLength(container) > 0)
- // {
- // if (!position.isText())
- // {
- // int index = forward ? position.getOffset() : position.getOffset() -
- // 1;
- // node = container.getChildNodes().item(index);
- // }
- // else
- // {
- // int index = forward ? position.getOffset() : position.getOffset() -
- // 1;
- // if (index >= 0 && index < getContainerLength(container))
- // {
- // text = ((Text) container).substringData(index, 1);
- // }
- // else
- // {
- // text = null;
- // }
- // }
- // }
- // _logger.debug("DOMPosition type?:" + (position instanceof
- // DOMPosition) + " container name: " +
- // position.getContainerNode().getLocalName() + " offset:" +
- // position.getOffset()
- // + " length:" + getContainerLength(position.getContainerNode()));
- // if (node != null)
- // {
- // _logger.debug("node to operate:" + node.getLocalName());
- // }
- // if (text != null)
- // {
- // _logger.debug("text to operate:\"" + text + "\" length:" +
- // text.length());
- // }
- // }
- // _logger.debug("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
-// }
-
- /**
- * @param pos
- * @param forward
- * @return true if the position if vallid for editing relative to forward (true) or backward (false)
- */
- public static boolean isValidForEditing(IDOMPosition pos, boolean forward) {
- if (pos == null) {
- return false;
- }
- if (pos.isText()) {
- return true;
- }
- Node container = pos.getContainerNode();
- // only head can't be edited
- if (EditModelQuery.isChild(IHTMLConstants.TAG_HEAD, container,
- true)) {
- return false;
- }
- Node sibling = EditModelQuery.getInstance().getSibling(pos,
- forward);
- if (sibling != null) {
- if (EditModelQuery.isText(sibling)) {
- return true;
- }
- Assert.isTrue(sibling.getLocalName() != null);
- if (EditModelQuery.UNREMOVEBLE_TAGS.contains(sibling
- .getLocalName().toLowerCase())) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * @param node
- * @return true if node is valid for editing
- */
- public static boolean isValidForEditing(Node node) {
- if (EditModelQuery.isChild(IHTMLConstants.TAG_HEAD, node, true)) {
- return false;
- }
- return true;
- }
-
- private EditValidateUtil()
- {
- // do nothing
- }
- // Reserved for inner use.
- //
- // private static void errorNotice()
- // {
- // try
- // {
- // // FileInputStream fileau = new
- // FileInputStream("C:\\WINNT\\Media\\ringout.wav");
- // // AudioStream as = new AudioStream(fileau);
- // // AudioPlayer.player.start(as);
- // }
- // catch (Exception e)
- // {
- // System.out.println("error in file open");
- // }
- //
- // }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/IDOMPosition.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/IDOMPosition.java
deleted file mode 100644
index fa3169d..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/IDOMPosition.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dom;
-
-import org.w3c.dom.Node;
-
-/**
- * An IDOMPosition represents a position in the DOM tree. There are multiple
- * ways of identify a position in the tree, such as by saying a offset in
- * parent, or before/after a particular node.
- *
- * NOTE: IDOMPosition and its child class should be implemented as literal. that
- * is, they should not be changed after it is constructed.
- *
- * @author mengbo
- */
-public interface IDOMPosition {
- /**
- *
- * @param forward
- * if true, same as getNextSiblingNode(), if false, same as
- * getPreviousSiblingNode
- * @return the sibling
- */
- public Node getSibling(boolean forward);
-
- /**
- * @return the next sibling node
- */
- public Node getNextSiblingNode();
-
- /**
- * @return the previous sibling node
- */
- public Node getPreviousSiblingNode();
-
- /**
- * @return the container node
- */
- public Node getContainerNode();
-
- /**
- * @return the offset
- */
- public int getOffset();
-
- /**
- * @return true if is text
- */
- public boolean isText();
-
- /**
- * "original" has been replace by "replacement" in the model. If this
- * replacement will affect this IDOMPosition, then this method should return
- * a new position that is valid after the replacement. If this replacement
- * won't affect this position, then the original position should be
- * returned.
- *
- * @param original
- * @param replacement
- * @return the dom position
- */
- public IDOMPosition handleReplacement(Node original, Node replacement);
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/IDOMRefPosition.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/IDOMRefPosition.java
deleted file mode 100644
index 5a841df..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/IDOMRefPosition.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dom;
-
-import org.w3c.dom.Node;
-
-/**
- * A IDOMRefPosition locate a position by reference a node in the dom tree. It
- * mean a position after node, before a node, or before anything in a node, or
- * after anything in a node.
- *
- * @author mengbo
- * @version 1.5
- */
-public interface IDOMRefPosition extends IDOMPosition {
- /**
- *
- * @return the reference (wrapped) node
- */
- public Node getReferenceNode();
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/ValidatorSupport.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/ValidatorSupport.java
deleted file mode 100644
index 19fda90..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/ValidatorSupport.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dom;
-
-import javax.xml.namespace.QName;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jst.jsf.core.internal.tld.CMUtil;
-import org.eclipse.jst.pagedesigner.adapters.IBodyInfo;
-import org.eclipse.jst.pagedesigner.adapters.internal.BodyInfo;
-import org.eclipse.jst.pagedesigner.editors.palette.TagToolPaletteEntry;
-import org.eclipse.jst.pagedesigner.editors.palette.impl.PaletteItemManager;
-import org.eclipse.jst.pagedesigner.editors.palette.impl.TaglibPaletteDrawer;
-import org.eclipse.jst.pagedesigner.utils.CommandUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-/**
- * Simple utility class.
- *
- * @author mengbo
- * @version 1.5
- */
-public class ValidatorSupport
-{
- /**
- * Equivalent to checkContainer(position new QName[]{qname}
- *
- * @param position
- * @param qname
- * @return true if the tag identified by qname is found as a parent
- * of position.
- */
- public static boolean checkContainer(IDOMPosition position, QName qname) {
- return checkContainer(position, new QName[] { qname });
- }
-
- /**
- * Check for any of the containers listed in qname starting from qname and working
- * up the DOM parent chain.
- *
- * @param position
- * @param qname
- * @return true if one of the tags identified by qname is found as a parent
- * of position.
- */
- public static boolean checkContainer(IDOMPosition position, QName qname[]) {
- Node node = position.getContainerNode();
- while (node != null) {
- if (node instanceof Text) {
- node = node.getParentNode();
- continue;
- }
- if (node instanceof Element) {
- Element ele = (Element) node;
- String url = CMUtil.getElementNamespaceURI(ele);
- String tag = ele.getLocalName();
-
- for (int i = 0; i < qname.length; i++) {
- if (tag.equalsIgnoreCase(qname[i].getLocalPart())) {
- if (url == null) {
- // this means something wrong. To be error tolerant,
- // we treat it
- // as if url is same
- return true;
- } else if (url.equalsIgnoreCase(qname[i].getNamespaceURI())) {
- return true;
- }
- }
- }
-
- node = node.getParentNode();
- continue;
- }
- break;
- }
- return false;
- }
-
- /**
- * @param position
- * @param container
- * @param customizationData
- * @return the new dom position for the inserted container or null if could
- * not insert
- */
- public static IDOMPosition insertContainer(IDOMPosition position,
- QName container, IAdaptable customizationData) {
- final TaglibPaletteDrawer category =
- PaletteItemManager.getCurrentInstance().findCategoryByURI
- (container.getNamespaceURI());
- if (category != null){
- final TagToolPaletteEntry tagItem =
- category.getTagPaletteEntryByTagName(container.getLocalPart());
- final IDOMModel model =
- ((IDOMNode) position.getContainerNode()).getModel();
- final Element form = CommandUtil.excuteInsertion
- (tagItem, model, position, customizationData);
- if (form != null) {
- DOMPosition pos = new DOMPosition(form, 0);
- return pos;
- }
- }
- return null;
- }
-
- /**
- * @return the body info
- */
- public static IBodyInfo getBodyInfo() {
- //TODO: change this to be meta-data driven.
- return BodyInfo.getInstance();
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/html/ColStructure.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/html/ColStructure.java
deleted file mode 100644
index 2f4f9c1..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/html/ColStructure.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dom.html;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-/*package*/ class ColStructure implements Comparable {
- private final int _column;
-
- private final int _colSpan;
-
- /**
- * @param column
- * @param colSpan
- */
- public ColStructure(int column, int colSpan) {
- this._column = column;
- this._colSpan = colSpan;
- }
-
- /**
- * @return the column span
- */
- public int getColSpan() {
- return _colSpan;
- }
-
- /**
- * @return the column
- */
- public int getColumn() {
- return _column;
- }
-
- public int compareTo(Object o) {
- ColStructure cs = (ColStructure) o;
- if (this._column > cs.getColumn()) {
- return 1;
- } else if (this._column == cs.getColumn()) {
- return 0;
- } else {
- return -1;
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/html/TableChildElementPosition.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/html/TableChildElementPosition.java
deleted file mode 100644
index 1b290ef..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/html/TableChildElementPosition.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dom.html;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class TableChildElementPosition {
- private int _rowIndex = -10;
-
- private int _columnIndex = -10;
-
- /**
- * @return Returns the _columnIndex.
- */
- public int getColumnIndex() {
- return _columnIndex;
- }
-
- /**
- * @param index
- * The _columnIndex to set.
- */
- public void setColumnIndex(int index) {
- _columnIndex = index;
- }
-
- /**
- * @return Returns the _rowIndex.
- */
- public int getRowIndex() {
- return _rowIndex;
- }
-
- /**
- * @param index
- * The _rowIndex to set.
- */
- public void setRowIndex(int index) {
- _rowIndex = index;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/html/TableUtil.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/html/TableUtil.java
deleted file mode 100644
index 70216e0..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dom/html/TableUtil.java
+++ /dev/null
@@ -1,531 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dom.html;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.utils.DOMUtil;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class TableUtil {
- private Element _fakeCell = null;
-
- private Element _table = null;
-
- private List[] _trCellLists = null;
-
- /**
- * judge whether there is rowspan>1 cell in the tr
- *
- * @param tr
- * TR element in a table
- * @return true if there is rowspan>1 cell in the tr
- */
- public static boolean hasRowSpanElement(Element tr) {
- List list = DOMUtil.getElementChildren(tr);
- Iterator itr = list.iterator();
- while (itr.hasNext()) {
- Element ele = (Element) itr.next();
- int value = DOMUtil.getIntAttributeIgnoreCase(ele,
- IHTMLConstants.ATTR_ROWSPAN, 1);
- if (value > 1) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * judge whether a tr is affected by row span cell in the previous trs.
- *
- * @param trList
- * list holds all tr elements in a table
- * @param tr
- * @param index
- * tr index in the DOM tree
- * @return true if tr is affected by row span cell in the previous trs
- */
- public static boolean isAffectedByRowSpan(List trList, Element tr, int index) {
- Node parent = tr.getParentNode();
- int dex = index;
- while (--dex >= 0) {
- Element preTr = (Element) trList.get(dex);
- if (preTr.getParentNode() != parent) {
- break;
- }
- int maxRowSpan = countMaxRowSpan(preTr);
- if (maxRowSpan > (index - dex)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * count all tr in the table
- *
- * @param element
- * table
- * @param list
- * list to hold tr elements
- */
- public static void getTrElements(Element element, List list) {
- NodeList nodeList = element.getChildNodes();
- for (int i = 0, size = nodeList.getLength(); i < size; i++) {
- Node node = nodeList.item(i);
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- Element ele = (Element) node;
- if (ele.getNodeName().equalsIgnoreCase(IHTMLConstants.TAG_TR)) {
- list.add(ele);
- } else if (ele.getNodeName().equalsIgnoreCase(
- IHTMLConstants.TAG_THEAD)
- || ele.getNodeName().equalsIgnoreCase(
- IHTMLConstants.TAG_TBODY)
- || ele.getNodeName().equalsIgnoreCase(
- IHTMLConstants.TAG_TFOOT)) {
- getTrElements(ele, list);
- }
- }
-
- }
- }
-
- /**
- * count row index in the code DOM tree according to the display index
- *
- * @param table
- * @param displayIndex
- * @return the row index
- */
- public static int countRowIndexInDOMTree(Element table, int displayIndex) {
-
- int footRows = countSectionRows(table, IHTMLConstants.TAG_TFOOT);
- if (footRows == 0) {
- return displayIndex;
- }
- int headRows = countSectionRows(table, IHTMLConstants.TAG_THEAD);
- List list = new ArrayList();
- getTrElements(table, list);
- int bodyRows = list.size() - headRows - footRows;
- // if display index is in TFOOT area
- if (displayIndex >= (list.size() - footRows)) {
- int index = displayIndex - bodyRows;
- return index;
- }
- // if display index is in TBODY area
- else if (displayIndex >= headRows) {
- int index = displayIndex + footRows;
- return index;
- }
- // if display index is in THEAD area
- else {
- return displayIndex;
- }
- }
-
- /**
- * get row count in the specified section
- *
- * @param table
- * @param sectionName
- * child element name of table, like THEAD or TFOOT
- * @return the row count in the section
- */
- public static int countSectionRows(Element table, String sectionName) {
- NodeList nodeList = table.getChildNodes();
- for (int i = 0, size = nodeList.getLength(); i < size; i++) {
- Node node = nodeList.item(i);
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- Element ele = (Element) node;
- if (node.getNodeName().equalsIgnoreCase(sectionName)) {
- List list = DOMUtil.getChildElementsByTagIgnoreCase(ele,
- IHTMLConstants.TAG_TR);
- if (list != null) {
- return list.size();
- }
- }
- }
-
- }
- return 0;
- }
-
- /**
- * constructor
- *
- * @param table
- */
- public TableUtil(Element table) {
- this._table = table;
- this._trCellLists = fillTrCells();
- }
-
- /**
- * get tr cells list
- *
- * @return the list of tr cells
- */
- public List[] getTrCellLists() {
- return this._trCellLists;
- }
-
- /**
- * calculate row and column index for tr or td/th
- *
- * @param node
- * tr or td/th
- * @return the position
- */
- public TableChildElementPosition getPosition(Node node) {
- TableChildElementPosition position = new TableChildElementPosition();
- String tagName = node.getLocalName();
- if (IHTMLConstants.TAG_TR.equalsIgnoreCase(tagName)) {
- List list = new ArrayList();
- getTrElements(this._table, list);
- for (int i = 0, size = list.size(); i < size; i++) {
- Element tr = (Element) list.get(i);
- if (tr == node) {
- position.setRowIndex(i);
- break;
- }
- }
- } else if (IHTMLConstants.TAG_TD.equalsIgnoreCase(tagName)
- || IHTMLConstants.TAG_TH.equalsIgnoreCase(tagName)) {
- Element tr = (Element) node.getParentNode();
- TableChildElementPosition pos = getPosition(tr);
- position.setRowIndex(pos.getRowIndex());
- List[] lists = getTrCellLists();
- List list = lists[pos.getRowIndex()];
- for (int i = 0, size = list.size(); i < size; i++) {
- Element td = (Element) list.get(i);
- if (td == node) {
- position.setColumnIndex(i);
- break;
- }
- }
- } else {
- boolean hasTDParent = false;
- Node childBackup = node;
- while (!IHTMLConstants.TAG_TABLE.equalsIgnoreCase(childBackup
- .getParentNode().getLocalName())) {
- childBackup = childBackup.getParentNode();
- String localName = childBackup.getLocalName();
- if (IHTMLConstants.TAG_TD.equalsIgnoreCase(localName)
- || IHTMLConstants.TAG_TH.equalsIgnoreCase(localName)) {
- hasTDParent = true;
- break;
- }
- }
- if (hasTDParent) {
- position = getPosition(childBackup);
- }
- }
- return position;
- }
-
- /**
- * get column count
- *
- * @return the column count
- */
- public int getColumnCount() {
- List[] lists = this._trCellLists;
- if (lists != null) {
- int max = 0;
- for (int i = 0, size = lists.length; i < size; i++) {
- List list = lists[i];
- if (list.size() > max) {
- max = list.size();
- }
- }
- return max;
- }
- return 0;
- }
-
- /**
- * judge whether there is columnspan>1 cell in the column
- *
- * @param columnIndex
- * column index in a table
- * @return true if there is columnspan>1 cell in the column
- */
- public boolean hasColumnSpanElement(int columnIndex) {
- List cells = getColumnCells(columnIndex);
- if (cells != null) {
- Iterator itr = cells.iterator();
- while (itr.hasNext()) {
- Element cell = (Element) itr.next();
- int value = DOMUtil.getIntAttributeIgnoreCase(cell,
- IHTMLConstants.ATTR_COLSPAN, 1);
- if (value > 1) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * judge whether the column has cell affected by column span cell in
- * privious columns
- *
- * @param columnIndex
- * @return true if the column has cell affected by column span cell in
- * privious columns
- */
- public boolean isAffectedByColSpan(int columnIndex) {
- int index = columnIndex;
- while (--index >= 0) {
- List cells = getColumnCells(index);
- int max = countMaxColSpan(cells);
- if (max > (columnIndex - index)) {
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * get cells in the specified column of the table
- *
- * @param columnIndex
- * @return the column cells
- */
- public List getColumnCells(int columnIndex) {
- List list = new ArrayList();
-
- List[] lists = this._trCellLists;
- for (int i = 0; i < lists.length; i++) {
- List tempList = lists[i];
- if (tempList.size() <= columnIndex) {
- continue;
- }
- list.add(tempList.get(columnIndex));
- }
- return list;
- }
-
- /**
- * count max row span in the tr
- *
- * @param tr
- * @return
- */
- private static int countMaxRowSpan(Element tr) {
- List list = DOMUtil.getElementChildren(tr);
- int max = countMaxValue(list, IHTMLConstants.ATTR_ROWSPAN);
- return max;
- }
-
- /**
- * count max attr value
- *
- * @param list
- * @param attr
- * @return
- */
- private static int countMaxValue(List list, String attr) {
- int max = 1;
- Iterator itr = list.iterator();
- while (itr.hasNext()) {
- Element ele = (Element) itr.next();
- int value = DOMUtil.getIntAttributeIgnoreCase(ele, attr, 1);
- if (value > max) {
- max = value;
- }
- }
- return max;
- }
-
- /**
- * count max col span in a column
- *
- * @param list
- * @return
- */
- private int countMaxColSpan(List list) {
- int max = countMaxValue(list, IHTMLConstants.ATTR_COLSPAN);
- return max;
- }
-
- /**
- * get fake element to fill tr cell
- *
- * @return
- */
- private Element getFakeElement() {
- if (_fakeCell != null) {
- return _fakeCell;
- }
- _fakeCell = this._table.getOwnerDocument().createElement("fake");
- return _fakeCell;
- }
-
- /**
- * initial every tr cells according to th and td under each tr element
- *
- * @param trList
- * @return
- */
- private List[] initialTrCells(List trList) {
- int size = trList.size();
- List[] lists = new ArrayList[size];
-
- if (trList != null) {
- for (int i = 0, n = trList.size(); i < n; i++) {
- lists[i] = new ArrayList();
- Element tr = (Element) trList.get(i);
- List domCells = DOMUtil.getElementChildren(tr);
- Iterator itr = domCells.iterator();
- while (itr.hasNext()) {
- Element cell = (Element) itr.next();
- lists[i].add(cell);
- int colSpan = DOMUtil.getIntAttributeIgnoreCase(cell,
- IHTMLConstants.ATTR_COLSPAN, 1);
- while (--colSpan > 0) {
- Element fakeElement = getFakeElement();
- lists[i].add(fakeElement);
- }
- }
- }
-
- }
-
- return lists;
-
- }
-
- /**
- * after initial tr cells,fill tr with fake cells if necessary.
- *
- * @return
- */
- private List[] fillTrCells() {
- List list = new ArrayList();
- getTrElements(this._table, list);
-
- List[] lists = initialTrCells(list);
- int size = lists.length;
-
- int headRows = countSectionRows(this._table, IHTMLConstants.TAG_THEAD);
- if (headRows > 0) {
- List[] headList = new ArrayList[headRows];
- for (int i = 0; i < headRows; i++) {
- headList[i] = lists[i];
- }
- fillSectionTrCells(headList);
- }
-
- int footRows = countSectionRows(this._table, IHTMLConstants.TAG_TFOOT);
- if (footRows > 0) {
- List[] footList = new ArrayList[footRows];
- for (int i = 0; i < footRows; i++) {
- footList[i] = lists[headRows + i];
- }
- fillSectionTrCells(footList);
- }
-
- int bodyRows = size - headRows - footRows;
- if (bodyRows > 0) {
- int bodyCount = 1;
- int k = 0;
- List bodys = new ArrayList();
- Element tr = (Element) list.get(headRows + footRows);
- Node node = tr.getParentNode();
- for (int i = 1; i < bodyRows; i++) {
- Element tempTr = (Element) list.get(headRows + footRows + i);
- if (tempTr.getParentNode() != node) {
- node = tempTr.getParentNode();
- bodys.add(new Integer(i - k));
- k = i;
- bodyCount++;
- }
- }
- bodys.add(new Integer(bodyRows - k));
-
- for (int j = 0; j < bodyCount; j++) {
- int num = ((Integer) bodys.get(j)).intValue();
- List[] bodyList = new ArrayList[num];
- int m = headRows + footRows;
-
- for (int i = 0; i < num; i++) {
- bodyList[i] = lists[m + i];
- }
- fillSectionTrCells(bodyList);
- m = m + num;
- }
-
- }
-
- return lists;
- }
-
- /**
- * fill tr cells under each table section,like THEAD,TFOOT,TBODY.
- *
- * @param lists
- */
- private void fillSectionTrCells(List[] lists) {
- Element cell = null;
-
- if (lists != null) {
- for (int i = 1, size = lists.length; i < size; i++) {
- List insertPoints = new ArrayList();
-
- for (int j = 0; j < i; j++) {
- List list = lists[j];
- for (int column = 0; column < list.size(); column++) {
- cell = (Element) list.get(column);
- if (cell.getTagName().equalsIgnoreCase("fake")) {
- continue;
- }
- int rowSpan = DOMUtil.getIntAttributeIgnoreCase(cell,
- IHTMLConstants.ATTR_ROWSPAN, 1);
- if (rowSpan > (i - j)) {
- int colSpan = DOMUtil.getIntAttributeIgnoreCase(
- cell, IHTMLConstants.ATTR_COLSPAN, 1);
- insertPoints.add(new ColStructure(column, colSpan));
- }
- }
- }
- // there are fake column cell need to be inserted into this tr
- if (insertPoints.size() > 0) {
- Collections.sort(insertPoints);
- List trCells = lists[i];
-
- Iterator itr = insertPoints.iterator();
- while (itr.hasNext()) {
- ColStructure cls = (ColStructure) itr.next();
- int loop = cls.getColSpan();
- int column = cls.getColumn();
- while (loop-- != 0) {
- trCells.add(column++, getFakeElement());
- }
-
- }
- }
- }
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/DTManager.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/DTManager.java
deleted file mode 100644
index f62e2a5..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/DTManager.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dtmanager;
-
-import org.eclipse.jst.jsf.core.internal.tld.CMUtil;
-import org.eclipse.jst.pagedesigner.converter.ConverterFactoryRegistry;
-import org.eclipse.jst.pagedesigner.converter.IConverterFactory;
-import org.eclipse.jst.pagedesigner.converter.ITagConverter;
-import org.eclipse.jst.pagedesigner.dtmanager.converter.internal.DTTagConverterFactory;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.w3c.dom.Element;
-
-/**
- * DTManager is the top-level entry point for design-time (DT) services, such
- * as tag converters and design-time information.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author Ian Trimble - Oracle
- */
-public class DTManager {
-
- private static DTManager instance;
- private IDTInfoFactory _dtInfoFactory;
-
- private DTManager() {
- // no external instantiation
- }
-
- /**
- * Gets the singleton DTManager instance.
- *
- * @return The singleton DTManager instance.
- */
- public static synchronized DTManager getInstance() {
- if (instance == null) {
- instance = new DTManager();
- }
- return instance;
- }
-
- /**
- * Gets an ITagConverter instance for the specified Element and mode.
- *
- * @param element Element instance for which to locate and return an
- * ITagConverter instance.
- * @param mode Mode flag (use IConverterFactory constants).
- * @param document Target IDOMDocument instance.
- * @return An ITagConverter instance for the specified Element and mode.
- */
- public ITagConverter getTagConverter(Element element, int mode, IDOMDocument document) {
- ITagConverter tagConverter = null;
- String nsURI = CMUtil.getElementNamespaceURI(element);
- //try MD-driven approach
- IConverterFactory tagConverterFactory = getTagConverterFactory(nsURI);
- if (tagConverterFactory != null) {
- tagConverter = tagConverterFactory.createConverter(element, mode);
- if (tagConverter != null) {
- tagConverter.setDestDocument(document);
- } else {
- //fallback to contributed (non-MD-driven) approach
- tagConverter = ConverterFactoryRegistry.getInstance().createTagConverter(element, mode, document);
- }
- }
- return tagConverter;
- }
-
- /**
- * Gets an IConverterFactory instance for the specified namespace URI.
- *
- * @param nsURI Namespace URI.
- * @return An IConverterFactory instance for the specified namespace URI.
- */
- protected IConverterFactory getTagConverterFactory(String nsURI) {
- //TODO: future - expand to first look for registered factories
- return new DTTagConverterFactory();
- }
-
- /**
- * Gets an IDTInfo instance for the specified Element.
- *
- * @param element Element instance for which to locate and return IDTInfo
- * instance.
- * @return An IDTInfo instance for the specified Element.
- */
- public IDTInfo getDTInfo(Element element) {
- IDTInfo dtInfo = null;
- String nsURI = CMUtil.getElementNamespaceURI(element);
- IDTInfoFactory dtInfoFactory = getDTInfoFactory(nsURI);
- if (dtInfoFactory != null) {
- dtInfo = dtInfoFactory.getDTInfo(element);
- }
- return dtInfo;
- }
-
- /**
- * Gets an IDTInfoFactory instance for the specified namespace URI.
- *
- * @param nsURI Namespace URI.
- * @return An IDTInfoFactory instance for the specified namespace URI.
- */
- protected IDTInfoFactory getDTInfoFactory(String nsURI) {
- if (_dtInfoFactory == null) {
- _dtInfoFactory = new DefaultDTInfoFactory();
- }
- return _dtInfoFactory;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/DefaultDTInfo.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/DefaultDTInfo.java
deleted file mode 100644
index 6d57cfc..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/DefaultDTInfo.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dtmanager;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfo;
-import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagConvertInfo;
-import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo;
-
-/**
- * Default IDTInfo implementation.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author Ian Trimble - Oracle
- */
-public class DefaultDTInfo implements IDTInfo {
-
- private DTInfo dtInfo = null;
- private Trait trait = null;
-
- /**
- * Constructs an instance that wraps the specified DTInfo instance.
- *
- * @param dtInfo DTInfo (EMF model object) instance.
- * @param trait Trait instance that was queried to load this data.
- */
- public DefaultDTInfo(DTInfo dtInfo, Trait trait) {
- this.dtInfo = dtInfo;
- this.trait = trait;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.dtmanager.internal.provisional.IDTInfo#getTagConvertInfo()
- */
- public TagConvertInfo getTagConvertInfo() {
- return dtInfo.getTagConvertInfo();
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.dtmanager.internal.provisional.IDTInfo#getTagDecorateInfos()
- */
- public List getTagDecorateInfos() {
- return dtInfo.getTagDecorateInfos();
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.dtmanager.internal.provisional.IDTInfo#getTagDecorateInfo(java.lang.String)
- */
- public TagDecorateInfo getTagDecorateInfo(String id) {
- TagDecorateInfo tdInfo = null;
- EList tdInfos = dtInfo.getTagDecorateInfos();
- Iterator itTDInfos = tdInfos.iterator();
- while (itTDInfos.hasNext()) {
- TagDecorateInfo curTDInfo = (TagDecorateInfo)itTDInfos.next();
- if (curTDInfo.getId().equals(id)) {
- tdInfo = curTDInfo;
- break;
- }
- }
- return tdInfo;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.dtmanager.internal.provisional.IDTInfo#getTrait()
- */
- public Trait getTrait() {
- return trait;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/DefaultDTInfoFactory.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/DefaultDTInfoFactory.java
deleted file mode 100644
index 1a37ec6..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/DefaultDTInfoFactory.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dtmanager;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.query.ITaglibDomainMetaDataModelContext;
-import org.eclipse.jst.jsf.common.metadata.query.TaglibDomainMetaDataQueryHelper;
-import org.eclipse.jst.jsf.core.internal.tld.CMUtil;
-import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfo;
-import org.eclipse.jst.pagedesigner.utils.StructuredModelUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Element;
-
-/**
- * Default IDTInfoFactory implementation.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author Ian Trimble - Oracle
- */
-public class DefaultDTInfoFactory implements IDTInfoFactory {
-
- /**
- * Key (in metadata) of IDTInfo trait.
- */
- public static final String DTINFO_TRAIT_KEY = "dt-info";
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.dtmanager.internal.provisional.IDTInfoFactory#getDTInfo(org.w3c.dom.Element)
- */
- public IDTInfo getDTInfo(Element element) {
- IDTInfo dtInfo = null;
- String nsURI = CMUtil.getElementNamespaceURI(element);
- IProject project = getProject(element);
- if (project != null) {
- ITaglibDomainMetaDataModelContext context = TaglibDomainMetaDataQueryHelper.createMetaDataModelContext(project, nsURI);
- if (context != null) {
- Trait trait = TaglibDomainMetaDataQueryHelper.getTrait(context, element.getLocalName(), DTINFO_TRAIT_KEY);
- if (trait != null) {
- DTInfo dtInfoModelObject = (DTInfo)trait.getValue();
- if (dtInfoModelObject != null) {
- dtInfo = new DefaultDTInfo(dtInfoModelObject, trait);
- }
- }
- }
- }
- return dtInfo;
- }
-
- /**
- * Gets the IProject instance that contains the model of the specified
- * Element.
- *
- * @param element Element instance.
- * @return IProject instance that contains the model of the specified
- * Element.
- */
- protected IProject getProject(Element element) {
- IProject project = null;
- if (element instanceof IDOMNode) {
- IDOMModel model = ((IDOMNode)element).getModel();
- if (model != null) {
- project = StructuredModelUtil.getProjectFor(model);
- }
- }
- return project;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/IDTInfo.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/IDTInfo.java
deleted file mode 100644
index 9ce9e07..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/IDTInfo.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dtmanager;
-
-import java.util.List;
-
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagConvertInfo;
-import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo;
-
-/**
- * Encapsulates design-time (DT) information.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author Ian Trimble - Oracle
- */
-public interface IDTInfo {
-
- /**
- * Gets the encapsulated TagConvertInfo instance.
- *
- * @return TagConvertInfo instance.
- */
- public TagConvertInfo getTagConvertInfo();
-
- /**
- * Gets the collection of encapsulated TagDecorateInfo instances.
- *
- * @return Collection of TagDecorateInfo instances.
- */
- public List getTagDecorateInfos();
-
- /**
- * Gets an encapsulated TagDecorateInfo instance matching specified ID.
- *
- * @param id ID of desired TagDecorateInfo instance.
- * @return TagDecorateInfo instance matching specified ID.
- */
- public TagDecorateInfo getTagDecorateInfo(String id);
-
- /**
- * Gets the Trait instance that was queried to load the metadata.
- *
- * @return Trait instance that was queried to load the metadata.
- */
- public Trait getTrait();
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/IDTInfoFactory.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/IDTInfoFactory.java
deleted file mode 100644
index 80f3b6d..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/IDTInfoFactory.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dtmanager;
-
-import org.w3c.dom.Element;
-
-/**
- * Factory that provides IDTInfo instances.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author Ian Trimble - Oracle
- */
-public interface IDTInfoFactory {
-
- /**
- * Gets an IDTInfo instance for the specified Element.
- *
- * @param element Element instance for which to locate and return IDTInfo
- * instance.
- * @return An IDTInfo instance for the specified Element.
- */
- public IDTInfo getDTInfo(Element element);
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/AbstractTagConverterContext.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/AbstractTagConverterContext.java
deleted file mode 100644
index b37242b..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/AbstractTagConverterContext.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dtmanager.converter;
-
-import org.eclipse.jst.pagedesigner.converter.ConvertPosition;
-import org.eclipse.jst.pagedesigner.converter.ITagConverter;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-/**
- * Abstract ITagConverter implementation of ITagConverterContext.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author Ian Trimble - Oracle
- */
-public abstract class AbstractTagConverterContext implements ITagConverterContext {
-
- /**
- * ITagConverter instance.
- */
- protected ITagConverter tagConverter;
-
- /**
- * Instantiates an instance for the specified ITagConverter instance.
- * @param tagConverter ITagConverter instance.
- */
- public AbstractTagConverterContext(ITagConverter tagConverter) {
- this.tagConverter = tagConverter;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.dtmanager.converter.ITagConverterContext#addChild(org.w3c.dom.Node, org.eclipse.jst.pagedesigner.converter.ConvertPosition)
- */
- public abstract void addChild(Node childNode, ConvertPosition position);
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.dtmanager.converter.ITagConverterContext#copyChildren(org.w3c.dom.Element, org.w3c.dom.Element)
- */
- public abstract void copyChildren(Element srcElement, Element destElement);
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.dtmanager.converter.ITagConverterContext#createElement(java.lang.String)
- */
- public abstract Element createElement(String tag);
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.dtmanager.converter.ITagConverterContext#createText(java.lang.String)
- */
- public abstract Text createText(String content);
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.dtmanager.converter.ITagConverterContext#getHostElement()
- */
- public Element getHostElement() {
- Element element = null;
- if (tagConverter != null) {
- element = tagConverter.getHostElement();
- }
- return element;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/IOutputRenderer.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/IOutputRenderer.java
deleted file mode 100644
index 30263d7..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/IOutputRenderer.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dtmanager.converter;
-
-import org.w3c.dom.Element;
-
-/**
- * Produces output rendering for ITagConverter instances.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author Ian Trimble - Oracle
- */
-public interface IOutputRenderer {
-
- /**
- * Uses the ITagConverterContext argument to produce output rendering.
- *
- * @param tagConverterContext ITagConverterContext instance providing
- * ITagConverter-specific context and functionality.
- * @return Element instance representing top Element in resulting output
- * tree.
- *
- * TODO: let's parameterize the return type either with a generic type
- * or with Object so that sub-classes can co-vary
- */
- public Element render(ITagConverterContext tagConverterContext);
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/ITagConverterContext.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/ITagConverterContext.java
deleted file mode 100644
index b857c4e..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/ITagConverterContext.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dtmanager.converter;
-
-import org.eclipse.jst.pagedesigner.converter.ConvertPosition;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-/**
- * Represents ITagConverter-specific context and functionality.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author Ian Trimble - Oracle
- */
-public interface ITagConverterContext {
-
- /**
- * Gets ITagConverter instance's host Element instance.
- *
- * @return ITagConverter instance's host Element instance.
- */
- public Element getHostElement();
-
- /**
- * Creates an Element instance to be used in ITagConverter's Document
- * instance.
- *
- * @param tag Name of element to be created.
- * @return Element instance to be used in ITagConverter's Document
- * instance.
- */
- public Element createElement(String tag);
-
- /**
- * Creates a Text node instance to be used in ITagConverter's Document
- * instance.
- *
- * @param content Textual content of the created text node.
- * @return Text node instance to be used in ITagConverter's Document
- * instance.
- */
- public Text createText(String content);
-
- /**
- * Adds a child Node instance to ITagConverter's collection of Nodes
- * requiring subsequent processing.
- *
- * @param childNode Child Node instance requiring subsequent processing.
- * @param position ConvertPosition instance describing child Node
- * instance's position, relative to another Node instance.
- */
- public void addChild(Node childNode, ConvertPosition position);
-
- /**
- * Add all child Element instances of srcElement to ITagConverter's
- * collection of Nodes requiring subsequent processing.
- *
- * @param srcElement Source Element instance from which child Elements are
- * copied.
- * @param destElement Destination Element instance to which child Elements
- * will be relative.
- */
- public void copyChildren(Element srcElement, Element destElement);
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/ITagConverterDecorator.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/ITagConverterDecorator.java
deleted file mode 100644
index 713245f..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/ITagConverterDecorator.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dtmanager.converter;
-
-import org.eclipse.jst.pagedesigner.converter.ITagConverter;
-
-/**
- * Decorates an ITagConverter instance as appropriate (generally
- * client-specific decoration performed after tag conversion).
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author Ian Trimble - Oracle
- */
-public interface ITagConverterDecorator {
-
- /**
- * Decorates the ITagConverter instance as appropriate.
- *
- * @param tagConverter ITagConverter instance to be decorated.
- */
- public void decorate(ITagConverter tagConverter);
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/ITransformOperation.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/ITransformOperation.java
deleted file mode 100644
index dfb847a..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/ITransformOperation.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dtmanager.converter;
-
-import java.util.List;
-
-import org.w3c.dom.Element;
-
-/**
- * Defines an operation used during transformation of input Element instances
- * to output Element instances.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author Ian Trimble - Oracle
- *
- * TODO: as with ITransformer, I'd like to consider
- * ITransfomOperation<SRC, RESULT>
- */
-public interface ITransformOperation {
-
- /**
- * Transforms an input element instance to an output Element instance.
- *
- * @param srcElement Original input Element instance.
- * @param curElement Current Element instance.
- * @return Resulting transformed Element instance.
- */
- public Element transform(Element srcElement, Element curElement);
-
- /**
- * Sets the ITagConverterContext instance allowing access to context and
- * functionality of the current ITagConverter instance.
- *
- * @param tagConverterContext ITagConverterContext instance allowing access
- * to context and functionality of the current ITagConverter instance.
- *
- */
- public void setTagConverterContext(ITagConverterContext tagConverterContext);
-
- /**
- * Appends a child ITransformOperation instance.
- *
- * @param operation Child ITransformOperation instance to be appended.
- */
- public void appendChildOperation(ITransformOperation operation);
-
- /**
- * Gets collection of child ITransformOperation instances.
- *
- * @return Collection of child ITransformOperation instances (may be null).
- */
- public List getChildOperations();
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/ITransformer.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/ITransformer.java
deleted file mode 100644
index 49e99f2..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/ITransformer.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dtmanager.converter;
-
-import org.w3c.dom.Element;
-
-/**
- * Transforms an original input Element instance to an output Element instance
- * by invoking a collection of ITransformOperation instances.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author Ian Trimble - Oracle
- */
-public interface ITransformer {
-
- /**
- * Appends an ITransformOperation instance to the collection.
- *
- * @param operation ITransformOperation instance to be appended.
- * API: does this need to be on the interface or could it be pushed
- * into the instance constructor (i.e. factory).
- */
- public void appendTransformOperation(ITransformOperation operation);
-
- /**
- * Transforms an original input Element instance to an output Element
- * instance, typically by invoking each ITransformOperation instance in
- * this instance's collection.
- *
- * @param srcElement Original input Element instance.
- * @return Transformed output Element instance.
- *
- * TODO: I'd like to consider templating the generic ITransformer
- * interface to ITransformer<I,O> and making this a normative instance
- * case of ITransformer<Element, Element>
- */
- public Element transform(Element srcElement);
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/internal/DTHTMLOutputRenderer.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/internal/DTHTMLOutputRenderer.java
deleted file mode 100644
index b546750..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/internal/DTHTMLOutputRenderer.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dtmanager.converter.internal;
-
-import java.util.Iterator;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jst.pagedesigner.dtmanager.DTManager;
-import org.eclipse.jst.pagedesigner.dtmanager.IDTInfo;
-import org.eclipse.jst.pagedesigner.dtmanager.converter.IOutputRenderer;
-import org.eclipse.jst.pagedesigner.dtmanager.converter.ITagConverterContext;
-import org.eclipse.jst.pagedesigner.dtmanager.converter.ITransformOperation;
-import org.eclipse.jst.pagedesigner.dtmanager.converter.ITransformer;
-import org.eclipse.jst.pagedesigner.dtmanager.converter.operations.TransformOperationFactory;
-import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.Operation;
-import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.Parameter;
-import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagConvertInfo;
-import org.w3c.dom.Element;
-
-/**
- * Design-time metadata-driven HTML IOutputRenderer implementation.
- *
- * @author Ian Trimble - Oracle
- */
-public class DTHTMLOutputRenderer implements IOutputRenderer {
-
- private ITagConverterContext tagConverterContext;
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.dtmanager.converter.IOutputRenderer#render(org.eclipse.jst.pagedesigner.dtmanager.converter.ITagConverterContext)
- */
- public Element render(ITagConverterContext newTagConverterContext) {
- this.tagConverterContext = newTagConverterContext;
- Element srcElement = newTagConverterContext.getHostElement();
- Element resultElement = null;
- if (srcElement != null) {
- ITransformer transformer = createTransformerFromDTInfo(srcElement);
- if (transformer != null) {
- resultElement = transformer.transform(srcElement);
- }
- }
- return resultElement;
- }
-
- /**
- * Configures and returns an ITransformer instance for the specified source
- * Element.
- *
- * @param element Element for which to configure and return an ITransformer
- * instance.
- * @return Configured ITransformer instance for the specified Element.
- */
- protected ITransformer createTransformerFromDTInfo(Element element) {
- ITransformer transformer = null;
- DTManager dtManager = DTManager.getInstance();
- IDTInfo dtInfo = dtManager.getDTInfo(element);
- if (dtInfo != null) {
- TagConvertInfo tcInfo = dtInfo.getTagConvertInfo();
- if (tcInfo != null) {
- transformer = new DefaultTransformer(tagConverterContext);
- EList operations = tcInfo.getOperations();
- if (!appendOperationsToTransformer(transformer, operations, dtInfo)) {
- transformer = null;
- }
- }
- }
- return transformer;
- }
-
- private boolean appendOperationsToTransformer(ITransformer transformer, EList operations, IDTInfo dtInfo) {
- Iterator itOperations = operations.iterator();
- while (itOperations.hasNext()) {
- Operation operation = (Operation)itOperations.next();
- ITransformOperation currentTransformOperation = null;
- String opID = operation.getId();
- String[] params = getParamsArray(operation);
- currentTransformOperation =
- TransformOperationFactory.getInstance().getTransformOperation(opID, params);
- if (currentTransformOperation != null) {
- transformer.appendTransformOperation(currentTransformOperation);
- EList childOperations = operation.getOperations();
- if (childOperations != null && childOperations.size() > 0) {
- if (!appendChildOperations(currentTransformOperation, childOperations, dtInfo)) {
- return false;
- }
- }
- } else {
- return false;
- }
- }
- return true;
- }
-
- private boolean appendChildOperations(ITransformOperation parentOperation, EList operations, IDTInfo dtInfo) {
- Iterator itOperations = operations.iterator();
- while (itOperations.hasNext()) {
- Operation operation = (Operation)itOperations.next();
- ITransformOperation currentTransformOperation = null;
- String opID = operation.getId();
- String[] params = getParamsArray(operation);
- currentTransformOperation =
- TransformOperationFactory.getInstance().getTransformOperation(opID, params);
- if (currentTransformOperation != null) {
- parentOperation.appendChildOperation(currentTransformOperation);
- EList childOperations = operation.getOperations();
- if (childOperations != null && childOperations.size() > 0) {
- if (!appendChildOperations(currentTransformOperation, childOperations, dtInfo)) {
- return false;
- }
- }
-
- } else {
- return false;
- }
- }
- return true;
- }
-
- private String[] getParamsArray(Operation operation) {
- EList paramsList = operation.getParameters();
- if (paramsList != null) {
- Iterator itParamsList = paramsList.iterator();
- String[] paramsArray = new String[paramsList.size()];
- int index = 0;
- while (itParamsList.hasNext()) {
- Parameter param = (Parameter)itParamsList.next();
- paramsArray[index++] = param.getValue();
- }
- return paramsArray;
- }
- //fall through - no params
- return new String[0];
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/internal/DTTagConverter.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/internal/DTTagConverter.java
deleted file mode 100644
index f0d5099..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/internal/DTTagConverter.java
+++ /dev/null
@@ -1,467 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dtmanager.converter.internal;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jst.pagedesigner.converter.ConvertPosition;
-import org.eclipse.jst.pagedesigner.converter.IDOMFactory;
-import org.eclipse.jst.pagedesigner.converter.ITagConverter;
-import org.eclipse.jst.pagedesigner.css2.style.ITagEditInfo;
-import org.eclipse.jst.pagedesigner.editors.palette.TagImageManager;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-/**
- * Design-Time metadata-driven tag converter.
- *
- * @author Ian Trimble - Oracle
- */
-public class DTTagConverter implements
- ITagConverter, ITagEditInfo, INodeAdapter, IDOMFactory {
-
- private Element hostElement;
- private Element resultElement;
- private Image visualImage;
- private ImageDescriptor visualImageDescriptor;
- private IDOMDocument destDocument;
- private List childNodeList = Collections.EMPTY_LIST;
- private NodeConvertPositionMap childVisualPositionMap;
- private List nonVisualChildElementList = Collections.EMPTY_LIST;
- private boolean isMultiLevel = false;
- private boolean isVisualByHTML = true;
- private boolean isWidget = false;
- private int mode;
- private int minHeight;
- private int minWidth;
- private boolean needBorderDecorator = false;
- private boolean needTableDecorator = false;
-
- /**
- * Constructs an instance for the specified source Element.
- *
- * @param hostElement Source Element instance.
- */
- public DTTagConverter(Element hostElement) {
- this.hostElement = hostElement;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.converter.ITagConverter#convertRefresh(java.lang.Object)
- */
- public void convertRefresh(Object context) {
- childNodeList = new ArrayList();
- childVisualPositionMap = new NodeConvertPositionMap();
- nonVisualChildElementList = new ArrayList();
- resultElement = new DTHTMLOutputRenderer().render(new DTTagConverterContext(this));
- new DTTagConverterDecorator().decorate(this);
- if (resultElement instanceof INodeNotifier) {
- ((INodeNotifier)resultElement).addAdapter(this);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.converter.ITagConverter#dispose()
- */
- public void dispose() {
- visualImage = null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.converter.ITagConverter#getChildModeList()
- */
- public List getChildModeList() {
- //need to reset the NodeConvertPositionMap at this time
- childVisualPositionMap.reset();
- return childNodeList;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.converter.ITagConverter#getChildVisualPosition(org.w3c.dom.Node)
- */
- public ConvertPosition getChildVisualPosition(Node childModel) {
- return childVisualPositionMap.get(childModel);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.converter.ITagConverter#getHostElement()
- */
- public Element getHostElement() {
- return hostElement;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.converter.ITagConverter#getNonVisualChildren()
- */
- public List getNonVisualChildren() {
- return nonVisualChildElementList;
- }
-
- /**
- * Sets the result Element instance; allows decorators to set an "unknown
- * tag" Element when tag conversion has not produced a result.
- *
- * @param resultElement Result Element instance to be set.
- */
- public void setResultElement(Element resultElement) {
- this.resultElement = resultElement;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.converter.ITagConverter#getResultElement()
- */
- public Element getResultElement() {
- return resultElement;
- }
-
- /**
- * Sets the visual Image instance.
- *
- * @param visualImage Visual Image instance.
- */
- public void setVisualImage(Image visualImage) {
- this.visualImage = visualImage;
- }
-
- /**
- * Sets the visual ImageDescriptor instance.
- *
- * @param imageDescriptor Visual ImageDescriptor instance.
- */
- public void setVisualImageDescriptor(ImageDescriptor imageDescriptor) {
- this.visualImageDescriptor = imageDescriptor;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.converter.ITagConverter#getVisualImage()
- */
- public Image getVisualImage() {
- if (visualImage == null && visualImageDescriptor != null) {
- visualImage = TagImageManager.getOrCreateImage(visualImageDescriptor);
- }
- return visualImage;
- }
-
- /**
- * Sets the "isMultiLevel" flag; allows decorators to manipulate this
- * setting.
- *
- * @param isMultiLevel Sets the "isMultiLevel" flag to true or false.
- */
- public void setMultiLevel(boolean isMultiLevel) {
- this.isMultiLevel = isMultiLevel;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.converter.ITagConverter#isMultiLevel()
- */
- public boolean isMultiLevel() {
- return isMultiLevel;
- }
-
- /**
- * Sets the "isVisualByHTML" flag; allows decorators to manipulate this
- * setting.
- *
- * @param isVisualByHTML Sets the "isVisualByHTML" flag to true or false.
- */
- public void setVisualByHTML(boolean isVisualByHTML) {
- this.isVisualByHTML = isVisualByHTML;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.converter.ITagConverter#isVisualByHTML()
- */
- public boolean isVisualByHTML() {
- return isVisualByHTML;
- }
-
- /**
- * Sets the "isWidget" flag; allows decorators to manipulate this setting.
- *
- * @param isWidget Sets the "isWidget" flag to true or false.
- */
- public void setWidget(boolean isWidget) {
- this.isWidget = isWidget;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.converter.ITagConverter#isWidget()
- */
- public boolean isWidget() {
- return isWidget;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.converter.ITagConverter#setDestDocument(org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument)
- */
- public void setDestDocument(IDOMDocument destDocument) {
- this.destDocument = destDocument;
- }
-
- /**
- * Gets the IDOMDocument instance on which new Nodes are created.
- *
- * @return IDOMDocument instance.
- */
- public IDOMDocument getDestDocument() {
- IDOMDocument document = null;
- if (destDocument != null) {
- document = destDocument;
- } else {
- document = (IDOMDocument)hostElement.getOwnerDocument();
- }
- return document;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.converter.ITagConverter#setMode(int)
- */
- public void setMode(int mode) {
- this.mode = mode;
- }
-
- /**
- * Gets this instance's "mode", as set by setMode(int mode).
- *
- * @return This instance's "mode".
- */
- public int getMode() {
- return mode;
- }
-
- /**
- * Sets the desired minimum height of the visual representation; allows
- * decorators to manipulate this setting.
- *
- * @param minHeight The desired minimum height of the visual
- * representation.
- */
- public void setMinHeight(int minHeight) {
- this.minHeight = minHeight;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.css2.style.ITagEditInfo#getMinHeight()
- */
- public int getMinHeight() {
- return minHeight;
- }
-
- /**
- * Sets the desired minimum width of the visual representation; allows
- * decorators to manipulate this setting.
- *
- * @param minWidth The desired minimum width of the visual
- * representation.
- */
- public void setMinWidth(int minWidth) {
- this.minWidth = minWidth;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.css2.style.ITagEditInfo#getMinWidth()
- */
- public int getMinWidth() {
- return minWidth;
- }
-
- /**
- * Sets the "needBorderDecorator" flag; allows decorators to manipulate
- * this setting.
- *
- * @param needBorderDecorator Sets the "needBorderDecorator" flag to true
- * or false.
- */
- public void setNeedBorderDecorator(boolean needBorderDecorator) {
- this.needBorderDecorator = needBorderDecorator;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.css2.style.ITagEditInfo#needBorderDecorator()
- */
- public boolean needBorderDecorator() {
- return needBorderDecorator;
- }
-
- /**
- * Sets the "needTableDecorator" flag; allows decorators to manipulate
- * this setting.
- *
- * @param needTableDecorator Sets the "needTableDecorator" flag to true
- * or false.
- */
- public void setNeedTableDecorator(boolean needTableDecorator) {
- this.needTableDecorator = needTableDecorator;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.css2.style.ITagEditInfo#needTableDecorator()
- */
- public boolean needTableDecorator() {
- return needTableDecorator;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.sse.core.internal.provisional.INodeAdapter#isAdapterForType(java.lang.Object)
- */
- public boolean isAdapterForType(Object type) {
- if (type == ITagEditInfo.class) {
- return true;
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.sse.core.internal.provisional.INodeAdapter#notifyChanged(org.eclipse.wst.sse.core.internal.provisional.INodeNotifier, int, java.lang.Object, java.lang.Object, java.lang.Object, int)
- */
- public void notifyChanged(INodeNotifier notifier, int eventType,
- Object changedFeature, Object oldValue, Object newValue, int pos) {
- //do nothing
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.converter.IDOMFactory#createElement(java.lang.String)
- */
- public Element createElement(String tag) {
- return getDestDocument().createElement(tag);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.converter.IDOMFactory#createText(java.lang.String)
- */
- public Text createText(String content) {
- return getDestDocument().createTextNode(content);
- }
-
- /**
- * Adds a child Node to the collection of Nodes requiring subsequent tag
- * conversion.
- *
- * @param childNode Node instance to be added.
- * @param position ConvertPosition instance describing indexed position
- * relative to another Node in the Document.
- */
- public void addChild(Node childNode, ConvertPosition position) {
- childNodeList.add(childNode);
- childVisualPositionMap.put(childNode, position);
- }
-
- /**
- * Adds all child Nodes to the collection of Nodes requiring subsequent tag
- * conversion.
- *
- * @param srcElement Source Element for which all child Nodes should be
- * added.
- * @param destElement Element to which added Nodes are relative.
- */
- public void copyChildren(Element srcElement, Element destElement) {
- int index = 0;
- NodeList childNodes = srcElement.getChildNodes();
- for (int i = 0; i < childNodes.getLength(); i++) {
- Node curNode = childNodes.item(i);
- if (
- curNode.getNodeType() == Node.ELEMENT_NODE ||
- curNode.getNodeType() == Node.TEXT_NODE ||
- curNode.getNodeType() == Node.CDATA_SECTION_NODE) {
- addChild(curNode, new ConvertPosition(destElement, index++));
- }
- }
- }
-
- /**
- * Adds a non-visual child Element to the collection of non-visual
- * children (subsequently retrieved via a call to "getNonVisualChildren".
- *
- * @param childElement Child Element to be added.
- */
- public void addNonVisualChildElement(Element childElement) {
- nonVisualChildElementList.add(childElement);
- }
-
- /**
- * Supports multiple ConvertPosition instances associated with a single
- * Node instance.
- */
- private class NodeConvertPositionMap {
-
- private Map mapOfConvertPositions = new HashMap();
- private Map mapOfIndexes = new HashMap();
-
- /**
- * Puts a ConvertPosition instance for the specified Node instance into
- * the map.
- *
- * @param node Node instance for which the ConvertPosition is to be
- * applied.
- * @param convertPosition ConvertPosition instance for the specified
- * Node instance.
- */
- public void put(Node node, ConvertPosition convertPosition) {
- List convertPositions = (List)mapOfConvertPositions.get(node);
- if (convertPositions == null) {
- convertPositions = new ArrayList();
- mapOfConvertPositions.put(node, convertPositions);
- }
- convertPositions.add(convertPosition);
- }
-
- /**
- * Gets the current ConvertPosition instance for the specified Node
- * instance. Note that each time this is called without a reset having
- * occurred, the next ConvertPosition instance mapped to the Node
- * instance is returned.
- *
- * @param node Node instance for which a ConvertPosition instance is
- * being requested.
- * @return the current ConvertPosition instance for the specified Node
- * instance.
- */
- public ConvertPosition get(Node node) {
- ConvertPosition convertPosition = null;
- List convertPositions = (List)mapOfConvertPositions.get(node);
- if (convertPositions != null) {
- int index;
- Object obj = mapOfIndexes.get(node);
- if (obj != null) {
- index = ((Integer)obj).intValue();
- } else {
- index = 0;
- }
- convertPosition = (ConvertPosition)convertPositions.get(index);
- mapOfIndexes.put(node, new Integer(++index));
- }
- return convertPosition;
- }
-
- /**
- * Resets the concept of "current" ConvertPosition instance for all
- * Node instances. Typically called when the List of child Nodes is
- * retrieved.
- */
- public void reset() {
- mapOfIndexes.clear();
- }
-
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/internal/DTTagConverterContext.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/internal/DTTagConverterContext.java
deleted file mode 100644
index aa60bff..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/internal/DTTagConverterContext.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dtmanager.converter.internal;
-
-import org.eclipse.jst.pagedesigner.converter.ConvertPosition;
-import org.eclipse.jst.pagedesigner.dtmanager.converter.AbstractTagConverterContext;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-/**
- * Design-time tag converter implementation of ITagConverterContext.
- *
- * @author Ian Trimble - Oracle
- */
-public class DTTagConverterContext extends AbstractTagConverterContext {
-
- /**
- * Constructs an instance for the specified DTTagConverter instance.
- *
- * @param tagConverter DTTagConverter instance.
- */
- public DTTagConverterContext(DTTagConverter tagConverter) {
- super(tagConverter);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.dtmanager.converter.ITagConverterContext#createElement(java.lang.String)
- */
- public Element createElement(String tag) {
- Element element = null;
- if (tagConverter != null) {
- element = ((DTTagConverter)tagConverter).createElement(tag);
- }
- return element;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.dtmanager.converter.ITagConverterContext#createText(java.lang.String)
- */
- public Text createText(String content) {
- Text text = null;
- if (tagConverter != null) {
- text = ((DTTagConverter)tagConverter).createText(content);
- }
- return text;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.dtmanager.converter.ITagConverterContext#addChild(org.w3c.dom.Node, org.eclipse.jst.pagedesigner.converter.ConvertPosition)
- */
- public void addChild(Node childNode, ConvertPosition position) {
- if (tagConverter != null) {
- ((DTTagConverter)tagConverter).addChild(childNode, position);
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.dtmanager.converter.ITagConverterContext#copyChildren(org.w3c.dom.Element, org.w3c.dom.Element)
- */
- public void copyChildren(Element srcElement, Element destElement) {
- if (tagConverter != null) {
- ((DTTagConverter)tagConverter).copyChildren(srcElement, destElement);
- }
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/internal/DTTagConverterDecorator.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/internal/DTTagConverterDecorator.java
deleted file mode 100644
index 59d6683..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/internal/DTTagConverterDecorator.java
+++ /dev/null
@@ -1,270 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dtmanager.converter.internal;
-
-import java.net.URL;
-
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathExpressionException;
-import javax.xml.xpath.XPathFactory;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.internal.IImageDescriptorProvider;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataSourceModelProvider;
-import org.eclipse.jst.jsf.common.metadata.internal.IResourceURLProvider;
-import org.eclipse.jst.pagedesigner.converter.IConverterFactory;
-import org.eclipse.jst.pagedesigner.converter.ITagConverter;
-import org.eclipse.jst.pagedesigner.dtmanager.DTManager;
-import org.eclipse.jst.pagedesigner.dtmanager.IDTInfo;
-import org.eclipse.jst.pagedesigner.dtmanager.converter.ITagConverterDecorator;
-import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.ResolveAttributeValue;
-import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo;
-import org.eclipse.jst.pagedesigner.preview.PageExpressionContext;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-/**
- * ITagConverterDecorator implementation for DTTagConverter.
- *
- * @author Ian Trimble - Oracle
- */
-public class DTTagConverterDecorator implements ITagConverterDecorator {
-
- private static final String DECORATE_INFO_ID_DESIGN = "vpd-decorate-design"; //$NON-NLS-1$
- private static final String DECORATE_INFO_ID_PREVIEW = "vpd-decorate-preview"; //$NON-NLS-1$
- private static final String MD_PLUGIN_LOCATION = "$metadata-plugin-location$"; //$NON-NLS-1$
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.dtmanager.converter.ITagConverterDecorator#decorate(org.eclipse.jst.pagedesigner.converter.ITagConverter)
- */
- public void decorate(ITagConverter tagConverter) {
- if (!(tagConverter instanceof DTTagConverter)) {
- throw new IllegalArgumentException("ITagConverter argument must be an instance of DTTagConverter"); //$NON-NLS-1$
- }
- DTTagConverter dtTagConverter = (DTTagConverter)tagConverter;
-
- if (dtTagConverter.getMode() == IConverterFactory.MODE_DESIGNER) {
- decorateFromDTInfo(dtTagConverter, DECORATE_INFO_ID_DESIGN);
- } else if (dtTagConverter.getMode() == IConverterFactory.MODE_PREVIEW) {
- decorateFromDTInfo(dtTagConverter, DECORATE_INFO_ID_PREVIEW);
- }
-
- if (tagConverter.getResultElement() == null && tagConverter.isVisualByHTML()) {
- createUnknownTagRepresentation(dtTagConverter);
- }
- }
-
- /**
- * Performs decoration of the specified DTTagConverter instance from
- * IDTInfo (metadata) for the specified (by ID) TagDecorateInfo.
- *
- * @param dtTagConverter DTTagConverter instance.
- * @param tagDecorateInfoID ID of the TagDecorateInfo to be located in
- * metadata.
- */
- protected void decorateFromDTInfo(DTTagConverter dtTagConverter, String tagDecorateInfoID) {
- Element srcElement = dtTagConverter.getHostElement();
- DTManager dtManager = DTManager.getInstance();
- IDTInfo dtInfo = dtManager.getDTInfo(srcElement);
- if (dtInfo != null) {
- TagDecorateInfo tdInfo = dtInfo.getTagDecorateInfo(tagDecorateInfoID);
- if (tdInfo != null) {
- dtTagConverter.setMultiLevel(tdInfo.isMultiLevel());
- dtTagConverter.setNeedBorderDecorator(tdInfo.isNeedBorderDecorator());
- dtTagConverter.setNeedTableDecorator(tdInfo.isNeedTableDecorator());
- if (tdInfo.isNonVisual()) {
- setNonVisual(dtTagConverter, dtInfo, tdInfo.getNonVisualImagePath());
- }
- if (tdInfo.isResolveChildText()) {
- resolveChildText(dtTagConverter.getResultElement(), dtInfo);
- }
- if (tdInfo.isSetNonVisualChildElements()) {
- setNonVisualChildElements(dtTagConverter, srcElement);
- }
- dtTagConverter.setWidget(tdInfo.isWidget());
- dtTagConverter.setMinHeight(tdInfo.getMinHeight());
- dtTagConverter.setMinWidth(tdInfo.getMinWidth());
- ResolveAttributeValue resAttrValue = tdInfo.getResolveAttributeValue();
- if (resAttrValue != null) {
- String attributeName = resAttrValue.getAttributeName();
- if (attributeName != null && attributeName.length() > 0) {
- resolveAttributeValue(dtTagConverter.getResultElement(), attributeName, dtInfo);
- }
- }
- }
- }
- }
-
- /**
- * Creates a visual representation result Element for an unknown tag.
- *
- * @param dtTagConverter DTTagConverter instance.
- */
- protected void createUnknownTagRepresentation(DTTagConverter dtTagConverter) {
- Element element = dtTagConverter.createElement("span"); //$NON-NLS-1$
- element.setAttribute("style", "color:red;font-weight:bold;"); //$NON-NLS-1$ //$NON-NLS-2$
- Text text = dtTagConverter.createText("<" + dtTagConverter.getHostElement().getTagName() + "/>"); //$NON-NLS-1$ //$NON-NLS-2$
- element.appendChild(text);
- dtTagConverter.setResultElement(element);
- dtTagConverter.setWidget(true);
- }
-
- /**
- * Adds child Elements of the specified source Element to the specified
- * DTTagConverter instance's collection of non-visual children.
- *
- * @param dtTagConverter DTTagConverter instance.
- * @param srcElement Source Element for which child Elements are to be
- * added.
- */
- protected void setNonVisualChildElements(DTTagConverter dtTagConverter, Element srcElement) {
- NodeList childNodes = srcElement.getChildNodes();
- for (int i = 0; i < childNodes.getLength(); i++) {
- Node curNode = childNodes.item(i);
- if (curNode.getNodeType() == Node.ELEMENT_NODE) {
- dtTagConverter.addNonVisualChildElement((Element)curNode);
- }
- }
- }
-
- /**
- * Performs simple EL resolution for the child Text Node of the specified
- * source Element instance.
- *
- * @param srcElement Source Element for which child Text Node EL resolution
- * is to be performed.
- * @param dtInfo IDTInfo instance.
- */
- protected void resolveChildText(Element srcElement, IDTInfo dtInfo) {
- if (srcElement != null) {
- NodeList childNodes = srcElement.getChildNodes();
- for (int i = 0; i < childNodes.getLength(); i++) {
- Node childNode = childNodes.item(i);
- if (childNode.getNodeType() == Node.TEXT_NODE) {
- Text textNode = (Text)childNode;
- String textNodeValue = textNode.getNodeValue();
- try {
- String newTextNodeValue;
- if (textNodeValue.contains(MD_PLUGIN_LOCATION)) {
- newTextNodeValue = resolveMDPluginLocation(textNodeValue, dtInfo);
- } else {
- newTextNodeValue = (String)PageExpressionContext.getCurrent().evaluateExpression(textNodeValue, String.class, null);
- }
- if (newTextNodeValue != null && !textNodeValue.equals(newTextNodeValue)) {
- textNode.setNodeValue(newTextNodeValue);
- }
- } catch(Exception ex) {
- //ignore - could not resolve, do not change existing value
- }
- }
- }
- }
- }
-
- /**
- * Performs simple EL resolution for the value of the specified attribute
- * of the specified Element.
- *
- * @param srcElement Source Element instance.
- * @param attributeName Name of attribute for which the value should be
- * resolved.
- * @param dtInfo IDTInfo instance.
- */
- protected void resolveAttributeValue(Element srcElement, String attributeName, IDTInfo dtInfo) {
- if (srcElement != null) {
- Element targetElement = srcElement;
- String targetAttributeName = attributeName;
- //determine if attributeName is XPath and re-target as appropriate
- if (attributeName.contains("/")) { //$NON-NLS-1$
- int lastSlashPos = attributeName.lastIndexOf("/"); //$NON-NLS-1$
- String xPathExpression = attributeName.substring(0, lastSlashPos);
- XPath xPath = XPathFactory.newInstance().newXPath();
- try {
- Object resultObject = xPath.evaluate(xPathExpression, srcElement, XPathConstants.NODE);
- if (resultObject instanceof Element) {
- targetElement = (Element)resultObject;
- targetAttributeName = attributeName.substring(lastSlashPos + 1);
- }
- } catch(XPathExpressionException xee) {
- //could not evaluate - leave targetElement and targetAttributeName unchanged
- }
- }
- String oldAttributeValue = targetElement.getAttribute(targetAttributeName);
- if (oldAttributeValue != null && oldAttributeValue.length() > 0) {
- try {
- String newAttributeValue;
- if (oldAttributeValue.contains(MD_PLUGIN_LOCATION)) {
- newAttributeValue = resolveMDPluginLocation(oldAttributeValue, dtInfo);
- } else {
- newAttributeValue = (String)PageExpressionContext.getCurrent().evaluateExpression(oldAttributeValue, String.class, null);
- }
- if (newAttributeValue != null && !oldAttributeValue.equals(newAttributeValue)) {
- targetElement.setAttribute(targetAttributeName, newAttributeValue);
- }
- } catch(Exception ex) {
- //ignore - could not resolve, do not change existing value
- }
- }
- }
- }
-
- /**
- * Resolves any instance of MD_PLUGIN_LOCATION in input String.
- *
- * @param input Input String.
- * @param dtInfo IDTInfo instance.
- * @return Input String with any instance of MD_PLUGIN_LOCATION resolved.
- */
- protected String resolveMDPluginLocation(String input, IDTInfo dtInfo) {
- String output = input;
- if (input != null && input.contains(MD_PLUGIN_LOCATION)) {
- int tokenStart = input.indexOf(MD_PLUGIN_LOCATION);
- int tokenEnd = tokenStart + MD_PLUGIN_LOCATION.length();
- String prefix = input.substring(0, tokenStart);
- String suffix = input.substring(tokenEnd);
- Trait trait = dtInfo.getTrait();
- IMetaDataSourceModelProvider mdSourceModelProvider = trait.getSourceModelProvider();
- IResourceURLProvider resourceURLProvider = (IResourceURLProvider)mdSourceModelProvider.getAdapter(IResourceURLProvider.class);
- URL url = resourceURLProvider.getResourceURL("/META-INF/"); //$NON-NLS-1$
- String resolvedToken = url.toExternalForm();
- resolvedToken = resolvedToken.substring(0, resolvedToken.length() - 10);
- output = prefix + resolvedToken + suffix;
- }
- return output;
- }
-
- /**
- * Sets DTTagConverter instance as non-visual as HTML and sets the
- * ImageDescriptor instance that DTTagConverter will use to return an Image
- * for rendering.
- *
- * @param dtTagConverter DTTagConverter instance.
- * @param dtInfo IDTInfo instance.
- * @param imagePath Image path, relative to declaring plug-in.
- */
- protected void setNonVisual(DTTagConverter dtTagConverter, IDTInfo dtInfo, String imagePath) {
- dtTagConverter.setVisualByHTML(false);
- if (imagePath != null && imagePath.length() > 0) {
- Trait trait = dtInfo.getTrait();
- IImageDescriptorProvider imgDescProvider = (IImageDescriptorProvider)trait.getSourceModelProvider().getAdapter(IImageDescriptorProvider.class);
- if (imgDescProvider != null) {
- ImageDescriptor imageDescriptor = imgDescProvider.getImageDescriptor(imagePath);
- dtTagConverter.setVisualImageDescriptor(imageDescriptor);
- }
- }
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/internal/DTTagConverterFactory.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/internal/DTTagConverterFactory.java
deleted file mode 100644
index df40831..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/internal/DTTagConverterFactory.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dtmanager.converter.internal;
-
-import org.eclipse.jst.pagedesigner.converter.IConverterFactory;
-import org.eclipse.jst.pagedesigner.converter.ITagConverter;
-import org.eclipse.jst.pagedesigner.dtmanager.DTManager;
-import org.eclipse.jst.pagedesigner.dtmanager.IDTInfo;
-import org.w3c.dom.Element;
-
-/**
- * Produces DTTagConverter instances.
- *
- * @author Ian Trimble - Oracle
- */
-public class DTTagConverterFactory implements IConverterFactory {
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.converter.IConverterFactory#createConverter(org.w3c.dom.Element, int)
- */
- public ITagConverter createConverter(Element element, int mode) {
- ITagConverter tagConverter = null;
- IDTInfo dtInfo = DTManager.getInstance().getDTInfo(element);
- if (dtInfo != null) {
- tagConverter = new DTTagConverter(element);
- tagConverter.setMode(mode);
- }
- return tagConverter;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.converter.IConverterFactory#getSupportedURI()
- */
- public String getSupportedURI() {
- return null;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/internal/DefaultTransformer.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/internal/DefaultTransformer.java
deleted file mode 100644
index 4e6ce62..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/internal/DefaultTransformer.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dtmanager.converter.internal;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.jst.pagedesigner.dtmanager.converter.ITagConverterContext;
-import org.eclipse.jst.pagedesigner.dtmanager.converter.ITransformOperation;
-import org.eclipse.jst.pagedesigner.dtmanager.converter.ITransformer;
-import org.w3c.dom.Element;
-
-/**
- * Default ITransformer implementation.
- *
- * @author Ian Trimble - Oracle
- */
-public class DefaultTransformer implements ITransformer {
-
- private ITagConverterContext tagConverterContext;
- // synchronization occurs on this object, so it must never
- // be allowed to be null
- private final Collection transformOperations = new ArrayList();
-
- /**
- * Instantiates an instance.
- *
- * @param context ITagConverterContext instance.
- */
- public DefaultTransformer(ITagConverterContext context) {
- this.tagConverterContext = context;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.dtmanager.converter.ITransformer#appendTransformOperation(org.eclipse.jst.pagedesigner.dtmanager.converter.ITransformOperation)
- */
- public void appendTransformOperation(ITransformOperation operation) {
- synchronized(transformOperations) {
- if (operation != null) {
- operation.setTagConverterContext(tagConverterContext);
- transformOperations.add(operation);
- }
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.dtmanager.converter.internal.provisional.ITransformer#transform(org.w3c.dom.Element)
- */
- public Element transform(Element srcElement) {
- Element curElement = null;
- if (srcElement != null) {
- synchronized(transformOperations) {
- if (transformOperations.size() > 0) {
- curElement = srcElement;
- Iterator itOperations = transformOperations.iterator();
- while (itOperations.hasNext()) {
- ITransformOperation operation = (ITransformOperation)itOperations.next();
- curElement = operation.transform(srcElement, curElement);
- }
- }
- }
- }
- return curElement;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/AbstractTransformOperation.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/AbstractTransformOperation.java
deleted file mode 100644
index 82b7c0b..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/AbstractTransformOperation.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dtmanager.converter.operations;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.dtmanager.converter.ITagConverterContext;
-import org.eclipse.jst.pagedesigner.dtmanager.converter.ITransformOperation;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * Abstract ITransformOperation implementation. Maintains ITagConverterContext
- * instance and collection of child ITransformOperation instances.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author Ian Trimble - Oracle
- */
-public abstract class AbstractTransformOperation implements ITransformOperation {
-
- /**
- * ITagConverterContext instance.
- */
- protected ITagConverterContext tagConverterContext;
-
- /**
- * Collection of child ITransformOperation instances.
- */
- protected List childOperations;
-
- private String[] params;
-
- private String id = "<not set>";
-
- /**
- * Zero-argument constructor
- */
- public AbstractTransformOperation(){
- //
- }
-
- /**
- * Called by TransformOperationFactory
- * @param params for the operation
- */
- void setParameters(String[] params) {
- if (params != null) {
- this.params = new String[params.length];
- System.arraycopy(params, 0, this.params, 0, params.length);
- }
- }
-
- /**
- * @return parameters for the operation
- */
- protected String[] getParameters(){
- return params;
- }
-
- /**
- * Called by TransformOperationFactory
- * @param id for the operation
- */
- void setTransformOperationID(String id){
- this.id = id;
- }
-
- /**
- * @return id for the operation
- */
- protected String getTransformOperationID(){
- return id;
- }
-
- /**
- * @return Logger
- */
- protected Logger getLog() {
- return PDPlugin.getLogger(TransformOperationFactory.class);
- }
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.dtmanager.converter.ITransformOperation#transform(org.w3c.dom.Element, org.w3c.dom.Element)
- */
- public abstract Element transform(Element srcElement, Element curElement);
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.dtmanager.converter.ITransformOperation#setTagConverterContext(org.eclipse.jst.pagedesigner.dtmanager.converter.internal.provisional.ITagConverterContext)
- */
- public void setTagConverterContext(ITagConverterContext tagConverterContext) {
- // API: this should really be set on construction since other methods
- // cannot be called until it is set.
- this.tagConverterContext = tagConverterContext;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.dtmanager.converter.ITransformOperation#appendChildOperation(org.eclipse.jst.pagedesigner.dtmanager.converter.internal.provisional.ITransformOperation)
- */
- public void appendChildOperation(ITransformOperation operation) {
- if (operation != null) {
- if (childOperations == null) {
- childOperations = new ArrayList();
- }
- operation.setTagConverterContext(tagConverterContext);
- childOperations.add(operation);
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.dtmanager.converter.ITransformOperation#getChildOperations()
- */
- public List getChildOperations() {
- return childOperations;
- }
-
- /**
- * Convenience method to execute child ITransformOperation instances.
- *
- * @param srcElement Source Element instance.
- * @param curElement Current Element instance (that is being transformed).
- * @return New current Element instance.
- */
- protected Element executeChildOperations(Element srcElement, Element curElement) {
- Element retElement = curElement;
- if (childOperations != null && childOperations.size() > 0) {
- Iterator itChildOperations = childOperations.iterator();
- while (itChildOperations.hasNext()) {
- ITransformOperation childOperation = (ITransformOperation)itChildOperations.next();
- retElement = childOperation.transform(srcElement, retElement);
- }
- }
- return retElement;
- }
-
- /**
- * Creates a new Element.
- *
- * @param tagName Name of Element to be created.
- * @return New Element instance.
- */
- protected Element createElement(String tagName) {
- ITransformOperation operation =
- TransformOperationFactory.getInstance().getTransformOperation(
- TransformOperationFactory.OP_CreateElementOperation,
- new String[]{tagName});
- operation.setTagConverterContext(tagConverterContext);
- return operation.transform(null, null);
- }
-
- /**
- * Creates and appends a new child Element.
- *
- * @param tagName Name of child Element to be created.
- * @param parentElement Element instance to which to append the new
- * Element.
- * @return New Element instance.
- */
- protected Element appendChildElement(String tagName, Element parentElement) {
- ITransformOperation operation =
- TransformOperationFactory.getInstance().getTransformOperation(
- TransformOperationFactory.OP_AppendChildElementOperation,
- new String[]{tagName});
- operation.setTagConverterContext(tagConverterContext);
- return operation.transform(null, parentElement);
- }
-
- /**
- * Creates and appends a new child Text.
- *
- * @param content Content of new child Text.
- * @param parentElement Element instance to which to append the new Text.
- */
- protected void appendChildText(String content, Element parentElement) {
- ITransformOperation operation =
- TransformOperationFactory.getInstance().getTransformOperation(
- TransformOperationFactory.OP_AppendChildTextOperation,
- new String[]{content});
- operation.setTagConverterContext(tagConverterContext);
- operation.transform(null, parentElement);
- }
-
- /**
- * Gets collection of child Element instances who's local name matches
- * specified tag name.
- *
- * @param srcNode Source Node instance.
- * @param tagName Tag local name.
- * @return Collection of child Element instances who's local name matches
- * specified tag name.
- */
- protected List getChildElements(Node srcNode, String tagName) {
- List childElements = new ArrayList();
- NodeList childNodes = srcNode.getChildNodes();
- for (int i = 0; i < childNodes.getLength(); i++) {
- Node curNode = childNodes.item(i);
- if (curNode.getNodeType() == Node.ELEMENT_NODE) {
- String curNodeName = curNode.getLocalName();
- if (curNodeName != null && curNodeName.equals(tagName)) {
- childElements.add(curNode);
- }
- }
- }
- return childElements;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/TransformOperationFactory.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/TransformOperationFactory.java
deleted file mode 100644
index 0c8e6ed..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/TransformOperationFactory.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dtmanager.converter.operations;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.InvalidRegistryObjectException;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.pagedesigner.IJMTConstants;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.dtmanager.converter.ITransformOperation;
-import org.osgi.framework.Bundle;
-
-/**
- * Factory responsible for producing {@link org.eclipse.jst.pagedesigner.dtmanager.converter.ITransformOperation} instances from the <br>
- * <code>org.eclipse.jst.pagedesigner.pageDesignerExtension.tagTransformOperation</code> extensions
- * <br>
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author Ian Trimble - Oracle
- */
-public final class TransformOperationFactory {
- /**
- * AppendChildElementOperation
- */
- public static final String OP_AppendChildElementOperation = PDPlugin.getPluginId()+".AppendChildElementOperation"; //$NON-NLS-1$
- /**
- * AppendChildTextFromXPathOperation
- */
- public static final String OP_AppendChildTextFromXPathOperation = PDPlugin.getPluginId()+".AppendChildTextFromXPathOperation"; //$NON-NLS-1$
- /**
- * AppendChildTextOperation
- */
- public static final String OP_AppendChildTextOperation = PDPlugin.getPluginId()+".AppendChildTextOperation"; //$NON-NLS-1$
- /**
- * ConvertAttributeToTextOperation
- */
- public static final String OP_ConvertAttributeToTextOperation = PDPlugin.getPluginId()+".ConvertAttributeToTextOperation"; //$NON-NLS-1$
- /**
- * CopyAllAttributesOperation
- */
- public static final String OP_CopyAllAttributesOperation = PDPlugin.getPluginId()+".CopyAllAttributesOperation"; //$NON-NLS-1$
- /**
- * CopyAttributeOperation
- */
- public static final String OP_CopyAttributeOperation = PDPlugin.getPluginId()+".CopyAttributeOperation"; //$NON-NLS-1$
- /**
- * CopyAttributeWithRenameOperation
- */
- public static final String OP_CopyAttributeWithRenameOperation = PDPlugin.getPluginId()+".CopyAttributeWithRenameOperation"; //$NON-NLS-1$
- /**
- * CopyChildrenOperation
- */
- public static final String OP_CopyChildrenOperation = PDPlugin.getPluginId()+".CopyChildrenOperation"; //$NON-NLS-1$
- /**
- * CreateAttributeFromXPathOperation
- */
- public static final String OP_CreateAttributeFromXPathOperation = PDPlugin.getPluginId()+".CreateAttributeFromXPathOperation"; //$NON-NLS-1$
- /**
- * CreateAttributeOperation
- */
- public static final String OP_CreateAttributeOperation = PDPlugin.getPluginId()+".CreateAttributeOperation"; //$NON-NLS-1$
- /**
- * CreateElementOperation
- */
- public static final String OP_CreateElementOperation = PDPlugin.getPluginId()+".CreateElementOperation"; //$NON-NLS-1$
- /**
- * CustomTransformOperation
- */
- public static final String OP_CustomTransformOperation = PDPlugin.getPluginId()+".CustomTransformOperation"; //$NON-NLS-1$
- /**
- * IfNotOperation
- */
- public static final String OP_IfNotOperation = PDPlugin.getPluginId()+".IfNotOperation"; //$NON-NLS-1$
- /**
- * IfOperation
- */
- public static final String OP_IfOperation = PDPlugin.getPluginId()+".IfOperation"; //$NON-NLS-1$
- /**
- * IterateOverElementsOperation
- */
- public static final String OP_IterateOverElementsOperation = PDPlugin.getPluginId()+".IterateOverElementsOperation"; //$NON-NLS-1$
- /**
- * MakeParentElementCurrentOperation
- */
- public static final String OP_MakeParentElementCurrentOperation = PDPlugin.getPluginId()+".MakeParentElementCurrentOperation"; //$NON-NLS-1$
- /**
- * RemoveAttributeOperation
- */
- public static final String OP_RemoveAttributeOperation = PDPlugin.getPluginId()+".RemoveAttributeOperation"; //$NON-NLS-1$
- /**
- * RenameAttributeOperation
- */
- public static final String OP_RenameAttributeOperation = PDPlugin.getPluginId()+".RenameAttributeOperation"; //$NON-NLS-1$
-
- private static TransformOperationFactory instance;
-
- private Logger log = PDPlugin.getLogger(TransformOperationFactory.class);
-
- private Map<String, Class> _tagTransformOpsRegistry;
-
- /**
- * Instantiates an instance.
- */
- private TransformOperationFactory() {
- //no external instantiation
-
- //read extensions
- readAllTagTransformOperations();
- }
-
-
- /**
- * Gets the singleton instance.
- *
- * @return The singleton instance.
- */
- public static synchronized TransformOperationFactory getInstance() {
- if (instance == null) {
- instance = new TransformOperationFactory();
- }
- return instance;
- }
-
- /**
- * Gets an ITransformOperation instance for the specified operation ID and
- * parameters.
- *
- * @param opID - the plugin-qualified Operation extension ID.
- * @param params - array of String parameters
- * @return ITransformOperation
- */
- public ITransformOperation getTransformOperation(String opID, String[] params) {
- Class opClass = null;
- try {
- opClass = _tagTransformOpsRegistry.get(opID);
- if (opClass != null) {
- Object opObject = opClass.newInstance();
- if (opObject instanceof AbstractTransformOperation) {
- ((AbstractTransformOperation)opObject).setParameters(params);
- ((AbstractTransformOperation)opObject).setTransformOperationID(opID);
- return (AbstractTransformOperation)opObject;
- }
- log.error("Warning.TransformOperationFactory.NotAbstractTransformOperation", opClass.getName()); //$NON-NLS-1$
- } else {
- log.error("Warning.TransformOperationFactory.ExtensionNotFound", opID); //$NON-NLS-1$
- }
- } catch(IllegalAccessException iae) {
- log.error("Warning.TransformOperationFactory.IllegalAccess", opClass.getName(), iae); //$NON-NLS-1$
- } catch(InstantiationException ie) {
- log.error("Warning.TransformOperationFactory.Instantiation", opClass.getName(), ie); //$NON-NLS-1$
- }
- return null;
- }
-
- /**
- * Reads the custom tag transform operations from WPE registry
- */
- private void readAllTagTransformOperations() {
- try {
- _tagTransformOpsRegistry = new HashMap<String, Class>();
- IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(PDPlugin.getPluginId(), IJMTConstants.EXTENSION_POINT_PAGEDESIGNER);
- IExtension[] extensions = point.getExtensions();
- for (int i=0;i < extensions.length;i++){
- IExtension ext = extensions[i];
- for (int j=0;j < ext.getConfigurationElements().length;j++){
- if (ext.getConfigurationElements()[j].getName()
- .equals(IJMTConstants.TAG_TRANSFORM_OPERATION)) {
- registerTransformOperation(ext.getConfigurationElements()[j]);
- }
- }
- }
- } catch (InvalidRegistryObjectException e) {
- log.error("Warning.TransformOperationFactory.RegistryError", PDPlugin.getPluginId()+IJMTConstants.EXTENSION_POINT_PAGEDESIGNER+"."+IJMTConstants.TAG_TRANSFORM_OPERATION, e); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- private void registerTransformOperation(final IConfigurationElement element) {
-
- final Bundle bundle = Platform.getBundle(element.getContributor().getName());
- final String id = element.getContributor().getName()+"."+element.getAttribute("id"); //$NON-NLS-1$ //$NON-NLS-2$
- if (bundle != null) {
- try {
- final Class transformClass = bundle.loadClass(element.getAttribute("class")); //$NON-NLS-1$
- // Not checking instance type here. Class gets checked as ITransformOperation at
- //instantiation time...
- //best to log error then rather than now.
- _tagTransformOpsRegistry.put(id, transformClass);
- }
- catch (Exception e) {
- log.error("Warning.TransformOperationFactory.CannotLoadOpClass",id, e); //$NON-NLS-1$
- }
- }
- }
-
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/AppendChildElementOperation.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/AppendChildElementOperation.java
deleted file mode 100644
index 37178ef..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/AppendChildElementOperation.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation;
-import org.w3c.dom.Element;
-
-/**
- * ITransformOperation implementation that appends a child Element and
- * optionally makes the new Element current.
- *
- * <br><b>Note:</b> requires ITransformOperation.setTagConverterContext(...) to
- * have been called to provide a valid ITagConverterContext instance prior to
- * a call to the transform(...) method.
- *
- * @author Ian Trimble - Oracle
- */
-public class AppendChildElementOperation extends AbstractTransformOperation {
-
- private String tagName;
- private boolean makeChildCurrent = true;
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal.provisional.AbstractTransformOperation#transform(org.w3c.dom.Element, org.w3c.dom.Element)
- */
- public Element transform(Element srcElement, Element curElement) {
- if (getParameters().length < 1) {
- getLog().error("Warning.TransformOperationFactory.TooFewParameters", getTransformOperationID()); //$NON-NLS-1$
- return null;
- } else if (getParameters().length < 2) {
- tagName = getParameters()[0];
- } else {
- tagName = getParameters()[0];
- makeChildCurrent = Boolean.valueOf(getParameters()[1]).booleanValue();
- }
-
- Assert.isNotNull(tagName);
- Element element = null;
- if (tagConverterContext != null && curElement != null && tagName != null && tagName.length() > 0) {
- Element childElement = tagConverterContext.createElement(tagName);
- curElement.appendChild(childElement);
- if (makeChildCurrent) {
- element = childElement;
- } else {
- element = curElement;
- }
- }
- return element;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/AppendChildTextFromXPathOperation.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/AppendChildTextFromXPathOperation.java
deleted file mode 100644
index b0a7391..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/AppendChildTextFromXPathOperation.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal;
-
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathExpressionException;
-import javax.xml.xpath.XPathFactory;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-
-/**
- * ITransformOperation implementation that creates a new child Text node by
- * getting a value from the specified XPath expression.
- *
- * <br><b>Note:</b> requires ITransformOperation.setTagConverterContext(...) to
- * have been called to provide a valid ITagConverterContext instance prior to
- * a call to the transform(...) method.
- *
- * @author Ian Trimble - Oracle
- */
-public class AppendChildTextFromXPathOperation extends AbstractTransformOperation {
-
- private String xPathExpression;
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal.provisional.AbstractTransformOperation#transform(org.w3c.dom.Element, org.w3c.dom.Element)
- */
- public Element transform(Element srcElement, Element curElement) {
-
- if (getParameters().length < 1) {
- getLog().error("Warning.TransformOperationFactory.TooFewParameters", getTransformOperationID()); //$NON-NLS-1$
- return null;
- }
-
- xPathExpression = getParameters()[0];
- Assert.isNotNull(xPathExpression);
- if (srcElement != null) {
- XPath xPath = XPathFactory.newInstance().newXPath();
- try {
- Object resultObject = xPath.evaluate(xPathExpression, srcElement, XPathConstants.STRING);
- if (tagConverterContext != null && resultObject instanceof String && curElement != null) {
- Text childText = tagConverterContext.createText((String)resultObject);
- curElement.appendChild(childText);
- }
- } catch(XPathExpressionException xee) {
- //could not evaluate - return curElement
- }
- }
- return curElement;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/AppendChildTextOperation.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/AppendChildTextOperation.java
deleted file mode 100644
index 5d910c5..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/AppendChildTextOperation.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-
-/**
- * ITransformOperation implementation that appends a child Text.
- *
- * <br><b>Note:</b> requires ITransformOperation.setTagConverterContext(...) to
- * have been called to provide a valid ITagConverterContext instance prior to
- * a call to the transform(...) method.
- *
- * @author Ian Trimble - Oracle
- */
-public class AppendChildTextOperation extends AbstractTransformOperation {
-
- private String content;
-
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal.provisional.AbstractTransformOperation#transform(org.w3c.dom.Element, org.w3c.dom.Element)
- */
- public Element transform(Element srcElement, Element curElement) {
- if (getParameters().length < 1) {
- getLog().error("Warning.TransformOperationFactory.TooFewParameters", getTransformOperationID()); //$NON-NLS-1$
- return null;
- }
-
- content = getParameters()[0];
- Assert.isNotNull(content);
-
- if (tagConverterContext != null && curElement != null && content != null && content.length() > 0) {
- Text childText = tagConverterContext.createText(content);
- curElement.appendChild(childText);
- }
- return curElement;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/ConvertAttributeToTextOperation.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/ConvertAttributeToTextOperation.java
deleted file mode 100644
index 51fdd9a..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/ConvertAttributeToTextOperation.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-
-/**
- * ITransformOperation implementation that converts an attribute to a child
- * Text Node and optionally removes the specified attribute.
- *
- * <br><b>Note:</b> requires ITransformOperation.setTagConverterContext(...) to
- * have been called to provide a valid ITagConverterContext instance prior to
- * a call to the transform(...) method.
- *
- * @author Ian Trimble - Oracle
- */
-public class ConvertAttributeToTextOperation extends AbstractTransformOperation {
-
- private String attributeName;
- private boolean removeAttribute = true;
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal.provisional.AbstractTransformOperation#transform(org.w3c.dom.Element, org.w3c.dom.Element)
- */
- public Element transform(Element srcElement, Element curElement) {
- if (getParameters().length < 1) {
- getLog().error("Warning.TransformOperationFactory.TooFewParameters", getTransformOperationID()); //$NON-NLS-1$
- return null;
- } else if (getParameters().length < 2) {
- attributeName = getParameters()[0];
- } else {
- attributeName = getParameters()[0];
- removeAttribute = Boolean.valueOf(getParameters()[1]).booleanValue();
- }
-
- Assert.isNotNull(attributeName);
- if (tagConverterContext != null && srcElement != null && curElement != null) {
- String content = srcElement.getAttribute(attributeName);
- if (content != null && content.length() > 0) {
- Text text = tagConverterContext.createText(content);
- curElement.appendChild(text);
- if (removeAttribute) {
- curElement.removeAttribute(attributeName);
- }
- }
- }
- return curElement;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/CopyAllAttributesOperation.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/CopyAllAttributesOperation.java
deleted file mode 100644
index 59b13f5..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/CopyAllAttributesOperation.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal;
-
-import org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-
-/**
- * ITransformOperation implementation that copies all attributes from the
- * source Element instance to the current Element instance.
- *
- * @author Ian Trimble - Oracle
- */
-public class CopyAllAttributesOperation extends AbstractTransformOperation {
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal.provisional.AbstractTransformOperation#transform(org.w3c.dom.Element, org.w3c.dom.Element)
- */
- public Element transform(Element srcElement, Element curElement) {
- if (srcElement != null && curElement != null) {
- NamedNodeMap attributes = srcElement.getAttributes();
- for (int i = 0; i < attributes.getLength(); i++) {
- Attr attribute = (Attr)attributes.item(i);
- curElement.setAttribute(attribute.getName(), attribute.getValue());
- }
- }
- return curElement;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/CopyAttributeOperation.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/CopyAttributeOperation.java
deleted file mode 100644
index a169436..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/CopyAttributeOperation.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-
-/**
- * Copies a single attribute from the source Element instance to the current
- * Element instance, and optionally creates a new attribute on the current
- * Element instance if no such attribute exists on the source Element instance.
- *
- * @author Ian Trimble - Oracle
- */
-public class CopyAttributeOperation extends AbstractTransformOperation {
-
- private String attributeName;
- private boolean create;
- private String newAttributeValue;
-
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal.provisional.AbstractTransformOperation#transform(org.w3c.dom.Element, org.w3c.dom.Element)
- */
- public Element transform(Element srcElement, Element curElement) {
- if (getParameters().length < 1) {
- getLog().error("Warning.TransformOperationFactory.TooFewParameters", getTransformOperationID()); //$NON-NLS-1$
- return null;
- } else if (getParameters().length < 3) {
- attributeName = getParameters()[0];
- } else {
- attributeName = getParameters()[0];
- create = Boolean.valueOf(getParameters()[1]).booleanValue();
- newAttributeValue = getParameters()[2];
- }
-
- Assert.isNotNull(attributeName);
- if (srcElement != null && curElement != null) {
- Attr attribute = srcElement.getAttributeNode(attributeName);
- if (attribute != null) {
- curElement.setAttribute(attributeName, attribute.getValue());
- } else if (create && newAttributeValue != null) {
- curElement.setAttribute(attributeName, newAttributeValue);
- }
- }
- return curElement;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/CopyAttributeWithRenameOperation.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/CopyAttributeWithRenameOperation.java
deleted file mode 100644
index 0a0a25b..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/CopyAttributeWithRenameOperation.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * Copyright (c) 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- */
-package org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-
-/**
- * Copies a single attribute from the source Element instance to the current
- * Element instance, renaming the attribute on the current Element instance.
- *
- * @author Ian Trimble - Oracle
- */
-public class CopyAttributeWithRenameOperation extends AbstractTransformOperation {
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation#transform(org.w3c.dom.Element, org.w3c.dom.Element)
- */
- public Element transform(Element srcElement, Element curElement) {
- if (getParameters().length < 2) {
- getLog().error("Warning.TransformOperationFactory.TooFewParameters", getTransformOperationID()); //$NON-NLS-1$
- return null;
- }
-
- String srcAttributeName = getParameters()[0];
- String destAttributeName = getParameters()[1];
- Assert.isNotNull(srcAttributeName);
- Assert.isNotNull(destAttributeName);
-
- if (srcElement != null && curElement != null) {
- Attr attribute = srcElement.getAttributeNode(srcAttributeName);
- if (attribute != null) {
- curElement.setAttribute(destAttributeName, attribute.getValue());
- }
- }
-
- return curElement;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/CopyChildrenOperation.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/CopyChildrenOperation.java
deleted file mode 100644
index 206e595..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/CopyChildrenOperation.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal;
-
-import org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation;
-import org.w3c.dom.Element;
-
-/**
- * ITransformOperation implementation that copies all child Elements as Nodes
- * requiring subsequent tag conversion.
- *
- * <br><b>Note:</b> requires ITransformOperation.setTagConverterContext(...) to
- * have been called to provide a valid ITagConverterContext instance prior to
- * a call to the transform(...) method.
- *
- * @author Ian Trimble - Oracle
- */
-public class CopyChildrenOperation extends AbstractTransformOperation {
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal.provisional.AbstractTransformOperation#transform(org.w3c.dom.Element, org.w3c.dom.Element)
- */
- public Element transform(Element srcElement, Element curElement) {
- if (tagConverterContext != null) {
- tagConverterContext.copyChildren(srcElement, curElement);
- }
- return curElement;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/CreateAttributeFromXPathOperation.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/CreateAttributeFromXPathOperation.java
deleted file mode 100644
index dc5badb..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/CreateAttributeFromXPathOperation.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal;
-
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathExpressionException;
-import javax.xml.xpath.XPathFactory;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation;
-import org.w3c.dom.Element;
-
-/**
- * ITransformOperation implementation that creates a new attribute on the
- * current Element by getting a value from the specified XPath expression.
- *
- * @author Ian Trimble - Oracle
- */
-public class CreateAttributeFromXPathOperation extends AbstractTransformOperation {
-
- private String attributeName;
- private String xPathExpression;
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal.provisional.AbstractTransformOperation#transform(org.w3c.dom.Element, org.w3c.dom.Element)
- */
- public Element transform(Element srcElement, Element curElement) {
-
- if (getParameters().length < 2) {
- getLog().error("Warning.TransformOperationFactory.TooFewParameters", getTransformOperationID()); //$NON-NLS-1$
- return null;
- }
-
- attributeName = getParameters()[0];
- xPathExpression = getParameters()[1];
- Assert.isNotNull(attributeName);
- Assert.isNotNull(xPathExpression);
-
- if (srcElement != null) {
- XPath xPath = XPathFactory.newInstance().newXPath();
- try {
- Object resultObject = xPath.evaluate(xPathExpression, srcElement, XPathConstants.STRING);
- if (resultObject instanceof String && curElement != null) {
- curElement.setAttribute(attributeName, (String)resultObject);
- }
- } catch(XPathExpressionException xee) {
- //could not evaluate - return curElement
- }
- }
- return curElement;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/CreateAttributeOperation.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/CreateAttributeOperation.java
deleted file mode 100644
index 7ffc0bb..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/CreateAttributeOperation.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation;
-import org.w3c.dom.Element;
-
-/**
- * ITransformOperation implementation that creates a new attribute on the
- * current Element.
- *
- * @author Ian Trimble - Oracle
- */
-public class CreateAttributeOperation extends AbstractTransformOperation {
-
- private String attributeName;
- private String attributeValue;
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal.provisional.AbstractTransformOperation#transform(org.w3c.dom.Element, org.w3c.dom.Element)
- */
- public Element transform(Element srcElement, Element curElement) {
- if (getParameters().length < 2) {
- getLog().error("Warning.TransformOperationFactory.TooFewParameters", getTransformOperationID()); //$NON-NLS-1$
- return null;
- }
-
- attributeName = getParameters()[0];
- attributeValue = getParameters()[1];
- Assert.isNotNull(attributeName);
- Assert.isNotNull(attributeValue);
-
- if (curElement != null) {
- curElement.setAttribute(attributeName, attributeValue);
- }
- return curElement;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/CreateElementOperation.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/CreateElementOperation.java
deleted file mode 100644
index 038fec2..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/CreateElementOperation.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation;
-import org.w3c.dom.Element;
-
-/**
- * ITransformOperation implementation that creates a new Element.
- *
- * <br><b>Note:</b> requires ITransformOperation.setTagConverterContext(...) to
- * have been called to provide a valid ITagConverterContext instance prior to
- * a call to the transform(...) method.
- *
- * @author Ian Trimble - Oracle
- */
-public class CreateElementOperation extends AbstractTransformOperation {
-
- private String tagName;
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal.provisional.AbstractTransformOperation#transform(org.w3c.dom.Element, org.w3c.dom.Element)
- */
- public Element transform(Element srcElement, Element curElement) {
- if (getParameters().length < 1) {
- getLog().error("Warning.TransformOperationFactory.TooFewParameters", getTransformOperationID()); //$NON-NLS-1$
- return null;
- }
-
- tagName = getParameters()[0];
- Assert.isNotNull(tagName);
-
- Element element = null;
- if (tagConverterContext != null && tagName != null && tagName.length() > 0) {
- element = tagConverterContext.createElement(tagName);
- }
- return element;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/IfNotOperation.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/IfNotOperation.java
deleted file mode 100644
index 95c62f2..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/IfNotOperation.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal;
-
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathExpressionException;
-import javax.xml.xpath.XPathFactory;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation;
-import org.w3c.dom.Element;
-
-/**
- * ITransformOperation implementation that executes child ITransformOperation
- * instances if the XPath expression evaluated against the source Element
- * instance returns a "false" result.
- *
- * <br><b>Note:</b> requires ITransformOperation.setTagConverterContext(...) to
- * have been called to provide a valid ITagConverterContext instance prior to
- * a call to the transform(...) method.
- *
- * @author Ian Trimble - Oracle
- */
-public class IfNotOperation extends AbstractTransformOperation {
-
- private String xPathExpression;
-
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal.provisional.AbstractTransformOperation#transform(org.w3c.dom.Element, org.w3c.dom.Element)
- */
- public Element transform(Element srcElement, Element curElement) {
- if (getParameters().length < 1) {
- getLog().error("Warning.TransformOperationFactory.TooFewParameters", getTransformOperationID()); //$NON-NLS-1$
- return null;
- }
-
- xPathExpression = getParameters()[0];
- Assert.isNotNull(xPathExpression);
-
- Element retElement = curElement;
- if (srcElement != null) {
- XPath xPath = XPathFactory.newInstance().newXPath();
- try {
- Object resultObject = xPath.evaluate(xPathExpression, srcElement, XPathConstants.BOOLEAN);
- if (!((Boolean)resultObject).booleanValue()) {
- retElement = executeChildOperations(srcElement, retElement);
- }
- } catch(XPathExpressionException xee) {
- //could not evaluate - return curElement
- }
- }
- return retElement;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/IfOperation.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/IfOperation.java
deleted file mode 100644
index f617e35..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/IfOperation.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal;
-
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathExpressionException;
-import javax.xml.xpath.XPathFactory;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation;
-import org.w3c.dom.Element;
-
-/**
- * ITransformOperation implementation that executes child ITransformOperation
- * instances if the XPath expression evaluated against the source Element
- * instance returns a "true" result.
- *
- * <br><b>Note:</b> requires ITransformOperation.setTagConverterContext(...) to
- * have been called to provide a valid ITagConverterContext instance prior to
- * a call to the transform(...) method.
- *
- * @author Ian Trimble - Oracle
- */
-public class IfOperation extends AbstractTransformOperation {
-
- private String xPathExpression;
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal.provisional.AbstractTransformOperation#transform(org.w3c.dom.Element, org.w3c.dom.Element)
- */
- public Element transform(Element srcElement, Element curElement) {
- if (getParameters().length < 1) {
- getLog().error("Warning.TransformOperationFactory.TooFewParameters", getTransformOperationID()); //$NON-NLS-1$
- return null;
- }
-
- xPathExpression = getParameters()[0];
- Assert.isNotNull(xPathExpression);
-
- Element retElement = curElement;
- if (srcElement != null) {
- XPath xPath = XPathFactory.newInstance().newXPath();
- try {
- Object resultObject = xPath.evaluate(xPathExpression, srcElement, XPathConstants.BOOLEAN);
- if (((Boolean)resultObject).booleanValue()) {
- retElement = executeChildOperations(srcElement, retElement);
- }
- } catch(XPathExpressionException xee) {
- //could not evaluate - return curElement
- }
- }
- return retElement;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/IterateOverElementsOperation.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/IterateOverElementsOperation.java
deleted file mode 100644
index cc4e8df..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/IterateOverElementsOperation.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal;
-
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathExpressionException;
-import javax.xml.xpath.XPathFactory;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * ITransformOperation implementation that executes child ITransformOperation
- * instances for each Element in the NodeList returned by the XPath expression,
- * which is evaluated against the source Element.
- *
- * <br><b>Note:</b> requires ITransformOperation.setTagConverterContext(...) to
- * have been called to provide a valid ITagConverterContext instance prior to
- * a call to the transform(...) method.
- *
- * @author Ian Trimble - Oracle
- */
-public class IterateOverElementsOperation extends AbstractTransformOperation {
-
- private String xPathExpression;
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal.provisional.AbstractTransformOperation#transform(org.w3c.dom.Element, org.w3c.dom.Element)
- */
- public Element transform(Element srcElement, Element curElement) {
- if (getParameters().length < 1) {
- getLog().error("Warning.TransformOperationFactory.TooFewParameters", getTransformOperationID()); //$NON-NLS-1$
- return null;
- }
-
- xPathExpression = getParameters()[0];
- Assert.isNotNull(xPathExpression);
-
- Element retElement = curElement;
- if (srcElement != null) {
- XPath xPath = XPathFactory.newInstance().newXPath();
- try {
- Object resultObject = xPath.evaluate(xPathExpression, srcElement, XPathConstants.NODESET);
- if (resultObject instanceof NodeList) {
- NodeList nodes = (NodeList)resultObject;
- for (int i = 0; i < nodes.getLength(); i++) {
- Node node = nodes.item(i);
- if (node instanceof Element) {
- retElement = executeChildOperations((Element)node, retElement);
- }
- }
- }
- } catch(XPathExpressionException xee) {
- //could not evaluate - return curElement
- }
- }
- return retElement;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/MakeParentElementCurrentOperation.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/MakeParentElementCurrentOperation.java
deleted file mode 100644
index b0e32af..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/MakeParentElementCurrentOperation.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal;
-
-import org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * ITransformOperation implementation that makes the current Element's parent
- * Element the new current Element.
- *
- * @author Ian Trimble - Oracle
- */
-public class MakeParentElementCurrentOperation extends AbstractTransformOperation {
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal.provisional.AbstractTransformOperation#transform(org.w3c.dom.Element, org.w3c.dom.Element)
- */
- public Element transform(Element srcElement, Element curElement) {
- Element resultElement = null;
- if (curElement != null) {
- Node parentNode = curElement.getParentNode();
- while (parentNode != null && parentNode.getNodeType() != Node.DOCUMENT_NODE) {
- if (parentNode.getNodeType() == Node.ELEMENT_NODE) {
- resultElement = (Element)parentNode;
- break;
- }
- parentNode = parentNode.getParentNode();
- }
- }
- return resultElement;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/RemoveAttributeOperation.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/RemoveAttributeOperation.java
deleted file mode 100644
index b217c6a..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/RemoveAttributeOperation.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation;
-import org.w3c.dom.Element;
-
-/**
- * ITransformOperation implementation that removes an attribute from the
- * current Element.
- *
- * @author Ian Trimble - Oracle
- */
-public class RemoveAttributeOperation extends AbstractTransformOperation {
-
- private String attributeName;
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal.provisional.AbstractTransformOperation#transform(org.w3c.dom.Element, org.w3c.dom.Element)
- */
- public Element transform(Element srcElement, Element curElement) {
- if (getParameters().length < 1) {
- getLog().error("Warning.TransformOperationFactory.TooFewParameters", getTransformOperationID()); //$NON-NLS-1$
- return null;
- }
-
- attributeName = getParameters()[0];
- Assert.isNotNull(attributeName);
-
- if (curElement != null) {
- curElement.removeAttribute(attributeName);
- }
- return curElement;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/RenameAttributeOperation.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/RenameAttributeOperation.java
deleted file mode 100644
index c924538..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/internal/RenameAttributeOperation.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Ian Trimble - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-
-/**
- * ITransformOperation implementation that renames an attribute of the current
- * Element.
- *
- * @author Ian Trimble - Oracle
- */
-public class RenameAttributeOperation extends AbstractTransformOperation {
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.dtmanager.converter.operations.internal.provisional.AbstractTransformOperation#transform(org.w3c.dom.Element, org.w3c.dom.Element)
- */
- public Element transform(Element srcElement, Element curElement) {
- if (getParameters().length < 2) {
- getLog().error("Warning.TransformOperationFactory.TooFewParameters", getTransformOperationID()); //$NON-NLS-1$
- return null;
- }
-
- String oldAttributeName = getParameters()[0];
- String newAttributeName = getParameters()[1];
- Assert.isNotNull(oldAttributeName);
- Assert.isNotNull(newAttributeName);
-
- if (curElement != null) {
- Attr oldAttribute = curElement.getAttributeNode(oldAttributeName);
- if (oldAttribute != null) {
- curElement.setAttribute(newAttributeName, oldAttribute.getValue());
- curElement.removeAttribute(oldAttributeName);
- }
- }
- return curElement;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/package-info.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/package-info.java
deleted file mode 100644
index 0b15e7d..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/operations/package-info.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-/**
- * Basic tag conversion operations.
- *
- * <p><b>Provisional API - subject to change</b></p>
- */
-package org.eclipse.jst.pagedesigner.dtmanager.converter.operations;
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/package-info.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/package-info.java
deleted file mode 100644
index dd15b1b..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/converter/package-info.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-/**
- * Meta-data driven tag converters.
- *
- * <p><b>Provisional API - subject to change</b></p>
- */
-package org.eclipse.jst.pagedesigner.dtmanager.converter;
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/DTInfo.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/DTInfo.java
deleted file mode 100644
index ca2ce46..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/DTInfo.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.jst.pagedesigner.dtmanager.dtinfo;
-
-import org.eclipse.emf.common.util.EList;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>DT Info</b></em>'.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfo#getTagConvertInfo <em>Tag Convert Info</em>}</li>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfo#getTagDecorateInfos <em>Tag Decorate Infos</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoPackage#getDTInfo()
- * @model
- * @generated
- */
-public interface DTInfo extends EObject {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * Returns the value of the '<em><b>Tag Convert Info</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Tag Convert Info</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Tag Convert Info</em>' containment reference.
- * @see #setTagConvertInfo(TagConvertInfo)
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoPackage#getDTInfo_TagConvertInfo()
- * @model containment="true" required="true"
- * extendedMetaData="kind='element' name='tag-convert-info'"
- * @generated
- */
- TagConvertInfo getTagConvertInfo();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfo#getTagConvertInfo <em>Tag Convert Info</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Tag Convert Info</em>' containment reference.
- * @see #getTagConvertInfo()
- * @generated
- */
- void setTagConvertInfo(TagConvertInfo value);
-
- /**
- * Returns the value of the '<em><b>Tag Decorate Infos</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Tag Decorate Infos</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Tag Decorate Infos</em>' containment reference list.
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoPackage#getDTInfo_TagDecorateInfos()
- * @model type="org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.provisional.TagDecorateInfo" containment="true"
- * extendedMetaData="kind='element' name='tag-decorate-info'"
- * @generated
- */
- EList getTagDecorateInfos();
-
-} // DTInfo
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/DTInfoFactory.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/DTInfoFactory.java
deleted file mode 100644
index 71f5b13..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/DTInfoFactory.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.jst.pagedesigner.dtmanager.dtinfo;
-
-import org.eclipse.emf.ecore.EFactory;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Factory</b> for the model.
- * It provides a create method for each non-abstract class of the model.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoPackage
- * @generated
- */
-public interface DTInfoFactory extends EFactory {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * The singleton instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- DTInfoFactory eINSTANCE = org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.DTInfoFactoryImpl.init();
-
- /**
- * Returns a new object of class '<em>DT Info</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>DT Info</em>'.
- * @generated
- */
- DTInfo createDTInfo();
-
- /**
- * Returns a new object of class '<em>Tag Convert Info</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Tag Convert Info</em>'.
- * @generated
- */
- TagConvertInfo createTagConvertInfo();
-
- /**
- * Returns a new object of class '<em>Operation</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Operation</em>'.
- * @generated
- */
- Operation createOperation();
-
- /**
- * Returns a new object of class '<em>Parameter</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Parameter</em>'.
- * @generated
- */
- Parameter createParameter();
-
- /**
- * Returns a new object of class '<em>Tag Decorate Info</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Tag Decorate Info</em>'.
- * @generated
- */
- TagDecorateInfo createTagDecorateInfo();
-
- /**
- * Returns a new object of class '<em>Resolve Attribute Value</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Resolve Attribute Value</em>'.
- * @generated
- */
- ResolveAttributeValue createResolveAttributeValue();
-
- /**
- * Returns the package supported by this factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the package supported by this factory.
- * @generated
- */
- DTInfoPackage getDTInfoPackage();
-
-} //DTInfoFactory
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/DTInfoPackage.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/DTInfoPackage.java
deleted file mode 100644
index 4aa55c6..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/DTInfoPackage.java
+++ /dev/null
@@ -1,892 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.jst.pagedesigner.dtmanager.dtinfo;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Package</b> for the model.
- * It contains accessors for the meta objects to represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoFactory
- * @model kind="package"
- * @generated
- */
-public interface DTInfoPackage extends EPackage {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * The package name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String eNAME = "dtinfo";
-
- /**
- * The package namespace URI.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String eNS_URI = "http://org.eclipse.jsf.pagedesigner/dtinfo.ecore";
-
- /**
- * The package namespace name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String eNS_PREFIX = "dti";
-
- /**
- * The singleton instance of the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- DTInfoPackage eINSTANCE = org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.DTInfoPackageImpl.init();
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.DTInfoImpl <em>DT Info</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.DTInfoImpl
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.DTInfoPackageImpl#getDTInfo()
- * @generated
- */
- int DT_INFO = 0;
-
- /**
- * The feature id for the '<em><b>Tag Convert Info</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int DT_INFO__TAG_CONVERT_INFO = 0;
-
- /**
- * The feature id for the '<em><b>Tag Decorate Infos</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int DT_INFO__TAG_DECORATE_INFOS = 1;
-
- /**
- * The number of structural features of the '<em>DT Info</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int DT_INFO_FEATURE_COUNT = 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.TagConvertInfoImpl <em>Tag Convert Info</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.TagConvertInfoImpl
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.DTInfoPackageImpl#getTagConvertInfo()
- * @generated
- */
- int TAG_CONVERT_INFO = 1;
-
- /**
- * The feature id for the '<em><b>Operations</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TAG_CONVERT_INFO__OPERATIONS = 0;
-
- /**
- * The number of structural features of the '<em>Tag Convert Info</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TAG_CONVERT_INFO_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.OperationImpl <em>Operation</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.OperationImpl
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.DTInfoPackageImpl#getOperation()
- * @generated
- */
- int OPERATION = 2;
-
- /**
- * The feature id for the '<em><b>Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int OPERATION__ID = 0;
-
- /**
- * The feature id for the '<em><b>Parameters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int OPERATION__PARAMETERS = 1;
-
- /**
- * The feature id for the '<em><b>Operations</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int OPERATION__OPERATIONS = 2;
-
- /**
- * The number of structural features of the '<em>Operation</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int OPERATION_FEATURE_COUNT = 3;
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.ParameterImpl <em>Parameter</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.ParameterImpl
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.DTInfoPackageImpl#getParameter()
- * @generated
- */
- int PARAMETER = 3;
-
- /**
- * The feature id for the '<em><b>Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int PARAMETER__VALUE = 0;
-
- /**
- * The number of structural features of the '<em>Parameter</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int PARAMETER_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.TagDecorateInfoImpl <em>Tag Decorate Info</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.TagDecorateInfoImpl
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.DTInfoPackageImpl#getTagDecorateInfo()
- * @generated
- */
- int TAG_DECORATE_INFO = 4;
-
- /**
- * The feature id for the '<em><b>Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TAG_DECORATE_INFO__ID = 0;
-
- /**
- * The feature id for the '<em><b>Min Height</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TAG_DECORATE_INFO__MIN_HEIGHT = 1;
-
- /**
- * The feature id for the '<em><b>Min Width</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TAG_DECORATE_INFO__MIN_WIDTH = 2;
-
- /**
- * The feature id for the '<em><b>Multi Level</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TAG_DECORATE_INFO__MULTI_LEVEL = 3;
-
- /**
- * The feature id for the '<em><b>Need Border Decorator</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TAG_DECORATE_INFO__NEED_BORDER_DECORATOR = 4;
-
- /**
- * The feature id for the '<em><b>Need Table Decorator</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TAG_DECORATE_INFO__NEED_TABLE_DECORATOR = 5;
-
- /**
- * The feature id for the '<em><b>Non Visual</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TAG_DECORATE_INFO__NON_VISUAL = 6;
-
- /**
- * The feature id for the '<em><b>Non Visual Image Path</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TAG_DECORATE_INFO__NON_VISUAL_IMAGE_PATH = 7;
-
- /**
- * The feature id for the '<em><b>Resolve Child Text</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TAG_DECORATE_INFO__RESOLVE_CHILD_TEXT = 8;
-
- /**
- * The feature id for the '<em><b>Resolve Attribute Value</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TAG_DECORATE_INFO__RESOLVE_ATTRIBUTE_VALUE = 9;
-
- /**
- * The feature id for the '<em><b>Set Non Visual Child Elements</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TAG_DECORATE_INFO__SET_NON_VISUAL_CHILD_ELEMENTS = 10;
-
- /**
- * The feature id for the '<em><b>Widget</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TAG_DECORATE_INFO__WIDGET = 11;
-
- /**
- * The number of structural features of the '<em>Tag Decorate Info</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TAG_DECORATE_INFO_FEATURE_COUNT = 12;
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.ResolveAttributeValueImpl <em>Resolve Attribute Value</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.ResolveAttributeValueImpl
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.DTInfoPackageImpl#getResolveAttributeValue()
- * @generated
- */
- int RESOLVE_ATTRIBUTE_VALUE = 5;
-
- /**
- * The feature id for the '<em><b>Attribute Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int RESOLVE_ATTRIBUTE_VALUE__ATTRIBUTE_NAME = 0;
-
- /**
- * The number of structural features of the '<em>Resolve Attribute Value</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int RESOLVE_ATTRIBUTE_VALUE_FEATURE_COUNT = 1;
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfo <em>DT Info</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>DT Info</em>'.
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfo
- * @generated
- */
- EClass getDTInfo();
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfo#getTagConvertInfo <em>Tag Convert Info</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Tag Convert Info</em>'.
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfo#getTagConvertInfo()
- * @see #getDTInfo()
- * @generated
- */
- EReference getDTInfo_TagConvertInfo();
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfo#getTagDecorateInfos <em>Tag Decorate Infos</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Tag Decorate Infos</em>'.
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfo#getTagDecorateInfos()
- * @see #getDTInfo()
- * @generated
- */
- EReference getDTInfo_TagDecorateInfos();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagConvertInfo <em>Tag Convert Info</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Tag Convert Info</em>'.
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagConvertInfo
- * @generated
- */
- EClass getTagConvertInfo();
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagConvertInfo#getOperations <em>Operations</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Operations</em>'.
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagConvertInfo#getOperations()
- * @see #getTagConvertInfo()
- * @generated
- */
- EReference getTagConvertInfo_Operations();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.Operation <em>Operation</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Operation</em>'.
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.Operation
- * @generated
- */
- EClass getOperation();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.Operation#getId <em>Id</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Id</em>'.
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.Operation#getId()
- * @see #getOperation()
- * @generated
- */
- EAttribute getOperation_Id();
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.Operation#getParameters <em>Parameters</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Parameters</em>'.
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.Operation#getParameters()
- * @see #getOperation()
- * @generated
- */
- EReference getOperation_Parameters();
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.Operation#getOperations <em>Operations</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Operations</em>'.
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.Operation#getOperations()
- * @see #getOperation()
- * @generated
- */
- EReference getOperation_Operations();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.Parameter <em>Parameter</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Parameter</em>'.
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.Parameter
- * @generated
- */
- EClass getParameter();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.Parameter#getValue <em>Value</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Value</em>'.
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.Parameter#getValue()
- * @see #getParameter()
- * @generated
- */
- EAttribute getParameter_Value();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo <em>Tag Decorate Info</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Tag Decorate Info</em>'.
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo
- * @generated
- */
- EClass getTagDecorateInfo();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#getId <em>Id</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Id</em>'.
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#getId()
- * @see #getTagDecorateInfo()
- * @generated
- */
- EAttribute getTagDecorateInfo_Id();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#getMinHeight <em>Min Height</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Min Height</em>'.
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#getMinHeight()
- * @see #getTagDecorateInfo()
- * @generated
- */
- EAttribute getTagDecorateInfo_MinHeight();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#getMinWidth <em>Min Width</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Min Width</em>'.
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#getMinWidth()
- * @see #getTagDecorateInfo()
- * @generated
- */
- EAttribute getTagDecorateInfo_MinWidth();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#isMultiLevel <em>Multi Level</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Multi Level</em>'.
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#isMultiLevel()
- * @see #getTagDecorateInfo()
- * @generated
- */
- EAttribute getTagDecorateInfo_MultiLevel();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#isNeedBorderDecorator <em>Need Border Decorator</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Need Border Decorator</em>'.
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#isNeedBorderDecorator()
- * @see #getTagDecorateInfo()
- * @generated
- */
- EAttribute getTagDecorateInfo_NeedBorderDecorator();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#isNeedTableDecorator <em>Need Table Decorator</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Need Table Decorator</em>'.
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#isNeedTableDecorator()
- * @see #getTagDecorateInfo()
- * @generated
- */
- EAttribute getTagDecorateInfo_NeedTableDecorator();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#isNonVisual <em>Non Visual</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Non Visual</em>'.
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#isNonVisual()
- * @see #getTagDecorateInfo()
- * @generated
- */
- EAttribute getTagDecorateInfo_NonVisual();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#getNonVisualImagePath <em>Non Visual Image Path</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Non Visual Image Path</em>'.
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#getNonVisualImagePath()
- * @see #getTagDecorateInfo()
- * @generated
- */
- EAttribute getTagDecorateInfo_NonVisualImagePath();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#isResolveChildText <em>Resolve Child Text</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Resolve Child Text</em>'.
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#isResolveChildText()
- * @see #getTagDecorateInfo()
- * @generated
- */
- EAttribute getTagDecorateInfo_ResolveChildText();
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#getResolveAttributeValue <em>Resolve Attribute Value</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Resolve Attribute Value</em>'.
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#getResolveAttributeValue()
- * @see #getTagDecorateInfo()
- * @generated
- */
- EReference getTagDecorateInfo_ResolveAttributeValue();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#isSetNonVisualChildElements <em>Set Non Visual Child Elements</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Set Non Visual Child Elements</em>'.
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#isSetNonVisualChildElements()
- * @see #getTagDecorateInfo()
- * @generated
- */
- EAttribute getTagDecorateInfo_SetNonVisualChildElements();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#isWidget <em>Widget</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Widget</em>'.
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#isWidget()
- * @see #getTagDecorateInfo()
- * @generated
- */
- EAttribute getTagDecorateInfo_Widget();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.ResolveAttributeValue <em>Resolve Attribute Value</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Resolve Attribute Value</em>'.
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.ResolveAttributeValue
- * @generated
- */
- EClass getResolveAttributeValue();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.ResolveAttributeValue#getAttributeName <em>Attribute Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Attribute Name</em>'.
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.ResolveAttributeValue#getAttributeName()
- * @see #getResolveAttributeValue()
- * @generated
- */
- EAttribute getResolveAttributeValue_AttributeName();
-
- /**
- * Returns the factory that creates the instances of the model.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the factory that creates the instances of the model.
- * @generated
- */
- DTInfoFactory getDTInfoFactory();
-
- /**
- * <!-- begin-user-doc -->
- * Defines literals for the meta objects that represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("hiding")
- interface Literals {
- /**
- * The meta object literal for the '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.DTInfoImpl <em>DT Info</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.DTInfoImpl
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.DTInfoPackageImpl#getDTInfo()
- * @generated
- */
- EClass DT_INFO = eINSTANCE.getDTInfo();
-
- /**
- * The meta object literal for the '<em><b>Tag Convert Info</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EReference DT_INFO__TAG_CONVERT_INFO = eINSTANCE.getDTInfo_TagConvertInfo();
-
- /**
- * The meta object literal for the '<em><b>Tag Decorate Infos</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EReference DT_INFO__TAG_DECORATE_INFOS = eINSTANCE.getDTInfo_TagDecorateInfos();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.TagConvertInfoImpl <em>Tag Convert Info</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.TagConvertInfoImpl
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.DTInfoPackageImpl#getTagConvertInfo()
- * @generated
- */
- EClass TAG_CONVERT_INFO = eINSTANCE.getTagConvertInfo();
-
- /**
- * The meta object literal for the '<em><b>Operations</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EReference TAG_CONVERT_INFO__OPERATIONS = eINSTANCE.getTagConvertInfo_Operations();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.OperationImpl <em>Operation</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.OperationImpl
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.DTInfoPackageImpl#getOperation()
- * @generated
- */
- EClass OPERATION = eINSTANCE.getOperation();
-
- /**
- * The meta object literal for the '<em><b>Id</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute OPERATION__ID = eINSTANCE.getOperation_Id();
-
- /**
- * The meta object literal for the '<em><b>Parameters</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EReference OPERATION__PARAMETERS = eINSTANCE.getOperation_Parameters();
-
- /**
- * The meta object literal for the '<em><b>Operations</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EReference OPERATION__OPERATIONS = eINSTANCE.getOperation_Operations();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.ParameterImpl <em>Parameter</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.ParameterImpl
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.DTInfoPackageImpl#getParameter()
- * @generated
- */
- EClass PARAMETER = eINSTANCE.getParameter();
-
- /**
- * The meta object literal for the '<em><b>Value</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute PARAMETER__VALUE = eINSTANCE.getParameter_Value();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.TagDecorateInfoImpl <em>Tag Decorate Info</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.TagDecorateInfoImpl
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.DTInfoPackageImpl#getTagDecorateInfo()
- * @generated
- */
- EClass TAG_DECORATE_INFO = eINSTANCE.getTagDecorateInfo();
-
- /**
- * The meta object literal for the '<em><b>Id</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute TAG_DECORATE_INFO__ID = eINSTANCE.getTagDecorateInfo_Id();
-
- /**
- * The meta object literal for the '<em><b>Min Height</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute TAG_DECORATE_INFO__MIN_HEIGHT = eINSTANCE.getTagDecorateInfo_MinHeight();
-
- /**
- * The meta object literal for the '<em><b>Min Width</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute TAG_DECORATE_INFO__MIN_WIDTH = eINSTANCE.getTagDecorateInfo_MinWidth();
-
- /**
- * The meta object literal for the '<em><b>Multi Level</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute TAG_DECORATE_INFO__MULTI_LEVEL = eINSTANCE.getTagDecorateInfo_MultiLevel();
-
- /**
- * The meta object literal for the '<em><b>Need Border Decorator</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute TAG_DECORATE_INFO__NEED_BORDER_DECORATOR = eINSTANCE.getTagDecorateInfo_NeedBorderDecorator();
-
- /**
- * The meta object literal for the '<em><b>Need Table Decorator</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute TAG_DECORATE_INFO__NEED_TABLE_DECORATOR = eINSTANCE.getTagDecorateInfo_NeedTableDecorator();
-
- /**
- * The meta object literal for the '<em><b>Non Visual</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute TAG_DECORATE_INFO__NON_VISUAL = eINSTANCE.getTagDecorateInfo_NonVisual();
-
- /**
- * The meta object literal for the '<em><b>Non Visual Image Path</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute TAG_DECORATE_INFO__NON_VISUAL_IMAGE_PATH = eINSTANCE.getTagDecorateInfo_NonVisualImagePath();
-
- /**
- * The meta object literal for the '<em><b>Resolve Child Text</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute TAG_DECORATE_INFO__RESOLVE_CHILD_TEXT = eINSTANCE.getTagDecorateInfo_ResolveChildText();
-
- /**
- * The meta object literal for the '<em><b>Resolve Attribute Value</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EReference TAG_DECORATE_INFO__RESOLVE_ATTRIBUTE_VALUE = eINSTANCE.getTagDecorateInfo_ResolveAttributeValue();
-
- /**
- * The meta object literal for the '<em><b>Set Non Visual Child Elements</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute TAG_DECORATE_INFO__SET_NON_VISUAL_CHILD_ELEMENTS = eINSTANCE.getTagDecorateInfo_SetNonVisualChildElements();
-
- /**
- * The meta object literal for the '<em><b>Widget</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute TAG_DECORATE_INFO__WIDGET = eINSTANCE.getTagDecorateInfo_Widget();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.ResolveAttributeValueImpl <em>Resolve Attribute Value</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.ResolveAttributeValueImpl
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.DTInfoPackageImpl#getResolveAttributeValue()
- * @generated
- */
- EClass RESOLVE_ATTRIBUTE_VALUE = eINSTANCE.getResolveAttributeValue();
-
- /**
- * The meta object literal for the '<em><b>Attribute Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute RESOLVE_ATTRIBUTE_VALUE__ATTRIBUTE_NAME = eINSTANCE.getResolveAttributeValue_AttributeName();
-
- }
-
-} //DTInfoPackage
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/Operation.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/Operation.java
deleted file mode 100644
index 5e9cd87..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/Operation.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.jst.pagedesigner.dtmanager.dtinfo;
-
-import org.eclipse.emf.common.util.EList;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Operation</b></em>'.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.Operation#getId <em>Id</em>}</li>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.Operation#getParameters <em>Parameters</em>}</li>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.Operation#getOperations <em>Operations</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoPackage#getOperation()
- * @model
- * @generated
- */
-public interface Operation extends EObject {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * Returns the value of the '<em><b>Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Id</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Id</em>' attribute.
- * @see #setId(String)
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoPackage#getOperation_Id()
- * @model id="true" required="true"
- * @generated
- */
- String getId();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.Operation#getId <em>Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Id</em>' attribute.
- * @see #getId()
- * @generated
- */
- void setId(String value);
-
- /**
- * Returns the value of the '<em><b>Parameters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.Parameter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Parameters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Parameters</em>' containment reference list.
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoPackage#getOperation_Parameters()
- * @model type="org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.provisional.Parameter" containment="true"
- * extendedMetaData="kind='element' name='parameter'"
- * @generated
- */
- EList getParameters();
-
- /**
- * Returns the value of the '<em><b>Operations</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.Operation}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Operations</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Operations</em>' containment reference list.
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoPackage#getOperation_Operations()
- * @model type="org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.provisional.Operation" containment="true"
- * extendedMetaData="kind='element' name='operation'"
- * @generated
- */
- EList getOperations();
-
-} // Operation
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/Parameter.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/Parameter.java
deleted file mode 100644
index b396a2a..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/Parameter.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.jst.pagedesigner.dtmanager.dtinfo;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Parameter</b></em>'.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.Parameter#getValue <em>Value</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoPackage#getParameter()
- * @model
- * @generated
- */
-public interface Parameter extends EObject {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * Returns the value of the '<em><b>Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Value</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Value</em>' attribute.
- * @see #setValue(String)
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoPackage#getParameter_Value()
- * @model required="true"
- * @generated
- */
- String getValue();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.Parameter#getValue <em>Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Value</em>' attribute.
- * @see #getValue()
- * @generated
- */
- void setValue(String value);
-
-} // Parameter
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/ResolveAttributeValue.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/ResolveAttributeValue.java
deleted file mode 100644
index 6ed698f..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/ResolveAttributeValue.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.jst.pagedesigner.dtmanager.dtinfo;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Resolve Attribute Value</b></em>'.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.ResolveAttributeValue#getAttributeName <em>Attribute Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoPackage#getResolveAttributeValue()
- * @model
- * @generated
- */
-public interface ResolveAttributeValue extends EObject {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * Returns the value of the '<em><b>Attribute Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Name</em>' attribute.
- * @see #setAttributeName(String)
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoPackage#getResolveAttributeValue_AttributeName()
- * @model required="true"
- * @generated
- */
- String getAttributeName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.ResolveAttributeValue#getAttributeName <em>Attribute Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attribute Name</em>' attribute.
- * @see #getAttributeName()
- * @generated
- */
- void setAttributeName(String value);
-
-} // ResolveAttributeValue
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/TagConvertInfo.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/TagConvertInfo.java
deleted file mode 100644
index 7ef7c07..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/TagConvertInfo.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.jst.pagedesigner.dtmanager.dtinfo;
-
-import org.eclipse.emf.common.util.EList;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Tag Convert Info</b></em>'.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagConvertInfo#getOperations <em>Operations</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoPackage#getTagConvertInfo()
- * @model
- * @generated
- */
-public interface TagConvertInfo extends EObject {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * Returns the value of the '<em><b>Operations</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.Operation}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Operations</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Operations</em>' containment reference list.
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoPackage#getTagConvertInfo_Operations()
- * @model type="org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.provisional.Operation" containment="true"
- * extendedMetaData="kind='element' name='operation'"
- * @generated
- */
- EList getOperations();
-
-} // TagConvertInfo
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/TagDecorateInfo.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/TagDecorateInfo.java
deleted file mode 100644
index 67d9b8d..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/TagDecorateInfo.java
+++ /dev/null
@@ -1,369 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.jst.pagedesigner.dtmanager.dtinfo;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Tag Decorate Info</b></em>'.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#getId <em>Id</em>}</li>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#getMinHeight <em>Min Height</em>}</li>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#getMinWidth <em>Min Width</em>}</li>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#isMultiLevel <em>Multi Level</em>}</li>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#isNeedBorderDecorator <em>Need Border Decorator</em>}</li>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#isNeedTableDecorator <em>Need Table Decorator</em>}</li>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#isNonVisual <em>Non Visual</em>}</li>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#getNonVisualImagePath <em>Non Visual Image Path</em>}</li>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#isResolveChildText <em>Resolve Child Text</em>}</li>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#getResolveAttributeValue <em>Resolve Attribute Value</em>}</li>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#isSetNonVisualChildElements <em>Set Non Visual Child Elements</em>}</li>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#isWidget <em>Widget</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoPackage#getTagDecorateInfo()
- * @model
- * @generated
- */
-public interface TagDecorateInfo extends EObject {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * Returns the value of the '<em><b>Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Id</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Id</em>' attribute.
- * @see #setId(String)
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoPackage#getTagDecorateInfo_Id()
- * @model id="true" required="true"
- * @generated
- */
- String getId();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#getId <em>Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Id</em>' attribute.
- * @see #getId()
- * @generated
- */
- void setId(String value);
-
- /**
- * Returns the value of the '<em><b>Min Height</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Min Height</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Min Height</em>' attribute.
- * @see #setMinHeight(int)
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoPackage#getTagDecorateInfo_MinHeight()
- * @model
- * @generated
- */
- int getMinHeight();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#getMinHeight <em>Min Height</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Min Height</em>' attribute.
- * @see #getMinHeight()
- * @generated
- */
- void setMinHeight(int value);
-
- /**
- * Returns the value of the '<em><b>Min Width</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Min Width</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Min Width</em>' attribute.
- * @see #setMinWidth(int)
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoPackage#getTagDecorateInfo_MinWidth()
- * @model
- * @generated
- */
- int getMinWidth();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#getMinWidth <em>Min Width</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Min Width</em>' attribute.
- * @see #getMinWidth()
- * @generated
- */
- void setMinWidth(int value);
-
- /**
- * Returns the value of the '<em><b>Multi Level</b></em>' attribute.
- * The default value is <code>"false"</code>.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Multi Level</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Multi Level</em>' attribute.
- * @see #setMultiLevel(boolean)
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoPackage#getTagDecorateInfo_MultiLevel()
- * @model default="false"
- * @generated
- */
- boolean isMultiLevel();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#isMultiLevel <em>Multi Level</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Multi Level</em>' attribute.
- * @see #isMultiLevel()
- * @generated
- */
- void setMultiLevel(boolean value);
-
- /**
- * Returns the value of the '<em><b>Need Border Decorator</b></em>' attribute.
- * The default value is <code>"false"</code>.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Need Border Decorator</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Need Border Decorator</em>' attribute.
- * @see #setNeedBorderDecorator(boolean)
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoPackage#getTagDecorateInfo_NeedBorderDecorator()
- * @model default="false"
- * @generated
- */
- boolean isNeedBorderDecorator();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#isNeedBorderDecorator <em>Need Border Decorator</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Need Border Decorator</em>' attribute.
- * @see #isNeedBorderDecorator()
- * @generated
- */
- void setNeedBorderDecorator(boolean value);
-
- /**
- * Returns the value of the '<em><b>Need Table Decorator</b></em>' attribute.
- * The default value is <code>"false"</code>.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Need Table Decorator</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Need Table Decorator</em>' attribute.
- * @see #setNeedTableDecorator(boolean)
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoPackage#getTagDecorateInfo_NeedTableDecorator()
- * @model default="false"
- * @generated
- */
- boolean isNeedTableDecorator();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#isNeedTableDecorator <em>Need Table Decorator</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Need Table Decorator</em>' attribute.
- * @see #isNeedTableDecorator()
- * @generated
- */
- void setNeedTableDecorator(boolean value);
-
- /**
- * Returns the value of the '<em><b>Non Visual</b></em>' attribute.
- * The default value is <code>"false"</code>.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Non Visual</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Non Visual</em>' attribute.
- * @see #setNonVisual(boolean)
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoPackage#getTagDecorateInfo_NonVisual()
- * @model default="false"
- * @generated
- */
- boolean isNonVisual();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#isNonVisual <em>Non Visual</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Non Visual</em>' attribute.
- * @see #isNonVisual()
- * @generated
- */
- void setNonVisual(boolean value);
-
- /**
- * Returns the value of the '<em><b>Non Visual Image Path</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Non Visual Image Path</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Non Visual Image Path</em>' attribute.
- * @see #setNonVisualImagePath(String)
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoPackage#getTagDecorateInfo_NonVisualImagePath()
- * @model
- * @generated
- */
- String getNonVisualImagePath();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#getNonVisualImagePath <em>Non Visual Image Path</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Non Visual Image Path</em>' attribute.
- * @see #getNonVisualImagePath()
- * @generated
- */
- void setNonVisualImagePath(String value);
-
- /**
- * Returns the value of the '<em><b>Resolve Child Text</b></em>' attribute.
- * The default value is <code>"false"</code>.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Resolve Child Text</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Resolve Child Text</em>' attribute.
- * @see #setResolveChildText(boolean)
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoPackage#getTagDecorateInfo_ResolveChildText()
- * @model default="false"
- * @generated
- */
- boolean isResolveChildText();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#isResolveChildText <em>Resolve Child Text</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Resolve Child Text</em>' attribute.
- * @see #isResolveChildText()
- * @generated
- */
- void setResolveChildText(boolean value);
-
- /**
- * Returns the value of the '<em><b>Resolve Attribute Value</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Resolve Attribute Value</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Resolve Attribute Value</em>' containment reference.
- * @see #setResolveAttributeValue(ResolveAttributeValue)
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoPackage#getTagDecorateInfo_ResolveAttributeValue()
- * @model containment="true"
- * extendedMetaData="kind='element' name='resolve-attribute-value'"
- * @generated
- */
- ResolveAttributeValue getResolveAttributeValue();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#getResolveAttributeValue <em>Resolve Attribute Value</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Resolve Attribute Value</em>' containment reference.
- * @see #getResolveAttributeValue()
- * @generated
- */
- void setResolveAttributeValue(ResolveAttributeValue value);
-
- /**
- * Returns the value of the '<em><b>Set Non Visual Child Elements</b></em>' attribute.
- * The default value is <code>"false"</code>.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Set Non Visual Child Elements</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Set Non Visual Child Elements</em>' attribute.
- * @see #setSetNonVisualChildElements(boolean)
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoPackage#getTagDecorateInfo_SetNonVisualChildElements()
- * @model default="false"
- * @generated
- */
- boolean isSetNonVisualChildElements();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#isSetNonVisualChildElements <em>Set Non Visual Child Elements</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Set Non Visual Child Elements</em>' attribute.
- * @see #isSetNonVisualChildElements()
- * @generated
- */
- void setSetNonVisualChildElements(boolean value);
-
- /**
- * Returns the value of the '<em><b>Widget</b></em>' attribute.
- * The default value is <code>"false"</code>.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Widget</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Widget</em>' attribute.
- * @see #setWidget(boolean)
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoPackage#getTagDecorateInfo_Widget()
- * @model default="false"
- * @generated
- */
- boolean isWidget();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo#isWidget <em>Widget</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Widget</em>' attribute.
- * @see #isWidget()
- * @generated
- */
- void setWidget(boolean value);
-
-} // TagDecorateInfo
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/internal/impl/DTInfoFactoryImpl.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/internal/impl/DTInfoFactoryImpl.java
deleted file mode 100644
index b5be005..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/internal/impl/DTInfoFactoryImpl.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-
-import org.eclipse.emf.ecore.impl.EFactoryImpl;
-
-import org.eclipse.emf.ecore.plugin.EcorePlugin;
-
-import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.*;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model <b>Factory</b>.
- * <!-- end-user-doc -->
- * @generated
- */
-public class DTInfoFactoryImpl extends EFactoryImpl implements DTInfoFactory {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * Creates the default factory implementation.
- * <!-- begin-user-doc -->
- * @return the factory
- * <!-- end-user-doc -->
- * @generated
- */
- public static DTInfoFactory init() {
- try {
- DTInfoFactory theDTInfoFactory = (DTInfoFactory)EPackage.Registry.INSTANCE.getEFactory("http://org.eclipse.jsf.pagedesigner/dtinfo.ecore");
- if (theDTInfoFactory != null) {
- return theDTInfoFactory;
- }
- }
- catch (Exception exception) {
- EcorePlugin.INSTANCE.log(exception);
- }
- return new DTInfoFactoryImpl();
- }
-
- /**
- * Creates an instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public DTInfoFactoryImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EObject create(EClass eClass) {
- switch (eClass.getClassifierID()) {
- case DTInfoPackage.DT_INFO: return createDTInfo();
- case DTInfoPackage.TAG_CONVERT_INFO: return createTagConvertInfo();
- case DTInfoPackage.OPERATION: return createOperation();
- case DTInfoPackage.PARAMETER: return createParameter();
- case DTInfoPackage.TAG_DECORATE_INFO: return createTagDecorateInfo();
- case DTInfoPackage.RESOLVE_ATTRIBUTE_VALUE: return createResolveAttributeValue();
- default:
- throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public DTInfo createDTInfo() {
- DTInfoImpl dtInfo = new DTInfoImpl();
- return dtInfo;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public TagConvertInfo createTagConvertInfo() {
- TagConvertInfoImpl tagConvertInfo = new TagConvertInfoImpl();
- return tagConvertInfo;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Operation createOperation() {
- OperationImpl operation = new OperationImpl();
- return operation;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Parameter createParameter() {
- ParameterImpl parameter = new ParameterImpl();
- return parameter;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public TagDecorateInfo createTagDecorateInfo() {
- TagDecorateInfoImpl tagDecorateInfo = new TagDecorateInfoImpl();
- return tagDecorateInfo;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public ResolveAttributeValue createResolveAttributeValue() {
- ResolveAttributeValueImpl resolveAttributeValue = new ResolveAttributeValueImpl();
- return resolveAttributeValue;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public DTInfoPackage getDTInfoPackage() {
- return (DTInfoPackage)getEPackage();
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the package
- * <!-- end-user-doc -->
- * @deprecated
- * @generated
- */
- public static DTInfoPackage getPackage() {
- return DTInfoPackage.eINSTANCE;
- }
-
-} //DTInfoFactoryImpl
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/internal/impl/DTInfoImpl.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/internal/impl/DTInfoImpl.java
deleted file mode 100644
index 8676928..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/internal/impl/DTInfoImpl.java
+++ /dev/null
@@ -1,228 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl;
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-
-import org.eclipse.emf.common.util.EList;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-
-import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfo;
-import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoPackage;
-import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagConvertInfo;
-import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>DT Info</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.DTInfoImpl#getTagConvertInfo <em>Tag Convert Info</em>}</li>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.DTInfoImpl#getTagDecorateInfos <em>Tag Decorate Infos</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class DTInfoImpl extends EObjectImpl implements DTInfo {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * The cached value of the '{@link #getTagConvertInfo() <em>Tag Convert Info</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTagConvertInfo()
- * @generated
- * @ordered
- */
- protected TagConvertInfo tagConvertInfo;
-
- /**
- * The cached value of the '{@link #getTagDecorateInfos() <em>Tag Decorate Infos</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTagDecorateInfos()
- * @generated
- * @ordered
- */
- protected EList tagDecorateInfos;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected DTInfoImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EClass eStaticClass() {
- return DTInfoPackage.Literals.DT_INFO;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public TagConvertInfo getTagConvertInfo() {
- return tagConvertInfo;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @param newTagConvertInfo
- * @param msgs
- * @return the notification chaing
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetTagConvertInfo(TagConvertInfo newTagConvertInfo, NotificationChain msgs) {
- TagConvertInfo oldTagConvertInfo = tagConvertInfo;
- tagConvertInfo = newTagConvertInfo;
- if (eNotificationRequired()) {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DTInfoPackage.DT_INFO__TAG_CONVERT_INFO, oldTagConvertInfo, newTagConvertInfo);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setTagConvertInfo(TagConvertInfo newTagConvertInfo) {
- if (newTagConvertInfo != tagConvertInfo) {
- NotificationChain msgs = null;
- if (tagConvertInfo != null)
- msgs = ((InternalEObject)tagConvertInfo).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DTInfoPackage.DT_INFO__TAG_CONVERT_INFO, null, msgs);
- if (newTagConvertInfo != null)
- msgs = ((InternalEObject)newTagConvertInfo).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DTInfoPackage.DT_INFO__TAG_CONVERT_INFO, null, msgs);
- msgs = basicSetTagConvertInfo(newTagConvertInfo, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTInfoPackage.DT_INFO__TAG_CONVERT_INFO, newTagConvertInfo, newTagConvertInfo));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EList getTagDecorateInfos() {
- if (tagDecorateInfos == null) {
- tagDecorateInfos = new EObjectContainmentEList(TagDecorateInfo.class, this, DTInfoPackage.DT_INFO__TAG_DECORATE_INFOS);
- }
- return tagDecorateInfos;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case DTInfoPackage.DT_INFO__TAG_CONVERT_INFO:
- return basicSetTagConvertInfo(null, msgs);
- case DTInfoPackage.DT_INFO__TAG_DECORATE_INFOS:
- return ((InternalEList)getTagDecorateInfos()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case DTInfoPackage.DT_INFO__TAG_CONVERT_INFO:
- return getTagConvertInfo();
- case DTInfoPackage.DT_INFO__TAG_DECORATE_INFOS:
- return getTagDecorateInfos();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case DTInfoPackage.DT_INFO__TAG_CONVERT_INFO:
- setTagConvertInfo((TagConvertInfo)newValue);
- return;
- case DTInfoPackage.DT_INFO__TAG_DECORATE_INFOS:
- getTagDecorateInfos().clear();
- getTagDecorateInfos().addAll((Collection)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eUnset(int featureID) {
- switch (featureID) {
- case DTInfoPackage.DT_INFO__TAG_CONVERT_INFO:
- setTagConvertInfo((TagConvertInfo)null);
- return;
- case DTInfoPackage.DT_INFO__TAG_DECORATE_INFOS:
- getTagDecorateInfos().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case DTInfoPackage.DT_INFO__TAG_CONVERT_INFO:
- return tagConvertInfo != null;
- case DTInfoPackage.DT_INFO__TAG_DECORATE_INFOS:
- return tagDecorateInfos != null && !tagDecorateInfos.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
-} //DTInfoImpl
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/internal/impl/DTInfoPackageImpl.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/internal/impl/DTInfoPackageImpl.java
deleted file mode 100644
index b6bf2b7..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/internal/impl/DTInfoPackageImpl.java
+++ /dev/null
@@ -1,563 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-
-import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfo;
-import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoFactory;
-import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoPackage;
-import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.Operation;
-import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.Parameter;
-import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.ResolveAttributeValue;
-import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagConvertInfo;
-import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model <b>Package</b>.
- * <!-- end-user-doc -->
- * @generated
- */
-public class DTInfoPackageImpl extends EPackageImpl implements DTInfoPackage {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass dtInfoEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass tagConvertInfoEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass operationEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass parameterEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass tagDecorateInfoEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass resolveAttributeValueEClass = null;
-
- /**
- * Creates an instance of the model <b>Package</b>, registered with
- * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
- * package URI value.
- * <p>Note: the correct way to create the package is via the static
- * factory method {@link #init init()}, which also performs
- * initialization of the package, or returns the registered package,
- * if one already exists.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.emf.ecore.EPackage.Registry
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoPackage#eNS_URI
- * @see #init()
- * @generated
- */
- private DTInfoPackageImpl() {
- super(eNS_URI, DTInfoFactory.eINSTANCE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static boolean isInited = false;
-
- /**
- * Creates, registers, and initializes the <b>Package</b> for this
- * model, and for any others upon which it depends. Simple
- * dependencies are satisfied by calling this method on all
- * dependent packages before doing anything else. This method drives
- * initialization for interdependent packages directly, in parallel
- * with this package, itself.
- * <p>Of this package and its interdependencies, all packages which
- * have not yet been registered by their URI values are first created
- * and registered. The packages are then initialized in two steps:
- * meta-model objects for all of the packages are created before any
- * are initialized, since one package's meta-model objects may refer to
- * those of another.
- * <p>Invocation of this method will not affect any packages that have
- * already been initialized.
- * <!-- begin-user-doc -->
- * @return the package
- * <!-- end-user-doc -->
- * @see #eNS_URI
- * @see #createPackageContents()
- * @see #initializePackageContents()
- * @generated
- */
- public static DTInfoPackage init() {
- if (isInited) return (DTInfoPackage)EPackage.Registry.INSTANCE.getEPackage(DTInfoPackage.eNS_URI);
-
- // Obtain or create and register package
- DTInfoPackageImpl theDTInfoPackage = (DTInfoPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof DTInfoPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new DTInfoPackageImpl());
-
- isInited = true;
-
- // Create package meta-data objects
- theDTInfoPackage.createPackageContents();
-
- // Initialize created meta-data
- theDTInfoPackage.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- theDTInfoPackage.freeze();
-
- return theDTInfoPackage;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getDTInfo() {
- return dtInfoEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EReference getDTInfo_TagConvertInfo() {
- return (EReference)dtInfoEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EReference getDTInfo_TagDecorateInfos() {
- return (EReference)dtInfoEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getTagConvertInfo() {
- return tagConvertInfoEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EReference getTagConvertInfo_Operations() {
- return (EReference)tagConvertInfoEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getOperation() {
- return operationEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getOperation_Id() {
- return (EAttribute)operationEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EReference getOperation_Parameters() {
- return (EReference)operationEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EReference getOperation_Operations() {
- return (EReference)operationEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getParameter() {
- return parameterEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getParameter_Value() {
- return (EAttribute)parameterEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getTagDecorateInfo() {
- return tagDecorateInfoEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getTagDecorateInfo_Id() {
- return (EAttribute)tagDecorateInfoEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getTagDecorateInfo_MinHeight() {
- return (EAttribute)tagDecorateInfoEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getTagDecorateInfo_MinWidth() {
- return (EAttribute)tagDecorateInfoEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getTagDecorateInfo_MultiLevel() {
- return (EAttribute)tagDecorateInfoEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getTagDecorateInfo_NeedBorderDecorator() {
- return (EAttribute)tagDecorateInfoEClass.getEStructuralFeatures().get(4);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getTagDecorateInfo_NeedTableDecorator() {
- return (EAttribute)tagDecorateInfoEClass.getEStructuralFeatures().get(5);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getTagDecorateInfo_NonVisual() {
- return (EAttribute)tagDecorateInfoEClass.getEStructuralFeatures().get(6);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getTagDecorateInfo_NonVisualImagePath() {
- return (EAttribute)tagDecorateInfoEClass.getEStructuralFeatures().get(7);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getTagDecorateInfo_ResolveChildText() {
- return (EAttribute)tagDecorateInfoEClass.getEStructuralFeatures().get(8);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EReference getTagDecorateInfo_ResolveAttributeValue() {
- return (EReference)tagDecorateInfoEClass.getEStructuralFeatures().get(9);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getTagDecorateInfo_SetNonVisualChildElements() {
- return (EAttribute)tagDecorateInfoEClass.getEStructuralFeatures().get(10);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getTagDecorateInfo_Widget() {
- return (EAttribute)tagDecorateInfoEClass.getEStructuralFeatures().get(11);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getResolveAttributeValue() {
- return resolveAttributeValueEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getResolveAttributeValue_AttributeName() {
- return (EAttribute)resolveAttributeValueEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public DTInfoFactory getDTInfoFactory() {
- return (DTInfoFactory)getEFactoryInstance();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isCreated = false;
-
- /**
- * Creates the meta-model objects for the package. This method is
- * guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void createPackageContents() {
- if (isCreated) return;
- isCreated = true;
-
- // Create classes and their features
- dtInfoEClass = createEClass(DT_INFO);
- createEReference(dtInfoEClass, DT_INFO__TAG_CONVERT_INFO);
- createEReference(dtInfoEClass, DT_INFO__TAG_DECORATE_INFOS);
-
- tagConvertInfoEClass = createEClass(TAG_CONVERT_INFO);
- createEReference(tagConvertInfoEClass, TAG_CONVERT_INFO__OPERATIONS);
-
- operationEClass = createEClass(OPERATION);
- createEAttribute(operationEClass, OPERATION__ID);
- createEReference(operationEClass, OPERATION__PARAMETERS);
- createEReference(operationEClass, OPERATION__OPERATIONS);
-
- parameterEClass = createEClass(PARAMETER);
- createEAttribute(parameterEClass, PARAMETER__VALUE);
-
- tagDecorateInfoEClass = createEClass(TAG_DECORATE_INFO);
- createEAttribute(tagDecorateInfoEClass, TAG_DECORATE_INFO__ID);
- createEAttribute(tagDecorateInfoEClass, TAG_DECORATE_INFO__MIN_HEIGHT);
- createEAttribute(tagDecorateInfoEClass, TAG_DECORATE_INFO__MIN_WIDTH);
- createEAttribute(tagDecorateInfoEClass, TAG_DECORATE_INFO__MULTI_LEVEL);
- createEAttribute(tagDecorateInfoEClass, TAG_DECORATE_INFO__NEED_BORDER_DECORATOR);
- createEAttribute(tagDecorateInfoEClass, TAG_DECORATE_INFO__NEED_TABLE_DECORATOR);
- createEAttribute(tagDecorateInfoEClass, TAG_DECORATE_INFO__NON_VISUAL);
- createEAttribute(tagDecorateInfoEClass, TAG_DECORATE_INFO__NON_VISUAL_IMAGE_PATH);
- createEAttribute(tagDecorateInfoEClass, TAG_DECORATE_INFO__RESOLVE_CHILD_TEXT);
- createEReference(tagDecorateInfoEClass, TAG_DECORATE_INFO__RESOLVE_ATTRIBUTE_VALUE);
- createEAttribute(tagDecorateInfoEClass, TAG_DECORATE_INFO__SET_NON_VISUAL_CHILD_ELEMENTS);
- createEAttribute(tagDecorateInfoEClass, TAG_DECORATE_INFO__WIDGET);
-
- resolveAttributeValueEClass = createEClass(RESOLVE_ATTRIBUTE_VALUE);
- createEAttribute(resolveAttributeValueEClass, RESOLVE_ATTRIBUTE_VALUE__ATTRIBUTE_NAME);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isInitialized = false;
-
- /**
- * Complete the initialization of the package and its meta-model. This
- * method is guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void initializePackageContents() {
- if (isInitialized) return;
- isInitialized = true;
-
- // Initialize package
- setName(eNAME);
- setNsPrefix(eNS_PREFIX);
- setNsURI(eNS_URI);
-
- // Add supertypes to classes
-
- // Initialize classes and features; add operations and parameters
- initEClass(dtInfoEClass, DTInfo.class, "DTInfo", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getDTInfo_TagConvertInfo(), this.getTagConvertInfo(), null, "tagConvertInfo", null, 1, 1, DTInfo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getDTInfo_TagDecorateInfos(), this.getTagDecorateInfo(), null, "tagDecorateInfos", null, 0, -1, DTInfo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(tagConvertInfoEClass, TagConvertInfo.class, "TagConvertInfo", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getTagConvertInfo_Operations(), this.getOperation(), null, "operations", null, 0, -1, TagConvertInfo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(operationEClass, Operation.class, "Operation", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getOperation_Id(), ecorePackage.getEString(), "id", null, 1, 1, Operation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getOperation_Parameters(), this.getParameter(), null, "parameters", null, 0, -1, Operation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getOperation_Operations(), this.getOperation(), null, "operations", null, 0, -1, Operation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(parameterEClass, Parameter.class, "Parameter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getParameter_Value(), ecorePackage.getEString(), "value", null, 1, 1, Parameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(tagDecorateInfoEClass, TagDecorateInfo.class, "TagDecorateInfo", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getTagDecorateInfo_Id(), ecorePackage.getEString(), "id", null, 1, 1, TagDecorateInfo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getTagDecorateInfo_MinHeight(), ecorePackage.getEInt(), "minHeight", null, 0, 1, TagDecorateInfo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getTagDecorateInfo_MinWidth(), ecorePackage.getEInt(), "minWidth", null, 0, 1, TagDecorateInfo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getTagDecorateInfo_MultiLevel(), ecorePackage.getEBoolean(), "multiLevel", "false", 0, 1, TagDecorateInfo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getTagDecorateInfo_NeedBorderDecorator(), ecorePackage.getEBoolean(), "needBorderDecorator", "false", 0, 1, TagDecorateInfo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getTagDecorateInfo_NeedTableDecorator(), ecorePackage.getEBoolean(), "needTableDecorator", "false", 0, 1, TagDecorateInfo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getTagDecorateInfo_NonVisual(), ecorePackage.getEBoolean(), "nonVisual", "false", 0, 1, TagDecorateInfo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getTagDecorateInfo_NonVisualImagePath(), ecorePackage.getEString(), "nonVisualImagePath", null, 0, 1, TagDecorateInfo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getTagDecorateInfo_ResolveChildText(), ecorePackage.getEBoolean(), "resolveChildText", "false", 0, 1, TagDecorateInfo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getTagDecorateInfo_ResolveAttributeValue(), this.getResolveAttributeValue(), null, "resolveAttributeValue", null, 0, 1, TagDecorateInfo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getTagDecorateInfo_SetNonVisualChildElements(), ecorePackage.getEBoolean(), "setNonVisualChildElements", "false", 0, 1, TagDecorateInfo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getTagDecorateInfo_Widget(), ecorePackage.getEBoolean(), "widget", "false", 0, 1, TagDecorateInfo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(resolveAttributeValueEClass, ResolveAttributeValue.class, "ResolveAttributeValue", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getResolveAttributeValue_AttributeName(), ecorePackage.getEString(), "attributeName", null, 1, 1, ResolveAttributeValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- // Create resource
- createResource(eNS_URI);
-
- // Create annotations
- // http:///org/eclipse/emf/ecore/util/ExtendedMetaData
- createExtendedMetaDataAnnotations();
- }
-
- /**
- * Initializes the annotations for <b>http:///org/eclipse/emf/ecore/util/ExtendedMetaData</b>.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected void createExtendedMetaDataAnnotations() {
- String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData";
- addAnnotation
- (getDTInfo_TagConvertInfo(),
- source,
- new String[] {
- "kind", "element",
- "name", "tag-convert-info"
- });
- addAnnotation
- (getDTInfo_TagDecorateInfos(),
- source,
- new String[] {
- "kind", "element",
- "name", "tag-decorate-info"
- });
- addAnnotation
- (getTagConvertInfo_Operations(),
- source,
- new String[] {
- "kind", "element",
- "name", "operation"
- });
- addAnnotation
- (getOperation_Parameters(),
- source,
- new String[] {
- "kind", "element",
- "name", "parameter"
- });
- addAnnotation
- (getOperation_Operations(),
- source,
- new String[] {
- "kind", "element",
- "name", "operation"
- });
- addAnnotation
- (getTagDecorateInfo_ResolveAttributeValue(),
- source,
- new String[] {
- "kind", "element",
- "name", "resolve-attribute-value"
- });
- }
-
-} //DTInfoPackageImpl
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/internal/impl/OperationImpl.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/internal/impl/OperationImpl.java
deleted file mode 100644
index 5ae2756..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/internal/impl/OperationImpl.java
+++ /dev/null
@@ -1,261 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl;
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-
-import org.eclipse.emf.common.util.EList;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-
-import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoPackage;
-import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.Operation;
-import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.Parameter;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Operation</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.OperationImpl#getId <em>Id</em>}</li>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.OperationImpl#getParameters <em>Parameters</em>}</li>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.OperationImpl#getOperations <em>Operations</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class OperationImpl extends EObjectImpl implements Operation {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * The default value of the '{@link #getId() <em>Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getId()
- * @generated
- * @ordered
- */
- protected static final String ID_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getId() <em>Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getId()
- * @generated
- * @ordered
- */
- protected String id = ID_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getParameters() <em>Parameters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getParameters()
- * @generated
- * @ordered
- */
- protected EList parameters;
-
- /**
- * The cached value of the '{@link #getOperations() <em>Operations</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getOperations()
- * @generated
- * @ordered
- */
- protected EList operations;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected OperationImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EClass eStaticClass() {
- return DTInfoPackage.Literals.OPERATION;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getId() {
- return id;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setId(String newId) {
- String oldId = id;
- id = newId;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTInfoPackage.OPERATION__ID, oldId, id));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EList getParameters() {
- if (parameters == null) {
- parameters = new EObjectContainmentEList(Parameter.class, this, DTInfoPackage.OPERATION__PARAMETERS);
- }
- return parameters;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EList getOperations() {
- if (operations == null) {
- operations = new EObjectContainmentEList(Operation.class, this, DTInfoPackage.OPERATION__OPERATIONS);
- }
- return operations;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case DTInfoPackage.OPERATION__PARAMETERS:
- return ((InternalEList)getParameters()).basicRemove(otherEnd, msgs);
- case DTInfoPackage.OPERATION__OPERATIONS:
- return ((InternalEList)getOperations()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case DTInfoPackage.OPERATION__ID:
- return getId();
- case DTInfoPackage.OPERATION__PARAMETERS:
- return getParameters();
- case DTInfoPackage.OPERATION__OPERATIONS:
- return getOperations();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case DTInfoPackage.OPERATION__ID:
- setId((String)newValue);
- return;
- case DTInfoPackage.OPERATION__PARAMETERS:
- getParameters().clear();
- getParameters().addAll((Collection)newValue);
- return;
- case DTInfoPackage.OPERATION__OPERATIONS:
- getOperations().clear();
- getOperations().addAll((Collection)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eUnset(int featureID) {
- switch (featureID) {
- case DTInfoPackage.OPERATION__ID:
- setId(ID_EDEFAULT);
- return;
- case DTInfoPackage.OPERATION__PARAMETERS:
- getParameters().clear();
- return;
- case DTInfoPackage.OPERATION__OPERATIONS:
- getOperations().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case DTInfoPackage.OPERATION__ID:
- return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
- case DTInfoPackage.OPERATION__PARAMETERS:
- return parameters != null && !parameters.isEmpty();
- case DTInfoPackage.OPERATION__OPERATIONS:
- return operations != null && !operations.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String toString() {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (id: ");
- result.append(id);
- result.append(')');
- return result.toString();
- }
-
-} //OperationImpl
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/internal/impl/ParameterImpl.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/internal/impl/ParameterImpl.java
deleted file mode 100644
index 7d9dbe9..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/internal/impl/ParameterImpl.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-
-import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoPackage;
-import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.Parameter;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Parameter</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.ParameterImpl#getValue <em>Value</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class ParameterImpl extends EObjectImpl implements Parameter {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * The default value of the '{@link #getValue() <em>Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValue()
- * @generated
- * @ordered
- */
- protected static final String VALUE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getValue() <em>Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValue()
- * @generated
- * @ordered
- */
- protected String value = VALUE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected ParameterImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EClass eStaticClass() {
- return DTInfoPackage.Literals.PARAMETER;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getValue() {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setValue(String newValue) {
- String oldValue = value;
- value = newValue;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTInfoPackage.PARAMETER__VALUE, oldValue, value));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case DTInfoPackage.PARAMETER__VALUE:
- return getValue();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case DTInfoPackage.PARAMETER__VALUE:
- setValue((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eUnset(int featureID) {
- switch (featureID) {
- case DTInfoPackage.PARAMETER__VALUE:
- setValue(VALUE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case DTInfoPackage.PARAMETER__VALUE:
- return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String toString() {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (value: ");
- result.append(value);
- result.append(')');
- return result.toString();
- }
-
-} //ParameterImpl
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/internal/impl/ResolveAttributeValueImpl.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/internal/impl/ResolveAttributeValueImpl.java
deleted file mode 100644
index 186ca38..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/internal/impl/ResolveAttributeValueImpl.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-
-import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoPackage;
-import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.ResolveAttributeValue;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Resolve Attribute Value</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.ResolveAttributeValueImpl#getAttributeName <em>Attribute Name</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class ResolveAttributeValueImpl extends EObjectImpl implements ResolveAttributeValue {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * The default value of the '{@link #getAttributeName() <em>Attribute Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeName()
- * @generated
- * @ordered
- */
- protected static final String ATTRIBUTE_NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAttributeName() <em>Attribute Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeName()
- * @generated
- * @ordered
- */
- protected String attributeName = ATTRIBUTE_NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected ResolveAttributeValueImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EClass eStaticClass() {
- return DTInfoPackage.Literals.RESOLVE_ATTRIBUTE_VALUE;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getAttributeName() {
- return attributeName;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setAttributeName(String newAttributeName) {
- String oldAttributeName = attributeName;
- attributeName = newAttributeName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTInfoPackage.RESOLVE_ATTRIBUTE_VALUE__ATTRIBUTE_NAME, oldAttributeName, attributeName));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case DTInfoPackage.RESOLVE_ATTRIBUTE_VALUE__ATTRIBUTE_NAME:
- return getAttributeName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case DTInfoPackage.RESOLVE_ATTRIBUTE_VALUE__ATTRIBUTE_NAME:
- setAttributeName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eUnset(int featureID) {
- switch (featureID) {
- case DTInfoPackage.RESOLVE_ATTRIBUTE_VALUE__ATTRIBUTE_NAME:
- setAttributeName(ATTRIBUTE_NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case DTInfoPackage.RESOLVE_ATTRIBUTE_VALUE__ATTRIBUTE_NAME:
- return ATTRIBUTE_NAME_EDEFAULT == null ? attributeName != null : !ATTRIBUTE_NAME_EDEFAULT.equals(attributeName);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String toString() {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (attributeName: ");
- result.append(attributeName);
- result.append(')');
- return result.toString();
- }
-
-} //ResolveAttributeValueImpl
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/internal/impl/TagConvertInfoImpl.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/internal/impl/TagConvertInfoImpl.java
deleted file mode 100644
index f6f9e4a..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/internal/impl/TagConvertInfoImpl.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl;
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoPackage;
-import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.Operation;
-import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagConvertInfo;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Tag Convert Info</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.TagConvertInfoImpl#getOperations <em>Operations</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class TagConvertInfoImpl extends EObjectImpl implements TagConvertInfo {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * The cached value of the '{@link #getOperations() <em>Operations</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getOperations()
- * @generated
- * @ordered
- */
- protected EList operations;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected TagConvertInfoImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EClass eStaticClass() {
- return DTInfoPackage.Literals.TAG_CONVERT_INFO;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EList getOperations() {
- if (operations == null) {
- operations = new EObjectContainmentEList(Operation.class, this, DTInfoPackage.TAG_CONVERT_INFO__OPERATIONS);
- }
- return operations;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case DTInfoPackage.TAG_CONVERT_INFO__OPERATIONS:
- return ((InternalEList)getOperations()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case DTInfoPackage.TAG_CONVERT_INFO__OPERATIONS:
- return getOperations();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case DTInfoPackage.TAG_CONVERT_INFO__OPERATIONS:
- getOperations().clear();
- getOperations().addAll((Collection)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eUnset(int featureID) {
- switch (featureID) {
- case DTInfoPackage.TAG_CONVERT_INFO__OPERATIONS:
- getOperations().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case DTInfoPackage.TAG_CONVERT_INFO__OPERATIONS:
- return operations != null && !operations.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
-} //TagConvertInfoImpl
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/internal/impl/TagDecorateInfoImpl.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/internal/impl/TagDecorateInfoImpl.java
deleted file mode 100644
index 33eee8f..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/internal/impl/TagDecorateInfoImpl.java
+++ /dev/null
@@ -1,791 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-
-import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoPackage;
-import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.ResolveAttributeValue;
-import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Tag Decorate Info</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.TagDecorateInfoImpl#getId <em>Id</em>}</li>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.TagDecorateInfoImpl#getMinHeight <em>Min Height</em>}</li>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.TagDecorateInfoImpl#getMinWidth <em>Min Width</em>}</li>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.TagDecorateInfoImpl#isMultiLevel <em>Multi Level</em>}</li>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.TagDecorateInfoImpl#isNeedBorderDecorator <em>Need Border Decorator</em>}</li>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.TagDecorateInfoImpl#isNeedTableDecorator <em>Need Table Decorator</em>}</li>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.TagDecorateInfoImpl#isNonVisual <em>Non Visual</em>}</li>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.TagDecorateInfoImpl#getNonVisualImagePath <em>Non Visual Image Path</em>}</li>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.TagDecorateInfoImpl#isResolveChildText <em>Resolve Child Text</em>}</li>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.TagDecorateInfoImpl#getResolveAttributeValue <em>Resolve Attribute Value</em>}</li>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.TagDecorateInfoImpl#isSetNonVisualChildElements <em>Set Non Visual Child Elements</em>}</li>
- * <li>{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.impl.TagDecorateInfoImpl#isWidget <em>Widget</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class TagDecorateInfoImpl extends EObjectImpl implements TagDecorateInfo {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * The default value of the '{@link #getId() <em>Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getId()
- * @generated
- * @ordered
- */
- protected static final String ID_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getId() <em>Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getId()
- * @generated
- * @ordered
- */
- protected String id = ID_EDEFAULT;
-
- /**
- * The default value of the '{@link #getMinHeight() <em>Min Height</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMinHeight()
- * @generated
- * @ordered
- */
- protected static final int MIN_HEIGHT_EDEFAULT = 0;
-
- /**
- * The cached value of the '{@link #getMinHeight() <em>Min Height</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMinHeight()
- * @generated
- * @ordered
- */
- protected int minHeight = MIN_HEIGHT_EDEFAULT;
-
- /**
- * The default value of the '{@link #getMinWidth() <em>Min Width</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMinWidth()
- * @generated
- * @ordered
- */
- protected static final int MIN_WIDTH_EDEFAULT = 0;
-
- /**
- * The cached value of the '{@link #getMinWidth() <em>Min Width</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMinWidth()
- * @generated
- * @ordered
- */
- protected int minWidth = MIN_WIDTH_EDEFAULT;
-
- /**
- * The default value of the '{@link #isMultiLevel() <em>Multi Level</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isMultiLevel()
- * @generated
- * @ordered
- */
- protected static final boolean MULTI_LEVEL_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isMultiLevel() <em>Multi Level</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isMultiLevel()
- * @generated
- * @ordered
- */
- protected boolean multiLevel = MULTI_LEVEL_EDEFAULT;
-
- /**
- * The default value of the '{@link #isNeedBorderDecorator() <em>Need Border Decorator</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isNeedBorderDecorator()
- * @generated
- * @ordered
- */
- protected static final boolean NEED_BORDER_DECORATOR_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isNeedBorderDecorator() <em>Need Border Decorator</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isNeedBorderDecorator()
- * @generated
- * @ordered
- */
- protected boolean needBorderDecorator = NEED_BORDER_DECORATOR_EDEFAULT;
-
- /**
- * The default value of the '{@link #isNeedTableDecorator() <em>Need Table Decorator</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isNeedTableDecorator()
- * @generated
- * @ordered
- */
- protected static final boolean NEED_TABLE_DECORATOR_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isNeedTableDecorator() <em>Need Table Decorator</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isNeedTableDecorator()
- * @generated
- * @ordered
- */
- protected boolean needTableDecorator = NEED_TABLE_DECORATOR_EDEFAULT;
-
- /**
- * The default value of the '{@link #isNonVisual() <em>Non Visual</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isNonVisual()
- * @generated
- * @ordered
- */
- protected static final boolean NON_VISUAL_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isNonVisual() <em>Non Visual</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isNonVisual()
- * @generated
- * @ordered
- */
- protected boolean nonVisual = NON_VISUAL_EDEFAULT;
-
- /**
- * The default value of the '{@link #getNonVisualImagePath() <em>Non Visual Image Path</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNonVisualImagePath()
- * @generated
- * @ordered
- */
- protected static final String NON_VISUAL_IMAGE_PATH_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getNonVisualImagePath() <em>Non Visual Image Path</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNonVisualImagePath()
- * @generated
- * @ordered
- */
- protected String nonVisualImagePath = NON_VISUAL_IMAGE_PATH_EDEFAULT;
-
- /**
- * The default value of the '{@link #isResolveChildText() <em>Resolve Child Text</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isResolveChildText()
- * @generated
- * @ordered
- */
- protected static final boolean RESOLVE_CHILD_TEXT_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isResolveChildText() <em>Resolve Child Text</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isResolveChildText()
- * @generated
- * @ordered
- */
- protected boolean resolveChildText = RESOLVE_CHILD_TEXT_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getResolveAttributeValue() <em>Resolve Attribute Value</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getResolveAttributeValue()
- * @generated
- * @ordered
- */
- protected ResolveAttributeValue resolveAttributeValue;
-
- /**
- * The default value of the '{@link #isSetNonVisualChildElements() <em>Set Non Visual Child Elements</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isSetNonVisualChildElements()
- * @generated
- * @ordered
- */
- protected static final boolean SET_NON_VISUAL_CHILD_ELEMENTS_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isSetNonVisualChildElements() <em>Set Non Visual Child Elements</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isSetNonVisualChildElements()
- * @generated
- * @ordered
- */
- protected boolean setNonVisualChildElements = SET_NON_VISUAL_CHILD_ELEMENTS_EDEFAULT;
-
- /**
- * The default value of the '{@link #isWidget() <em>Widget</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isWidget()
- * @generated
- * @ordered
- */
- protected static final boolean WIDGET_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isWidget() <em>Widget</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isWidget()
- * @generated
- * @ordered
- */
- protected boolean widget = WIDGET_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected TagDecorateInfoImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EClass eStaticClass() {
- return DTInfoPackage.Literals.TAG_DECORATE_INFO;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getId() {
- return id;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setId(String newId) {
- String oldId = id;
- id = newId;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTInfoPackage.TAG_DECORATE_INFO__ID, oldId, id));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getMinHeight() {
- return minHeight;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setMinHeight(int newMinHeight) {
- int oldMinHeight = minHeight;
- minHeight = newMinHeight;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTInfoPackage.TAG_DECORATE_INFO__MIN_HEIGHT, oldMinHeight, minHeight));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getMinWidth() {
- return minWidth;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setMinWidth(int newMinWidth) {
- int oldMinWidth = minWidth;
- minWidth = newMinWidth;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTInfoPackage.TAG_DECORATE_INFO__MIN_WIDTH, oldMinWidth, minWidth));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean isMultiLevel() {
- return multiLevel;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setMultiLevel(boolean newMultiLevel) {
- boolean oldMultiLevel = multiLevel;
- multiLevel = newMultiLevel;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTInfoPackage.TAG_DECORATE_INFO__MULTI_LEVEL, oldMultiLevel, multiLevel));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean isNeedBorderDecorator() {
- return needBorderDecorator;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setNeedBorderDecorator(boolean newNeedBorderDecorator) {
- boolean oldNeedBorderDecorator = needBorderDecorator;
- needBorderDecorator = newNeedBorderDecorator;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTInfoPackage.TAG_DECORATE_INFO__NEED_BORDER_DECORATOR, oldNeedBorderDecorator, needBorderDecorator));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean isNeedTableDecorator() {
- return needTableDecorator;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setNeedTableDecorator(boolean newNeedTableDecorator) {
- boolean oldNeedTableDecorator = needTableDecorator;
- needTableDecorator = newNeedTableDecorator;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTInfoPackage.TAG_DECORATE_INFO__NEED_TABLE_DECORATOR, oldNeedTableDecorator, needTableDecorator));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean isNonVisual() {
- return nonVisual;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setNonVisual(boolean newNonVisual) {
- boolean oldNonVisual = nonVisual;
- nonVisual = newNonVisual;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTInfoPackage.TAG_DECORATE_INFO__NON_VISUAL, oldNonVisual, nonVisual));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getNonVisualImagePath() {
- return nonVisualImagePath;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setNonVisualImagePath(String newNonVisualImagePath) {
- String oldNonVisualImagePath = nonVisualImagePath;
- nonVisualImagePath = newNonVisualImagePath;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTInfoPackage.TAG_DECORATE_INFO__NON_VISUAL_IMAGE_PATH, oldNonVisualImagePath, nonVisualImagePath));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean isResolveChildText() {
- return resolveChildText;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setResolveChildText(boolean newResolveChildText) {
- boolean oldResolveChildText = resolveChildText;
- resolveChildText = newResolveChildText;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTInfoPackage.TAG_DECORATE_INFO__RESOLVE_CHILD_TEXT, oldResolveChildText, resolveChildText));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public ResolveAttributeValue getResolveAttributeValue() {
- return resolveAttributeValue;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @param newResolveAttributeValue
- * @param msgs
- * @return the notification chain
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetResolveAttributeValue(ResolveAttributeValue newResolveAttributeValue, NotificationChain msgs) {
- ResolveAttributeValue oldResolveAttributeValue = resolveAttributeValue;
- resolveAttributeValue = newResolveAttributeValue;
- if (eNotificationRequired()) {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DTInfoPackage.TAG_DECORATE_INFO__RESOLVE_ATTRIBUTE_VALUE, oldResolveAttributeValue, newResolveAttributeValue);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setResolveAttributeValue(ResolveAttributeValue newResolveAttributeValue) {
- if (newResolveAttributeValue != resolveAttributeValue) {
- NotificationChain msgs = null;
- if (resolveAttributeValue != null)
- msgs = ((InternalEObject)resolveAttributeValue).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DTInfoPackage.TAG_DECORATE_INFO__RESOLVE_ATTRIBUTE_VALUE, null, msgs);
- if (newResolveAttributeValue != null)
- msgs = ((InternalEObject)newResolveAttributeValue).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DTInfoPackage.TAG_DECORATE_INFO__RESOLVE_ATTRIBUTE_VALUE, null, msgs);
- msgs = basicSetResolveAttributeValue(newResolveAttributeValue, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTInfoPackage.TAG_DECORATE_INFO__RESOLVE_ATTRIBUTE_VALUE, newResolveAttributeValue, newResolveAttributeValue));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean isSetNonVisualChildElements() {
- return setNonVisualChildElements;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setSetNonVisualChildElements(boolean newSetNonVisualChildElements) {
- boolean oldSetNonVisualChildElements = setNonVisualChildElements;
- setNonVisualChildElements = newSetNonVisualChildElements;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTInfoPackage.TAG_DECORATE_INFO__SET_NON_VISUAL_CHILD_ELEMENTS, oldSetNonVisualChildElements, setNonVisualChildElements));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean isWidget() {
- return widget;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setWidget(boolean newWidget) {
- boolean oldWidget = widget;
- widget = newWidget;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DTInfoPackage.TAG_DECORATE_INFO__WIDGET, oldWidget, widget));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case DTInfoPackage.TAG_DECORATE_INFO__RESOLVE_ATTRIBUTE_VALUE:
- return basicSetResolveAttributeValue(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case DTInfoPackage.TAG_DECORATE_INFO__ID:
- return getId();
- case DTInfoPackage.TAG_DECORATE_INFO__MIN_HEIGHT:
- return new Integer(getMinHeight());
- case DTInfoPackage.TAG_DECORATE_INFO__MIN_WIDTH:
- return new Integer(getMinWidth());
- case DTInfoPackage.TAG_DECORATE_INFO__MULTI_LEVEL:
- return isMultiLevel() ? Boolean.TRUE : Boolean.FALSE;
- case DTInfoPackage.TAG_DECORATE_INFO__NEED_BORDER_DECORATOR:
- return isNeedBorderDecorator() ? Boolean.TRUE : Boolean.FALSE;
- case DTInfoPackage.TAG_DECORATE_INFO__NEED_TABLE_DECORATOR:
- return isNeedTableDecorator() ? Boolean.TRUE : Boolean.FALSE;
- case DTInfoPackage.TAG_DECORATE_INFO__NON_VISUAL:
- return isNonVisual() ? Boolean.TRUE : Boolean.FALSE;
- case DTInfoPackage.TAG_DECORATE_INFO__NON_VISUAL_IMAGE_PATH:
- return getNonVisualImagePath();
- case DTInfoPackage.TAG_DECORATE_INFO__RESOLVE_CHILD_TEXT:
- return isResolveChildText() ? Boolean.TRUE : Boolean.FALSE;
- case DTInfoPackage.TAG_DECORATE_INFO__RESOLVE_ATTRIBUTE_VALUE:
- return getResolveAttributeValue();
- case DTInfoPackage.TAG_DECORATE_INFO__SET_NON_VISUAL_CHILD_ELEMENTS:
- return isSetNonVisualChildElements() ? Boolean.TRUE : Boolean.FALSE;
- case DTInfoPackage.TAG_DECORATE_INFO__WIDGET:
- return isWidget() ? Boolean.TRUE : Boolean.FALSE;
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case DTInfoPackage.TAG_DECORATE_INFO__ID:
- setId((String)newValue);
- return;
- case DTInfoPackage.TAG_DECORATE_INFO__MIN_HEIGHT:
- setMinHeight(((Integer)newValue).intValue());
- return;
- case DTInfoPackage.TAG_DECORATE_INFO__MIN_WIDTH:
- setMinWidth(((Integer)newValue).intValue());
- return;
- case DTInfoPackage.TAG_DECORATE_INFO__MULTI_LEVEL:
- setMultiLevel(((Boolean)newValue).booleanValue());
- return;
- case DTInfoPackage.TAG_DECORATE_INFO__NEED_BORDER_DECORATOR:
- setNeedBorderDecorator(((Boolean)newValue).booleanValue());
- return;
- case DTInfoPackage.TAG_DECORATE_INFO__NEED_TABLE_DECORATOR:
- setNeedTableDecorator(((Boolean)newValue).booleanValue());
- return;
- case DTInfoPackage.TAG_DECORATE_INFO__NON_VISUAL:
- setNonVisual(((Boolean)newValue).booleanValue());
- return;
- case DTInfoPackage.TAG_DECORATE_INFO__NON_VISUAL_IMAGE_PATH:
- setNonVisualImagePath((String)newValue);
- return;
- case DTInfoPackage.TAG_DECORATE_INFO__RESOLVE_CHILD_TEXT:
- setResolveChildText(((Boolean)newValue).booleanValue());
- return;
- case DTInfoPackage.TAG_DECORATE_INFO__RESOLVE_ATTRIBUTE_VALUE:
- setResolveAttributeValue((ResolveAttributeValue)newValue);
- return;
- case DTInfoPackage.TAG_DECORATE_INFO__SET_NON_VISUAL_CHILD_ELEMENTS:
- setSetNonVisualChildElements(((Boolean)newValue).booleanValue());
- return;
- case DTInfoPackage.TAG_DECORATE_INFO__WIDGET:
- setWidget(((Boolean)newValue).booleanValue());
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eUnset(int featureID) {
- switch (featureID) {
- case DTInfoPackage.TAG_DECORATE_INFO__ID:
- setId(ID_EDEFAULT);
- return;
- case DTInfoPackage.TAG_DECORATE_INFO__MIN_HEIGHT:
- setMinHeight(MIN_HEIGHT_EDEFAULT);
- return;
- case DTInfoPackage.TAG_DECORATE_INFO__MIN_WIDTH:
- setMinWidth(MIN_WIDTH_EDEFAULT);
- return;
- case DTInfoPackage.TAG_DECORATE_INFO__MULTI_LEVEL:
- setMultiLevel(MULTI_LEVEL_EDEFAULT);
- return;
- case DTInfoPackage.TAG_DECORATE_INFO__NEED_BORDER_DECORATOR:
- setNeedBorderDecorator(NEED_BORDER_DECORATOR_EDEFAULT);
- return;
- case DTInfoPackage.TAG_DECORATE_INFO__NEED_TABLE_DECORATOR:
- setNeedTableDecorator(NEED_TABLE_DECORATOR_EDEFAULT);
- return;
- case DTInfoPackage.TAG_DECORATE_INFO__NON_VISUAL:
- setNonVisual(NON_VISUAL_EDEFAULT);
- return;
- case DTInfoPackage.TAG_DECORATE_INFO__NON_VISUAL_IMAGE_PATH:
- setNonVisualImagePath(NON_VISUAL_IMAGE_PATH_EDEFAULT);
- return;
- case DTInfoPackage.TAG_DECORATE_INFO__RESOLVE_CHILD_TEXT:
- setResolveChildText(RESOLVE_CHILD_TEXT_EDEFAULT);
- return;
- case DTInfoPackage.TAG_DECORATE_INFO__RESOLVE_ATTRIBUTE_VALUE:
- setResolveAttributeValue((ResolveAttributeValue)null);
- return;
- case DTInfoPackage.TAG_DECORATE_INFO__SET_NON_VISUAL_CHILD_ELEMENTS:
- setSetNonVisualChildElements(SET_NON_VISUAL_CHILD_ELEMENTS_EDEFAULT);
- return;
- case DTInfoPackage.TAG_DECORATE_INFO__WIDGET:
- setWidget(WIDGET_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case DTInfoPackage.TAG_DECORATE_INFO__ID:
- return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
- case DTInfoPackage.TAG_DECORATE_INFO__MIN_HEIGHT:
- return minHeight != MIN_HEIGHT_EDEFAULT;
- case DTInfoPackage.TAG_DECORATE_INFO__MIN_WIDTH:
- return minWidth != MIN_WIDTH_EDEFAULT;
- case DTInfoPackage.TAG_DECORATE_INFO__MULTI_LEVEL:
- return multiLevel != MULTI_LEVEL_EDEFAULT;
- case DTInfoPackage.TAG_DECORATE_INFO__NEED_BORDER_DECORATOR:
- return needBorderDecorator != NEED_BORDER_DECORATOR_EDEFAULT;
- case DTInfoPackage.TAG_DECORATE_INFO__NEED_TABLE_DECORATOR:
- return needTableDecorator != NEED_TABLE_DECORATOR_EDEFAULT;
- case DTInfoPackage.TAG_DECORATE_INFO__NON_VISUAL:
- return nonVisual != NON_VISUAL_EDEFAULT;
- case DTInfoPackage.TAG_DECORATE_INFO__NON_VISUAL_IMAGE_PATH:
- return NON_VISUAL_IMAGE_PATH_EDEFAULT == null ? nonVisualImagePath != null : !NON_VISUAL_IMAGE_PATH_EDEFAULT.equals(nonVisualImagePath);
- case DTInfoPackage.TAG_DECORATE_INFO__RESOLVE_CHILD_TEXT:
- return resolveChildText != RESOLVE_CHILD_TEXT_EDEFAULT;
- case DTInfoPackage.TAG_DECORATE_INFO__RESOLVE_ATTRIBUTE_VALUE:
- return resolveAttributeValue != null;
- case DTInfoPackage.TAG_DECORATE_INFO__SET_NON_VISUAL_CHILD_ELEMENTS:
- return setNonVisualChildElements != SET_NON_VISUAL_CHILD_ELEMENTS_EDEFAULT;
- case DTInfoPackage.TAG_DECORATE_INFO__WIDGET:
- return widget != WIDGET_EDEFAULT;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String toString() {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (id: ");
- result.append(id);
- result.append(", minHeight: ");
- result.append(minHeight);
- result.append(", minWidth: ");
- result.append(minWidth);
- result.append(", multiLevel: ");
- result.append(multiLevel);
- result.append(", needBorderDecorator: ");
- result.append(needBorderDecorator);
- result.append(", needTableDecorator: ");
- result.append(needTableDecorator);
- result.append(", nonVisual: ");
- result.append(nonVisual);
- result.append(", nonVisualImagePath: ");
- result.append(nonVisualImagePath);
- result.append(", resolveChildText: ");
- result.append(resolveChildText);
- result.append(", setNonVisualChildElements: ");
- result.append(setNonVisualChildElements);
- result.append(", widget: ");
- result.append(widget);
- result.append(')');
- return result.toString();
- }
-
-} //TagDecorateInfoImpl
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/internal/util/DTInfoAdapterFactory.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/internal/util/DTInfoAdapterFactory.java
deleted file mode 100644
index fc18398..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/internal/util/DTInfoAdapterFactory.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.util;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-
-import org.eclipse.emf.ecore.EObject;
-
-import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.*;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Adapter Factory</b> for the model.
- * It provides an adapter <code>createXXX</code> method for each class of the model.
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoPackage
- * @generated
- */
-public class DTInfoAdapterFactory extends AdapterFactoryImpl {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * The cached model package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected static DTInfoPackage modelPackage;
-
- /**
- * Creates an instance of the adapter factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public DTInfoAdapterFactory() {
- if (modelPackage == null) {
- modelPackage = DTInfoPackage.eINSTANCE;
- }
- }
-
- /**
- * Returns whether this factory is applicable for the type of the object.
- * <!-- begin-user-doc -->
- * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
- * <!-- end-user-doc -->
- * @return whether this factory is applicable for the type of the object.
- * @generated
- */
- public boolean isFactoryForType(Object object) {
- if (object == modelPackage) {
- return true;
- }
- if (object instanceof EObject) {
- return ((EObject)object).eClass().getEPackage() == modelPackage;
- }
- return false;
- }
-
- /**
- * The switch the delegates to the <code>createXXX</code> methods.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected DTInfoSwitch modelSwitch =
- new DTInfoSwitch() {
- public Object caseDTInfo(DTInfo object) {
- return createDTInfoAdapter();
- }
- public Object caseTagConvertInfo(TagConvertInfo object) {
- return createTagConvertInfoAdapter();
- }
- public Object caseOperation(Operation object) {
- return createOperationAdapter();
- }
- public Object caseParameter(Parameter object) {
- return createParameterAdapter();
- }
- public Object caseTagDecorateInfo(TagDecorateInfo object) {
- return createTagDecorateInfoAdapter();
- }
- public Object caseResolveAttributeValue(ResolveAttributeValue object) {
- return createResolveAttributeValueAdapter();
- }
- public Object defaultCase(EObject object) {
- return createEObjectAdapter();
- }
- };
-
- /**
- * Creates an adapter for the <code>target</code>.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param target the object to adapt.
- * @return the adapter for the <code>target</code>.
- * @generated
- */
- public Adapter createAdapter(Notifier target) {
- return (Adapter)modelSwitch.doSwitch((EObject)target);
- }
-
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfo <em>DT Info</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfo
- * @generated
- */
- public Adapter createDTInfoAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagConvertInfo <em>Tag Convert Info</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagConvertInfo
- * @generated
- */
- public Adapter createTagConvertInfoAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.Operation <em>Operation</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.Operation
- * @generated
- */
- public Adapter createOperationAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.Parameter <em>Parameter</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.Parameter
- * @generated
- */
- public Adapter createParameterAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo <em>Tag Decorate Info</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.TagDecorateInfo
- * @generated
- */
- public Adapter createTagDecorateInfoAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.jst.pagedesigner.dtmanager.dtinfo.ResolveAttributeValue <em>Resolve Attribute Value</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.ResolveAttributeValue
- * @generated
- */
- public Adapter createResolveAttributeValueAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for the default case.
- * <!-- begin-user-doc -->
- * This default implementation returns null.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @generated
- */
- public Adapter createEObjectAdapter() {
- return null;
- }
-
-} //DTInfoAdapterFactory
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/internal/util/DTInfoSwitch.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/internal/util/DTInfoSwitch.java
deleted file mode 100644
index 6f178c8..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/internal/util/DTInfoSwitch.java
+++ /dev/null
@@ -1,245 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.jst.pagedesigner.dtmanager.dtinfo.internal.util;
-
-import java.util.List;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-
-import org.eclipse.jst.pagedesigner.dtmanager.dtinfo.*;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Switch</b> for the model's inheritance hierarchy.
- * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
- * to invoke the <code>caseXXX</code> method for each class of the model,
- * starting with the actual class of the object
- * and proceeding up the inheritance hierarchy
- * until a non-null result is returned,
- * which is the result of the switch.
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.pagedesigner.dtmanager.dtinfo.DTInfoPackage
- * @generated
- */
-public class DTInfoSwitch {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * The cached model package
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected static DTInfoPackage modelPackage;
-
- /**
- * Creates an instance of the switch.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public DTInfoSwitch() {
- if (modelPackage == null) {
- modelPackage = DTInfoPackage.eINSTANCE;
- }
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc -->
- * @param theEObject
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * <!-- end-user-doc -->
- * @generated
- */
- public Object doSwitch(EObject theEObject) {
- return doSwitch(theEObject.eClass(), theEObject);
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc -->
- * @param theEClass
- * @param theEObject
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * <!-- end-user-doc -->
- * @generated
- */
- protected Object doSwitch(EClass theEClass, EObject theEObject) {
- if (theEClass.eContainer() == modelPackage) {
- return doSwitch(theEClass.getClassifierID(), theEObject);
- }
- List eSuperTypes = theEClass.getESuperTypes();
- return
- eSuperTypes.isEmpty() ?
- defaultCase(theEObject) :
- doSwitch((EClass)eSuperTypes.get(0), theEObject);
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc -->
- * @param classifierID
- * @param theEObject
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * <!-- end-user-doc -->
- * @generated
- */
- protected Object doSwitch(int classifierID, EObject theEObject) {
- switch (classifierID) {
- case DTInfoPackage.DT_INFO: {
- DTInfo dtInfo = (DTInfo)theEObject;
- Object result = caseDTInfo(dtInfo);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case DTInfoPackage.TAG_CONVERT_INFO: {
- TagConvertInfo tagConvertInfo = (TagConvertInfo)theEObject;
- Object result = caseTagConvertInfo(tagConvertInfo);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case DTInfoPackage.OPERATION: {
- Operation operation = (Operation)theEObject;
- Object result = caseOperation(operation);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case DTInfoPackage.PARAMETER: {
- Parameter parameter = (Parameter)theEObject;
- Object result = caseParameter(parameter);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case DTInfoPackage.TAG_DECORATE_INFO: {
- TagDecorateInfo tagDecorateInfo = (TagDecorateInfo)theEObject;
- Object result = caseTagDecorateInfo(tagDecorateInfo);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case DTInfoPackage.RESOLVE_ATTRIBUTE_VALUE: {
- ResolveAttributeValue resolveAttributeValue = (ResolveAttributeValue)theEObject;
- Object result = caseResolveAttributeValue(resolveAttributeValue);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- default: return defaultCase(theEObject);
- }
- }
-
- /**
- * Returns the result of interpretting the object as an instance of '<em>DT Info</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpretting the object as an instance of '<em>DT Info</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public Object caseDTInfo(DTInfo object) {
- return null;
- }
-
- /**
- * Returns the result of interpretting the object as an instance of '<em>Tag Convert Info</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpretting the object as an instance of '<em>Tag Convert Info</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public Object caseTagConvertInfo(TagConvertInfo object) {
- return null;
- }
-
- /**
- * Returns the result of interpretting the object as an instance of '<em>Operation</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpretting the object as an instance of '<em>Operation</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public Object caseOperation(Operation object) {
- return null;
- }
-
- /**
- * Returns the result of interpretting the object as an instance of '<em>Parameter</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpretting the object as an instance of '<em>Parameter</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public Object caseParameter(Parameter object) {
- return null;
- }
-
- /**
- * Returns the result of interpretting the object as an instance of '<em>Tag Decorate Info</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpretting the object as an instance of '<em>Tag Decorate Info</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public Object caseTagDecorateInfo(TagDecorateInfo object) {
- return null;
- }
-
- /**
- * Returns the result of interpretting the object as an instance of '<em>Resolve Attribute Value</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpretting the object as an instance of '<em>Resolve Attribute Value</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public Object caseResolveAttributeValue(ResolveAttributeValue object) {
- return null;
- }
-
- /**
- * Returns the result of interpretting the object as an instance of '<em>EObject</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch, but this is the last case anyway.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpretting the object as an instance of '<em>EObject</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject)
- * @generated
- */
- public Object defaultCase(EObject object) {
- return null;
- }
-
-} //DTInfoSwitch
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/package-info.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/package-info.java
deleted file mode 100644
index 3f0ea23..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/dtinfo/package-info.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-/**
- * Tag conversion model.
- *
- * <p><b>Provisional API - subject to change</b></p>
- */
-package org.eclipse.jst.pagedesigner.dtmanager.dtinfo;
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/package-info.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/package-info.java
deleted file mode 100644
index 8f5fa02..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/dtmanager/package-info.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-/**
- * Tag conversion design time manager.
- *
- * <p><b>Provisional API - subject to change</b></p>
- */
-package org.eclipse.jst.pagedesigner.dtmanager;
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/DesignerStructuredTextEditorJSP.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/DesignerStructuredTextEditorJSP.java
deleted file mode 100644
index dc84c35..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/DesignerStructuredTextEditorJSP.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jst.pagedesigner.dnd.internal.DesignerSourceDropTargetListener;
-import org.eclipse.ui.texteditor.ITextEditorDropTargetListener;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-
-/**
- * @author mengbo
- */
-public class DesignerStructuredTextEditorJSP extends StructuredTextEditor {
- protected void initializeDrop(ITextViewer textViewer) {
- // It seems if we don't skip this method, our drag drop listener will
- // can't be enabled.
- }
-
- public IAction getAction(String actionID) {
- try {
- return super.getAction(actionID);
- } catch (Exception e) {
- return null;
- }
- }
-
- public Object getAdapter(Class required) {
- if (ITextEditorDropTargetListener.class.equals(required)) {
- DesignerSourceDropTargetListener listener = new DesignerSourceDropTargetListener(
- this);
- return listener;
- }
- return super.getAdapter(required);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/HTMLEditor.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/HTMLEditor.java
deleted file mode 100644
index 603c271..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/HTMLEditor.java
+++ /dev/null
@@ -1,1061 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors;
-
-import java.io.File;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.gef.DefaultEditDomain;
-import org.eclipse.gef.palette.PaletteRoot;
-import org.eclipse.gef.ui.palette.PaletteViewerProvider;
-import org.eclipse.gef.ui.views.palette.PalettePage;
-import org.eclipse.gef.ui.views.palette.PaletteViewerPage;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.viewers.IPostSelectionProvider;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.jsf.common.ui.internal.utils.ResourceUtils;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.dnd.internal.DesignerSourceMouseTrackAdapter;
-import org.eclipse.jst.pagedesigner.editors.pagedesigner.PageDesignerResources;
-import org.eclipse.jst.pagedesigner.editors.palette.impl.PaletteItemManager;
-import org.eclipse.jst.pagedesigner.jsp.core.pagevar.IPageVariablesProvider;
-import org.eclipse.jst.pagedesigner.jsp.core.pagevar.adapter.IDocumentPageVariableAdapter;
-import org.eclipse.jst.pagedesigner.parts.DocumentEditPart;
-import org.eclipse.jst.pagedesigner.preview.PreviewHandlerNew;
-import org.eclipse.jst.pagedesigner.preview.WindowsIEBrowser;
-import org.eclipse.jst.pagedesigner.properties.WPETabbedPropertySheetPage;
-import org.eclipse.jst.pagedesigner.tools.RangeSelectionTool;
-import org.eclipse.jst.pagedesigner.ui.common.PartActivationHandler;
-import org.eclipse.jst.pagedesigner.ui.common.sash.SashEditorPart;
-import org.eclipse.jst.pagedesigner.utils.PreviewUtil;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IPropertyListener;
-import org.eclipse.ui.IStorageEditorInput;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.contexts.IContextService;
-import org.eclipse.ui.part.MultiPageSelectionProvider;
-import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
-import org.eclipse.ui.views.properties.IPropertySheetPage;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
-import org.eclipse.wst.common.ui.provisional.editors.PostMultiPageEditorSite;
-import org.eclipse.wst.common.ui.provisional.editors.PostMultiPageSelectionProvider;
-import org.eclipse.wst.common.ui.provisional.editors.PostSelectionMultiPageEditorPart;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.ISourceEditingTextTools;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.ui.internal.provisional.IDOMSourceEditingTextTools;
-import org.w3c.dom.Document;
-
-/**
- * The HTMLEditor is a multi paged editor. It will use the StructuredTextEditor
- * as the chief editor, and delegate most operations to it.
- *
- * @author mengbo
- */
-public final class HTMLEditor extends PostSelectionMultiPageEditorPart implements
- IPropertyListener, ITabbedPropertySheetPageContributor {
- // private static final String PAGE_NAME_DESIGN = "Design"; //$NON-NLS-1$
- // private static final String PAGE_NAME_SOURCE = "Source"; //$NON-NLS-1$
- /**
- * Tabbed property contributor id for WPE
- */
- public final static String TABBED_PROPERTIES_CONTRIBUTOR_ID = "org.eclipse.jst.pagedesigner.tabPropertyContributor"; //$NON-NLS-1$
-
- // four different modes for the designer when displayed in a sash editor.
- /**
- * editor split is vertical
- */
- public static final int MODE_SASH_VERTICAL = 0;
-
- /**
- * editor split is horizontal
- */
- public static final int MODE_SASH_HORIZONTAL = 1;
-
- /**
- * no split, only designer canvas
- */
- public static final int MODE_DESIGNER = 2;
-
- /**
- * no split, only SSE source
- */
- public static final int MODE_SOURCE = 3;
-
- private Logger _log = PDPlugin.getLogger(HTMLEditor.class);
-
- private boolean _sash = true;
-
- private int _mode = 0;
-
- private SashEditorPart _sashEditorPart = null;
-
- private int _previewPageIndex;
-
- /** The design viewer */
- private SimpleGraphicalEditor _designViewer;
-
- /** The text editor. */
- private StructuredTextEditor _textEditor;
-
- private PartActivationHandler _partListener;
-
- private PaletteViewerPage _paletteViewerPage;
-
- private DefaultEditDomain _editDomain;
-
- private WindowsIEBrowser _browser;
-
- private Composite _previewComposite;
-
- private List PREVIEW_FILES_LIST = new ArrayList();
-
- private WPETabbedPropertySheetPage _tabbedPropSheet;
-
- private ISelectionChangedListener _selChangedListener;
-
- // TODO:This class is never used locally
-// private class TextInputListener implements ITextInputListener {
-// public void inputDocumentAboutToBeChanged(IDocument oldInput,
-// IDocument newInput) {
-// // do nothing
-// }
-//
-// public void inputDocumentChanged(IDocument oldInput, IDocument newInput) {
-// if (_designViewer != null && newInput != null)
-// _designViewer.setModel(getModel());
-// }
-// }
-
- /**
- * Default constructor
- */
- public HTMLEditor() {
- super();
- }
-
- /*
- * This method is just to make firePropertyChanged accessbible from some
- * (anonomous) inner classes.
- */
- private void _firePropertyChange(int property) {
- super.firePropertyChange(property);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.xtools.common.ui.properties.ITabbedPropertySheetPageContributor#getContributorId()
- */
- public String getContributorId() {
- return TABBED_PROPERTIES_CONTRIBUTOR_ID;
- }
-
- private void connectSashPage() {
- ISelectionProvider selectionProvider = _sashEditorPart.getSite()
- .getSelectionProvider();
- if (selectionProvider instanceof IPostSelectionProvider) {
- ((IPostSelectionProvider) selectionProvider)
- .addPostSelectionChangedListener(getSelectionChangedListener(selectionProvider));
- } else {
- selectionProvider
- .addSelectionChangedListener(getSelectionChangedListener(selectionProvider));
- }
- }
-
- private void disconnectSashPage() {
- ISelectionProvider selectionProvider = _sashEditorPart.getSite()
- .getSelectionProvider();
- if (selectionProvider instanceof IPostSelectionProvider) {
- ((IPostSelectionProvider) selectionProvider)
- .removePostSelectionChangedListener(getSelectionChangedListener(selectionProvider));
- } else {
- selectionProvider
- .removeSelectionChangedListener(getSelectionChangedListener(selectionProvider));
- }
- }
-
- private ISelectionChangedListener getSelectionChangedListener(ISelectionProvider selectionProvider) {
- if (_selChangedListener == null) {
- if (selectionProvider instanceof IPostSelectionProvider) {
- _selChangedListener = new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- ((PostMultiPageSelectionProvider) getSite()
- .getSelectionProvider())
- .firePostSelectionChanged(event);
- }
- };
- }
- else {
- _selChangedListener = new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- ((MultiPageSelectionProvider) getSite()
- .getSelectionProvider())
- .firePostSelectionChanged(event);
- }
- };
- }
- }
- return _selChangedListener;
- }
-
- /**
- * Creates the source page of the multi-page editor.
- * @throws PartInitException
- */
- protected void sash_createAndAddDesignSourcePage() throws PartInitException {
- // create source page
- _textEditor = createTextEditor();
- _textEditor.setEditorPart(this);
- _textEditor.addPropertyListener(this);
- // create design page
- _designViewer = new SimpleGraphicalEditor(this, getEditDomain());
-
- // create SashEditor
- _sashEditorPart = new SashEditorPart() {
- protected void createPages() throws PartInitException {
- addPage(_designViewer, getEditorInput());
- addPage(_textEditor, getEditorInput());
- }
- };
- int sashIndex = addPage(_sashEditorPart, getEditorInput());
-
- setPageText(sashIndex, PDPlugin.getResourceString("HTMLEditor.Design"));
-
- // the update's critical, to get viewer selection manager and
- // highlighting to work
- _textEditor.update();
-
- firePropertyChange(PROP_TITLE);
-
- // Changes to the Text Viewer's document instance should also force an
- // input refresh
- // _textEditor.getTextViewer().addTextInputListener(new
- // TextInputListener());
- connectSashPage();
- }
-
- /**
- * @see org.eclipse.ui.part.MultiPageEditorPart#createSite(org.eclipse.ui.IEditorPart)
- */
- protected IEditorSite createSite(IEditorPart editor) {
- return new PostMultiPageEditorSite(this, editor);
- }
-
- private void tabbed_createAndAddDesignSourcePage()
- throws PartInitException {
- // create source page
- _textEditor = createTextEditor();
- _textEditor.setEditorPart(this);
- _textEditor.addPropertyListener(this);
-
- // create design page
- SimpleGraphicalEditor editor = new SimpleGraphicalEditor(this,
- getEditDomain());
-
- // add design page
- int designPageIndex = addPage(editor, null);
-
- _designViewer = editor;
- // // note: By adding the design page as a Control instead of an
- // // IEditorPart, page switches will indicate
- // // a "null" active editor when the design page is made active
- setPageText(designPageIndex, PDPlugin
- .getResourceString("HTMLEditor.Design"));
-
- // add source page
- int sourcePageIndex = addPage(_textEditor, getEditorInput());
- setPageText(sourcePageIndex, PDPlugin
- .getResourceString("HTMLEditor.Source"));
- // the update's critical, to get viewer selection manager and
- // highlighting to work
- _textEditor.update();
-
- firePropertyChange(PROP_TITLE);
-
- // Changes to the Text Viewer's document instance should also force an
- // input refresh
- // _textEditor.getTextViewer().addTextInputListener(new
- // TextInputListener());
- }
-
- private void createAndAddPreviewPage() {
- _previewComposite = new Composite(getContainer(), 0);
- FillLayout filllayout = new FillLayout();
- _previewComposite.setLayout(filllayout);
-
- _previewPageIndex = addPage(_previewComposite);
- // JSPSourceEditor.Page.Preview.PageText=Preview
- setPageText(_previewPageIndex, PageDesignerResources.getInstance()
- .getString("JSPSourceEditor.Page.Preview.PageText")); //$NON-NLS-1$
-
- }
-
- private WindowsIEBrowser getPreviewBrowser() {
- if (_browser == null) {
- _browser = new WindowsIEBrowser();
- if (_browser != null) {
- _browser.create(_previewComposite, SWT.NONE);
- _previewComposite.layout();
- }
- }
- return _browser;
- }
- /**
- * Connects the design viewer with the viewer selection manager. Should be
- * done after createSourcePage() is done because we need to get the
- * ViewerSelectionManager from the TextEditor. setModel is also done here
- * because getModel() needs to reference the TextEditor.
- */
- protected void connectDesignPage() {
- if (_designViewer != null) {
- _designViewer.setModel(getModel());
- // _designViewer.getSynchronizer().listenToModel(getModel());
- ISelectionProvider designSelectionProvider = _designViewer
- .getSite().getSelectionProvider();
- if (designSelectionProvider instanceof IPostSelectionProvider) {
- ((IPostSelectionProvider) designSelectionProvider)
- .addPostSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(
- SelectionChangedEvent event) {
- if (getActiveEditor() != _textEditor) {
- _designViewer.getSynchronizer()
- .selectionChanged(event);
- }
- }
- });
- } else {
- designSelectionProvider
- .addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(
- SelectionChangedEvent event) {
- if (getActiveEditor() != _textEditor) {
- _designViewer.getSynchronizer()
- .selectionChanged(event);
- }
- }
- });
- }
- ISelectionProvider textSelectionProvider = _textEditor.getSite()
- .getSelectionProvider();
- if (textSelectionProvider instanceof IPostSelectionProvider) {
- ((IPostSelectionProvider) textSelectionProvider)
- .addPostSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(
- SelectionChangedEvent event) {
- if (event.getSelection() instanceof TextSelection) {
- TextSelection textSelection = ((TextSelection) event
- .getSelection());
- _designViewer
- .getSynchronizer()
- .textSelectionChanged(
- textSelection.getOffset(),
- textSelection.getOffset()
- + textSelection
- .getLength());
- }
- }
- });
- } else {
- textSelectionProvider
- .addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(
- SelectionChangedEvent event) {
- TextSelection textSelection = ((TextSelection) event
- .getSelection());
- _designViewer.getSynchronizer()
- .textSelectionChanged(
- textSelection.getOffset(),
- textSelection.getOffset()
- + textSelection
- .getLength());
- }
- });
- }
- }
- }
-
- /**
- * Creates the pages of this multi-page editor.
- * <p>
- * Subclasses of <code>MultiPageEditor</code> must implement this method.
- * </p>
- */
- protected void createPages() {
- try {
- // source page MUST be created before design page, now
- if (_sash) {
- sash_createAndAddDesignSourcePage();
- } else {
- tabbed_createAndAddDesignSourcePage();
- }
- connectDesignPage();
- createAndAddPreviewPage();
- DesignerSourceMouseTrackAdapter adapter = new DesignerSourceMouseTrackAdapter(
- _textEditor, getEditDomain());
- _textEditor.getTextViewer().getTextWidget().addMouseListener(
- adapter);
- _textEditor.getTextViewer().getTextWidget().addMouseMoveListener(
- adapter);
- } catch (PartInitException exception) {
- //$NON-NLS-1$ = "An error has occurred when initializing the input for the the editor's source page."
- if (_log != null) {
- // throw new SourceEditingRuntimeException(
- // "An error has occurred when initializing the input for the
- // the editor's source page.");
- }
- }
- // TODO: add a catch block here for any exception the design
- // page throws and convert it into a more informative message.
- }
-
- /**
- * Method createTextEditor.
- *
- * @return StructuredTextEditor
- */
- protected StructuredTextEditor createTextEditor() {
- return new DesignerStructuredTextEditorJSP();
- }
-
- private void disconnectDesignPage() {
- if (_designViewer != null) {
- _designViewer.setModel(null);
- _designViewer.dispose();
- }
- }
-
- public void dispose() {
- //System.out.println("dispose of HTML Editor");
- deletePreviewFiles();
-
- disconnectDesignPage();
- disconnectSashPage();
-
- IWorkbenchWindow window = getSite().getWorkbenchWindow();
- window.getPartService().removePartListener(_partListener);
- window.getShell().removeShellListener(_partListener);
- getSite().getPage().removePartListener(_partListener);
-
- if (_textEditor != null) {
- _textEditor.removePropertyListener(this);
- _textEditor.setEditorPart(null);
- _textEditor.dispose();
- }
-
- // moved to last when added window ... seems like
- // we'd be in danger of losing some data, like site,
- // or something.
- _sashEditorPart = null;
- _tabbedPropSheet = null;
- _partListener = null;
- _editDomain = null;
- _designViewer = null;
- _browser = null;
- _previewComposite = null;
- _paletteViewerPage = null;
- _log = null;
- _selChangedListener = null;
- _textEditor = null;
-
- super.dispose();
-
- }
-
- public void doSave(IProgressMonitor monitor) {
- _textEditor.doSave(monitor);
- }
-
- /*
- * (non-Javadoc) Saves the contents of this editor to another object. <p>
- * Subclasses must override this method to implement the open-save-close
- * lifecycle for an editor. For greater details, see <code> IEditorPart
- * </code></p>
- *
- * @see IEditorPart
- */
- public void doSaveAs() {
- _textEditor.doSaveAs();
- }
-
- private void editorInputIsAcceptable(IEditorInput input)
- throws PartInitException {
- if (input instanceof IFileEditorInput) {
- // verify that it can be opened
- CoreException[] coreExceptionArray = new CoreException[1];
- if (fileDoesNotExist((IFileEditorInput) input, coreExceptionArray)) {
- // todo use message formatter for {0}
- Throwable coreException = coreExceptionArray[0];
-
- // C.B: this is a strange piece of logic. It was referenceing
- // the internal sub-class of CoreException, ResourceException.
- // need to review fileDoesNotExist.
- if (coreException instanceof CoreException) {
- // I'm assuming this is always 'does not exist'
- // we'll refresh local go mimic behavior of default
- // editor, where the
- // troublesome file is refreshed (and will cause it to
- // 'disappear' from Navigator.
- try {
- ((IFileEditorInput) input).getFile()
- .refreshLocal(IResource.DEPTH_ZERO,
- new NullProgressMonitor());
- } catch (CoreException ce) {
- if (_log != null) {
- _log.error("Error.HTMLEditor.0", ce); //$NON-NLS-1$
- }
- }
- throw new PartInitException("Resource " + input.getName()
- + " does not exist.");
- }
- throw new PartInitException("Editor could not be open on "
- + input.getName());
- }
- } else if (input instanceof IStorageEditorInput) {
- InputStream contents = null;
- try {
- contents = ((IStorageEditorInput) input).getStorage()
- .getContents();
- if (contents == null) {
- throw new PartInitException("Editor could not be open on "
- + input.getName());
- }
- } catch (CoreException noStorageExc) {
- // Error in geting storage contents
- _log.error("Error.HTMLEditor.1", noStorageExc); //$NON-NLS-1$
- }
- finally
- {
- ResourceUtils.ensureClosed(contents);
- }
- }
- }
-
- /**
- * Initializes the editor part with a site and input. <p>
- * Subclasses of <code> EditorPart </code> must implement this method.
- * Within the implementation subclasses should verify that the input type is
- * acceptable and then save the site and input. Here is sample code: </p><pre>
- * if (!(input instanceof IFileEditorInput)) throw new
- * PartInitException("Invalid Input: Must be IFileEditorInput");
- * setSite(site); setInput(editorInput); </pre>
- * @param input
- * @param coreException
- * @return true if the input doesn't exist
- */
- protected boolean fileDoesNotExist(IFileEditorInput input,
- Throwable[] coreException) {
- boolean result = false;
- InputStream inStream = null;
- if ((!(input.exists())) || (!(input.getFile().exists()))) {
- result = true;
- } else {
- try
- {
- inStream = input.getFile().getContents(true);
- }
- catch (CoreException e)
- {
- // very likely to be file not found
- result = true;
- coreException[0] = e;
- // The core has exception
- _log.error("Error.HTMLEditor.3", e); //$NON-NLS-1$
- }
- finally
- {
- ResourceUtils.ensureClosed(inStream);
- }
- }
- return result;
- }
-
- public Object getAdapter(Class key) {
- Object result = null;
- if (key == IDesignViewer.class) {
- result = _designViewer;
- } else if (key == PalettePage.class) {
- return getPaletteViewerPage();
- } else if (key == IPropertySheetPage.class) {
- // XXX: we can delegate this to the fTextEditor, but that use some
- // more
- // complicate mechanism, and don't work with page designer well, so
- // do it simple now, fix later.
- // return _textEditor.getAdapter(key);
- return getPropertySheetPage();
- } else if (key == IContentOutlinePage.class) {
- if (_textEditor != null) {
- result = _textEditor.getAdapter(key);
- }
- } else if (key == IPageVariablesProvider.class) {
- Object obj = ((IDOMModel) getModel()).getDocument().getAdapterFor(
- IDocumentPageVariableAdapter.class);
- if (obj instanceof IPageVariablesProvider) {
- return obj;
- }
- return null;
- } else {
- // DMW: I'm bullet-proofing this because
- // its been reported (on 4.03 version) a null pointer sometimes
- // happens here on startup, when an editor has been left
- // open when workbench shutdown.
- if (_textEditor != null) {
- result = _textEditor.getAdapter(key);
- }
- }
- return result;
- }
-
-
- /**
- * IExtendedSimpleEditor method
- * @return IDocument
- */
- public IDocument getDocument() {
- if (getTextEditor() == null) {
- return null;
- }
-
- Object apapter = _textEditor.getAdapter(ISourceEditingTextTools.class);
- if (apapter != null) {
- return ((ISourceEditingTextTools) apapter).getDocument();
- }
-
- return null;
- }
-
- /**
- * IExtendedMarkupEditor method
- * @return the dom document
- */
- public Document getDOMDocument() {
- if (getTextEditor() == null) {
- return null;
- }
-
- Object adapter = _textEditor.getAdapter(ISourceEditingTextTools.class);
- if (adapter instanceof IDOMSourceEditingTextTools) {
- return ((IDOMSourceEditingTextTools) adapter).getDOMDocument();
- }
- return null;
- }
-
- /**
- * IExtendedSimpleEditor method
- * @return the editor part
- */
- public IEditorPart getEditorPart() {
- return this;
- }
-
- /**
- * @return the structured model
- */
- public IStructuredModel getModel() {
- IStructuredModel model = null;
- if (_textEditor != null) {
- model = ((DesignerStructuredTextEditorJSP) _textEditor).getModel();
- }
- return model;
- }
-
-
- /**
- * @return the SSE editor delegate
- */
- public StructuredTextEditor getTextEditor() {
- return _textEditor;
- }
-
-
- /*
- * (non-Javadoc) Method declared on IWorkbenchPart.
- */
- public String getTitle() {
- String title = null;
- if (getTextEditor() == null) {
- if (getEditorInput() != null) {
- title = getEditorInput().getName();
- }
- } else {
- title = getTextEditor().getTitle();
- }
- if (title == null) {
- title = getPartName();
- }
- return title;
- }
-
- public void init(IEditorSite site, IEditorInput input)
- throws PartInitException {
- super.init(site, input);
- editorInputIsAcceptable(input);
- try {
- // super.init(site, input);
- // setSite(site);
- setInput(input);
- if (_partListener == null) {
- _partListener = new PartActivationHandler(this) {
- public void handleActivation() {
- safelySanityCheckState();
- }
- };
- }
- // we want to listen for our own activation
- IWorkbenchWindow window = getSite().getWorkbenchWindow();
- window.getPartService().addPartListener(_partListener);
- window.getShell().addShellListener(_partListener);
-
- // TODO: is this the right place to do this?
- // enable our editor context
- IContextService contextService = (IContextService) getSite()
- .getService(IContextService.class);
- contextService.activateContext("org.eclipse.jst.pagedesigner.editorContext");
-
- } catch (Exception e) {
- // Error in editor initialization
- _log.error("Error.HTMLEditor.5", e); //$NON-NLS-1$
- }
- setPartName(input.getName());
- }
-
- /*
- * (non-Javadoc) Returns whether the "save as" operation is supported by
- * this editor. <p> Subclasses must override this method to implement the
- * open-save-close lifecycle for an editor. For greater details, see <code>
- * IEditorPart </code></p>
- *
- * @see IEditorPart
- */
- public boolean isSaveAsAllowed() {
- return _textEditor != null && _textEditor.isSaveAsAllowed();
- }
-
- /*
- * (non-Javadoc) Returns whether the contents of this editor should be saved
- * when the editor is closed. <p> This method returns <code> true </code> if
- * and only if the editor is dirty ( <code> isDirty </code> ). </p>
- */
- public boolean isSaveOnCloseNeeded() {
- // overriding super class since it does a lowly isDirty!
- if (_textEditor != null) {
- return _textEditor.isSaveOnCloseNeeded();
- }
- return isDirty();
- }
-
- /**
- * Posts the update code "behind" the running operation.
- */
- private void postOnDisplayQue(Runnable runnable) {
- IWorkbench workbench = PlatformUI.getWorkbench();
- IWorkbenchWindow[] windows = workbench.getWorkbenchWindows();
- if (windows != null && windows.length > 0) {
- Display display = windows[0].getShell().getDisplay();
- display.asyncExec(runnable);
- } else {
- runnable.run();
- }
- }
-
- /**
- * Indicates that a property has changed.
- *
- * @param source
- * the object whose property has changed
- * @param propId
- * the id of the property which has changed; property ids are
- * generally defined as constants on the source class
- */
- public void propertyChanged(Object source, int propId) {
- switch (propId) {
- // had to implement input changed "listener" so that
- // strucutedText could tell it containing editor that
- // the input has change, when a 'resource moved' event is
- // found.
- case IEditorPart.PROP_INPUT: {
- if (source == _textEditor) {
- if (_textEditor.getEditorInput() != getEditorInput()) {
- setInput(_textEditor.getEditorInput());
- // title should always change when input changes.
- // create runnable for following post call
- Runnable runnable = new Runnable() {
- public void run() {
- _firePropertyChange(IWorkbenchPart.PROP_TITLE);
- }
- };
- // Update is just to post things on the display queue
- // (thread). We have to do this to get the dirty
- // property to get updated after other things on the
- // queue are executed.
- postOnDisplayQue(runnable);
- }
- }
- break;
- }
- case IWorkbenchPart.PROP_TITLE: {
- // // update the input if the title is changed. why? It seems input
- // change event will be fired at last.
- // if (source == _textEditor)
- // {
- // if (_textEditor.getEditorInput() != getEditorInput())
- // {
- // setInput(_textEditor.getEditorInput());
- // }
- // }
- // break;
- }
- default: {
- // propagate changes. Is this needed? Answer: Yes.
- // PROP_PART_NAME, PROP_DIRTY etc.
- if (source == _textEditor) {
- firePropertyChange(propId);
- }
- break;
- }
- }
-
- }
-
- private void safelySanityCheckState() {
- // If we're called before editor is created, simply ignore since we
- // delegate this function to our embedded TextEditor
- if (getTextEditor() == null) {
- return;
- }
-
- getTextEditor().safelySanityCheckState(getEditorInput());
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.part.EditorPart#setInput(org.eclipse.ui.IEditorInput)
- */
- protected void setInput(IEditorInput input) {
- // If driven from the Source page, it's "model" may not be up to date
- // with the input just yet. We'll rely on later notification from the
- // TextViewer to set us straight
- super.setInput(input);
- if (_designViewer != null) {
-
- _designViewer.setModel(getModel());
- }
- setPartName(input.getName());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.part.EditorPart#isDirty()
- */
- public boolean isDirty() {
- if (getTextEditor() == null) {
- return false;
- }
- return getTextEditor().isDirty();
- }
-
- private IPropertySheetPage getPropertySheetPage() {
- if (_tabbedPropSheet == null){
- _tabbedPropSheet = new org.eclipse.jst.pagedesigner.properties.WPETabbedPropertySheetPage(
- this, this);
- }
- return _tabbedPropSheet;
- }
-
- private PaletteViewerPage getPaletteViewerPage() {
- if (null == _paletteViewerPage) {
- DefaultEditDomain editDomain = getEditDomain();
- PaletteItemManager manager = PaletteItemManager
- .getInstance(getCurrentProject(getEditorInput()));
- manager.reset();
- PaletteRoot paletteRoot = _designViewer.getPaletteRoot();
- editDomain.setPaletteRoot(paletteRoot);
-
- _paletteViewerPage = (PaletteViewerPage) _designViewer.getAdapter(PalettePage.class);
- // if possible, try to use the
- if (_paletteViewerPage == null)
- {
- PaletteViewerProvider provider = _designViewer.getPaletteViewerProvider2();
- _paletteViewerPage = new PaletteViewerPage(provider);
- }
- }
- return _paletteViewerPage;
- }
-
- /**
- * @return the edit domain
- */
- public DefaultEditDomain getEditDomain() {
- if (_editDomain == null) {
- _editDomain = new DefaultEditDomain(this);
-
- // XXX: if i don't do the following line, system will default use
- // SelectionTool. Don't know where else to set this. Since it is
- // kind of duplicate
- // to the DesignerPaletteRoot.
- _editDomain.setDefaultTool(new RangeSelectionTool());
- _editDomain.loadDefaultTool();
-
- // next config the _editDomain
- // _editDomain.setPaletteRoot(new JSFPaletteRoot());
- }
- return _editDomain;
- }
-
- /**
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.part.MultiPageEditorPart#pageChange(int)
- */
- protected void pageChange(int newPageIndex) {
- super.pageChange(newPageIndex);
-
- deletePreviewFiles();
-
- if (newPageIndex == _previewPageIndex) {
- // preview page activate, need to regenerate the preview text and
- // display it.
- StringBuffer result = new StringBuffer();
- try {
- // PreviewHandler.generatePreview(this.getModel(),
- // this.getEditorInput(), result);
- DocumentEditPart part = (DocumentEditPart) this._designViewer
- .getGraphicViewer().getContents();
- PreviewHandlerNew.generatePreview(part, result);
- } catch (Exception ex) {
- result = new StringBuffer();
- result
- .append(this.getModel().getStructuredDocument()
- .getText());
- // Error in page changing
- _log.info("Error.HTMLEditor.6", ex); //$NON-NLS-1$
- ex.printStackTrace();
- }
- File file = PreviewUtil.toFile(result, getEditorInput());
- if (file != null) {
- PREVIEW_FILES_LIST.add(file);
- getPreviewBrowser().loadFile(file);
- } else {
- getPreviewBrowser().getBrowser().setUrl("about:blank"); //$NON-NLS-1$
- }
- }
- }
-
- /**
- * @return Returns the _designViewer.
- */
- public IDesignViewer getDesignViewer() {
- return _designViewer;
- }
-
- /**
- * @param mode
- */
- public void setDesignerMode(int mode) {
- if (_sashEditorPart != null) {
- switch (mode) {
- case MODE_SASH_HORIZONTAL:
- _sashEditorPart.setOrientation(SWT.HORIZONTAL);
- break;
- case MODE_DESIGNER:
- _sashEditorPart.setMaximizedEditor(this._designViewer);
- break;
- case MODE_SOURCE:
- _sashEditorPart.setMaximizedEditor(this._textEditor);
- break;
- case MODE_SASH_VERTICAL:
- default:
- _sashEditorPart.setOrientation(SWT.VERTICAL);
- }
- }
- this._mode = mode;
- }
-
- /**
- * @return the current design mode
- */
- public int getDesignerMode() {
- return this._mode;
- }
-
- private IProject getCurrentProject(IEditorInput input) {
- IProject curProject = null;
- IFile inputFile = null;
- if (input instanceof IFileEditorInput) {
- inputFile = ((IFileEditorInput) input).getFile();
- curProject = inputFile.getProject();
- }
- return curProject;
- }
-
- public IEditorPart getActiveEditor() {
- IEditorPart result = null;
- if (_sash) {
- result = _sashEditorPart.getActiveEditor();
- } else {
- if (_designViewer.getGraphicViewer().getControl().isFocusControl()) {
- result = _designViewer;
- } else if (_textEditor.getTextViewer().getControl()
- .isFocusControl()) {
- result = _textEditor;
- }
- }
- return result;
- }
-
- public String getPartName() {
- if (_textEditor != null) {
- return _textEditor.getPartName();
- }
- return super.getPartName();
- }
-
- private void deletePreviewFiles() {
- Iterator itPreviewFiles = PREVIEW_FILES_LIST.iterator();
- while (itPreviewFiles.hasNext()) {
- File file = (File)itPreviewFiles.next();
- if (file != null && file.exists()) {
- file.delete();
- }
- }
- PREVIEW_FILES_LIST.clear();
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/IDesignViewer.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/IDesignViewer.java
deleted file mode 100644
index fc05338..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/IDesignViewer.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors;
-
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-
-/**
- * This is copied from the xmleditor plugin. Represents the design viewer that
- * need can be used to show the design page.
- *
- * @author mengbo
- */
-public interface IDesignViewer {
- /**
- * @return the title
- */
- String getTitle();
-
- /**
- * @param model
- */
- void setModel(IStructuredModel model);
-
- // void setViewerSelectionManager(ViewerSelectionManager
- // viewerSelectionManager);
-
- /**
- * @return the graphical viewer
- */
- public IHTMLGraphicalViewer getGraphicViewer();
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/OutlineConfiguration.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/OutlineConfiguration.java
deleted file mode 100644
index e247dc1..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/OutlineConfiguration.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jst.jsp.ui.views.contentoutline.JSPContentOutlineConfiguration;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-
-/**
- * the HTML editor's outline view configuration
- *
- */
-public class OutlineConfiguration extends JSPContentOutlineConfiguration {
- private Object[] _selections = new Object[0];
-
- public ISelection getSelection(TreeViewer viewer, ISelection selection) {
- if ((viewer.getInput() instanceof IStructuredModel)
- && (selection instanceof ITextSelection)) {
- _selections = getSelectedObjects((IStructuredModel) viewer
- .getInput(), (ITextSelection) selection);
- if (_selections != null) {
- return super.getSelection(viewer, new StructuredSelection(
- _selections));
- }
- }
- return super.getSelection(viewer, new StructuredSelection(_selections));
- }
-
- private Object[] getSelectedObjects(IStructuredModel model,
- ITextSelection selection) {
- Object[] selectedStructures = null;
- if (model != null) {
- IndexedRegion region = model
- .getIndexedRegion(selection.getOffset());
- int end = selection.getOffset() + selection.getLength();
- if (region != null) {
- if (end <= region.getEndOffset()) {
- // single selection
- selectedStructures = new Object[1];
- selectedStructures[0] = region;
- } else {
- // multiple selection
- int maxLength = model.getStructuredDocument().getLength();
- List structures = new ArrayList(2);
- while (region != null && region.getEndOffset() <= end
- && region.getEndOffset() < maxLength) {
- structures.add(region);
- region = model
- .getIndexedRegion(region.getEndOffset() + 1);
- }
- selectedStructures = structures.toArray();
- }
- }
- }
- if (selectedStructures == null) {
- selectedStructures = new Object[0];
- }
- return selectedStructures;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/PageDesignerActionConstants.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/PageDesignerActionConstants.java
deleted file mode 100644
index cbe7381..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/PageDesignerActionConstants.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors;
-
-import org.eclipse.gef.ui.actions.GEFActionConstants;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.ui.IWorkbenchActionConstants;
-
-/**
- * Common constants used to id specific locations in the canvas context menu.
- *
- * @see SimpleGraphicalEditor.ContextMenuListener for construction order
- *
- * @author mengbo
- */
-public class PageDesignerActionConstants
-{
- /**
- * Id for the standard Edit sub-menu
- */
- public static final String EDIT_SUBMENU_ID = "org.eclipse.jst.pagedesigner.context.submenu.edit"; //$NON-NLS-1$
- /**
- * Id for the standard Select sub-menu
- */
- public static final String SELECT_SUBMENU_ID = "org.eclipse.jst.pagedesigner.context.submenu.select"; //$NON-NLS-1$
- /**
- * Id for the standard Insert sub-menu
- */
- public static final String INSERT_SUBMENU_ID = "org.eclipse.jst.pagedesigner.context.submenu.insert"; //$NON-NLS-1$
- /**
- * Id for the standard Navigate sub-menu
- */
- public static final String NAVIGATE_SUBMENU_ID = "org.eclipse.jst.pagedesigner.context.submenu.navigate"; //$NON-NLS-1$
- /**
- * Id for the standard Style sub-menu
- */
- public static final String STYLE_SUBMENU_ID = "org.eclipse.jst.pagedesigner.context.submenu.style"; //$NON-NLS-1$
- /**
- * Id for the standard Show(View) sub-menu
- */
- public static final String SHOWVIEW_SUBMENU_ID = "org.eclipse.jst.pagedesigner.viewMenuMgr"; //$NON-NLS-1$
-
- /**
- * Undo action group
- */
- public static final String GROUP_UNDO = GEFActionConstants.GROUP_UNDO;
- /**
- * Standard Edit sub-menu action group
- */
- public static final String GROUP_EDIT = GEFActionConstants.GROUP_EDIT;
- /**
- * Group for container injected actions
- */
- public static final String GROUP_CONTAINER = "org.eclipse.jst.pagedesigner.container"; //$NON-NLS-1$
- /**
- * Standard Style sub-menu action group
- */
- public static final String GROUP_STYLE = "org.eclipse.jst.pagedesigner.style"; //$NON-NLS-1$
- /**
- * Group for third-party contributed tag-specific actions
- */
- public static final String GROUP_SPECIAL = "org.eclipse.jst.pagedesigner.special"; //$NON-NLS-1$
- /**
- * Standard Select sub-menu action group
- */
- public static final String GROUP_SELECT = "org.eclipse.jst.pagedesigner.select"; //$NON-NLS-1$
- /**
- * Standard Insert sub-menu action group
- */
- public static final String GROUP_INSERT = "org.eclipse.jst.pagedesigner.insert"; //$NON-NLS-1$
- /**
- * Standard Navigate sub-menu action group
- */
- public static final String GROUP_NAVIGATE = "org.eclipse.jst.pagedesigner.navigate"; //$NON-NLS-1$
-
-
- /**
- * Add standard group separators for the Edit sub-menu
- *
- * @param menu
- */
- public static final void addStandardEditActionGroups(IMenuManager menu)
- {
- menu.add(new Separator(GROUP_UNDO));
- menu.add(new Separator(GROUP_EDIT));
- }
-
- /**
- * Adds standard group separators to the given MenuManager.
- *
- * @param menu the MenuManager
- */
- public static final void addStandardActionGroups(IMenuManager menu) {
- menu.add(new Separator(GROUP_CONTAINER));
- menu.add(new Separator(GROUP_SPECIAL));
- menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
- }
-
- /**
- * Add standard group separators for the Style sub-menu
- * @param menu
- */
- public static void addStandardStyleActionGroups(IMenuManager menu)
- {
- menu.add(new Separator(GROUP_STYLE));
- }
-
- /**
- * Add standard group separators for the Select sub-menu
- * @param menu
- */
- public static void addStandardSelectActionGroups(IMenuManager menu) {
- menu.add(new Separator(GROUP_SELECT));
- }
-
- /**
- * Add standard group separators for the Insert sub-menu
- * @param menu
- */
- public static void addStandardInsertActionGroups(IMenuManager menu) {
- menu.add(new Separator(GROUP_INSERT));
- }
-
- /**
- * Add standard group separators for the Navigate sub-menu
- * @param menu
- */
- public static void addStandardNavigateActionGroups(
- IMenuManager menu) {
- menu.add(new Separator(GROUP_NAVIGATE));
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/SelectionSynchronizer.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/SelectionSynchronizer.java
deleted file mode 100644
index 33025aa..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/SelectionSynchronizer.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors;
-
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jst.pagedesigner.utils.SelectionHelper;
-import org.eclipse.swt.custom.StyledText;
-
-/**
- * This class handles selection synchronization between the designer and other
- * parts. It listens event from both ViewerSelectionManager and the
- * IDesignerView, and convert the events to each other.
- * <p>
- * SelectionSynchronizer will be registered on the ViewerSelectionManager,
- * basically listens to selection change of other parts, and make the designer
- * sync with them.
- * <p>
- * As ViewerSelectionManager is firing out both textSelectionChange and
- * nodeSelectionChange, we only need to listen to one of them. As
- * textSelectionChange provide more information than nodeSelectionChange, so
- * we'll listen only to textSelectionChange.
- *
- * @author mengbo
- * @version 1.5
- */
-public class SelectionSynchronizer implements ISelectionChangedListener {
- private boolean _firingChange = false;
-
- private SimpleGraphicalEditor _editor;
-
- /**
- * @param editor
- */
- public SelectionSynchronizer(SimpleGraphicalEditor editor) {
- _editor = editor;
- }
-
- /**
- * @return true if the status check is okay
- */
- protected boolean statusCheckOk() {
- try {
- StyledText text = _editor.getHTMLEditor().getTextEditor()
- .getTextViewer().getTextWidget();
- if (text == null || text.isDisposed()) {
- return false;
- }
- return true;
- } catch (NullPointerException ex) {
- return false;
- }
- }
-
- /**
- * This is for event from the designer.
- */
- public void selectionChanged(SelectionChangedEvent event) {
- ISelection selection = event.getSelection();
-
- if (!_firingChange) {
- // check current status
- if (!statusCheckOk()) {
- return;
- }
-
- _firingChange = true;
- try {
- // convert the designer selection into SSE selection
- // (IStructureSelection of nodes
- // or textSelection, and let the ViewerSelectionManager to
- // handle it.
- // if (selection instanceof IStructuredSelection)
- // {
- // IStructuredSelection nodeSel =
- // SelectionHelper.convertFromDesignSelection((IStructuredSelection)selection);
- // can't use DoubleClickEvent, since it requre a Viewer.
- // _viewerSelectionManager.doubleClick(new
- // DoubleClickEvent(null, nodeSel));
- // }
- // else if (selection instanceof DesignRange)
- // {
- // ITextSelection srcselection =
- // SelectionHelper.convertFromDesignSelection((DesignRange)selection);
- // event = new SelectionChangedEvent(_editor.getGraphicViewer(),
- // srcselection);
- // _viewerSelectionManager.selectionChanged(event);
- // }
- ITextSelection srcselection = SelectionHelper
- .convertFromDesignSelectionToTextSelection(selection);
-
- // ideally, we should let the text editor display the selection
- // through calls to _viewerSelectionManager,
- // but seemed _viewerSelectionManager don't support that, so we
- // do workaround by calling the text editor (lium)
- _editor.getHTMLEditor().getTextEditor().selectAndReveal(
- srcselection.getOffset(), srcselection.getLength());
- } finally {
- _firingChange = false;
- }
- }
- }
-
- /**
- * We are listening to the selection change in ViewerSelectionManager. The
- * original source of the event could be source view or the outline view or
- * other party that participate in the ViewerSelectionManager.
- * @param start
- * @param end
- */
- public void textSelectionChanged(int start, int end) {
- if (!_firingChange) {
- try {
- _firingChange = true;
-
- // XXX: workaround a SSE problem. In SSE, when user select a
- // range, it will fire two textSelectionChange event
- // the first one indicate the correct range, the second one is
- // zero size for caret position.
- // @see ViewerSelectionManagerImpl.caretMoved
- // We try to ignore the second event by checking whether the
- // current real selection is empty
- if (start == end) {
- ITextSelection sel = (ITextSelection) _editor
- .getHTMLEditor().getTextEditor()
- .getSelectionProvider().getSelection();
- if (sel.getLength() != 0) {
- return;
- }
- }
-
- if (start > end) {
- int temp = start;
- start = end;
- end = temp;
- }
- int offset = start;
- int length = end - start;
-
- ITextSelection oldSelection = SelectionHelper
- .convertFromDesignSelectionToTextSelection(_editor
- .getGraphicViewer().getSelection());
- if (oldSelection != null && oldSelection.getOffset() == offset
- && oldSelection.getLength() == length) {
- return;
- }
-
- ISelection selection = SelectionHelper
- .convertToDesignerSelection(this._editor
- .getGraphicViewer(), offset, length);
- _editor.getGraphicViewer().setSelection(selection);
- } finally {
- _firingChange = false;
- }
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/SimpleGraphicalEditor.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/SimpleGraphicalEditor.java
deleted file mode 100644
index 4c2c043..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/SimpleGraphicalEditor.java
+++ /dev/null
@@ -1,742 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.gef.DefaultEditDomain;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.gef.editparts.ScalableRootEditPart;
-import org.eclipse.gef.palette.PaletteRoot;
-import org.eclipse.gef.ui.actions.ActionRegistry;
-import org.eclipse.gef.ui.actions.UpdateAction;
-import org.eclipse.gef.ui.palette.PaletteViewer;
-import org.eclipse.gef.ui.palette.PaletteViewerProvider;
-import org.eclipse.gef.ui.palette.FlyoutPaletteComposite.FlyoutPreferences;
-import org.eclipse.gef.ui.parts.GraphicalEditorWithFlyoutPalette;
-import org.eclipse.gef.ui.parts.GraphicalViewerKeyHandler;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.actions.container.ContainerActionGroup;
-import org.eclipse.jst.pagedesigner.actions.menuextension.CustomedContextMenuActionGroup;
-import org.eclipse.jst.pagedesigner.actions.range.RangeActionGroup;
-import org.eclipse.jst.pagedesigner.actions.single.SingleElementActionGroup;
-import org.eclipse.jst.pagedesigner.commands.CopyAction;
-import org.eclipse.jst.pagedesigner.commands.CutAction;
-import org.eclipse.jst.pagedesigner.commands.DeleteAction;
-import org.eclipse.jst.pagedesigner.commands.PasteAction;
-import org.eclipse.jst.pagedesigner.dnd.internal.DesignerTemplateTransferDragSourceListener;
-import org.eclipse.jst.pagedesigner.dnd.internal.LocalSelectionDropTargetListener;
-import org.eclipse.jst.pagedesigner.dnd.internal.PDTemplateTransferDropTargetListener;
-import org.eclipse.jst.pagedesigner.dnd.internal.ResouceDropTargetListener;
-import org.eclipse.jst.pagedesigner.editors.actions.ActionsMessages;
-import org.eclipse.jst.pagedesigner.editors.actions.DesignerUndoRedoAction;
-import org.eclipse.jst.pagedesigner.editors.actions.RelatedViewActionGroup;
-import org.eclipse.jst.pagedesigner.editors.palette.DesignerPaletteCustomizer;
-import org.eclipse.jst.pagedesigner.editors.palette.DesignerPaletteRootFactory;
-import org.eclipse.jst.pagedesigner.editors.palette.DesignerPaletteViewerProvider;
-import org.eclipse.jst.pagedesigner.jsp.core.internal.pagevar.DocumentPageVariableAdapter;
-import org.eclipse.jst.pagedesigner.jsp.core.pagevar.adapter.PageVariableAdapterFactory;
-import org.eclipse.jst.pagedesigner.parts.CSSStyleAdapterFactory;
-import org.eclipse.jst.pagedesigner.parts.DocumentEditPart;
-import org.eclipse.jst.pagedesigner.parts.HTMLEditPartsFactory;
-import org.eclipse.jst.pagedesigner.parts.RefresherFactory;
-import org.eclipse.jst.pagedesigner.utils.SelectionHelper;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IPageLayout;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.ActionContext;
-import org.eclipse.ui.texteditor.IWorkbenchActionDefinitionIds;
-import org.eclipse.wst.sse.core.internal.PropagatingAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.IModelStateListener;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.undo.IDocumentSelectionMediator;
-import org.eclipse.wst.sse.core.internal.undo.UndoDocumentEvent;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-
-/**
- * @author mengbo
- */
-public class SimpleGraphicalEditor extends GraphicalEditorWithFlyoutPalette implements
- IDesignViewer, IDocumentSelectionMediator {
-
- private HTMLEditor _delegate;
-
- private IHTMLGraphicalViewer _viewer;
-
- private IStructuredModel _model;
-
- /** Palette component, holding the tools and shapes. */
- private PaletteRoot _palette;
-
- private SelectionSynchronizer _synchronizer = new SelectionSynchronizer(
- this);
-
- private IModelStateListener _internalModelListener = new IModelStateListener() {
- public void modelAboutToBeChanged(IStructuredModel model) {
- // do nothing
- }
-
- public void modelChanged(IStructuredModel model) {
- updateActionsWhenModelChange();
- }
-
- public void modelDirtyStateChanged(IStructuredModel model,
- boolean isDirty) {
- // do nothing
- }
-
- public void modelResourceDeleted(IStructuredModel model) {
- // do nothing
- }
-
- public void modelResourceMoved(IStructuredModel oldModel,
- IStructuredModel newModel) {
- // do nothing
- }
-
- public void modelAboutToBeReinitialized(IStructuredModel structuredModel) {
- // do nothing
- }
-
- public void modelReinitialized(IStructuredModel structuredModel) {
- // do nothing
- }
- };
-
- /**
- * @param delegate
- * @param editdomain
- */
- public SimpleGraphicalEditor(HTMLEditor delegate,
- DefaultEditDomain editdomain) {
- _delegate = delegate;
- this.setEditDomain(editdomain);
- }
-
- protected void createGraphicalViewer(Composite parent) {
- _viewer = IHTMLGraphicalViewer.Factory.createGraphicalViewer(this);
- Control control = _viewer.createControl(parent);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(control,
- PDPlugin.getResourceString("SimpleGraphicalEditor.help.id"));
- setGraphicalViewer(_viewer);
- configureGraphicalViewer();
- hookGraphicalViewer();
- initializeGraphicalViewer();
- initializeContextMenu();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.ui.parts.GraphicalEditor#dispose()
- */
- public void dispose() {
- if (_model != null) {
- _model.getUndoManager().disconnect(this);
- }
-
- super.dispose();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.ui.parts.GraphicalEditor#initializeGraphicalViewer()
- */
- protected void initializeGraphicalViewer() {
- ScalableRootEditPart rootEditPart = new ScalableRootEditPart();
- _viewer.setRootEditPart(rootEditPart);
-
- _viewer.getViewport().setContentsTracksWidth(true);
-
- _viewer.setKeyHandler(new GraphicalViewerKeyHandler(_viewer));
-
- // initialize the viewer with input
- // IStructuredModel sModel =
- // StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(ContentTypeIdForHTML.ContentTypeID_HTML);
- // IDOMDocument designDoc = ((IDOMModel)sModel).getDocument();
- // HTMLEditPartsFactory factory = new HTMLEditPartsFactory(designDoc);
- HTMLEditPartsFactory factory = new HTMLEditPartsFactory(null);
-
- _viewer.setEditPartFactory(factory);
-
- // for sync with source view.
-
- _viewer.addDropTargetListener(new LocalSelectionDropTargetListener(
- _viewer));
- _viewer.addDropTargetListener(new PDTemplateTransferDropTargetListener(
- _viewer));
- _viewer.addDropTargetListener(new ResouceDropTargetListener(_viewer));
-
- // add double click support.
- _viewer.getControl().addMouseListener(new MouseAdapter() {
- public void mouseDoubleClick(MouseEvent e) {
- try {
- getSite().getPage().showView(IPageLayout.ID_PROP_SHEET);
- } catch (PartInitException e1) {
- // ignore
- }
- }
- });
-
- super.initializeGraphicalViewer();
- }
-
- /**
- *
- */
- protected void initializeContextMenu() {
- Control gviewer = _viewer.getControl();
- MenuManager menuMgr = new MenuManager();
- menuMgr.setRemoveAllWhenShown(true);
- Menu menu = menuMgr.createContextMenu(gviewer);
- gviewer.setMenu(menu);
- menuMgr.addMenuListener(new ContextMenuListener());
- getSite().registerContextMenu(
- "HTMLVisualEditor.contextMenu", menuMgr, _viewer); //$NON-NLS-1$
- }
-
- private void updateActionsWhenModelChange() {
- // update undo/redo action
- IAction action = this.getAction(IWorkbenchActionDefinitionIds.UNDO);
- ((UpdateAction) action).update();
-
- action = this.getAction(IWorkbenchActionDefinitionIds.REDO);
- ((UpdateAction) action).update();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.ui.parts.GraphicalEditor#createActions()
- */
- protected void createActions() {
- super.createActions();
- ActionRegistry registry = getActionRegistry();
- ISharedImages sharedImages = PlatformUI.getWorkbench()
- .getSharedImages();
-
- IAction action;
-
- action = new DesignerUndoRedoAction(true, this);
- action.setImageDescriptor(sharedImages
- .getImageDescriptor(ISharedImages.IMG_TOOL_UNDO));
- action.setDisabledImageDescriptor(sharedImages
- .getImageDescriptor(ISharedImages.IMG_TOOL_UNDO_DISABLED));
- action.setActionDefinitionId(IWorkbenchActionDefinitionIds.UNDO);
- action.setId(IWorkbenchActionDefinitionIds.UNDO);
- getSite().getKeyBindingService().registerAction(action);
- registry.registerAction(action);
-
- action = new DesignerUndoRedoAction(false, this);
- action.setImageDescriptor(sharedImages
- .getImageDescriptor(ISharedImages.IMG_TOOL_REDO));
- action.setDisabledImageDescriptor(sharedImages
- .getImageDescriptor(ISharedImages.IMG_TOOL_REDO_DISABLED));
- action.setActionDefinitionId(IWorkbenchActionDefinitionIds.REDO);
- action.setId(IWorkbenchActionDefinitionIds.REDO);
- getSite().getKeyBindingService().registerAction(action);
- registry.registerAction(action);
-
- action = new DeleteAction(this);
- action.setImageDescriptor(sharedImages
- .getImageDescriptor(ISharedImages.IMG_TOOL_DELETE));
- action.setDisabledImageDescriptor(sharedImages
- .getImageDescriptor(ISharedImages.IMG_TOOL_DELETE_DISABLED));
- action.setActionDefinitionId(IWorkbenchActionDefinitionIds.DELETE);
- action.setId(IWorkbenchActionDefinitionIds.DELETE);
- getSite().getKeyBindingService().registerAction(action);
- this.getSelectionActions().add(action.getId());
- registry.registerAction(action);
-
- action = new CopyAction(this);
- action.setImageDescriptor(sharedImages
- .getImageDescriptor(ISharedImages.IMG_TOOL_COPY));
- action.setDisabledImageDescriptor(sharedImages
- .getImageDescriptor(ISharedImages.IMG_TOOL_COPY_DISABLED));
- action.setActionDefinitionId(IWorkbenchActionDefinitionIds.COPY);
- action.setId(IWorkbenchActionDefinitionIds.COPY);
- getSite().getKeyBindingService().registerAction(action);
- this.getSelectionActions().add(action.getId());
- registry.registerAction(action);
-
- action = new CutAction(this);
- action.setImageDescriptor(sharedImages
- .getImageDescriptor(ISharedImages.IMG_TOOL_CUT));
- action.setDisabledImageDescriptor(sharedImages
- .getImageDescriptor(ISharedImages.IMG_TOOL_CUT_DISABLED));
- action.setActionDefinitionId(IWorkbenchActionDefinitionIds.CUT);
- action.setId(IWorkbenchActionDefinitionIds.CUT);
- getSite().getKeyBindingService().registerAction(action);
- this.getSelectionActions().add(action.getId());
- registry.registerAction(action);
-
- action = new PasteAction(this);
- action.setImageDescriptor(sharedImages
- .getImageDescriptor(ISharedImages.IMG_TOOL_PASTE));
- action.setDisabledImageDescriptor(sharedImages
- .getImageDescriptor(ISharedImages.IMG_TOOL_PASTE_DISABLED));
- action.setActionDefinitionId(IWorkbenchActionDefinitionIds.PASTE);
- action.setId(IWorkbenchActionDefinitionIds.PASTE);
- getSite().getKeyBindingService().registerAction(action);
- this.getSelectionActions().add(action.getId());
- registry.registerAction(action);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.ISaveablePart#doSave(org.eclipse.core.runtime.IProgressMonitor)
- */
- public void doSave(IProgressMonitor monitor) {
- if (_delegate != null) {
- _delegate.doSave(monitor);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.ISaveablePart#doSaveAs()
- */
- public void doSaveAs() {
- if (_delegate != null) {
- _delegate.doSaveAs();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.ISaveablePart#isDirty()
- */
- public boolean isDirty() {
- if (_delegate != null) {
- return _delegate.isDirty();
- }
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.ISaveablePart#isSaveAsAllowed()
- */
- public boolean isSaveAsAllowed() {
- if (_delegate != null) {
- return _delegate.isSaveAsAllowed();
- }
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.sybase.html.editor.IDesignViewer#setModel(com.ibm.sse.model.IStructuredModel)
- */
- public void setModel(IStructuredModel model) {
- if (_model != null) {
- if (_model.getUndoManager() != null)
- _model.getUndoManager().disconnect(this);
- _model.removeModelStateListener(_internalModelListener);
- }
-
- this._model = model;
-
- if (_model != null) {
- _model.addModelStateListener(_internalModelListener);
- if (_model.getUndoManager() != null) {
- _model.getUndoManager().connect(this);
- updateActionsWhenModelChange();
- }
- }
-
- if (model instanceof IDOMModel) {
- IDOMDocument doc = ((IDOMModel) model).getDocument();
- PropagatingAdapter adapter = (PropagatingAdapter) doc
- .getAdapterFor(PropagatingAdapter.class);
- if (adapter != null) {
- INodeAdapterFactory factory = RefresherFactory.getInstance();
- adapter.addAdaptOnCreateFactory(factory);
- adapter.initializeForFactory(factory, doc);
- // CSSStyleAdapterFactory fac2 =
- // CSSStyleAdapterFactory.getInstance();
- // adapter.addAdaptOnCreateFactory(fac2);
- // adapter.initializeForFactory(fac2, doc);
- }
- ((IDOMModel) model).getFactoryRegistry().addFactory(
- CSSStyleAdapterFactory.getInstance());
-
- // _viewer.getDestDocumentForDesign().getModel().getFactoryRegistry().addFactory(CSSStyleAdapterFactory.getInstance());
- ((IDOMModel) model).getFactoryRegistry().addFactory(
- new PageVariableAdapterFactory());
- doc.addAdapter(new DocumentPageVariableAdapter(doc));
- _viewer.setContents(((IDOMModel) model).getDocument());
- } else {
- _viewer.setContents((EditPart) null);
- }
- }
-
- /**
- * @return the selection synchronizer
- */
- protected SelectionSynchronizer getSynchronizer() {
- return _synchronizer;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.ui.parts.GraphicalEditor#updateActions(java.util.List)
- */
- protected void updateActions(List actionIds) {
- super.updateActions(actionIds);
- }
-
- /**
- * @param id
- * @return the action for the id
- */
- public IAction getAction(Object id) {
- // lium: following lines commented out, see comments in
- // DesignerUndoRedoAction
- // if (ITextEditorActionConstants.UNDO.equals(id) ||
- // ITextEditorActionConstants.REDO.equals(id))
- // {
- // return _delegate.getTextEditor().getAction((String) id);
- // }
- return getActionRegistry().getAction(id);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.ui.parts.GraphicalEditorWithFlyoutPalette#getPalettePreferences()
- */
- protected FlyoutPreferences getPalettePreferences() {
- return DesignerPaletteRootFactory.createPalettePreferences();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.ui.parts.GraphicalEditorWithFlyoutPalette#getPaletteRoot()
- */
- protected PaletteRoot getPaletteRoot() {
- if (_palette == null) {
- _palette = DesignerPaletteRootFactory
- .createPaletteRoot(getCurrentProject(_delegate.getEditorInput()));
- }
- return _palette;
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.ui.parts.GraphicalEditorWithFlyoutPalette#createPaletteViewerProvider()
- */
- protected PaletteViewerProvider createPaletteViewerProvider() {
- return new DesignerPaletteViewerProvider(getEditDomain()) {
- protected void configurePaletteViewer(PaletteViewer viewer) {
- super.configurePaletteViewer(viewer);
- viewer.setCustomizer(new DesignerPaletteCustomizer());
-
- // create a drag source listener for this palette viewer
- // together with an appropriate transfer drop target listener,
- // this will enable
- // model element creation by dragging a
- // CombinatedTemplateCreationEntries
- // from the palette into the editor
- // @see ShapesEditor#createTransferDropTargetListener()
- viewer
- .addDragSourceListener(new DesignerTemplateTransferDragSourceListener(
- viewer));
- }
- };
- }
-
- PaletteViewerProvider getPaletteViewerProvider2()
- {
- return getPaletteViewerProvider();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.editors.IDesignViewer#getGraphicViewer()
- */
- public IHTMLGraphicalViewer getGraphicViewer() {
- return _viewer;
- }
-
- /**
- * @return the html editor delegate
- */
- public HTMLEditor getHTMLEditor() {
- return _delegate;
- }
-
- private IProject getCurrentProject(IEditorInput input) {
- IProject curProject = null;
- IFile inputFile = null;
- if (input instanceof IFileEditorInput) {
- inputFile = ((IFileEditorInput) input).getFile();
- curProject = inputFile.getProject();
- }
- return curProject;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart,
- * org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
- if (_viewer != null) {
- GraphicalViewer viewerViewer = getGraphicalViewer();
- if (viewerViewer != null && viewerViewer.getControl() != null
- && viewerViewer.getControl().isFocusControl()) {
- updateActions(getSelectionActions());
- if (selection instanceof IStructuredSelection && //
- !(((IStructuredSelection) selection).getFirstElement() instanceof DocumentEditPart)) {
- ((IHTMLGraphicalViewer) viewerViewer)
- .updateRangeSelection(selection);
- }
- }
- } else {
- super.selectionChanged(part, selection);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.internal.undo.IDocumentSelectionMediator#getDocument()
- */
- public IDocument getDocument() {
- if (_model != null) {
- return _model.getStructuredDocument();
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.internal.undo.IDocumentSelectionMediator#undoOperationSelectionChanged(org.eclipse.wst.sse.core.internal.undo.UndoDocumentEvent)
- */
- public void undoOperationSelectionChanged(UndoDocumentEvent event) {
- IDocumentSelectionMediator requester = event.getRequester();
- if (this == requester) {
- // ok, the undo/redo operation is initialized by designer page.
- // we should set selection in designer.
- // However, when this method is called, the modelChanged event is
- // not fired yet, so the
- // editpart hasn't refreshed yet. So we register a
- // modelStateListener, and do the selection
- // in modelChangedEvent. (lium)
- final int offset = event.getOffset();
- final int length = event.getLength();
-
- _model.addModelStateListener(new IModelStateListener() {
- public void modelAboutToBeChanged(IStructuredModel model) {
- // nothing to do
- }
-
- public void modelChanged(IStructuredModel model) {
- _model.removeModelStateListener(this);
- ISelection sel = SelectionHelper
- .convertToDesignerSelection(getGraphicViewer(),
- offset, length);
- if (sel != null) {
- getGraphicViewer().setSelection(sel);
- }
- }
-
- public void modelDirtyStateChanged(IStructuredModel model,
- boolean isDirty) {
- // do nothing
- }
-
- public void modelResourceDeleted(IStructuredModel model) {
- // do nothign
- }
-
- public void modelResourceMoved(IStructuredModel oldModel,
- IStructuredModel newModel) {
- // do nothing
- }
-
- public void modelAboutToBeReinitialized(
- IStructuredModel structuredModel) {
- // do nothing
- }
-
- public void modelReinitialized(IStructuredModel structuredModel) {
- // do nothing
- }
- });
- }
- }
-
- private final class ContextMenuListener implements IMenuListener
- {
- public void menuAboutToShow(IMenuManager menuMgr1)
- {
- // add standarized sub-menus
- addEditSubMenu(menuMgr1);
- addSelectSubMenu(menuMgr1);
- addInsertSubMenu(menuMgr1);
- addNavigateSubMenu(menuMgr1);
- addStyleSubMenu(menuMgr1);
-
- // add separators that mark standard append locations in the main
- // context menu
- PageDesignerActionConstants.addStandardActionGroups(menuMgr1);
-
- // TODO: Run/Debug?
-
- // insert ElementEdit contributed menu items
- final ContainerActionGroup containerActionGroup =
- new ContainerActionGroup();
- ActionContext context = new ActionContext(_viewer
- .getSelection());
- context.setInput(_viewer);
- containerActionGroup.setContext(context);
- containerActionGroup.fillContextMenu(menuMgr1);
- containerActionGroup.setContext(null);
-
- // TODO: TableActionGroup
-
- // if on a text context, (instead of a ElementEditPart),
- // add text styling actions
- final RangeActionGroup rangeActionGroup = new RangeActionGroup();
- context = new ActionContext(_viewer.getSelection());
- context.setInput(_viewer);
- rangeActionGroup.setContext(context);
- rangeActionGroup.fillContextMenu(menuMgr1);
- rangeActionGroup.setContext(null);
-
- // Add actions for single ElementEditPart's that are common
- // to all
- final SingleElementActionGroup singleActionGroup =
- new SingleElementActionGroup();
- singleActionGroup.setContext(new ActionContext(_viewer
- .getSelection()));
- singleActionGroup.fillContextMenu(menuMgr1);
- singleActionGroup.setContext(null);
-
- // add "Show In" actions...
- final RelatedViewActionGroup viewMenu = new RelatedViewActionGroup(getEditDomain());
- context = new ActionContext(_viewer.getSelection());
- viewMenu.setContext(context);
- viewMenu.fillContextMenu(menuMgr1);
-
- // add extension point contributed menu actions
- CustomedContextMenuActionGroup customedMenu = new CustomedContextMenuActionGroup();
- customedMenu.setContext(new ActionContext(_viewer
- .getSelection()));
- customedMenu.setModel(_model);
- customedMenu.setParentControl(_viewer.getControl());
- customedMenu.fillContextMenu(menuMgr1);
- customedMenu.setContext(null);
- customedMenu.setParentControl(null);
- customedMenu.setModel(null);
- }
-
- private void addNavigateSubMenu(IMenuManager menu) {
- final IMenuManager navigateSubmenu =
- new MenuManager(ActionsMessages.getString("Navigate.Menu") //$NON-NLS-1$
- , PageDesignerActionConstants.NAVIGATE_SUBMENU_ID);
- menu.add(navigateSubmenu);
- PageDesignerActionConstants.addStandardNavigateActionGroups(navigateSubmenu);
- }
-
- private void addEditSubMenu(IMenuManager menu)
- {
- final IMenuManager editSubmenu
- = new MenuManager(ActionsMessages.getString("Edit.Menu") //$NON-NLS-1$
- , PageDesignerActionConstants.EDIT_SUBMENU_ID);
- menu.add(editSubmenu);
- PageDesignerActionConstants.addStandardEditActionGroups(editSubmenu);
-
- // FIXME: for UNDO/REDO, maybe need also wrap them in
- // DesignerCommand.
- // otherwise don't have validate() called after the source
- // change.
- editSubmenu.appendToGroup(PageDesignerActionConstants.GROUP_UNDO,
- getAction(IWorkbenchActionDefinitionIds.UNDO));
- editSubmenu.appendToGroup(PageDesignerActionConstants.GROUP_UNDO,
- getAction(IWorkbenchActionDefinitionIds.REDO));
-
- editSubmenu.appendToGroup(PageDesignerActionConstants.GROUP_EDIT,
- getAction(IWorkbenchActionDefinitionIds.CUT));
- editSubmenu.appendToGroup(PageDesignerActionConstants.GROUP_EDIT,
- getAction(IWorkbenchActionDefinitionIds.COPY));
- editSubmenu.appendToGroup(PageDesignerActionConstants.GROUP_EDIT,
- getAction(IWorkbenchActionDefinitionIds.PASTE));
- editSubmenu.appendToGroup(PageDesignerActionConstants.GROUP_EDIT,
- getAction(IWorkbenchActionDefinitionIds.DELETE));
-
- }
-
- private void addStyleSubMenu(IMenuManager menu)
- {
- final IMenuManager styleSubmenu =
- new MenuManager(ActionsMessages.getString("Style.Menu") //$NON-NLS-1$
- , PageDesignerActionConstants.STYLE_SUBMENU_ID);
- menu.add(styleSubmenu);
- PageDesignerActionConstants.addStandardStyleActionGroups(styleSubmenu);
- }
- private void addInsertSubMenu(IMenuManager menu) {
- final IMenuManager insertSubmenu =
- new MenuManager(ActionsMessages.getString("Insert.Menu") //$NON-NLS-1$
- , PageDesignerActionConstants.INSERT_SUBMENU_ID);
- menu.add(insertSubmenu);
- PageDesignerActionConstants.addStandardInsertActionGroups(insertSubmenu);
- }
-
- private void addSelectSubMenu(IMenuManager menu)
- {
- final IMenuManager selectSubMenu =
- new MenuManager(ActionsMessages.getString("Select.Menu") //$NON-NLS-1$
- , PageDesignerActionConstants.SELECT_SUBMENU_ID);
- menu.add(selectSubMenu);
- PageDesignerActionConstants.addStandardSelectActionGroups(selectSubMenu);
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/ActionsMessages.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/ActionsMessages.java
deleted file mode 100644
index b5da948..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/ActionsMessages.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.actions;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class ActionsMessages {
- private static final String BUNDLE_NAME = "org.eclipse.jst.pagedesigner.editors.actions.ActionsMessages"; //$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
- .getBundle(BUNDLE_NAME);
-
- private ActionsMessages() {
- // no external instantiation
- }
-
- /**
- * @param key
- * @return the resource for the key
- */
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/ActionsMessages.properties b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/ActionsMessages.properties
deleted file mode 100644
index 6944ae3..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/ActionsMessages.properties
+++ /dev/null
@@ -1,43 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2007 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are 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:
-# Oracle Corporation - initial API and implementation
-###############################################################################
-DesignActionBarFactory.Underline=Underline
-DesignActionBarFactory.Italic=Italic
-DesignActionBarFactory.Bold=Bold
-DesignActionBarFactory.Small=Small
-DesignActionBarFactory.Big=Big
-DesignActionBarFactory.Paragraph=Paragraph
-DesignActionBarFactory.Underline.Text=Underline
-DesignActionBarFactory.Italic.Text=Italic
-DesignActionBarFactory.Bold.Text=Bold
-DesignActionBarFactory.Small.Text=Small
-DesignActionBarFactory.Big.Text=Big
-PaletteViewAction.Menu.PaletteView=Palette
-RelatedViewActionGroup.Menu.ShowView=Show
-PropertiesViewAction.Menu.Properties=Properties
-DataBindingViewAction.Menu.DataBinding=DataBinding
-OutlineViewAction.Menu.OutlineView=Outline
-DesignerStyleActionGroup.CommandLabel.V=V
-DesignerStyleActionGroup.CommandLabel.H=H
-DesignerStyleActionGroup.CommandLabel.D=D
-DesignerStyleActionGroup.CommandLabel.S=S
-DesignerStyleActionGroup.CommandLabel.V.Tooltip=Show Design Page and Source Page as Horizontal Panes
-DesignerStyleActionGroup.CommandLabel.H.Tooltip=Show Design Page and Source Page as Vertical Panes
-DesignerStyleActionGroup.CommandLabel.D.Tooltip=Only Show Design Page
-DesignerStyleActionGroup.CommandLabel.S.Tooltip=Only Show Source Page
-DesignerUndoRedoAction.UNDO=Undo
-DesignerUndoRedoAction.REDO=Redo
-DesignerUndoRedoAction.UNDO_LABEL=Undo {0}
-DesignerUndoRedoAction.REDO_LABEL=Redo {0}
-Select.Menu=Select
-Edit.Menu=Edit
-Navigate.Menu=Navigate
-Style.Menu=Style
-Insert.Menu=Insert
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/ChangeStyleAction.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/ChangeStyleAction.java
deleted file mode 100644
index 70e5a68..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/ChangeStyleAction.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jst.pagedesigner.commands.DesignerCommand;
-import org.eclipse.jst.pagedesigner.commands.range.ApplyStyleCommand;
-import org.eclipse.jst.pagedesigner.range.RangeUtil;
-import org.eclipse.jst.pagedesigner.viewer.DesignRange;
-import org.eclipse.jst.pagedesigner.viewer.HTMLGraphicalViewerListenenerAdapter;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewerListener;
-import org.eclipse.ui.texteditor.IUpdate;
-
-/**
- * @author mengbo
- */
-public abstract class ChangeStyleAction extends Action implements IUpdate {
- private IHTMLGraphicalViewer _viewer;
-
- private String _expectedTag;
-
- private IHTMLGraphicalViewerListener _listener = new HTMLGraphicalViewerListenenerAdapter()
- {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewerListener#selectionChangeFinished()
- */
- public void selectionChangeFinished() {
- update();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
- */
- public void selectionChanged(SelectionChangedEvent event) {
- update();
- }
- };
-
- /**
- * @param text
- * @param name
- * @param image
- * @param style
- */
- public ChangeStyleAction(String text, String name, ImageDescriptor image,
- int style) {
- super(text, style);
- _expectedTag = name;
- this.setImageDescriptor(image);
- }
-
- /**
- * @param viewer
- */
- public void setViewer(IHTMLGraphicalViewer viewer) {
- if (viewer == _viewer) {
- return;
- }
- if (_viewer != null) {
- _viewer.removeHTMLViewerListener(_listener);
- }
- _viewer = viewer;
- if (_viewer != null) {
- _viewer.addHTMLViewerListener(_listener);
- }
- update();
- }
-
- /**
- *
- */
- public void update()
- {
- boolean update = checkForUpdateAndMaybeDisableState();
-
- if (update)
- {
- updateState();
- }
- }
-
- /**
- * Update the state
- */
- protected void updateState()
- {
- DesignRange range = _viewer.getRangeSelection();
- updateStatus(RangeUtil.normalize(range));
- }
-
- /**
- * Update the checked/enabled state
- * @return true if we should update status
- */
- protected final boolean checkForUpdateAndMaybeDisableState()
- {
- if (_viewer == null) {
- this.setChecked(false);
- this.setEnabled(false);
- return false;
- }
- if (!_viewer.isInRangeMode()) {
- // XXX: later we may support in range mode.
- this.setChecked(false);
- this.setEnabled(false);
- return false;
- }
- DesignRange range = _viewer.getRangeSelection();
- if (range == null || !range.isValid()) {
- this.setChecked(false);
- this.setEnabled(false);
- return false;
- }
- return true;
- }
-
-
- /**
- * @return the viewer's current design range
- */
- protected final DesignRange getDesignRange()
- {
- return _viewer.getRangeSelection();
- }
- /**
- * @param range
- */
- private void updateStatus(DesignRange range) {
- if (range.isEmpty()) {
- this.setEnabled(false);
- this.setChecked(false); // FIXME: not handling checked status yet.
- } else {
- this.setEnabled(true);
- this.setChecked(false);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run() {
- if (_viewer == null || !_viewer.isInRangeMode()) {
- return;
- }
- DesignRange range = _viewer.getRangeSelection();
- if (range == null || !range.isValid()) {
- return;
- }
- if (range.isEmpty())
- return; // nothing to do to empty range.
-
- // if currently checked, means unapply the style. If current not
- // checked, means apply the style
- boolean apply = !this.isChecked();
- if (apply) {
- applyStyle();
- } else {
- // not supported yet.
- }
- }
-
- /**
- *
- */
- private void applyStyle() {
- DesignerCommand command = new ApplyStyleCommand(_viewer,
- getExpectedTag(), getExpectedCSSProperty(),
- getExpectedCSSPropertyValue());
- command.execute();
- }
-
- /**
- * @return the expected property value
- */
- protected abstract String getExpectedCSSPropertyValue();
-
- /**
- * @return the expected property
- */
- protected abstract String getExpectedCSSProperty();
-
- /**
- * @return the expected tag
- */
- protected String getExpectedTag() {
- return _expectedTag;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/DataBindingViewAction.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/DataBindingViewAction.java
deleted file mode 100644
index 17fb7d7..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/DataBindingViewAction.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class DataBindingViewAction extends Action {
-
- private static Logger _log = PDPlugin
- .getLogger(DataBindingViewAction.class);
-
- /**
- * Default constructor
- */
- public DataBindingViewAction() {
- setText(ActionsMessages
- .getString("DataBindingViewAction.Menu.DataBinding")); //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- try {
- getPage().showView(
- "org.eclipse.jst.pagedesigner.databinding.ui.views.DataBindingsView");//$NON-NLS-1$
- } catch (PartInitException e) {
- _log.error("Error opening the DataBindingView");
- }
- }
-
- private IWorkbenchPage getPage() {
- IWorkbench workbench = PlatformUI.getWorkbench();
- IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
- return window.getActivePage();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/DesignActionBarFactory.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/DesignActionBarFactory.java
deleted file mode 100644
index 0b9971f..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/DesignActionBarFactory.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.actions.range.ChangeStyleAction;
-import org.eclipse.jst.pagedesigner.actions.range.DesignerToolBarAction;
-import org.eclipse.jst.pagedesigner.actions.range.HTagsInsertGroupAction;
-
-/**
- * @author mengbo
- */
-public class DesignActionBarFactory {
- private static DesignActionBarFactory _instance;
-
- private DesignActionBarFactory() {
- // no external instantiation
- }
-
- /**
- * @return get the factory singleton
- */
- public static DesignActionBarFactory getInstance() {
- if (_instance == null) {
- _instance = new DesignActionBarFactory();
- }
- return _instance;
- }
-
- /**
- * @param name
- * @return the tool bar action
- */
- public DesignerToolBarAction getStyleAction(String name) {
- DesignerToolBarAction action = null;
-
- if (name.equals(IHTMLConstants.TAG_U)) {
- action = new ChangeStyleAction(ActionsMessages
- .getString("DesignActionBarFactory.Underline.Text"), name,
- PDPlugin.getDefault().getImageDescriptor(
- "PD_Toolbar_underline.gif"), PDPlugin.getDefault()
- .getImageDescriptor(
- "PD_Toolbar_underline_disabled.gif"),
- IAction.AS_CHECK_BOX);
- action.setToolTipText(ActionsMessages
- .getString("DesignActionBarFactory.Underline"));
- } else if (name.equals(IHTMLConstants.TAG_I)) {
- action = new ChangeStyleAction(ActionsMessages
- .getString("DesignActionBarFactory.Italic.Text"), name,
- PDPlugin.getDefault().getImageDescriptor(
- "PD_Toolbar_italic.gif"), PDPlugin.getDefault()
- .getImageDescriptor(
- "PD_Toolbar_italic_disabled.gif"),
- IAction.AS_CHECK_BOX);
- action.setToolTipText(ActionsMessages
- .getString("DesignActionBarFactory.Italic"));
- } else if (name.equals(IHTMLConstants.TAG_B)) {
- action = new ChangeStyleAction(ActionsMessages
- .getString("DesignActionBarFactory.Bold.Text"), name,
- PDPlugin.getDefault().getImageDescriptor(
- "PD_Toolbar_bold.gif"),
- PDPlugin.getDefault().getImageDescriptor(
- "PD_Toolbar_bold_disabled.gif"),
- IAction.AS_CHECK_BOX);
- action.setToolTipText(ActionsMessages
- .getString("DesignActionBarFactory.Bold"));
- } else if (name.equals(IHTMLConstants.TAG_SMALL)) {
- action = new ChangeStyleAction(ActionsMessages
- .getString("DesignActionBarFactory.Small.Text"), name,
- PDPlugin.getDefault().getImageDescriptor(
- "PD_Toolbar_smallfont.gif"), PDPlugin.getDefault()
- .getImageDescriptor(
- "PD_Toolbar_smallfont_disabled.gif"),
- IAction.AS_CHECK_BOX);
- action.setToolTipText(ActionsMessages
- .getString("DesignActionBarFactory.Small"));
- } else if (name.equals(IHTMLConstants.TAG_BIG)) {
- action = new ChangeStyleAction(ActionsMessages
- .getString("DesignActionBarFactory.Big.Text"), name,
- PDPlugin.getDefault().getImageDescriptor(
- "PD_Toolbar_largefont.gif"), PDPlugin.getDefault()
- .getImageDescriptor(
- "PD_Toolbar_largefont_disabled.gif"),
- IAction.AS_CHECK_BOX);
- action.setToolTipText(ActionsMessages
- .getString("DesignActionBarFactory.Big"));
- } else if (name
- .equalsIgnoreCase(DesignPageActionContributor.PARAGRAPH_ACTION_ID)) {
- action = new HTagsInsertGroupAction(PDPlugin.getDefault()
- .getImageDescriptor("PD_Toolbar_paragraph.gif"),
- IAction.AS_DROP_DOWN_MENU);
- action.setToolTipText(ActionsMessages
- .getString("DesignActionBarFactory.Paragraph"));
- }
-
- return action;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/DesignPageActionContributor.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/DesignPageActionContributor.java
deleted file mode 100644
index 131ec1b..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/DesignPageActionContributor.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IContributionManager;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.actions.range.DesignerToolBarAction;
-import org.eclipse.jst.pagedesigner.editors.HTMLEditor;
-import org.eclipse.jst.pagedesigner.editors.SimpleGraphicalEditor;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPartSite;
-import org.eclipse.ui.part.EditorActionBarContributor;
-import org.eclipse.ui.texteditor.ITextEditorActionConstants;
-import org.eclipse.ui.texteditor.IWorkbenchActionDefinitionIds;
-
-/**
- * sub action contributor for the designer page.
- *
- * @author mengbo
- */
-public class DesignPageActionContributor extends EditorActionBarContributor {
- private static final Logger _log = PDPlugin
- .getLogger(DesignPageActionContributor.class);
-
- /**
- * paragraph
- */
- public static final String PARAGRAPH_ACTION_ID = "paragraph";
-
- private IEditorPart _editorPart;
-
- /**
- * @param manager
- * @param id
- */
- protected void doRemove(IContributionManager manager, String id) {
- try {
- if (manager.find(id) != null) {
- manager.remove(id);
- }
- } catch (Exception e) {
- _log.info("Error:", e);
- }
- }
-
- public void init(IActionBars bars, IWorkbenchPage page) {
- super.init(bars);
- init(bars);
- }
-
- public void init(IActionBars bars) {
- IToolBarManager toolbar = bars.getToolBarManager();
- initToolbar(toolbar);
- }
-
- /**
- * @param toolbar
- */
- private void initToolbar(IToolBarManager toolbar) {
- DesignActionBarFactory factory = DesignActionBarFactory.getInstance();
-
- Action action = factory.getStyleAction(IHTMLConstants.TAG_U);
- toolbar.add(action);
-
- action = factory.getStyleAction(IHTMLConstants.TAG_B);
- toolbar.add(action);
-
- action = factory.getStyleAction(IHTMLConstants.TAG_I);
- toolbar.add(action);
-
- action = factory.getStyleAction(IHTMLConstants.TAG_SMALL);
- toolbar.add(action);
-
- action = factory.getStyleAction(IHTMLConstants.TAG_BIG);
- toolbar.add(action);
- // action = factory.getStyleAction(PARAGRAPH_ACTION_ID);
- // toolbar.add(action);
- }
-
- /**
- * @param menuManager
- * @param action
- * @param id
- */
- protected void addActionWithId(IMenuManager menuManager, Action action,
- String id) {
- action.setId(id);
- menuManager.add(action);
- }
-
- /**
- * @param enabled
- */
- public void setViewerSpecificContributionsEnabled(boolean enabled) {
- HTMLEditor htmlEditor = null;
- if (_editorPart instanceof HTMLEditor) {
- htmlEditor = (HTMLEditor) _editorPart;
- } else if (_editorPart instanceof SimpleGraphicalEditor) {
- htmlEditor = ((SimpleGraphicalEditor) _editorPart).getHTMLEditor();
- }
-
- if (htmlEditor == null)
- return;
-
- SimpleGraphicalEditor graphicalEditor = (SimpleGraphicalEditor) htmlEditor
- .getDesignViewer();
- IWorkbenchPartSite site = htmlEditor.getSite();
- if (site instanceof IEditorSite) {
- IActionBars actionBars = ((IEditorSite) site).getActionBars();
-
- if (enabled) {
- // // we always let the text editor to handle UNDO and REDO
- // actionBars.setGlobalActionHandler(ITextEditorActionConstants.UNDO,
- // textEditor
- // .getAction(ITextEditorActionConstants.UNDO));
- // actionBars.setGlobalActionHandler(ITextEditorActionConstants.REDO,
- // textEditor
- // .getAction(ITextEditorActionConstants.REDO));
- // lium: the above behavior changed, since we now use
- // DesignerUndoRedoAction.
- // see comments in DesignerUndoRedoAction
- actionBars.setGlobalActionHandler(
- ITextEditorActionConstants.UNDO, graphicalEditor
- .getAction(IWorkbenchActionDefinitionIds.UNDO));
- actionBars.setGlobalActionHandler(
- ITextEditorActionConstants.REDO, graphicalEditor
- .getAction(IWorkbenchActionDefinitionIds.REDO));
-
- // cut/copy/paste is delegated to design actions
- actionBars
- .setGlobalActionHandler(
- ITextEditorActionConstants.DELETE,
- graphicalEditor
- .getAction(IWorkbenchActionDefinitionIds.DELETE));
- actionBars.setGlobalActionHandler(
- ITextEditorActionConstants.CUT, graphicalEditor
- .getAction(IWorkbenchActionDefinitionIds.CUT));
- actionBars.setGlobalActionHandler(
- ITextEditorActionConstants.COPY, graphicalEditor
- .getAction(IWorkbenchActionDefinitionIds.COPY));
- actionBars
- .setGlobalActionHandler(
- ITextEditorActionConstants.PASTE,
- graphicalEditor
- .getAction(IWorkbenchActionDefinitionIds.PASTE));
- } else {
- actionBars.setGlobalActionHandler(
- ITextEditorActionConstants.UNDO, null);
- actionBars.setGlobalActionHandler(
- ITextEditorActionConstants.REDO, null);
-
- actionBars.setGlobalActionHandler(
- ITextEditorActionConstants.DELETE, null);
- actionBars.setGlobalActionHandler(
- ITextEditorActionConstants.CUT, null);
- actionBars.setGlobalActionHandler(
- ITextEditorActionConstants.COPY, null);
- actionBars.setGlobalActionHandler(
- ITextEditorActionConstants.PASTE, null);
- }
- }
- }
-
- /**
- * The active editor passed in could be the following: HTMLEditor,
- * SimpleGraphicalEditor, null.
- */
- public void setActiveEditor(IEditorPart targetEditor) {
- _editorPart = targetEditor;
-
- // temp code.
- if (targetEditor instanceof SimpleGraphicalEditor) {
- IHTMLGraphicalViewer viewer = ((SimpleGraphicalEditor) targetEditor)
- .getGraphicViewer();
- setViewerOnActions(viewer);
- } else if (targetEditor instanceof HTMLEditor) {
- IHTMLGraphicalViewer viewer = ((HTMLEditor) targetEditor)
- .getDesignViewer().getGraphicViewer();
- setViewerOnActions(viewer);
- } else {
- setViewerOnActions(null);
- }
-
- // TODO... uncomment this and investigate NPE
- //
- // add the cut/copy/paste for text fields
- // ActionHandlerPlugin.connectPart(editorPart);
- }
-
- private void setViewerOnActions(IHTMLGraphicalViewer viewer) {
- IContributionItem[] items = getActionBars().getToolBarManager()
- .getItems();
- if (items != null) {
- for (int i = 0; i < items.length; i++) {
- if (items[i] instanceof ActionContributionItem) {
- IAction action = ((ActionContributionItem) items[i])
- .getAction();
- if (action instanceof DesignerToolBarAction) {
- ((DesignerToolBarAction) action).setViewer(viewer);
- }
- }
- }
- }
-
- }
-
- /**
- * @see org.eclipse.ui.IEditorActionBarContributor#dispose()
- */
- public void dispose() {
- // TODO: anything to dispose?
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/DesignerStyleActionGroup.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/DesignerStyleActionGroup.java
deleted file mode 100644
index 56accac..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/DesignerStyleActionGroup.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.actions;
-
-import java.util.HashMap;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.editors.HTMLEditor;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IKeyBindingService;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class DesignerStyleActionGroup {
- private static HashMap IMAGE_NAMES = new HashMap();
-
- private static final String VERTICAL = ActionsMessages
- .getString("DesignerStyleActionGroup.CommandLabel.V"); //$NON-NLS-1$
-
- private static final String HORIZONTAL = ActionsMessages
- .getString("DesignerStyleActionGroup.CommandLabel.H"); //$NON-NLS-1$
-
- private static final String DESIGN = ActionsMessages
- .getString("DesignerStyleActionGroup.CommandLabel.D"); //$NON-NLS-1$
-
- private static final String SOURCE = ActionsMessages
- .getString("DesignerStyleActionGroup.CommandLabel.S"); //$NON-NLS-1$
-
- private static final String VERTICAL_TOOLTIP = ActionsMessages
- .getString("DesignerStyleActionGroup.CommandLabel.V.Tooltip"); //$NON-NLS-1$
-
- private static final String HORIZONTAL_TOOLTIP = ActionsMessages
- .getString("DesignerStyleActionGroup.CommandLabel.H.Tooltip"); //$NON-NLS-1$
-
- private static final String DESIGN_TOOLTIP = ActionsMessages
- .getString("DesignerStyleActionGroup.CommandLabel.D.Tooltip"); //$NON-NLS-1$
-
- private static final String SOURCE_TOOLTIP = ActionsMessages
- .getString("DesignerStyleActionGroup.CommandLabel.S.Tooltip"); //$NON-NLS-1$
- static {
- IMAGE_NAMES.put(VERTICAL, "PD_Toolbar_vsplit.gif"); //$NON-NLS-1$
- IMAGE_NAMES.put(HORIZONTAL, "PD_Toolbar_hsplit.gif"); //$NON-NLS-1$
- IMAGE_NAMES.put(DESIGN, "PD_Toolbar_designer.gif"); //$NON-NLS-1$
- IMAGE_NAMES.put(SOURCE, "PD_Toolbar_source.gif"); //$NON-NLS-1$
- }
-
- class ChangeDesignerStyleAction extends Action {
- int _mode;
-
- ChangeDesignerStyleAction(String text, ImageDescriptor image, int mode) {
- super(text, IAction.AS_RADIO_BUTTON);
- this.setImageDescriptor(image);
- _mode = mode;
- }
-
- /**
- * @return the mode
- */
- public int getMode() {
- return _mode;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run() {
- if (_htmlEditor != null) {
- _htmlEditor.setDesignerMode(_mode);
- updateActionBars();
- }
- }
- };
-
- HTMLEditor _htmlEditor;
-
- ChangeDesignerStyleAction[] _actions = null;
-
- {
- ChangeDesignerStyleAction _verAction = new ChangeDesignerStyleAction(
- VERTICAL, PDPlugin.getDefault().getImageDescriptor(
- (String) IMAGE_NAMES.get(VERTICAL)),
- HTMLEditor.MODE_SASH_VERTICAL);
- _verAction.setId("org.eclipse.jst.pagedesigner.vertical");
- _verAction
- .setActionDefinitionId("org.eclipse.jst.pagedesigner.vertical");
- _verAction.setToolTipText(VERTICAL_TOOLTIP);
-
- ChangeDesignerStyleAction _horAction = new ChangeDesignerStyleAction(
- HORIZONTAL, PDPlugin.getDefault().getImageDescriptor(
- (String) IMAGE_NAMES.get(HORIZONTAL)),
- HTMLEditor.MODE_SASH_HORIZONTAL);
- _horAction.setId("org.eclipse.jst.pagedesigner.horizotal");
- _horAction
- .setActionDefinitionId("org.eclipse.jst.pagedesigner.horizotal");
- _horAction.setToolTipText(HORIZONTAL_TOOLTIP);
-
- ChangeDesignerStyleAction _designAction = new ChangeDesignerStyleAction(
- DESIGN, PDPlugin.getDefault().getImageDescriptor(
- (String) IMAGE_NAMES.get(DESIGN)),
- HTMLEditor.MODE_DESIGNER);
- _designAction.setId("org.eclipse.jst.pagedesigner.design");
- _designAction
- .setActionDefinitionId("org.eclipse.jst.pagedesigner.design");
- _designAction.setToolTipText(DESIGN_TOOLTIP);
-
- ChangeDesignerStyleAction _sourceAction = new ChangeDesignerStyleAction(
- SOURCE, PDPlugin.getDefault().getImageDescriptor(
- (String) IMAGE_NAMES.get(SOURCE)),
- HTMLEditor.MODE_SOURCE);
- _sourceAction.setId("org.eclipse.jst.pagedesigner.source");
- _sourceAction
- .setActionDefinitionId("org.eclipse.jst.pagedesigner.source");
- _sourceAction.setToolTipText(SOURCE_TOOLTIP);
-
- _actions = new ChangeDesignerStyleAction[] { _verAction, _horAction,
- _designAction, _sourceAction };
- }
-
-
- private void updateActionBars() {
- if (_htmlEditor == null) {
- for (int i = 0; i < _actions.length; i++) {
- _actions[i].setEnabled(false);
- }
- } else {
- for (int i = 0; i < _actions.length; i++) {
- _actions[i].setEnabled(true);
- _actions[i].setChecked(_actions[i].getMode() == _htmlEditor
- .getDesignerMode());
- }
- }
- }
-
- /**
- * @param editor
- */
- public void setHTMLEditor(HTMLEditor editor) {
- this._htmlEditor = editor;
- if (editor != null) {
- IKeyBindingService keyBindingService = editor.getSite()
- .getKeyBindingService();
- for (int i = 0; i < _actions.length; i++) {
- keyBindingService.registerAction(_actions[i]);
- }
- }
- updateActionBars();
- }
-
-
- /**
- * @param actionBars
- */
- public void fillActionBars(IActionBars actionBars) {
- IToolBarManager toolbar = actionBars.getToolBarManager();
- for (int i = 0; i < _actions.length; i++) {
- toolbar.add(_actions[i]);
- }
- toolbar.add(new Separator());
- }
-
- /**
- * dispose the action
- */
- public void dispose() {
- if (_htmlEditor != null) {
- IKeyBindingService keyBindingService = _htmlEditor.getSite()
- .getKeyBindingService();
- for (int i = 0; i < _actions.length; i++) {
- keyBindingService.unregisterAction(_actions[i]);
- }
- }
-
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/DesignerUndoRedoAction.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/DesignerUndoRedoAction.java
deleted file mode 100644
index 3d563ac..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/DesignerUndoRedoAction.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.actions;
-
-import java.text.MessageFormat;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.gef.ui.actions.UpdateAction;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jst.pagedesigner.editors.SimpleGraphicalEditor;
-import org.eclipse.wst.sse.core.internal.undo.IStructuredTextUndoManager;
-
-/**
- * SSE has a IDocumentSelectionMediator mechanism, basically it let the viewer
- * that invoke the redo/undo to reset the selection after redo/undo.
- *
- * To utilize this feature, we can't directly use the undo/redo action of the
- * text editor for the designer, since in that way it will be the TextEditor to
- * handle selection after redo/undo.
- *
- * @author mengbo
- * @version 1.5
- */
-public class DesignerUndoRedoAction extends Action implements UpdateAction {
- private boolean _undo = true; // if false means redo
-
- private final SimpleGraphicalEditor _designer;
-
- /**
- * @param undo
- * @param designer
- *
- */
- public DesignerUndoRedoAction(boolean undo, SimpleGraphicalEditor designer) {
- this._undo = undo;
- this._designer = designer;
-
- if (undo) {
- setText(ActionsMessages.getString("DesignerUndoRedoAction.UNDO")); //$NON-NLS-1$
- } else {
- setText(ActionsMessages.getString("DesignerUndoRedoAction.REDO")); //$NON-NLS-1$
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.ui.actions.UpdateAction#update()
- */
- public void update() {
- IStructuredTextUndoManager undoManager = _designer.getHTMLEditor()
- .getModel().getUndoManager();
- if (_undo) {
- Command c = undoManager.getUndoCommand();
- this.setEnabled(undoManager.undoable());
- if (c != null) {
- String label = c.getLabel();
- this
- .setText(MessageFormat
- .format(
- ActionsMessages
- .getString("DesignerUndoRedoAction.UNDO_LABEL"), new Object[] { label })); //$NON-NLS-1$
- } else {
- this.setText(ActionsMessages
- .getString("DesignerUndoRedoAction.UNDO")); //$NON-NLS-1$
- }
- } else {
- Command c = undoManager.getRedoCommand();
- this.setEnabled(undoManager.redoable());
- if (c != null) {
- String label = c.getLabel();
- this
- .setText(MessageFormat
- .format(
- ActionsMessages
- .getString("DesignerUndoRedoAction.REDO_LABEL"), new Object[] { label })); //$NON-NLS-1$
- } else {
- this.setText(ActionsMessages
- .getString("DesignerUndoRedoAction.REDO")); //$NON-NLS-1$
- }
- }
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run() {
- IStructuredTextUndoManager undoManager = _designer.getHTMLEditor()
- .getModel().getUndoManager();
- if (_undo) {
- undoManager.undo(_designer);
- } else {
- undoManager.redo(_designer);
- }
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/OutlineViewAction.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/OutlineViewAction.java
deleted file mode 100644
index 987bc4f..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/OutlineViewAction.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.actions;
-
-import org.eclipse.ui.IPageLayout;
-
-/**
- * A show view action that shows the outline view
- *
- */
-public class OutlineViewAction extends ShowViewAction
-{
- /**
- * the action id
- */
- public final static String ID = "org.eclipse.jst.pagedesigner.editors.actions.OutlineViewAction"; //$NON-NLS-1$
-
- /**
- * Default constructor
- */
- public OutlineViewAction()
- {
- super(ActionsMessages
- .getString("OutlineViewAction.Menu.OutlineView")
- , IPageLayout.ID_OUTLINE); //$NON-NLS-1$
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/PageDesignerActionBarContributor2.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/PageDesignerActionBarContributor2.java
deleted file mode 100644
index 4457d64..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/PageDesignerActionBarContributor2.java
+++ /dev/null
@@ -1,347 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.actions;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jst.pagedesigner.IJMTConstants;
-import org.eclipse.jst.pagedesigner.editors.HTMLEditor;
-import org.eclipse.jst.pagedesigner.editors.SimpleGraphicalEditor;
-import org.eclipse.jst.pagedesigner.ui.common.sash.NestedEditorActionBarContributor;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.sse.ui.internal.ExtendedEditorActionBuilder;
-import org.eclipse.wst.sse.ui.internal.IExtendedContributor;
-import org.eclipse.wst.sse.ui.internal.ISourceViewerActionBarContributor;
-
-/**
- * This is the actionbar contributor for HTML Editor. As HTMLEditor is
- * multipaged, so this contributor will also handle on which page currently is
- * activated.
- *
- * @author mengbo
- */
-public class PageDesignerActionBarContributor2 extends
- NestedEditorActionBarContributor implements IExtendedContributor {
-
- private DesignPageActionContributor _designViewerActionBarContributor = null;
-
- private ISourceViewerActionBarContributor _sourceViewerActionContributor = null;
-
- private HTMLEditor _htmlEditor = null;
-
- // EditorExtension
- private static final String EDITOR_ID = IJMTConstants.EDITORID_HTML;
-
- private IExtendedContributor _extendedContributor;
-
- DesignerStyleActionGroup _group = new DesignerStyleActionGroup();
-
- /**
- * Default constructor
- */
- public PageDesignerActionBarContributor2() {
- super();
-
- _sourceViewerActionContributor = new SourcePageActionContributor();
- _designViewerActionBarContributor = new DesignPageActionContributor();
-
- // Read action extensions.
- ExtendedEditorActionBuilder builder = new ExtendedEditorActionBuilder();
- _extendedContributor = builder.readActionExtensions(EDITOR_ID);
- }
-
- public void init(IActionBars actionBars) {
- super.init(actionBars);
-
- if (actionBars != null) {
- initCommonActionBarContributor(actionBars);
- initDesignViewerActionBarContributor(actionBars);
- initSourceViewerActionContributor(actionBars);
- }
- }
-
- /**
- * @param actionBars
- */
- private void initCommonActionBarContributor(IActionBars actionBars) {
- _group.fillActionBars(actionBars);
- }
-
- /**
- * @param actionBars
- */
- protected void initDesignViewerActionBarContributor(IActionBars actionBars) {
- if (_designViewerActionBarContributor != null)
- _designViewerActionBarContributor.init(actionBars, getPage());
- }
-
- /**
- * @param actionBars
- */
- protected void initSourceViewerActionContributor(IActionBars actionBars) {
- if (_sourceViewerActionContributor != null)
- _sourceViewerActionContributor.init(actionBars, getPage());
- }
-
- public void dispose() {
- super.dispose();
- if (_designViewerActionBarContributor != null) {
- _designViewerActionBarContributor.dispose();
- }
- if (_sourceViewerActionContributor != null) {
- _sourceViewerActionContributor.dispose();
- }
- if (_extendedContributor != null) {
- _extendedContributor.dispose();
- }
- if (_group != null) {
- _group.dispose();
- }
- }
-
- /**
- * @see org.eclipse.ui.part.EditorActionBarContributor#contributeToMenu(IMenuManager)
- */
- public final void contributeToMenu(IMenuManager menu) {
- super.contributeToMenu(menu);
- addToMenu(menu);
- if (_extendedContributor != null)
- _extendedContributor.contributeToMenu(menu);
- }
-
- private void addToMenu(IMenuManager menu) {
- // IMenuManager menuMgr = new MenuManager(PD_EDITOR_MENU_LABEL,
- // IJMTConstants.PD_EDITOR_MENU_ID);
- // menu.insertBefore(IWorkbenchActionConstants.M_NAVIGATE, menuMgr);
- //
- // menuMgr.add(action);
- // menuMgr.setRemoveAllWhenShown(true);
- //
- // menuMgr.addMenuListener(new IMenuListener()
- // {
- // public void menuAboutToShow(IMenuManager menuMgr)
- // {
- // PageDesignerActionConstants.addStandardActionGroups(menuMgr);
- // RelatedViewActionGroup viewMenu = new RelatedViewActionGroup();
- // viewMenu.fillContextMenu(menuMgr);
- // updateEditorMenu(menuMgr);
- // }
- // });
- }
-
- /**
- * @see IExtendedContributor#contributeToPopupMenu(IMenuManager)
- */
- public final void contributeToPopupMenu(IMenuManager menu) {
- // TODO: this method is empty addToPopupMenu(menu);
- if (_extendedContributor != null)
- _extendedContributor.contributeToPopupMenu(menu);
- }
-
-// protected void addToPopupMenu(IMenuManager menu) {
-// // do nothing
-// }
-
- /**
- * @see org.eclipse.ui.part.EditorActionBarContributor#contributeToToolBar(IToolBarManager)
- */
- public final void contributeToToolBar(IToolBarManager toolBarManager) {
- super.contributeToToolBar(toolBarManager);
- // TODO: this method is empty addToToolBar(toolBarManager);
- if (_extendedContributor != null)
- _extendedContributor.contributeToToolBar(toolBarManager);
- }
-
-// protected void addToToolBar(IToolBarManager toolBarManager) {
-// }
-
- /**
- * @see org.eclipse.ui.part.EditorActionBarContributor#contributeToStatusLine(IStatusLineManager)
- */
- public final void contributeToStatusLine(IStatusLineManager manager) {
- super.contributeToStatusLine(manager);
- // TODO: this method does nothing addToStatusLine(manager);
- if (_extendedContributor != null)
- _extendedContributor.contributeToStatusLine(manager);
- }
-
-// protected void addToStatusLine(IStatusLineManager manager) {
-// }
-
- /**
- * @see IExtendedContributor#updateToolbarActions()
- */
- public void updateToolbarActions() {
- if (_extendedContributor != null) {
- _extendedContributor.updateToolbarActions();
- }
- _group.setHTMLEditor(_htmlEditor);
- }
-
- public void setActiveEditor(IEditorPart targetEditor) {
- if (targetEditor instanceof HTMLEditor) {
- _htmlEditor = (HTMLEditor) targetEditor;
- //StructuredTextEditor textEditor = _htmlEditor.getTextEditor();
- // TODO: never read this._model = textEditor.getModel();
- }
- super.setActiveEditor(targetEditor);
- updateToolbarActions();
- if (_extendedContributor != null)
- _extendedContributor.setActiveEditor(targetEditor);
- }
-
- public void setInnerActivePage(IEditorPart activeEditor) {
- // This contributor is designed for StructuredTextMultiPageEditorPart.
- // To safe-guard this from problems caused by unexpected usage by
- // other editors, the following
- // check is added.
- if (_htmlEditor != null) {
- if (activeEditor instanceof StructuredTextEditor) {
- activateSourcePage((StructuredTextEditor) activeEditor);
- } else if (activeEditor instanceof SimpleGraphicalEditor) {
- //SimpleGraphicalEditor graphEditor = (SimpleGraphicalEditor) activeEditor;
- activateDesignPage((SimpleGraphicalEditor) activeEditor);
- // TODO: never read this._viewer = graphEditor.getGraphicViewer();
- } else {
- // currently we don't have special action for preview.
- deactivateSourceAndDesignPage(activeEditor);
- // TODO: never read this._viewer = null;
- }
- }
-
- updateToolbarActions();
-
- IActionBars actionBars = getActionBars();
- if (actionBars != null) {
- // update menu bar and tool bar
- actionBars.updateActionBars();
- }
- }
-
- /**
- * @param activeEditor
- *
- */
- protected void deactivateSourceAndDesignPage(IEditorPart activeEditor) {
- if (_designViewerActionBarContributor != null) {
- _designViewerActionBarContributor.setActiveEditor(_htmlEditor);
- _designViewerActionBarContributor
- .setViewerSpecificContributionsEnabled(false);
- }
- if (_sourceViewerActionContributor != null) {
- _sourceViewerActionContributor.setActiveEditor(_htmlEditor);
- _sourceViewerActionContributor
- .setViewerSpecificContributionsEnabled(false);
- }
- }
-
- /**
- * @param activeEditor
- */
- protected void activateDesignPage(SimpleGraphicalEditor activeEditor) {
-
- if (_sourceViewerActionContributor != null /*
- * &&
- * _sourceViewerActionContributor
- * instanceof
- * ISourceViewerActionBarContributor
- */) {
- // previously I was trying setActiveEditor(null) here. But as in the
- // super class will
- // compare the editor with original one, if same then directly
- // return. So will not disable
- // those actions. (lium)
- _sourceViewerActionContributor.setActiveEditor(_htmlEditor);
- _sourceViewerActionContributor
- .setViewerSpecificContributionsEnabled(false);
- }
-
- if (_designViewerActionBarContributor != null) {
- _designViewerActionBarContributor.setActiveEditor(activeEditor);
- _designViewerActionBarContributor
- .setViewerSpecificContributionsEnabled(true);
- }
- }
-
- /**
- * @param activeEditor
- */
- protected void activateSourcePage(StructuredTextEditor activeEditor) {
- if (_designViewerActionBarContributor != null /*
- * &&
- * _designViewerActionBarContributor
- * instanceof
- * IDesignViewerActionBarContributor
- */) {
- // _designViewerActionBarContributor only recogonize HTMLEditor and
- // its own GraphicEditor. so not setting source editor to it.
- _designViewerActionBarContributor.setActiveEditor(_htmlEditor);
- _designViewerActionBarContributor
- .setViewerSpecificContributionsEnabled(false);
- }
-
- if (_sourceViewerActionContributor != null /*
- * &&
- * _sourceViewerActionContributor
- * instanceof
- * ISourceViewerActionBarContributor
- */) {
- _sourceViewerActionContributor.setActiveEditor(activeEditor);
- _sourceViewerActionContributor.setViewerSpecificContributionsEnabled(true);
- }
- }
-
- // TODO: dead?
-// private void updateEditorMenu(IMenuManager menuMgr) {
-// if (this._viewer == null) {
-// return;
-// } else {
-// if (menuMgr != null) {
-// ContainerActionGroup containerActionGroup = new ContainerActionGroup();
-// ActionContext context = new ActionContext(this._viewer
-// .getSelection());
-// context.setInput(this._viewer);
-// containerActionGroup.setContext(context);
-// containerActionGroup.fillContextMenu(menuMgr);
-// containerActionGroup.setContext(null);
-//
-// RangeActionGroup rangeActionGroup = new RangeActionGroup();
-// context = new ActionContext(this._viewer.getSelection());
-// context.setInput(this._viewer);
-// rangeActionGroup.setContext(context);
-// rangeActionGroup.fillContextMenu(menuMgr);
-// rangeActionGroup.setContext(null);
-//
-// SingleElementActionGroup singleActionGroup = new SingleElementActionGroup();
-// singleActionGroup.setContext(new ActionContext(this._viewer
-// .getSelection()));
-// singleActionGroup.fillContextMenu(menuMgr);
-// singleActionGroup.setContext(null);
-//
-// if (this._model != null) {
-// CustomedContextMenuActionGroup customedMenu = new CustomedContextMenuActionGroup();
-// customedMenu.setContext(new ActionContext(_viewer
-// .getSelection()));
-// customedMenu.setModel(_model);
-// customedMenu.setParentControl(_viewer.getControl());
-// customedMenu.fillContextMenu(menuMgr);
-// customedMenu.setContext(null);
-// customedMenu.setParentControl(null);
-// customedMenu.setModel(null);
-// }
-// }
-// }
-// }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/PaletteViewAction.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/PaletteViewAction.java
deleted file mode 100644
index 49f2645..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/PaletteViewAction.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.actions;
-
-import org.eclipse.gef.EditDomain;
-import org.eclipse.gef.ui.views.palette.PaletteView;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class PaletteViewAction extends ShowViewAction {
- /**
- * the action id
- */
- public final static String ID = "org.eclipse.jst.pagedesigner.editors.actions.PaletteViewAction"; //$NON-NLS-1$
-
- /**
- * @param element
- * @param editDomain
- */
- public PaletteViewAction(Element element, EditDomain editDomain) {
- super(ActionsMessages.getString("PaletteViewAction.Menu.PaletteView")
- , PaletteView.ID); //$NON-NLS-1$
- //_element = element;
- //_editDomain = editDomain;
- }
-
- /**
- * Add to default behavior because pallete view doesn't automatically track
- * selection to currently selected edit part
- */
- public void run()
- {
- super.run();
-
- //TODO: for some reason getting a palette item to select doesn't work
-// if (_element != null && _editDomain != null)
-// {
-// PaletteItemManager manager = PaletteItemManager
-// .getInstance(getProject(_element));
-// if (manager != null) {
-// IPaletteItemCategory category = manager.findOrCreateCategory(CMUtil
-// .getElementNamespaceURI(_element), null);
-//
-// if (category != null) {
-// String name = _element.getLocalName();
-// if (category.getURI().equals(IJMTConstants.URI_JSP)) {
-// name = _element.getTagName();
-// }
-// IPaletteItemDescriptor descriptor = category
-// .getItemByTagName(name);
-// if (descriptor != null)
-// {
-// PaletteEntry paletteEntry = descriptor.getPaletteEntry();
-// final RootEditPart editPart =
-// _editDomain.getPaletteViewer().getRootEditPart();
-// EditPart newSelection = findMatchingPart(editPart.getContents(), paletteEntry);
-//
-// if (newSelection != null)
-// {
-// _editDomain.getPaletteViewer().setSelection(new StructuredSelection(newSelection));
-// }
-// }
-// }
-// }
-// }
- }
-
-// private EditPart findMatchingPart(EditPart curPart, PaletteEntry paletteEntry)
-// {
-// EditPart match = null;
-//
-// if (curPart.getModel() == paletteEntry)
-// {
-// return curPart;
-// }
-//
-// for (final Iterator it = curPart.getChildren().iterator(); it.hasNext();)
-// {
-// match = findMatchingPart((EditPart)it.next(), paletteEntry);
-//
-// if (match != null)
-// {
-// break;
-// }
-// }
-//
-// return match;
-// }
-// private IProject getProject(Element element) {
-// if (element instanceof IDOMElement) {
-// IDOMModel model = ((IDOMElement) element).getModel();
-// IFile file = StructuredModelUtil.getFileFor(model);
-// if (file != null) {
-// return file.getProject();
-// }
-// }
-// return null;
-// }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/PropertiesViewAction.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/PropertiesViewAction.java
deleted file mode 100644
index 67abf65..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/PropertiesViewAction.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.actions;
-
-import org.eclipse.ui.IPageLayout;
-
-/**
- * @author mengbo
- */
-public class PropertiesViewAction extends ShowViewAction {
- /**
- * the id
- */
- public final static String ID = "org.eclipse.jst.pagedesigner.editors.actions.PropertiesViewAction"; //$NON-NLS-1$
-
- /**
- * Default constructor
- */
- public PropertiesViewAction()
- {
- super(ActionsMessages
- .getString("PropertiesViewAction.Menu.Properties")
- , IPageLayout.ID_PROP_SHEET); //$NON-NLS-1$
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/RelatedViewActionGroup.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/RelatedViewActionGroup.java
deleted file mode 100644
index b7e6e4e..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/RelatedViewActionGroup.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.actions;
-
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.gef.EditDomain;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.pagedesigner.editors.PageDesignerActionConstants;
-import org.eclipse.jst.pagedesigner.parts.ElementEditPart;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.actions.ActionContext;
-import org.eclipse.ui.actions.ActionGroup;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class RelatedViewActionGroup extends ActionGroup
-{
- private final EditDomain _editDomain;
-
- /**
- * @param editDomain
- */
- public RelatedViewActionGroup(EditDomain editDomain)
- {
- _editDomain = editDomain;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.actions.ActionGroup#fillContextMenu(org.eclipse.jface.action.IMenuManager)
- */
- public void fillContextMenu(IMenuManager menu) {
- super.fillContextMenu(menu);
-
- final IMenuManager viewMgr = new MenuManager(ActionsMessages
- .getString("RelatedViewActionGroup.Menu.ShowView"),//$NON-NLS-1$
- PageDesignerActionConstants.SHOWVIEW_SUBMENU_ID);
- viewMgr.add(new Action() {
- // add noop action; TODO: why?
- });
- viewMgr.setRemoveAllWhenShown(true);
- final ActionContext context = getContext();
- viewMgr.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager manager) {
- // TODO: don't like this at all
- String[] views = { "org.eclipse.ui.views.PropertySheet",
- "org.eclipse.gef.ui.palette_view", "org.eclipse.ui.views.ContentOutline"};
-
- Map icons = getIconForView(views);
- // TODO: is this the best way to do this?
- if (manager.find(PropertiesViewAction.ID) == null) {
- Action action = new PropertiesViewAction();
- action.setId(PropertiesViewAction.ID);
- action.setImageDescriptor((ImageDescriptor) icons
- .get(views[0]));
- manager.add(action);
- }
- ISelection selection = context.getSelection();
- if (manager.find(PaletteViewAction.ID) == null) {
- if (selection instanceof IStructuredSelection)
- {
- IStructuredSelection strucSelection =
- (IStructuredSelection) selection;
- Action action = null;
-
- if (strucSelection.getFirstElement() instanceof ElementEditPart)
- {
- Element selectedElem = (Element)
- ((ElementEditPart) strucSelection.getFirstElement()).getModel();
- action = new PaletteViewAction(selectedElem, _editDomain);
- }
- else
- {
- // if can't determine, just default open the palette
- action = new PaletteViewAction(null, null);
- }
- action.setId(PaletteViewAction.ID);
- action.setImageDescriptor((ImageDescriptor) icons
- .get(views[1]));
- manager.add(action);
- }
- }
- if (manager.find(OutlineViewAction.ID) == null)
- {
- Action action = new OutlineViewAction();
- action.setId(OutlineViewAction.ID);
- action.setImageDescriptor((ImageDescriptor) icons
- .get(views[2]));
- manager.add(action);
- }
-
- }
- });
- menu.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, viewMgr);
- }
-
- private Map getIconForView(String[] viewids) {
- List views = Arrays.asList(viewids);
- Map icons = new HashMap();
-
- IConfigurationElement[] elements = Platform.getExtensionRegistry()
- .getConfigurationElementsFor("org.eclipse.ui.views");
- for (int i = 0; i < elements.length; i++) {
- String name = elements[i].getName();
- String id = elements[i].getAttribute("id");
- if ("view".equals(name) && views.contains(id)) {
- String iconPath = elements[i].getAttribute("icon");
- if (iconPath != null) {
- icons.put(id, AbstractUIPlugin.imageDescriptorFromPlugin(
- elements[i].getDeclaringExtension().getContributor().getName(),
- iconPath));
- } else {
- icons.put(id, null);
- }
- if (icons.size() == viewids.length) {
- break;
- }
- }
- }
- return icons;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/ShowViewAction.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/ShowViewAction.java
deleted file mode 100644
index 5422d60..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/ShowViewAction.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * TODO: isn't there a workbench registry action for this?
- * @author cbateman
- *
- */
-public class ShowViewAction extends Action {
- private static Logger _log = PDPlugin.getLogger(PropertiesViewAction.class);
- private final String _viewId;
-
- /**
- * @param text
- * @param viewId
- */
- public ShowViewAction(String text, String viewId)
- {
- _viewId = viewId;
- setText(text); //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- try {
- getPage().showView(_viewId);
- } catch (PartInitException e) {
- _log.info("Open the view: "+_viewId, e);
- }
-
- }
-
- private IWorkbenchPage getPage() {
- IWorkbench workbench = PlatformUI.getWorkbench();
- IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
- return window.getActivePage();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/SourcePageActionContributor.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/SourcePageActionContributor.java
deleted file mode 100644
index 7d48737..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/actions/SourcePageActionContributor.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.actions;
-
-import org.eclipse.jst.pagedesigner.editors.HTMLEditor;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.ITextEditorActionConstants;
-import org.eclipse.wst.xml.ui.internal.actions.ActionContributorXML;
-
-/**
- * SourcePageActionContributor
- *
- * This class is for multi page editor's source page contributor.
- *
- * Use XMLEditorActionContributor for single page editor.
- */
-public class SourcePageActionContributor extends ActionContributorXML {
-
- private IActionBars fBars;
-
- /**
- * This method calls:
- * <ul>
- * <li><code>contributeToMenu</code> with <code>bars</code>' menu
- * manager</li>
- * <li><code>contributeToToolBar</code> with <code>bars</code>' tool
- * bar manager</li>
- * <li><code>contributeToStatusLine</code> with <code>bars</code>'
- * status line manager</li>
- * </ul>
- * The given action bars are also remembered and made accessible via
- * <code>getActionBars</code>.
- *
- * @param bars
- * the action bars
- *
- */
- public void init(IActionBars bars) {
- fBars = bars;
- contributeToMenu(bars.getMenuManager());
- contributeToToolBar(bars.getToolBarManager());
- contributeToStatusLine(bars.getStatusLineManager());
- }
-
- /**
- * Returns this contributor's action bars.
- *
- * @return the action bars
- */
- public IActionBars getActionBars() {
- return fBars;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.internal.ISourceViewerActionBarContributor#setViewerSpecificContributionsEnabled(boolean)
- */
- public void setViewerSpecificContributionsEnabled(boolean enabled) {
- super.setViewerSpecificContributionsEnabled(enabled);
- IEditorPart editor = getActiveEditorPart();
- ITextEditor targetEditor = null;
- if (editor instanceof ITextEditor) {
- targetEditor = (ITextEditor) editor;
- } else if (editor instanceof HTMLEditor) {
- targetEditor = ((HTMLEditor) editor).getTextEditor();
- }
- if (targetEditor != null) {
- if (enabled) {
- getActionBars()
- .setGlobalActionHandler(
- ITextEditorActionConstants.UNDO,
- targetEditor
- .getAction(ITextEditorActionConstants.UNDO));
- getActionBars()
- .setGlobalActionHandler(
- ITextEditorActionConstants.REDO,
- targetEditor
- .getAction(ITextEditorActionConstants.REDO));
- } else {
- getActionBars().setGlobalActionHandler(
- ITextEditorActionConstants.UNDO, null);
- getActionBars().setGlobalActionHandler(
- ITextEditorActionConstants.REDO, null);
- }
-
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/pagedesigner/DelegatingZoomManager.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/pagedesigner/DelegatingZoomManager.java
deleted file mode 100644
index bc15858..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/pagedesigner/DelegatingZoomManager.java
+++ /dev/null
@@ -1,374 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.pagedesigner;
-
-import org.eclipse.core.runtime.ListenerList;
-import org.eclipse.draw2d.ScalableFigure;
-import org.eclipse.draw2d.Viewport;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.editparts.ZoomListener;
-import org.eclipse.gef.editparts.ZoomManager;
-
-/**
- * A delegating ZoomManager.
- */
-public class DelegatingZoomManager extends ZoomManager implements ZoomListener {
- /** the current ZoomManager all work is delegated to */
- private final static int DEFAULT_ZOOM = 1;
-
- private final static String ZOOM_AS_TEXT = "100%";
-
- private final static String ZOOM_LEVEL_AS_TEXT = "100%";
-
- private ZoomManager _currentZoomManager;
-
- /** listeners */
- private ListenerList _zoomListeners = new ListenerList(ListenerList.IDENTITY);
-
- /**
- * Creates a new DelegatingZoomManager instance.
- */
- public DelegatingZoomManager() {
- super((ScalableFigure) null, (Viewport) null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.ZoomListener#zoomChanged(double)
- */
- public void zoomChanged(double zoom) {
- Object[] listeners = _zoomListeners.getListeners();
- for (int i = 0; i < listeners.length; ++i) {
- ((ZoomListener) listeners[i]).zoomChanged(zoom);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.ZoomManager#addZoomListener(org.eclipse.gef.editparts.ZoomListener)
- */
- public void addZoomListener(ZoomListener listener) {
- _zoomListeners.add(listener);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.ZoomManager#removeZoomListener(org.eclipse.gef.editparts.ZoomListener)
- */
- public void removeZoomListener(ZoomListener listener) {
- _zoomListeners.remove(listener);
- }
-
- /**
- * Sets the ZoomManager all work should be delegated to.
- *
- * @param zoomManager
- */
- public void setCurrentZoomManager(ZoomManager zoomManager) {
- if (null != _currentZoomManager) {
- _currentZoomManager.removeZoomListener(this);
- }
-
- _currentZoomManager = zoomManager;
- if (null != _currentZoomManager) {
- _currentZoomManager.addZoomListener(this);
- zoomChanged(_currentZoomManager.getZoom());
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.ZoomManager#canZoomIn()
- */
- public boolean canZoomIn() {
- if (null == _currentZoomManager) {
- return false;
- }
- return _currentZoomManager.canZoomIn();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.ZoomManager#canZoomOut()
- */
- public boolean canZoomOut() {
- if (null == _currentZoomManager) {
- return false;
- }
- return _currentZoomManager.canZoomOut();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.ZoomManager#getMaxZoom()
- */
- public double getMaxZoom() {
- if (null == _currentZoomManager) {
- return DEFAULT_ZOOM;
- }
-
- return _currentZoomManager.getMaxZoom();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.ZoomManager#getMinZoom()
- */
- public double getMinZoom() {
- if (null == _currentZoomManager) {
- return DEFAULT_ZOOM;
- }
- return _currentZoomManager.getMinZoom();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.ZoomManager#getNextZoomLevel()
- */
- public double getNextZoomLevel() {
- if (null == _currentZoomManager) {
- return DEFAULT_ZOOM;
- }
- return _currentZoomManager.getNextZoomLevel();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.ZoomManager#getPreviousZoomLevel()
- */
- public double getPreviousZoomLevel() {
- if (null == _currentZoomManager) {
- return DEFAULT_ZOOM;
- }
- return _currentZoomManager.getPreviousZoomLevel();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.ZoomManager#getScalableFigure()
- */
- public ScalableFigure getScalableFigure() {
- if (null == _currentZoomManager) {
- return null;
- }
-
- return _currentZoomManager.getScalableFigure();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.ZoomManager#getUIMultiplier()
- */
- public double getUIMultiplier() {
- if (null == _currentZoomManager) {
- return DEFAULT_ZOOM;
- }
-
- return _currentZoomManager.getUIMultiplier();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.ZoomManager#getViewport()
- */
- public Viewport getViewport() {
- if (null == _currentZoomManager) {
- return null;
- }
-
- return _currentZoomManager.getViewport();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.ZoomManager#getZoom()
- */
- public double getZoom() {
- if (null == _currentZoomManager) {
- return DEFAULT_ZOOM;
- }
-
- return _currentZoomManager.getZoom();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.ZoomManager#getZoomAsText()
- */
- public String getZoomAsText() {
- if (null == _currentZoomManager) {
- return ZOOM_AS_TEXT;
- }
- //$NON-NLS-1$
-
- return _currentZoomManager.getZoomAsText();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.ZoomManager#getZoomLevels()
- */
- public double[] getZoomLevels() {
- if (null == _currentZoomManager) {
- return new double[] { DEFAULT_ZOOM };
- }
-
- return _currentZoomManager.getZoomLevels();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.ZoomManager#getZoomLevelsAsText()
- */
- public String[] getZoomLevelsAsText() {
- if (null == _currentZoomManager) {
- return new String[] { ZOOM_LEVEL_AS_TEXT };
- }
-
- return _currentZoomManager.getZoomLevelsAsText();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.ZoomManager#setUIMultiplier(double)
- */
- public void setUIMultiplier(double multiplier) {
- if (null == _currentZoomManager) {
- return;
- }
-
- _currentZoomManager.setUIMultiplier(multiplier);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.ZoomManager#setViewLocation(org.eclipse.draw2d.geometry.Point)
- */
- public void setViewLocation(Point p) {
- if (null == _currentZoomManager) {
- return;
- }
-
- _currentZoomManager.setViewLocation(p);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.ZoomManager#setZoom(double)
- */
- public void setZoom(double zoom) {
- if (null == _currentZoomManager) {
- return;
- }
-
- _currentZoomManager.setZoom(zoom);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.ZoomManager#setZoomAnimationStyle(int)
- */
- public void setZoomAnimationStyle(int style) {
- if (null == _currentZoomManager) {
- return;
- }
-
- _currentZoomManager.setZoomAnimationStyle(style);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.ZoomManager#setZoomAsText(java.lang.String)
- */
- public void setZoomAsText(String zoomString) {
- if (null == _currentZoomManager) {
- return;
- }
-
- _currentZoomManager.setZoomAsText(zoomString);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.ZoomManager#setZoomLevels(double[])
- */
- public void setZoomLevels(double[] zoomLevels) {
- if (null == _currentZoomManager) {
- return;
- }
-
- _currentZoomManager.setZoomLevels(zoomLevels);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.ZoomManager#zoomIn()
- */
- public void zoomIn() {
- if (null == _currentZoomManager) {
- return;
- }
-
- _currentZoomManager.zoomIn();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.ZoomManager#zoomOut()
- */
- public void zoomOut() {
- if (null == _currentZoomManager) {
- return;
- }
-
- _currentZoomManager.zoomOut();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.ZoomManager#zoomTo(org.eclipse.draw2d.geometry.Rectangle)
- */
- public void zoomTo(Rectangle rect) {
- if (null == _currentZoomManager) {
- return;
- }
-
- _currentZoomManager.zoomTo(rect);
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/pagedesigner/IPageDesignerConstants.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/pagedesigner/IPageDesignerConstants.java
deleted file mode 100644
index b586f9d..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/pagedesigner/IPageDesignerConstants.java
+++ /dev/null
@@ -1,290 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.pagedesigner;
-
-/**
- * The designer constants
- *
- * TODO: dead?
- *
- */
-interface IPageDesignerConstants {
- /**
- * JSP UI Component Tag Node
- */
- public static final String DEFAULT_TAG_NAME = "tagname";
-
- /**
- * keyword
- */
- public static final String ATTR_TYPE_CDATA = "CDATA";
-
- /**
- * basename attribute
- */
- public static final String ATTR_LOADBUNDLE_1 = "basename";
-
- /**
- * var attribute
- */
- public static final String ATTR_LOADBUNDLE_2 = "var";
-
- /**
- * columns attribute
- */
- public static final String ATTR_PANELGRID_1 = "columns";
-
- /**
- * summary attribute
- */
- public static final String ATTR_PANELGRID_2 = "summary";
-
- /**
- * title attribute
- */
- public static final String ATTR_PANELGRID_3 = "title";
-
- /**
- * action attribute
- */
- public static final String ATTR_BUTTON_1 = "action";
-
- /**
- * value attribute
- */
- public static final String ATTR_BUTTON_2 = "value";
-
- /**
- * url attribute
- */
- public static final String ATTR_GRAPHICIMAGE_1 = "url";
-
- /**
- * binding attribute
- */
- public static final String ATTR_GRAPHICIMAGE_2 = "binding";
-
- /**
- * binding attribute
- */
- public static final String ATTR_OUTPUTTEXT_1 = "binding";
-
- /**
- * value attribute
- */
- public static final String ATTR_OUTPUTTEXT_2 = "value";
-
- /**
- * styleClass attribute
- */
- public static final String ATTR_OUTPUTTEXT_3 = "styleClass";
-
- /**
- * dataWindowBean attribute
- */
- public static final String ATTR_DATAWINDOW_1 = "dataWindowBean";
-
- /**
- * scriptName attribute
- */
- public static final String ATTR_DATAWINDOW_2 = "scriptName";
-
- /**
- * page attribute
- */
- public static final String ATTR_INCLUDE = "page";
-
- /**
- * prefix atttribute
- */
- public static final String ATTR_TAGLIB_1 = "prefix";
-
- /**
- * uri attribute
- */
- public static final String ATTR_TAGLIB_2 = "uri";
-
- /**
- * bundle attribute
- */
- public static final String RESOURCE_BUNDLE_MARK = "bundle";
-
- /**
- * value attribute
- */
- public static final String ATTR_RESOURCE_BUNDLE = "value";
-
- /**
- * value attribute
- */
- public static final String ATTR_FACET = "value";
-
- /**
- * view tag
- */
- public static final String TAG_VIEW_TYPE = "view";
-
- /**
- * for tag
- */
- public static final String TAG_FORM_TYPE = "form";
-
- /**
- * text tag
- */
- public static final String TAG_TEXT_TYPE = "text";
-
- /**
- * loadBundle tag
- */
- public static final String TAG_LOADBUNDLE_TYPE = "loadBundle";
-
- /**
- * panelGrid tag
- */
- public static final String TAG_PANELGRID_TYPE = "panelGrid";
-
- /**
- *
- */
- public static final String TAG_IMAGE_TYPE = "image";
-
- /**
- * outputText tag
- */
- public static final String TAG_OUTPUTTEXT_TYPE = "outputText";
-
- /**
- *
- */
- public static final String TAG_BUTTON_TYPE = "button";
-
- /**
- *
- */
- public static final String TAG_DATAWINDOW_TYPE = "datawindow";
-
- /**
- *
- */
- public static final String TAG_TAGLIB_TYPE = "taglib";
-
- /**
- *
- */
- public static final String TAG_INCLUDE_TYPE = "include";
-
- /**
- *
- */
- public static final String TAG_OTHERS_TYPE = "";
-
- /**
- *
- */
- public static final String TAG_NAME_VIEW = "view";
-
- /**
- *
- */
- public static final String TAG_NAME_FORM = "form";
-
- /**
- *
- */
- public static final String TAG_NAME_PANELGRID = "panelGrid";
-
- /**
- *
- */
- public static final String TAG_NAME_PANELGROUP = "panelGroup";
-
- /**
- *
- */
- public static final String TAG_NAME_FACET = "facet";
-
- /**
- *
- */
- public static final String TAG_NAME_DATAWINDOW = "dataWindow";
-
- /**
- *
- */
- public static final String TAG_NAME_OUTPUTTEXT = "outputText";
-
- /**
- *
- */
- public static final String TAG_NAME_INCLUDE = "include";
-
- /**
- *
- */
- public static final String TAG_NAME_LOADBUNDLE = "loadBundle";
-
- /**
- *
- */
- public static final String TAG_NAME_TAGLIB = "taglib";
-
- /**
- * graphicImage tag
- */
- public static final String TAG_NAME_GRAPHICIMAGE = "graphicImage";
-
- /**
- * commandButton tag
- */
- public static final String TAG_NAME_COMMANDBUTTON = "commandButton";
-
- /**
- *
- */
- public static final String REQUEST_TYPE_SELECT = "selection";
-
- /**
- *
- */
- public static final int EOF = -1;
-
- /**
- *
- */
- public static final char CHAR_TAB = '\t';
-
- /**
- *
- */
- public static final char CHAR_N_RETURN = '\n';
-
- /**
- *
- */
- public static final String STRING_N_RETURN = "\n";
-
- /**
- *
- */
- public static final String STRING_BLANK = " ";
-
- /**
- *
- */
- public static final char CHAR_BLANK = ' ';
-
- /**
- *
- */
- public static final String FONT_NAME_HELVETICA = "Helvetica";
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/pagedesigner/JSPEditorMessages.properties b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/pagedesigner/JSPEditorMessages.properties
deleted file mode 100644
index beecba5..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/pagedesigner/JSPEditorMessages.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2007 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are 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:
-# Oracle Corporation - initial API and implementation
-###############################################################################
-JSFPalette.DefaultGroup.LabelJSFPallete=Controls
-JSPSourceEditor.Page.Preview.PageText=Preview
-
-CommonResourceDialog.statusMessage=Select an image file
-ResourcesOnClasspathDialog.statusMessage=Select a property file
-TreeViewerSelectionDialog.Title=Select a file
-RangeSelectionTool.CommandLabel.Insert=Insert
-
-DesignerPaletteCustomizerDialog.label.import=Import
-DesignerPaletteCustomizerDialog.label.export=Export
-
-DesignerSourceDropTargetListener.InserCommandLabel=Create New Item
-SourceViewLocalDropCommand.Label.InsertSyntax=Insert Syntax
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/pagedesigner/MessageFormater.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/pagedesigner/MessageFormater.java
deleted file mode 100644
index 5b4d95d..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/pagedesigner/MessageFormater.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.pagedesigner;
-
-import java.text.MessageFormat;
-
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-
-/**
- * @A tool class for message format
- */
-public final class MessageFormater {
- private static Logger _log = PDPlugin.getLogger(MessageFormater.class);
-
- /**
- *
- * @param message
- * the parts for filling is {number}
- * @param o1
- * @return the formatted string
- */
- public static String format(String message, Object o1) {
- try {
- Object[] args = new Object[] { o1 };
- MessageFormat formatter = new MessageFormat(message);
- return formatter.format(args);
- } catch (Exception e) {
- _log.error("Log.Error.MessageFormater.Format0", e); //$NON-NLS-1$
- return "";
- }
- }
-
- /**
- * @param message
- * @param o1
- * @param o2
- * @return the formatted string
- */
- public static String format(String message, Object o1, Object o2) {
- try {
- Object[] args = new Object[] { o1, o2 };
- MessageFormat formatter = new MessageFormat(message);
- return formatter.format(args);
- } catch (Exception e) {
- _log.error("Log.Error.MessageFormater.Format0", e);
- return "";
- }
- }
-
- /**
- * @param message
- * @param o1
- * @param o2
- * @param o3
- * @return the formatted string
- */
- public static String format(String message, Object o1, Object o2, Object o3) {
- try {
- Object[] args = new Object[] { o1, o2, o3 };
- MessageFormat formatter = new MessageFormat(message);
- return formatter.format(args);
- } catch (Exception e) {
- _log.error("Log.Error.MessageFormater.Format0", e);
- return "";
- }
- }
-
- /**
- * @param message
- * @param o
- * @return the formatted string
- */
- public static String format(String message, Object o[]) {
- try {
- MessageFormat formater = new MessageFormat(message);
- return formater.format(o);
- } catch (Exception e) {
- _log.error("Log.Error.MessageFormater.Format0", e);
- return "";
- }
- }
-
- private MessageFormater()
- {
- // util class, no instantiation
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/pagedesigner/PageDesignerResources.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/pagedesigner/PageDesignerResources.java
deleted file mode 100644
index ec83204..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/pagedesigner/PageDesignerResources.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.pagedesigner;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.jsf.common.ui.internal.utils.ResourceUtils;
-import org.eclipse.jst.pagedesigner.IJMTConstants;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-
-/**
- * @author mengbo
- */
-public class PageDesignerResources extends ResourceUtils {
- private static Logger _log = PDPlugin
- .getLogger(PageDesignerResources.class);
-
- private static PageDesignerResources _resource; // singleton
-
- /**
- * Empty Constructor.
- */
- protected PageDesignerResources() {
- try {
- _resources = ResourceBundle
- .getBundle(IJMTConstants.PAGEDESIGNER_RESOURCE_BUNDLE_FILE);
- // NOTE: this throws a runtime "MissingResourceException".
- } catch (MissingResourceException ee) {
- // catch this and the error is reported in setBundle.
- // Log.Error.PageDesignerResources.Open=Error in getting source
- // bundle
- _log.error("Log.Error.PageDesignerResources.Open", ee); //$NON-NLS-1$
- }
- setBundle(_resources, IJMTConstants.PAGEDESIGNER_RESOURCE_BUNDLE_FILE);
- }
-
- /**
- * @return the singleton
- */
- public static PageDesignerResources getInstance() {
- if (_resource == null) {
- _resource = new PageDesignerResources();
- }
- return _resource;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/DesignerPaletteCustomizationsHelper.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/DesignerPaletteCustomizationsHelper.java
deleted file mode 100644
index 7235c12..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/DesignerPaletteCustomizationsHelper.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.palette;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.Iterator;
-
-import javax.xml.parsers.DocumentBuilder;
-
-import org.eclipse.gef.palette.PaletteEntry;
-import org.eclipse.gef.ui.palette.PaletteCustomizer;
-import org.eclipse.gef.ui.palette.PaletteViewer;
-import org.eclipse.gef.ui.palette.customize.PaletteCustomizerDialog;
-import org.eclipse.jface.preference.IPersistentPreferenceStore;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.editors.palette.impl.PaletteItemManager;
-import org.eclipse.jst.pagedesigner.editors.palette.impl.TaglibPaletteDrawer;
-import org.eclipse.jst.pagedesigner.utils.XMLUtil;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
-
-/**
- * Helper class that all clients should use when dealing with palette customizations
- */
-public final class DesignerPaletteCustomizationsHelper {
- private static final String PREFS_TAGLIBHIDE_PREFIX = "hidden_taglib:";
-
- private static Logger _log = PDPlugin.getLogger(DesignerPaletteCustomizationsHelper.class);
-
- /**
- * @return new DesignerPaletteCustomizer
- */
- public static DesignerPaletteCustomizer getNewCustomizer(){
- return new DesignerPaletteCustomizer();
- }
-
- /**
- * @param paletteViewer
- * @param paletteCustomizer
- * @return new DesignerPaletteCustomizerDialog
- */
- public static PaletteCustomizerDialog getNewCustomizerDialog(PaletteViewer paletteViewer, PaletteCustomizer paletteCustomizer){
- return new DesignerPaletteCustomizerDialog(
- paletteViewer.getControl().getShell(), paletteCustomizer, paletteViewer.getPaletteRoot());
-
- }
-
- /**
- * Save palette item customizations
- * @param paletteRoot
- */
- public static void save(DesignerPaletteRoot paletteRoot) {
- IPersistentPreferenceStore prefs = getPreferenceStore();
-
- for (Iterator it=paletteRoot.getChildren().iterator();it.hasNext();){
- PaletteEntry entry = (PaletteEntry)it.next();
- if (entry instanceof TaglibPaletteDrawer){
- TaglibPaletteDrawer pd = (TaglibPaletteDrawer)entry;
- prefs.putValue(PREFS_TAGLIBHIDE_PREFIX + pd.getURI(), Boolean.toString(! pd.isVisible()));
- }
- }
- PaletteItemManager.notifyPaletteItemManagersOfCustomizationsUpdate(paletteRoot.getPaletteManager());
-
- }
-
- /**
- * Load user customizations
- * @param paletteItemManager
- */
- public static void loadUserCustomizations(IPaletteItemManager paletteItemManager) {
- IPreferenceStore store = getPreferenceStore();
- for (Iterator it=paletteItemManager.getAllCategories().iterator();it.hasNext();){
- TaglibPaletteDrawer tld = (TaglibPaletteDrawer)it.next();
- if (store.contains(PREFS_TAGLIBHIDE_PREFIX+tld.getURI())){
- tld.setVisible( ! store.getBoolean(PREFS_TAGLIBHIDE_PREFIX+tld.getURI()));
- }
- }
- }
-
- /**
- * Hide a category (TaglibPaletteDrawer) that will be persisted as a customization
- * @param taglibPaletteDrawer
- */
- public static void hideTaglibDrawer(TaglibPaletteDrawer taglibPaletteDrawer){
- IPersistentPreferenceStore prefs = getPreferenceStore();
- taglibPaletteDrawer.setVisible(false);
- prefs.putValue(PREFS_TAGLIBHIDE_PREFIX + taglibPaletteDrawer.getURI(), Boolean.TRUE.toString());
- save((DesignerPaletteRoot)taglibPaletteDrawer.getParent());
- }
-
- private static IPersistentPreferenceStore getPreferenceStore() {
- return (IPersistentPreferenceStore)PDPlugin.getDefault().getPreferenceStore();
- }
-
- /**
- * Exports the current state of customizations of the current palette instance.
- *
- * Unsaved data will be exported.
- *
- * Currently only the "hide" flag of a category is exported. All categories are exported.
- *
- * @param paletteItemManager
- * @param filename
- */
- public static void exportCustomizations(IPaletteItemManager paletteItemManager, String filename){
-
- Document document = XMLUtil.getDocumentBuilder().getDOMImplementation()
- .createDocument(null, IPaletteConstants.ROOT, null);
- try {
- FileOutputStream ostream = null;
- int index = filename.lastIndexOf(File.separator);
- String foldername = filename.substring(0, index);
- File folder = new File(foldername);
- if (folder != null && !folder.exists()) {
- folder.mkdir();
- }
-
- ostream = new FileOutputStream(filename);
-
- for (Iterator iter = paletteItemManager.getAllCategories().iterator(); iter.hasNext();) {
- TaglibPaletteDrawer category = (TaglibPaletteDrawer) iter
- .next();
- if (category == null) continue;
-
- Element categoryElement = document.createElement(IPaletteConstants.CATEGORY_TAG);
- categoryElement.setAttribute(IPaletteConstants.ID, category.getURI());
- categoryElement.setAttribute(IPaletteConstants.ISHIDDEN, Boolean.toString(! category.isVisible()));
- document.getDocumentElement().appendChild(categoryElement);
- }
- XMLUtil.serialize(document, ostream);
- ostream.close();
- } catch (IOException e) {
- _log.error("DesignerPaletteCustomizationsHelper.save.error.IOException", e); //$NON-NLS-1$
- }
- }
-
- /**
- * Imports a palette customization export file.
- *
- * If there are entries matching in the existing workspace customizations, they will be overridden.
- *
- * @param customizer
- * @param filename
- */
- public static void importCustomizations(DesignerPaletteCustomizer customizer, String filename){
- Document document = null;
- try {
- DocumentBuilder builder = XMLUtil.getDocumentBuilder();
- if (builder != null) {
- document = builder.parse(filename);
- } else {
- _log.error("DesignerPaletteCustomizationsHelper.importCustomizations.error.getDocumentBuilderFail");// $NON-NLS-1$
- }
- } catch (FileNotFoundException e) {
- //should never get here as user chose file thru a file chooser dialog
- _log.error(
- "DesignerPaletteCustomizationsHelper.importCustomizations.error.FileNotFoundException");// $NON-NLS-1$
- document = null;
- } catch (IOException e) {
- _log.error(
- "DesignerPaletteCustomizationsHelper.importCustomizations.error.IOException", e.toString(), e); //$NON-NLS-1$
- } catch (SAXException e) {
- _log.error(
- "DesignerPaletteCustomizationsHelper.importCustomizations.error.SAXException", e.toString(), e); //$NON-NLS-1$
- }
- if (document != null) {
- Element root = document.getDocumentElement();
- if (root != null) {
- NodeList catetorylist = root.getChildNodes();
- for (int i = 0, n = catetorylist.getLength(); i < n; i++) {
- Node childNode = catetorylist.item(i);
- if (childNode.getNodeType() == Node.ELEMENT_NODE
- && childNode.getNodeName().equals(
- IPaletteConstants.CATEGORY_TAG)) {
-
- Element categoryElement = (Element) childNode;
- //only checking for hidden flag currently
- if (categoryElement.hasAttribute(IPaletteConstants.ISHIDDEN)){
- boolean isHidden =Boolean.valueOf(categoryElement.getAttribute(IPaletteConstants.ISHIDDEN)).booleanValue();
-
- String uri = categoryElement.getAttribute(IPaletteConstants.ID);
- applyImport(customizer, uri, isHidden);
- }
-
-
- }
- }
- }
- }
- }
-
- private static void applyImport(
- DesignerPaletteCustomizer customizer, String uri, boolean isHidden) {
- //apply the isHidden exported flag to the paletteRoot child if present
- for (Iterator it=customizer.getDesignerPaletteRoot().getChildren().iterator();it.hasNext();){
- Object o = it.next();
- if (o instanceof TaglibPaletteDrawer){
- TaglibPaletteDrawer pd = (TaglibPaletteDrawer)o;
- if (uri.equals(pd.getURI())){
- pd.setVisible(! isHidden);
- break;
- }
- }
- }
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/DesignerPaletteCustomizer.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/DesignerPaletteCustomizer.java
deleted file mode 100644
index 9656cd1..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/DesignerPaletteCustomizer.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.palette;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.gef.palette.PaletteEntry;
-import org.eclipse.gef.ui.palette.PaletteCustomizer;
-import org.eclipse.gef.ui.palette.customize.PaletteSeparatorFactory;
-import org.eclipse.gef.ui.palette.customize.PaletteStackFactory;
-import org.eclipse.jst.pagedesigner.editors.palette.impl.PaletteItemManager;
-
-/**
- * @author mengbo
- */
-public class DesignerPaletteCustomizer extends PaletteCustomizer {
-
-
- private DesignerPaletteRoot root;
-
- /**
- * Set the palette root. Must be set before the customizer can be used
- * @param root
- */
- public void setPaletteRoot(DesignerPaletteRoot root){
- this.root = root;
- }
-
- /**
- * Return the palette root for this customizer
- * @return DesignerPaletteRoot
- */
- public DesignerPaletteRoot getDesignerPaletteRoot(){
- return root;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.gef.ui.palette.PaletteCustomizer#canMoveDown(org.eclipse.gef.palette.PaletteEntry)
- */
- public boolean canMoveDown(PaletteEntry entry) {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.gef.ui.palette.PaletteCustomizer#canMoveUp(org.eclipse.gef.palette.PaletteEntry)
- */
- public boolean canMoveUp(PaletteEntry entry) {
- return false;
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.ui.palette.PaletteCustomizer#canMoveDown(org.eclipse.gef.palette.PaletteEntry)
- */
-// public boolean canMoveDown(PaletteEntry entry) {
-// if (!(entry instanceof PaletteDrawer)) {
-// return false;
-// }
-// return super.canMoveDown(entry);
-// }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.ui.palette.PaletteCustomizer#canMoveUp(org.eclipse.gef.palette.PaletteEntry)
- */
-// public boolean canMoveUp(PaletteEntry entry) {
-// if (!(entry instanceof PaletteDrawer)) {
-// return false;
-// }
-// if (entry.getParent().getChildren().indexOf(entry) == 1) {
-// return false;
-// }
-// return super.canMoveUp(entry);
-// }
-
-// /*
-// * (non-Javadoc)
-// *
-// * @see org.eclipse.gef.ui.palette.PaletteCustomizer#performMoveDown(org.eclipse.gef.palette.PaletteEntry)
-// */
-// public void performMoveDown(PaletteEntry entry) {
-// if (entry instanceof PaletteDrawer) {
-// String id = entry.getId();
-// TaglibPaletteDrawer cat = PaletteItemManager.getCurrentInstance().getTaglibPalletteDrawer(id);
-// movedown(PaletteItemManager.getCurrentInstance(), cat);
-// super.performMoveDown(entry);
-// }
-// }
-// private void moveup(PaletteItemManager paletteItemManager, TaglibPaletteDrawer cat) {
-// int i = paletteItemManager.getAllCategories().indexOf(cat);
-// TaglibPaletteDrawer upCat = (TaglibPaletteDrawer) paletteItemManager.getAllCategories()
-// .get(i - 1);
-// movedown(paletteItemManager, upCat);
-// }
-//
-// private void movedown(PaletteItemManager paletteItemManager, TaglibPaletteDrawer cat) {
-// int i = paletteItemManager.getAllCategories().indexOf(cat);
-// paletteItemManager.getAllCategories().add(i + 2, cat);
-// paletteItemManager.getAllCategories().remove(i);
-// }
-// /*
-// * (non-Javadoc)
-// *
-// * @see org.eclipse.gef.ui.palette.PaletteCustomizer#performMoveUp(org.eclipse.gef.palette.PaletteEntry)
-// */
-// public void performMoveUp(PaletteEntry entry) {
-// if (entry instanceof PaletteDrawer) {
-// String id = entry.getId();
-// TaglibPaletteDrawer cat = PaletteItemManager.getCurrentInstance().getTaglibPalletteDrawer(id);
-// moveup(PaletteItemManager.getCurrentInstance(), cat);
-// super.performMoveUp(entry);
-// }
-// }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.ui.palette.PaletteCustomizer#canDelete(org.eclipse.gef.palette.PaletteEntry)
- */
- public boolean canDelete(PaletteEntry entry) {
- return false;
- }
-
- public List getNewEntryFactories() {
- List list = new ArrayList(4);
- list.add(new PaletteSeparatorFactory());
- list.add(new PaletteStackFactory());
- return list;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.ui.palette.PaletteCustomizer#revertToSaved()
- */
- public void revertToSaved() {
- //note that reset is not currently part of IPaletteItemManager interface...
- ((PaletteItemManager)root.getPaletteManager()).reset();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.ui.palette.PaletteCustomizer#save()
- */
- public void save() {
- DesignerPaletteCustomizationsHelper.save(root);
-// PaletteItemManager.getCurrentInstance().reset();
- }
-
-
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/DesignerPaletteCustomizerDialog.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/DesignerPaletteCustomizerDialog.java
deleted file mode 100644
index a46fbbf..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/DesignerPaletteCustomizerDialog.java
+++ /dev/null
@@ -1,363 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.palette;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.gef.palette.PaletteEntry;
-import org.eclipse.gef.palette.PaletteRoot;
-import org.eclipse.gef.ui.palette.PaletteCustomizer;
-import org.eclipse.gef.ui.palette.customize.PaletteCustomizationAction;
-import org.eclipse.gef.ui.palette.customize.PaletteCustomizerDialog;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jst.jsf.common.ui.internal.utils.PluginImageHelper;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.editors.pagedesigner.PageDesignerResources;
-import org.eclipse.jst.pagedesigner.editors.palette.impl.PaletteItemManager;
-import org.eclipse.jst.pagedesigner.editors.palette.impl.TaglibPaletteDrawer;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Customization dialog for Web Page Designer palette items
- * @author mengbo
- * @version 1.5
- */
-public class DesignerPaletteCustomizerDialog extends PaletteCustomizerDialog {
- private static final String DEFAULT_CUSTOMIZATIONS_EXPORT_FILENAME = "WPDPaletteCustomizations.xml";
-
- private static String DEFAULTEXTENSION = ".xml";//$NON-NLS-1$
-
- /**
- * Constructor
- * @param shell
- * @param customizer
- * @param root
- */
- public DesignerPaletteCustomizerDialog(Shell shell,
- PaletteCustomizer customizer, PaletteRoot root) {
- super(shell, customizer, root);
-
- }
-
- private PropertyChangeListener applyButtonUpdater = new PropertyChangeListener() {
-
-
- public void propertyChange(PropertyChangeEvent evt) {
- Button applyButton = getButton(PaletteCustomizerDialog.APPLY_ID);
- if (applyButton == null) {
- return;
- }
- applyButton.setEnabled(true);
- }
- };
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.window.Window#open()
- */
- public int open() {
- // save the current state before open
- // save();
- return super.open();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.ui.palette.customize.PaletteCustomizerDialog#setActiveEntry(org.eclipse.gef.palette.PaletteEntry)
- */
- protected void setActiveEntry(PaletteEntry entry) {
- //remove listener on previous entry before adding to new entry
- PaletteEntry pre = getSelectedPaletteEntry();
- if (pre != null) {
- pre.removePropertyChangeListener(applyButtonUpdater);
- } else {
- getButton(APPLY_ID).setEnabled(false);
- }
-
- if (entry != null)
- entry.addPropertyChangeListener(applyButtonUpdater);
-
- super.setActiveEntry(entry);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.ui.palette.customize.PaletteCustomizerDialog#save()
- */
- protected void save() {
- super.save();
- Button applyButton = getButton(PaletteCustomizerDialog.APPLY_ID);
- if (applyButton != null) {
- applyButton.setEnabled(false);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.gef.ui.palette.customize.PaletteCustomizerDialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
- */
- protected void createButtonsForButtonBar(Composite parent) {
- super.createButtonsForButtonBar(parent);
- getButton(APPLY_ID).setEnabled(false);
- // save();
- }
-
- /* (non-Javadoc)
- * Export action
- *
- */
- private class ExportAction extends PaletteCustomizationAction {
-
- /**
- * Constructor
- */
- public ExportAction() {
- setEnabled(true);
- setText(PageDesignerResources.getInstance().getString(
- "DesignerPaletteCustomizerDialog.label.export")); //$NON-NLS-1$
- setImageDescriptor(PluginImageHelper.getInstance()
- .getImageDescriptor(DesignerPaletteImages.IMG_ELCL_EXPORT,
- PDPlugin.getPluginId()));
- setDisabledImageDescriptor(PluginImageHelper.getInstance()
- .getImageDescriptor(DesignerPaletteImages.IMG_DLCL_EXPORT,
- PDPlugin.getPluginId()));
- setHoverImageDescriptor(PluginImageHelper.getInstance()
- .getImageDescriptor(DesignerPaletteImages.IMG_CLCL_EXPORT,
- PDPlugin.getPluginId()));
- }
-
- private void handleExport() {
- final FileDialog fileDialog = new FileDialog(PDPlugin
- .getActiveWorkbenchShell());
- fileDialog.setFileName(DEFAULT_CUSTOMIZATIONS_EXPORT_FILENAME); //$NON-NLS-1$
- String[] filterExtensions = new String[2];
- filterExtensions[0] = "*.xml"; //$NON-NLS-1$
- filterExtensions[1] = "*.*"; //$NON-NLS-1$
- fileDialog.setFilterExtensions(filterExtensions);
- fileDialog.setText("Export Palette Customizations");
- String filename = fileDialog.open();
- if (filename != null) {
- if (!filename.endsWith(DEFAULTEXTENSION)) {
- filename = filename + DEFAULTEXTENSION;
- }
- DesignerPaletteCustomizationsHelper
- .exportCustomizations(PaletteItemManager.getCurrentInstance(), filename);
-
-
- updateActions();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run() {
- handleExport();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.gef.ui.palette.customize.PaletteCustomizationAction#update()
- */
- public void update() {
- //boolean enabled = false;
-// PaletteEntry entry = getSelectedPaletteEntry();
-// if (entry != null) {
- // if (getCustomizer() instanceof DesignerPaletteCustomizer)
- // enabled = ((DesignerPaletteCustomizer)
- // getCustomizer()).canExport(entry);
-// }
- setEnabled(true);
- }
-
- }
-
- /* (non-Javadoc)
- * Import action
- */
- private class ImportAction extends PaletteCustomizationAction {
- private DesignerPaletteCustomizerDialog designerPaletteCustomizerDialog;
-
- /**
- * Constructor
- * @param designerPaletteCustomizerDialog
- */
- public ImportAction(DesignerPaletteCustomizerDialog designerPaletteCustomizerDialog) {
- super();
- this.designerPaletteCustomizerDialog = designerPaletteCustomizerDialog;
- setEnabled(true);
- setText(PageDesignerResources.getInstance().getString(
- "DesignerPaletteCustomizerDialog.label.import")); //$NON-NLS-1$
- setImageDescriptor(PluginImageHelper.getInstance()
- .getImageDescriptor(DesignerPaletteImages.IMG_ELCL_IMPORT,
- PDPlugin.getPluginId()));
- setDisabledImageDescriptor(PluginImageHelper.getInstance()
- .getImageDescriptor(DesignerPaletteImages.IMG_DLCL_IMPORT,
- PDPlugin.getPluginId()));
- setHoverImageDescriptor(PluginImageHelper.getInstance()
- .getImageDescriptor(DesignerPaletteImages.IMG_CLCL_IMPORT,
- PDPlugin.getPluginId()));
-
- }
-
- private void handleImport() {
-// PaletteEntry entry = designerPaletteCustomizerDialog.getSelectedPaletteEntry();
- final FileDialog fileDialog = new FileDialog(PDPlugin
- .getActiveWorkbenchShell());
- fileDialog.setFileName(DEFAULT_CUSTOMIZATIONS_EXPORT_FILENAME); //$NON-NLS-1$
- String[] filterExtensions = new String[2];
- filterExtensions[0] = "*.xml"; //$NON-NLS-1$
- filterExtensions[1] = "*.*"; //$NON-NLS-1$
- fileDialog.setFilterExtensions(filterExtensions);
- fileDialog.setText("Import Palette Customizations");
- String filename = fileDialog.open();
- if (filename != null) {
- //deselect current entry first
- designerPaletteCustomizerDialog.close();
-
-// getCustomizer().revertToSaved();
- DesignerPaletteCustomizationsHelper
- .importCustomizations((DesignerPaletteCustomizer)getCustomizer(), filename);
-
-// designerPaletteCustomizerDialog.setActiveEntry(entry);
- ((DesignerPaletteCustomizer)getCustomizer()).getDesignerPaletteRoot().refresh();
- designerPaletteCustomizerDialog.open();
-// designerPaletteCustomizerDialog.setActiveEntry(entry);
- }
- }
-
- public void run() {
- handleImport();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.ui.palette.customize.PaletteCustomizationAction#update()
- */
- public void update() {
- //nothing to do
- }
- }
-
- /**
- * @return import action
- */
- public Action getImportAction() {
- return new ImportAction(this);
- }
-
- /**
- * @return export action
- */
- public Action getExportAction() {
- return new ExportAction();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.gef.ui.palette.customize.PaletteCustomizerDialog#createOutlineActions()
- */
- protected List createOutlineActions() {
- List actions = super.createOutlineActions();
- actions.remove(0);// remove new action
- actions.remove(0);// remove delete action
- actions.add(new ImportAction(this));
- actions.add(new ExportAction());
-
- return actions;
- }
-
- @Override
- protected TreeViewer createOutlineTreeViewer(Composite composite) {
- TreeViewer viewer = super.createOutlineTreeViewer(composite);
- viewer.setContentProvider(new DesignerPaletteContentProvider());
- return viewer;
- }
-
-
- /**
- * Content provider for dialog.
- * Displays only {@link TaglibPaletteDrawer}s
- */
- private static class DesignerPaletteContentProvider implements ITreeContentProvider {
-
- public Object[] getChildren(Object parentElement) {
- if (parentElement instanceof DesignerPaletteRoot){
- List libs = new ArrayList();
- List children = ((DesignerPaletteRoot)parentElement).getChildren();
- if (!children.isEmpty()) {
- for (Iterator it=children.iterator();it.hasNext();){
- PaletteEntry entry = (PaletteEntry)it.next();
- if (entry instanceof TaglibPaletteDrawer)
- libs.add(entry);
- }
- if (!libs.isEmpty())
- return libs.toArray();
- }
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
- */
- public Object getParent(Object element) {
- return ((PaletteEntry)element).getParent();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
- */
- public boolean hasChildren(Object element) {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
- */
- public Object[] getElements(Object inputElement) {
- Object[] elements = new Object[0];
- if (inputElement instanceof DesignerPaletteRoot){
- elements = getChildren(inputElement);
- if (elements == null) {
- elements = new Object[0];
- }
- }
- return elements;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- public void dispose() {
- //nothing to do
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- //won't change
- }
-
-
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/DesignerPaletteImages.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/DesignerPaletteImages.java
deleted file mode 100644
index 3b1d7e1..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/DesignerPaletteImages.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.palette;
-
-/**
- * Palette Image constants
- * @author mengbo
- */
-public class DesignerPaletteImages {
- /**
- * Import hover image
- */
- public static final String IMG_CLCL_IMPORT = "icons/palette/GENERIC/small/PD_Palette_Import_Hover.gif";
-
- /**
- * Export hover image
- */
- public static final String IMG_CLCL_EXPORT = "icons/palette/GENERIC/small/PD_Palette_Export_Hover.gif";
-
- /**
- * Import disabled image
- */
- public static final String IMG_DLCL_IMPORT = "icons/palette/GENERIC/small/PD_Palette_Import_Disabled.gif";
-
- /**
- * Export disabled image
- */
- public static final String IMG_DLCL_EXPORT = "icons/palette/GENERIC/small/PD_Palette_Export_Disabled.gif";
-
- /**
- * Import image
- */
- public static final String IMG_ELCL_IMPORT = "icons/palette/GENERIC/small/PD_Palette_Import.gif";
-
- /**
- * Export image
- */
- public static final String IMG_ELCL_EXPORT = "icons/palette/GENERIC/small/PD_Palette_Export.gif";
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/DesignerPaletteRoot.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/DesignerPaletteRoot.java
deleted file mode 100644
index 31c9d03..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/DesignerPaletteRoot.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.palette;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.gef.Tool;
-import org.eclipse.gef.palette.MarqueeToolEntry;
-import org.eclipse.gef.palette.PaletteEntry;
-import org.eclipse.gef.palette.PaletteGroup;
-import org.eclipse.gef.palette.PaletteRoot;
-import org.eclipse.gef.palette.SelectionToolEntry;
-import org.eclipse.gef.palette.ToolEntry;
-import org.eclipse.jst.pagedesigner.editors.pagedesigner.PageDesignerResources;
-import org.eclipse.jst.pagedesigner.tools.RangeSelectionTool;
-
-/**
- * @author mengbo
- */
-public class DesignerPaletteRoot extends PaletteRoot {
- private IPaletteItemManager _manager;
-
- /**
- * Creates a new DesignerPaletteRoot instance.
- * @param manager
- */
- public DesignerPaletteRoot(IPaletteItemManager manager) {
- // create root
- super();
-
- this._manager = manager;
- setupBasicItems();
- loadItems();
-
- // TODO: register listener on the manager for toolpalette change event.
-
- }
-
- /**
- * @return IPaletteItemManager instance for this root
- */
- public IPaletteItemManager getPaletteManager() {
- return this._manager;
- }
-
- private void setupBasicItems() {
- // Preferences prefs = PDPlugin.getDefault().getPluginPreferences();
- // _showAll = prefs.getBoolean(IJMTConstants.PREF_PALETTE_SHOW_ALL);
-
- // a group of default control tools
- // JSFPalette.DefaultGroup.LabelJSFPallete=Controls
- PaletteGroup controls = new PaletteGroup(PageDesignerResources
- .getInstance().getString(
- "JSFPalette.DefaultGroup.LabelJSFPallete")); //$NON-NLS-1$
- add(controls);
- // the selection tool
- ToolEntry tool = new SelectionToolEntry() {
- public Tool createTool() {
- return new RangeSelectionTool();
- }
- };
- controls.add(tool);
-
- // use selection tool as default entry
- setDefaultEntry(tool);
-
- // the marquee selection tool
- controls.add(new MarqueeToolEntry());
- }
-
- private void loadItems() {
- // _showAll =
- // PDPlugin.getDefault().getPluginPreferences().getBoolean(IJMTConstants.PREF_PALETTE_SHOW_ALL);
- // remove other things first.
- removeItems();
-
- List categories = _manager.getAllCategories();
- this.addAll(categories);
- }
-
- /**
- * remove everything from the paletteroot
- *
- */
- protected void removeItems() {
- // we try to remove anything other than the basic
- // group that have the selectentry and marqeeentry
- List children1 = new ArrayList(getChildren());
- children1.remove(0); // remove the first one
- for (int i = 0, n = children1.size(); i < n; i++) {
- this.remove((PaletteEntry) children1.get(i));
- }
- }
-
- /**
- * refresh the palette, normally caused by preference change.
- */
- public void refresh() {
- loadItems();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/DesignerPaletteRootFactory.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/DesignerPaletteRootFactory.java
deleted file mode 100644
index 3f81a7f..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/DesignerPaletteRootFactory.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.palette;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.gef.palette.PaletteRoot;
-import org.eclipse.gef.ui.palette.FlyoutPaletteComposite.FlyoutPreferences;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.editors.palette.impl.PaletteItemManager;
-
-/**
- * Factory for creating DesignerPaletteRoots
- * @author mengbo
- */
-public class DesignerPaletteRootFactory {
- /** Default palette size. */
- private static final int DEFAULT_PALETTE_SIZE = 125;
-
- /** Preference ID used to persist the palette location. */
- private static final String PALETTE_DOCK_LOCATION = "DesignerPaletteRootFactory.Location";
-
- /** Preference ID used to persist the palette size. */
- private static final String PALETTE_SIZE = "DesignerPaletteRootFactory.Size";
-
- /** Preference ID used to persist the flyout palette's state. */
- private static final String PALETTE_STATE = "DesignerPaletteRootFactory.State";
-
- /**
- * Return a {@link FlyoutPreferences} instance used to save/load the preferences of
- * a flyout palette.
- * @return FlyoutPreferences
- */
- public static FlyoutPreferences createPalettePreferences() {
- // set default flyout palette preference values, in case the preference
- // store
- // does not hold stored values for the given preferences
- getPreferenceStore().setDefault(PALETTE_DOCK_LOCATION, -1);
- getPreferenceStore().setDefault(PALETTE_STATE, -1);
- getPreferenceStore().setDefault(PALETTE_SIZE, DEFAULT_PALETTE_SIZE);
-
- return new FlyoutPreferences() {
- public int getDockLocation() {
- return getPreferenceStore().getInt(PALETTE_DOCK_LOCATION);
- }
-
- public int getPaletteState() {
- return getPreferenceStore().getInt(PALETTE_STATE);
- }
-
- public int getPaletteWidth() {
- return getPreferenceStore().getInt(PALETTE_SIZE);
- }
-
- public void setDockLocation(int location) {
- getPreferenceStore().setValue(PALETTE_DOCK_LOCATION, location);
- }
-
- public void setPaletteState(int state) {
- getPreferenceStore().setValue(PALETTE_STATE, state);
- }
-
- public void setPaletteWidth(int width) {
- getPreferenceStore().setValue(PALETTE_SIZE, width);
- }
- };
- }
-
- /**
- * Returns the preference store for the PDPlugin.
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#getPreferenceStore()
- */
- private static IPreferenceStore getPreferenceStore() {
- return PDPlugin.getDefault().getPreferenceStore();
- }
-
- /**
- * Creates the PaletteRoot and adds all palette elements. Use this factory
- * method to create a new palette for your graphical editor.
- * @param project
- * @return a new PaletteRoot
- */
- public static PaletteRoot createPaletteRoot(IProject project) {
- PaletteItemManager manager = PaletteItemManager.getInstance(project);
- if (manager == null) {
- return null;
- }
- manager.reset();
- PaletteRoot palette = new DesignerPaletteRoot(manager);
- return palette;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/DesignerPaletteViewer.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/DesignerPaletteViewer.java
deleted file mode 100644
index d25c94f..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/DesignerPaletteViewer.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.palette;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.Preferences.PropertyChangeEvent;
-import org.eclipse.gef.palette.PaletteRoot;
-import org.eclipse.gef.ui.palette.PaletteCustomizer;
-import org.eclipse.gef.ui.palette.PaletteViewer;
-import org.eclipse.gef.ui.palette.customize.PaletteCustomizerDialog;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.editors.palette.impl.PaletteItemManager;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * XXX: currently create this class is just for add/remove listener to
- * preference change, so can refresh the palette.
- *
- * @author mengbo
- * @author mengbo
- * @version 1.5
- */
-public class DesignerPaletteViewer extends PaletteViewer {
-
- private PaletteCustomizerDialog _customizerDialog = null;
-
- private DesignerPaletteCustomizer _customizer;
-
- /**
- *
- */
- public DesignerPaletteViewer() {
- super();
-
- this.enableVerticalScrollbar(true);
- }
-
- Preferences.IPropertyChangeListener listener = new Preferences.IPropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent event) {
- PaletteRoot root = getPaletteRoot();
- if (root instanceof DesignerPaletteRoot) {
-// ((DesignerPaletteRoot) root).refresh();
- // XXX: setActiveTool to null to workaround GEF bug of NPE
- // setActiveTool(null);
- }
- }
- };
-
- IEntryChangeListener _paletteModelListener = new IEntryChangeListener() {
-
- public void modelChanged(List oldDefinitions, List newDefinitions) {
- final PaletteRoot root = getPaletteRoot();
- if (root instanceof DesignerPaletteRoot) {
- Control viewerControl = getControl();
-
- if (viewerControl != null && !viewerControl.isDisposed())
- {
- Display display = viewerControl.getDisplay();
-
- if (display != null && !display.isDisposed())
- {
- // this updates the UI, so it must be run on
- // the display thread
- display.asyncExec(new Runnable()
- {
- public void run() {
- ((DesignerPaletteRoot) root).refresh();
- }
- });
- }
- }
- }
- }
-
- };
-
-//
-// IResourceChangeListener _resourceChangeListener = new IResourceChangeListener() {
-//
-// public void resourceChanged(IResourceChangeEvent event) {
-// IResourceDeltaVisitor visitor = new IResourceDeltaVisitor() {
-// public boolean visit(IResourceDelta delta) throws CoreException {
-// IResource resource = delta.getResource();
-// // FIXME need make performance better
-// if (resource.getType() == IResource.FILE
-// && (delta.getFlags() & IResourceDelta.CONTENT) != 0) {
-// String ext = ((IFile) resource).getFileExtension();
-// // resource.getFullPath().
-// if (ext != null
-// && ("tld".equalsIgnoreCase(ext) || "jar"
-// .equalsIgnoreCase(ext))) {
-// PaletteRoot root = getPaletteRoot();
-// if (root instanceof DesignerPaletteRoot) {
-// IPaletteItemManager imanager = ((DesignerPaletteRoot) root)
-// .getPaletteManager();
-// if (imanager instanceof PaletteItemManager) {
-// PaletteItemManager manager = (PaletteItemManager) imanager;
-// manager.reset();
-// }
-//
-// }
-// }
-// }
-// return true;
-// }
-// };
-// try {
-// IResourceDelta delta = event.getDelta();
-// if (delta != null) {
-// delta.accept(visitor);
-// }
-// } catch (CoreException e) {
-// // ignore
-// }
-// }
-//
-// };
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.ui.palette.PaletteViewer#hookControl()
- */
- protected void hookControl() {
- super.hookControl();
- PDPlugin.getDefault().getPluginPreferences().addPropertyChangeListener(
- listener);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.ui.palette.PaletteViewer#unhookControl()
- */
- protected void unhookControl() {
- PDPlugin.getDefault().getPluginPreferences()
- .removePropertyChangeListener(listener);
- // remove palette model change listener
- PaletteRoot root = getPaletteRoot();
- if (root instanceof DesignerPaletteRoot) {
- if (_customizer != null){
- _customizer.setPaletteRoot(null);
- }
- IPaletteItemManager imanager = ((DesignerPaletteRoot) root)
- .getPaletteManager();
- if (imanager instanceof PaletteItemManager) {
- PaletteItemManager manager = (PaletteItemManager) imanager;
-// ResourcesPlugin.getWorkspace().removeResourceChangeListener(
-// _resourceChangeListener);
- manager.removeEntryChangeListener(_paletteModelListener);
- PaletteItemManager.clearPaletteItemManager();
- }
- }
- super.unhookControl();
- }
-
- public PaletteCustomizerDialog getCustomizerDialog() {
- if (_customizerDialog == null){
- _customizerDialog = DesignerPaletteCustomizationsHelper.getNewCustomizerDialog(this, getCustomizer() );
- }
- return _customizerDialog;
- }
-
- public PaletteCustomizer getCustomizer() {
- if (_customizer == null){
- _customizer = DesignerPaletteCustomizationsHelper.getNewCustomizer();
- _customizer.setPaletteRoot((DesignerPaletteRoot)this.getPaletteRoot());
- }
- return _customizer;
- }
-
- public void setPaletteRoot(PaletteRoot root) {
- super.setPaletteRoot(root);
- // add palette model change listener
- // PaletteRoot root = getPaletteRoot();
- if (root instanceof DesignerPaletteRoot) {
- ((DesignerPaletteRoot) root).getPaletteManager()
- .addEntryChangeListener(_paletteModelListener);
-// ResourcesPlugin.getWorkspace().addResourceChangeListener(
-// _resourceChangeListener);
- }
-
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/DesignerPaletteViewerProvider.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/DesignerPaletteViewerProvider.java
deleted file mode 100644
index 203e40f..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/DesignerPaletteViewerProvider.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.palette;
-
-import org.eclipse.gef.EditDomain;
-import org.eclipse.gef.internal.ui.palette.editparts.DrawerEditPart;
-import org.eclipse.gef.ui.palette.PaletteContextMenuProvider;
-import org.eclipse.gef.ui.palette.PaletteViewer;
-import org.eclipse.gef.ui.palette.PaletteViewerProvider;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.dnd.internal.DesignerTemplateTransferDragSourceListener;
-import org.eclipse.jst.pagedesigner.editors.palette.impl.TaglibPaletteDrawer;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @author mengbo
- */
-public class DesignerPaletteViewerProvider extends PaletteViewerProvider {
- /**
- * @param graphicalViewerDomain
- */
- public DesignerPaletteViewerProvider(EditDomain graphicalViewerDomain) {
- super(graphicalViewerDomain);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.ui.palette.PaletteViewerProvider#configurePaletteViewer(org.eclipse.gef.ui.palette.PaletteViewer)
- */
- protected void configurePaletteViewer(PaletteViewer viewer) {
- // super.configurePaletteViewer(viewer);
- viewer.setContextMenu(new PaletteContextMenuProvider(viewer) {
- public void buildContextMenu(IMenuManager menu) {
- StructuredSelection sel = (StructuredSelection)getViewer().getSelection();
- if (sel != null
- && sel.getFirstElement() instanceof DrawerEditPart
- && ((DrawerEditPart)sel.getFirstElement()).getDrawer() instanceof TaglibPaletteDrawer)
- menu.add(new HideTagLibAction((DrawerEditPart)sel.getFirstElement(), "Hide"));
- super.buildContextMenu(menu);
- }
- });
-
- // XXX: should only use the following when we use Template
- viewer
- .addDragSourceListener(new DesignerTemplateTransferDragSourceListener(
- viewer));
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.ui.palette.PaletteViewerProvider#createPaletteViewer(org.eclipse.swt.widgets.Composite)
- */
- public PaletteViewer createPaletteViewer(Composite parent) {
- PaletteViewer pViewer = new DesignerPaletteViewer();
- pViewer.createControl(parent);
- configurePaletteViewer(pViewer);
- pViewer.setCustomizer(new DesignerPaletteCustomizer());
- hookPaletteViewer(pViewer);
-
- PlatformUI
- .getWorkbench()
- .getHelpSystem()
- .setHelp(
- parent,
- PDPlugin
- .getResourceString("DesignerPaletteViewerProvider.help.id"));
-
- return pViewer;
- }
-
- private static class HideTagLibAction extends Action {
- private DrawerEditPart tagLib;
-
- /**
- * Constructor
- * @param tagLibDrawer
- * @param string
- */
- public HideTagLibAction(DrawerEditPart tagLibDrawer, String string) {
- super(string);
- this.tagLib = tagLibDrawer;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run() {
- TaglibPaletteDrawer pd = (TaglibPaletteDrawer)tagLib.getDrawer();
- pd.setVisible(false);
- DesignerPaletteCustomizationsHelper.hideTaglibDrawer(pd);
- }
-
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/IEntryChangeListener.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/IEntryChangeListener.java
deleted file mode 100644
index 2f4667e..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/IEntryChangeListener.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.palette;
-
-import java.util.List;
-
-/**
- * @author mengbo
- */
-public interface IEntryChangeListener {
- /**
- * @param oldDefinitions
- * the old taglib definitions
- * @param newDefinitions
- * the new taglib definitions
- */
- void modelChanged(List oldDefinitions, List newDefinitions);
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/IPaletteConstants.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/IPaletteConstants.java
deleted file mode 100644
index dcbf651..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/IPaletteConstants.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.palette;
-
-/**
- * Constants used by palette customizations persistence
- *
- * @author mengbo
- */
-public interface IPaletteConstants {
- /**
- *
- */
- public static final String BUNDLE_ID = "org.eclipse.jst.pagedesigner"; //$NON-NLS-1$
-
- /**
- * contant for palett-item element name
- */
- public static final String ROOT = "palette-item"; //$NON-NLS-1$
-
- /**
- * constant for uri attribute
- */
- public static final String URI = "uri"; //$NON-NLS-1$
-
- /**
- * Constant for hidden attribute
- */
- public static final String ISHIDDEN = "hidden"; //$NON-NLS-1$
-
- /**
- * constant for id attribute
- */
- public static final String ID = "id"; //$NON-NLS-1$
-
- /**
- * constant for category element name
- */
- public static final String CATEGORY_TAG = "category"; //$NON-NLS-1$
-
-//OLD - no longer/currently used
-
-// public static final String EXTENSION_POINT_ID = "ResourceContributions"; //$NON-NLS-1$
-// public static final String FILENAME = "/tag.xml"; //$NON-NLS-1$
-// public static final String TAGNAME = "tagName"; //$NON-NLS-1$
-// public static final String ITEM_TAG = "item"; //$NON-NLS-1$
-// public static final String EXPERT = "expert"; //$NON-NLS-1$
-// public static final String LARGEICON = "largeIcon"; //$NON-NLS-1$
-// public static final String SMALLICON = "smallIcon"; //$NON-NLS-1$
-// public static final String LABEL = "label"; //$NON-NLS-1$
-// public static final String INITIALSTATE = "initialState"; //$NON-NLS-1$
-// public static final String SHORTDESC = "shortDesc"; //$NON-NLS-1$
-// public static final String ATTRIBUTE_TAG = "attribute"; //$NON-NLS-1$
-// public static final String NAME = "name"; //$NON-NLS-1$
-// public static final String VALUE = "value"; //$NON-NLS-1$
-// public static final String ICONPREFIX = "iconPrefix"; //$NON-NLS-1$
-// public static final String TAGLIBEXT = "capability"; //$NON-NLS-1$
-// public static final String JARPROTO = "jar:file://"; //$NON-NLS-1$
-// public static final String FILEPROTO = "file://"; //$NON-NLS-1$
-// public static final String REQUIREHFORM = "requireHForm"; //$NON-NLS-1$
-// public static final String JSFCOMPONENTCATEGORY = "jsfComponentCategory"; //$NON-NLS-1$
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/IPaletteItemManager.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/IPaletteItemManager.java
deleted file mode 100644
index aa047ff..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/IPaletteItemManager.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.palette;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.pagedesigner.editors.palette.impl.TaglibPaletteDrawer;
-
-/**
- * PaletteItemManager interface.
- *
- * NOT intended to be implemented by clients
- *
- * @author mengbo
- */
-public interface IPaletteItemManager {
- /**
- * @return IProject
- */
- public IProject getProject();
-
- /**
- * @return list of {@link TaglibPaletteDrawer}s being managed for this project
- */
- public List/*TaglibPaletteDrawer*/ getAllCategories();
-
- /**
- * Create a TaglibPaletteDrawer with given label for given id
- *
- * @param id
- * @param label
- * @return TaglibPaletteDrawer
- */
- public TaglibPaletteDrawer createTaglibPaletteDrawer(String id, String label);
-
- /**
- * Retrieve the TaglibPaletteDrawer by id. May be null.
- *
- * @param id
- * @return TaglibPaletteDrawer
- */
- public TaglibPaletteDrawer getTaglibPalletteDrawer(String id);
-
- /**
- * Locate by id, and if not found, create a TaglibPaletteDrawer using label and id
- *
- * @param id
- * @param label
- * @return TaglibPaletteDrawer
- */
- public TaglibPaletteDrawer findOrCreateCategory(String id, String label);
-
- /**
- * Adds a listener to the list of those notified when the model contents are
- * replaced
- *
- * @param listener -
- * the listener to add
- */
- void addEntryChangeListener(IEntryChangeListener listener);
-
- /**
- * Adds a listener to the list of those notified when the model contents are
- * replaced
- *
- * @param listener -
- * the listener to remove
- */
- void removeEntryChangeListener(IEntryChangeListener listener);
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/ShowAllAction.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/ShowAllAction.java
deleted file mode 100644
index f115bfe..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/ShowAllAction.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.palette;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jst.pagedesigner.IJMTConstants;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-
-/**
- * @author mengbo
- */
-public class ShowAllAction extends Action {
- Preferences _preferences = null;
-
- /**
- * @param pluginPreferences
- */
- public ShowAllAction(Preferences pluginPreferences) {
- super(PDPlugin.getResourceString("ShowAllAction.ActionLabel.ShowAll")); //$NON-NLS-1$
- _preferences = pluginPreferences;
- boolean showAll = _preferences
- .getBoolean(IJMTConstants.PREF_PALETTE_SHOW_ALL);
- this.setChecked(showAll);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run() {
- boolean showAll = _preferences
- .getBoolean(IJMTConstants.PREF_PALETTE_SHOW_ALL);
- // toggle the show all status. preference will fire out change event,
- // and palettes
- // receive this event will refresh
- _preferences.setValue(IJMTConstants.PREF_PALETTE_SHOW_ALL, !showAll);
- this.setChecked(!showAll);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/TagImageManager.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/TagImageManager.java
deleted file mode 100644
index d76a0b9..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/TagImageManager.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.palette;
-
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.internal.IImageDescriptorProvider;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataSourceModelProvider;
-import org.eclipse.jst.jsf.common.metadata.internal.TraitValueHelper;
-import org.eclipse.jst.jsf.common.metadata.query.ITaglibDomainMetaDataModelContext;
-import org.eclipse.jst.jsf.common.metadata.query.TaglibDomainMetaDataQueryHelper;
-import org.eclipse.jst.jsf.common.ui.JSFUICommonPlugin;
-import org.eclipse.jst.jsf.common.ui.internal.utils.JSFSharedImages;
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo;
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfos;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * Locates and creates Images for tags using the common metadata framework.
- *
- * Images are cached in the PDPlugin's ImageRegistry.
- *
- * Some code is being duplicated in palette helper. PaletteHelper should be re-factored to use this code
- *
- */
-public class TagImageManager {
- private static TagImageManager INSTANCE = null;
-
- private final static ImageDescriptor DEFAULT_SMALL_ICON = JSFUICommonPlugin
- .getDefault().getImageDescriptor(
- JSFSharedImages.DEFAULT_PALETTE_TAG_IMG);
-
- private final static ImageDescriptor DEFAULT_LARGE_ICON = PDPlugin
- .getDefault().getImageDescriptor(
- "palette/GENERIC/large/PD_Palette_Default.gif");
-
- private static final String TRAIT_ICON_SMALL = "small-icon";
-
- private static final String TRAIT_ICON_LARGE = "large-icon";
-
- /**
- * @return singleton instance
- */
- public synchronized static TagImageManager getInstance() {
- if (INSTANCE == null) {
- INSTANCE = new TagImageManager();
- }
- return INSTANCE;
- }
-
- /**
- * Returns small image using metadata and may be null. Caller should NOT dispose the image, but should call TagImageManager's dispose(image)
- * @param project
- * @param nsUri
- * @param tagName
- * @return small image using metadata. May be null.
- */
- public Image getSmallIconImage(IProject project, String nsUri, String tagName) {
- Image image = null;
- Model model = getModel(project, nsUri);
- if (model != null){
- ImageDescriptor imgDesc = getSmallIconImageDescriptor(model, tagName);
- image = getOrCreateImage(imgDesc);
- }
-
- return image;
- }
-
- /**
- * @param project
- * @param nsUri
- * @param tagName
- * @return large image using metadata. May be null.
- */
- public Image getLargeIconImage(IProject project, String nsUri, String tagName) {
- Image image = null;
- Model model = getModel(project, nsUri);
- if (model != null){
- ImageDescriptor imgDesc = getLargeIconImageDescriptor(model, nsUri);
- image = getOrCreateImage(imgDesc);
- }
-
- return image;
- }
-
- /**
- * Gets, and creates if necessary, a shared image.
- * @param imageDescriptor
- * @return Image from shared cache
- */
- public static Image getOrCreateImage(ImageDescriptor imageDescriptor) {
- Image image = null;
- if (imageDescriptor != null){
- image = PDPlugin.getDefault().getImageRegistry().get(imageDescriptor.toString());
- if (image == null ){
- image = imageDescriptor.createImage();
- PDPlugin.getDefault().getImageRegistry().put(imageDescriptor.toString(), image);
- } else if (image.isDisposed()){ //should not occur, but handling just in case
- PDPlugin.getDefault().getImageRegistry().remove(imageDescriptor.toString());
- image = imageDescriptor.createImage();
- PDPlugin.getDefault().getImageRegistry().put(imageDescriptor.toString(), image);
- }
- }
- return image;
- }
-
- private Model getModel(IProject project, String nsUri) {
- ITaglibDomainMetaDataModelContext modelContext = TaglibDomainMetaDataQueryHelper.createMetaDataModelContext(project, nsUri);
- Model model =TaglibDomainMetaDataQueryHelper.getModel(modelContext);
- // no caching at this time so there is no need to listen to model notifications
-// if (model != null && !hasAdapter(model))
-// addAdapter(model);
- return model;
- }
-
-
-// private void addAdapter(Model model) {
-// if (model != null){
-//// model.eAdapters().add(INSTANCE);
-// }
-// }
-//
-// private boolean hasAdapter(Model model) {
-// for(Adapter a : model.eAdapters()){
-// if (a == INSTANCE)
-// return true;
-// }
-// return false;
-// }
-
- private ImageDescriptor getSmallIconImageDescriptor(Model model, String tagName) {
- return getIconImageDescriptor(model, tagName, true);
- }
-
- private ImageDescriptor getLargeIconImageDescriptor(Model model, String tagName) {
- return getIconImageDescriptor(model, tagName, false);
- }
-
- private ImageDescriptor getIconImageDescriptor(Model model, String tagName, boolean small) {
- ImageDescriptor icon = null;
-
- //use palette infos if available
- Trait trait = TaglibDomainMetaDataQueryHelper.getTrait(model, "paletteInfos");
- if (trait != null){
- PaletteInfos tags = (PaletteInfos)trait.getValue();
- for (Iterator it=tags.getInfos().iterator();it.hasNext();){
- PaletteInfo tag = (PaletteInfo)it.next();
- if (tag.getId().equalsIgnoreCase(tagName)){
- IMetaDataSourceModelProvider sourceProvider = ((Trait)tag.eContainer().eContainer()).getSourceModelProvider();
- if (small)
- icon = getImageDescriptorFromString(sourceProvider, tag.getSmallIcon(), DEFAULT_SMALL_ICON);
- else
- icon = getImageDescriptorFromString(sourceProvider, tag.getLargeIcon(), DEFAULT_LARGE_ICON);
-
- break;
- }
- }
- }
- if (icon == null) {
- for (Iterator it=model.getChildEntities().iterator();it.hasNext();){
- Entity tagAsEntity = (Entity)it.next();
- if (tagAsEntity.getId().equalsIgnoreCase(tagName)){
- if (small)
- icon = getImageDescriptorFromTagTraitValueAsString(tagAsEntity, TRAIT_ICON_SMALL, DEFAULT_SMALL_ICON);
- else
- icon = getImageDescriptorFromTagTraitValueAsString(tagAsEntity, TRAIT_ICON_LARGE, DEFAULT_LARGE_ICON);
-
- break;
- }
- }
-
- }
-
- return icon;
- }
-
- private ImageDescriptor getImageDescriptorFromString(IMetaDataSourceModelProvider sourceModelProvider, String imgDesc, ImageDescriptor defaultValue){
- ImageDescriptor image = defaultValue;
- IImageDescriptorProvider imageProvider = (IImageDescriptorProvider)sourceModelProvider.getAdapter(IImageDescriptorProvider.class);
- if (imageProvider != null){
- image = imageProvider.getImageDescriptor(imgDesc);
- }
- return image;
- }
-
- private ImageDescriptor getImageDescriptorFromTagTraitValueAsString(Entity entity, String key, ImageDescriptor defaultValue){
- Trait t = TaglibDomainMetaDataQueryHelper.getTrait(entity, key);
- if (t != null){
- String imgDesc = TraitValueHelper.getValueAsString(t);
- return getImageDescriptorFromString(t.getSourceModelProvider(), imgDesc, defaultValue);
- }
- return defaultValue;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/TagToolPaletteEntry.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/TagToolPaletteEntry.java
deleted file mode 100644
index 7f14afb..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/TagToolPaletteEntry.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.palette;
-
-import org.eclipse.gef.Tool;
-import org.eclipse.gef.palette.ToolEntry;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jst.pagedesigner.editors.palette.impl.TaglibPaletteDrawer;
-import org.eclipse.jst.pagedesigner.itemcreation.ItemCreationTool;
-
-/**
- * Represents a tag palette item entry in the web page designer palette
- *
- */
-public class TagToolPaletteEntry extends ToolEntry {
-
- private String tagName;
-
- /**
- * Constructor
- * @param tagName
- * @param label
- * @param shortDescription
- * @param iconSmall
- * @param iconLarge
- */
- public TagToolPaletteEntry(String tagName, String label, String shortDescription,
- ImageDescriptor iconSmall, ImageDescriptor iconLarge) {
- super(label, shortDescription, iconSmall, iconLarge);
- this.tagName = tagName;
- }
-
- /**
- * @return tagName
- */
- public String getTagName(){
- return tagName;
- }
-
- /**
- * Convenience method returning the tag libraries default prefix, if applicable
- * @return default prefix
- */
- public String getDefaultPrefix(){
- return ((TaglibPaletteDrawer)getParent()).getDefaultPrefix();
- }
-
- /**
- * @return uri of the tag's library
- */
- public String getURI(){
- return ((TaglibPaletteDrawer)getParent()).getURI();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.gef.palette.ToolEntry#createTool()
- */
- public Tool createTool() {
- return new ItemCreationTool(this);
- }
-
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/impl/PaletteElementTemplateHelper.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/impl/PaletteElementTemplateHelper.java
deleted file mode 100644
index 5c1cfa6..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/impl/PaletteElementTemplateHelper.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.palette.impl;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationInfo;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.editors.palette.TagToolPaletteEntry;
-import org.eclipse.jst.pagedesigner.utils.JSPUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-import org.xml.sax.SAXException;
-
-/**
- *
- * @author mengbo
- */
-public class PaletteElementTemplateHelper {
- //private static final String TEMPLATE_ITEM_NAME = "template";
-
- private static final String PREFIX_ATTRIBUTE = "_uri_";
-
-// private static Logger _log = PDPlugin
-// .getLogger(PaletteElementTemplateHelper.class);
-
- /**
- * This method is used to process template element which is read from .xmi
- * file and generate default element.
- *
- * @param model
- * @param element
- * @param tagItem
- * @param tagCreationInfo
- */
- public static void applyTemplate(IDOMModel model, Element element,
- TagToolPaletteEntry tagItem, TagCreationInfo tagCreationInfo) {
- if (element == null || element.getLocalName() == null) {
- return;
- }
-
- Node[] templateNodes = getTemplateNodes(model, tagCreationInfo);
- if (templateNodes != null) {
- for (int i=0;i<templateNodes.length;i++){
- Node anode = templateNodes[i];
- element.appendChild(anode);
- }
- }
- }
-
- private static Node[] getTemplateNodes(IDOMModel model,
- TagCreationInfo tagCreationInfo) {
-
- if (tagCreationInfo == null)
- return null;
-
- String template = (String)tagCreationInfo.getTemplate();
- if (template != null){
-
- final String nodeStr = prepareNode(template);//(String)template.getTemplate();
- final Logger logger = PDPlugin.getLogger(PaletteElementTemplateHelper.class);
- try {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- factory.setNamespaceAware(true);
- factory.setValidating(false);
- DocumentBuilder builder = factory.newDocumentBuilder();
- Document doc = builder.parse(new ByteArrayInputStream( nodeStr.getBytes()));
- Node beginNode = doc.getFirstChild();
- Node templateNode = beginNode.cloneNode(true);//model.getDocument().importNode(beginNode, true);
- Node[] templateNodes = applyPrefixes(model, tagCreationInfo, templateNode.getChildNodes(), model.getDocument());
- return templateNodes;
- } catch (ParserConfigurationException e) {
- logger.error(e);
- } catch (SAXException e) {
- logger.error(e);
- } catch (IOException e) {
- logger.error(e);
- } catch (Exception e){
- logger.error(e);
- }
- }
- return null;
- }
-
- /**
- * @param template
- * @return xml as String wrapped by a <begin> node as template may not have a single root element
- */
- private static String prepareNode(String template) {
- StringBuffer buf = new StringBuffer("<begin>");
- buf.append(template);
- buf.append("</begin>");
- return buf.toString();
- }
-
- /**
- * Use the actrual prefixs of jsf html and jsf core to set the prefix of
- * each node declared in template.
- * @param model
- * @param info
- * @param templateNodes
- * @param document
- * @return Node[]
- *
- */
- public static Node[] applyPrefixes(IDOMModel model, TagCreationInfo info,
- NodeList templateNodes, Document document) {
- List result = new ArrayList();
- for (int i = 0, n = templateNodes.getLength(); i < n; i++) {
- Node node = cloneNodeDeep(model, document, templateNodes.item(i));
- if (node instanceof Element) {
- result.add(node);
- }
- }
- return (Node[]) result.toArray(new Node[result.size()]);
- }
-
- /**
- * TODO: Later we may add some logic to reference the tld file through tag
- * name to resolve the prefixs directly.
- */
- private static void internalApplyPrefixes(IDOMModel model, Element refNode, Element node) {
- if (node != null && refNode != null) {
- String uri = refNode.getAttribute(PREFIX_ATTRIBUTE); //$NON-NLS-1$
- if (uri != null) {
- String prefix = JSPUtil.getOrCreatePrefix(model, uri, null);
- node.setPrefix(prefix);
- }
- }
- }
-
-
- /**
- * A deep clone of the sourceNode
- * @param model
- * @param destDoc
- * @param sourceNode
- * @return Node
- */
- public static Node cloneNodeDeep(IDOMModel model, Document destDoc, Node sourceNode) {
- switch (sourceNode.getNodeType()) {
- case Node.ELEMENT_NODE:
- Element sourceEle = (Element) sourceNode;
- Element resultEle = destDoc.createElement(sourceEle.getTagName());
- internalApplyPrefixes(model, sourceEle, resultEle);
- NamedNodeMap attrs = sourceEle.getAttributes();
- for (int i = 0, size = attrs.getLength(); i < size; i++) {
- Attr a = (Attr) attrs.item(i);
- if (!PREFIX_ATTRIBUTE.equalsIgnoreCase(a.getNodeName())) {
- resultEle.setAttribute(a.getName(), a.getValue());
- }
- }
- NodeList children = sourceEle.getChildNodes();
- for (int i = 0, size = children.getLength(); i < size; i++) {
- Node n = children.item(i);
- Node d = cloneNodeDeep(model, destDoc, n);
- if (d != null) {
- resultEle.appendChild(d);
- }
- }
- return resultEle;
- case Node.TEXT_NODE:
- Text txt = destDoc.createTextNode(sourceNode.getNodeValue());
- if (txt instanceof IDOMText && sourceNode instanceof IDOMText) {
- try {
- ((IDOMText) txt).setSource(((IDOMText) sourceNode)
- .getSource());
- } catch (Exception ex) {
- // ignore
- }
- }
- return txt;
- case Node.CDATA_SECTION_NODE:
- return destDoc.createCDATASection(sourceNode.getNodeValue());
- default:
- return null; // not support.
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/impl/PaletteHelper.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/impl/PaletteHelper.java
deleted file mode 100644
index fc79558..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/impl/PaletteHelper.java
+++ /dev/null
@@ -1,420 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.palette.impl;
-
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-import java.util.regex.Pattern;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.gef.palette.PaletteDrawer;
-import org.eclipse.gef.palette.PaletteEntry;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.internal.IImageDescriptorProvider;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataSourceModelProvider;
-import org.eclipse.jst.jsf.common.metadata.internal.TraitValueHelper;
-import org.eclipse.jst.jsf.common.metadata.query.ITaglibDomainMetaDataModelContext;
-import org.eclipse.jst.jsf.common.metadata.query.TaglibDomainMetaDataQueryHelper;
-import org.eclipse.jst.jsf.common.ui.JSFUICommonPlugin;
-import org.eclipse.jst.jsf.common.ui.internal.utils.JSFSharedImages;
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo;
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfos;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDDocument;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDElementDeclaration;
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.editors.palette.IPaletteItemManager;
-import org.eclipse.jst.pagedesigner.editors.palette.TagToolPaletteEntry;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDocument;
-import org.eclipse.wst.html.core.internal.contentmodel.JSPCMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMDocType;
-
-/**
- * Helper class.
- *
- * @author mengbo
- */
-public class PaletteHelper {
-
- // pattern to strip all <x> and </x> HTML tags
- final private static Pattern removeHTMLTags = Pattern.compile("<[/?\\w\\s=\"\\.\\#]+>");
-
- // pattern to find all runs of spaces longer than one
- final private static Pattern trimInteriorWhitespace = Pattern.compile("[ ]+");
-
- // pattern to find all new lines for removal
- final private static Pattern removeNewLines = Pattern.compile("[\n]");
-
- private final static ImageDescriptor DEFAULT_SMALL_ICON = JSFUICommonPlugin
- .getDefault().getImageDescriptor(
- JSFSharedImages.DEFAULT_PALETTE_TAG_IMG);
-
- private final static ImageDescriptor DEFAULT_LARGE_ICON = PDPlugin
- .getDefault().getImageDescriptor(
- "palette/GENERIC/large/PD_Palette_Default.gif");
-
-
-
-// how many characters to truncate a palette item's description to.
-// TODO: add preference?
-// the soft length is the ideal length we try to truncate to. We first
-// try to find a period (end of sentence; TODO: should have a character class)
-// inside the first SOFT_LENGTH chars at which to truncate a description string.
-// if we can't find one then we search for the first one between SOFT_LENGTH
-// and min(HARD_LENGTH, str.length()). If found, we truncate there. If not,
-// we truncate to HARD_LENGTH-" ...".length() and append the ellipsis.
-// In all cases the truncated description string returned should <= HARD_LENGTH.
-// private final static int DESCRIPTION_TRUNCATE_SOFT_LENGTH = 150;
- private final static int DESCRIPTION_TRUNCATE_HARD_LENGTH = 250;
-
-
- /**
- * Creates a TaglibPaletteDrawer with TagTool palette entries for each tag from the CMDocument
- * @param manager
- * @param project
- * @param doc
- * @return TaglibPaletteDrawer
- */
- public static TaglibPaletteDrawer configPaletteItemsByTLD(IPaletteItemManager manager, IProject project,
- CMDocument doc) {
- //bit of a hack... could be greatly improved
- String tldURI = null;
- if (doc instanceof TLDDocument){
- tldURI = ((TLDDocument)doc).getUri();
- }
- else if (doc instanceof HTMLCMDocument){
- tldURI = CMDocType.HTML_DOC_TYPE;
- }
- else if (doc instanceof JSPCMDocument){
- tldURI = CMDocType.JSP11_DOC_TYPE;
- }
-
- if (tldURI == null)
- return null;
-
- TaglibPaletteDrawer category = findCategory(manager, tldURI);
- if (category != null)
- return category;
-
- ITaglibDomainMetaDataModelContext modelContext = TaglibDomainMetaDataQueryHelper.createMetaDataModelContext(project, tldURI);
- Model model = TaglibDomainMetaDataQueryHelper.getModel(modelContext);
- category = createTaglibPaletteDrawer(manager, doc, model);
-
- if (category != null){
- loadTags(category, doc, model);
- sortTags(category.getChildren());
- }
- return category;
- }
-
- private static void sortTags(List tags) {
- //note that once we store ordering customizations, we will need to do something different
- //it will also be complicated if we decide to do 181958 and 181866
- Collections.sort(tags, new Comparator(){
-
- public int compare(Object o1, Object o2) {
- String label1 = ((PaletteEntry)o1).getLabel();
- String label2 = ((PaletteEntry)o2).getLabel();
-
- if (label1 == null)
- {
- // if both null, then equal
- if (label2 == null)
- {
- return 0;
- }
- // otherwise, sort label 2 before
- return 1;
- }
-
-
- if (label2 == null)
- {
- // if both null then equal
- if (label1 == null)
- {
- return 0;
- }
- // if label1 not null, then sort it first
- return -1;
- }
- return label1.compareTo(label2);
- }
-
- });
-
- }
-
- private static void loadTags(TaglibPaletteDrawer category,
- CMDocument doc,Model model) {
-
- if (model != null) {//load from metadata - should always drop in here
- Trait trait = TaglibDomainMetaDataQueryHelper.getTrait(model, "paletteInfos");
- if (trait != null){
- PaletteInfos tags = (PaletteInfos)trait.getValue();
- for (Iterator it=tags.getInfos().iterator();it.hasNext();){
- PaletteInfo tag = (PaletteInfo)it.next();
- createTagEntry(category, tag);
- }
- } else {
- for (Iterator it=model.getChildEntities().iterator();it.hasNext();){
- Entity tagAsEntity = (Entity)it.next();
- createTagEntry(category, tagAsEntity);
- }
- }
- }
- else {//fail safe loading from cmDoc... should no longer go in here
- loadFromCMDocument(category, doc);
- }
-
- }
-
- private static TaglibPaletteDrawer createTaglibPaletteDrawer(IPaletteItemManager manager,
- CMDocument doc, Model model) {
-
- TaglibPaletteDrawer category = null;
- if (model != null){
- //do we create it?
- boolean isHidden = getBooleanTagTraitValue(model, "hidden", false);
- if (isHidden){
- return null;
- }
-
- String label = getStringTagTraitValue(model, "display-label", model.getId());
- label = label.equals("") ? model.getId() : label;
- category = manager.createTaglibPaletteDrawer(model.getId(), label);
-
- String desc = getStringTagTraitValue(model, "description", model.getId());
- category.setDescription(formatDescription(desc));
-
- ImageDescriptor largeIconImage = getImageDescriptorFromTagTraitValueAsString(model, "small-icon", null);
- if (largeIconImage != null)
- category.setLargeIcon(largeIconImage);
-
- String prefix = getStringTagTraitValue(model, "default-prefix", null);
- category.setDefaultPrefix(prefix);
-
- boolean isVisible = !(getBooleanTagTraitValue(model, "expert", false));
- category.setVisible(isVisible);
-
- category.setInitialState(PaletteDrawer.INITIAL_STATE_CLOSED);
-
- }
- return category;
- }
-
- private static TaglibPaletteDrawer findCategory(IPaletteItemManager manager,
- String tldURI) {
- TaglibPaletteDrawer lib = null;
- for (Iterator it = manager.getAllCategories().iterator();it.hasNext();){
- lib = (TaglibPaletteDrawer)it.next();
- if (tldURI.equals(lib.getURI()))
- return lib;
- }
- return null;
- }
-
- /* (non-JavaDoc)
- * This method will read information from the CMDocument to create the tag entries. It will
- * check the existing items in the registry. If the corresponding tag is not
- * in palette manager, then it will create one, and mark the newly created
- * item as "expert". Otherwise, it will check whether the tld contains more
- * information than the palette manager, and adding those information to it
- * (such as description, icons for tags)
- *
- * @param category
- * @param cmdoc
- */
- private static void loadFromCMDocument(TaglibPaletteDrawer category,
- CMDocument cmdoc) {
-
- CMNamedNodeMap nodeMap = cmdoc.getElements();
- for (int i = 0, size = nodeMap.getLength(); i < size; i++) {
- CMElementDeclaration eledecl = (CMElementDeclaration) nodeMap
- .item(i);
- String tagName = eledecl.getElementName();
- TagToolPaletteEntry item;
- if (tagName.equalsIgnoreCase(IHTMLConstants.TAG_INPUT)) {//TODO: fix this nonsense!
- StringBuffer name = new StringBuffer(category.getURI());
- name.append(":").append(tagName).append(":").append(tagName);
- item = category.getTagPaletteEntryById(name.toString());
- } else {
- item = category.getTagPaletteEntryByTagName(tagName);
- }
- if (item == null) {
- createTagEntry(category, eledecl);
-
- }
- }
- }
-
- private static void createTagEntry(TaglibPaletteDrawer category,
- PaletteInfo info) {
-
- Boolean hidden = info.getHidden();
- if ((hidden != null) && (hidden.booleanValue()))//do not create a palette entry
- return;
-
- IMetaDataSourceModelProvider sourceProvider = ((Trait)info.eContainer().eContainer()).getSourceModelProvider();
- String tagName = info.getTag();
- String id = info.getId();
- String label = info.getDisplayLabel();
- String desc = formatDescription(info.getDescription());
- ImageDescriptor smallIcon = getImageDescriptorFromString(sourceProvider, info.getSmallIcon(), DEFAULT_SMALL_ICON);
- ImageDescriptor largeIcon = getImageDescriptorFromString(sourceProvider, info.getLargeIcon(), DEFAULT_LARGE_ICON);
- Boolean expert = info.getExpert();
-
- internalCreateTagEntry(category, id, tagName, label, desc, smallIcon, largeIcon, (expert !=null && expert.booleanValue()));
-
- }
-
- private static void createTagEntry(TaglibPaletteDrawer category,
- Entity entity) {
-
- boolean hidden = getBooleanTagTraitValue(entity, "hidden", false);
- if (hidden)//do not create a palette entry
- return;
-
- String tagName = entity.getId();
- String label = getStringTagTraitValue(entity, "display-label", tagName);
- String desc = formatDescription(getStringTagTraitValue(entity, "description", tagName));
- ImageDescriptor smallIcon = getImageDescriptorFromTagTraitValueAsString(entity, "small-icon", DEFAULT_SMALL_ICON);
- ImageDescriptor largeIcon = getImageDescriptorFromTagTraitValueAsString(entity, "large-icon", DEFAULT_LARGE_ICON);
- boolean expert = getBooleanTagTraitValue(entity, "expert", false);
-
- internalCreateTagEntry(category, tagName, tagName, label, desc, smallIcon, largeIcon, expert);
-
- }
-
- private static TagToolPaletteEntry internalCreateTagEntry(TaglibPaletteDrawer category, String id, String tagName, String label, String desc, ImageDescriptor smallIcon, ImageDescriptor largeIcon, boolean expert){
- TagToolPaletteEntry item = new TagToolPaletteEntry(tagName, label, desc, smallIcon, largeIcon);
- item.setId(id);
-
- item.setVisible(!expert);
- category.getChildren().add(item);
- item.setParent(category);
-
- return item;
- }
-
- private static boolean getBooleanTagTraitValue(Entity entity,
- String key, boolean defaultValue) {
- Trait trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, key);
- if (trait != null){
- return TraitValueHelper.getValueAsBoolean(trait);
- }
- return defaultValue;
- }
-
- private static String getStringTagTraitValue(Entity entity, String key, String defaultValue){
- Trait trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, key);
- if (trait != null){
- String val = TraitValueHelper.getValueAsString(trait);
- if (val != null)
- return val;
- }
- return defaultValue;
- }
-
- private static ImageDescriptor getImageDescriptorFromTagTraitValueAsString(Entity entity, String key, ImageDescriptor defaultValue){
- Trait t = TaglibDomainMetaDataQueryHelper.getTrait(entity, key);
- if (t != null){
- String imgDesc = TraitValueHelper.getValueAsString(t);
- return getImageDescriptorFromString(t.getSourceModelProvider(), imgDesc, defaultValue);
- }
- return defaultValue;
- }
-
- private static ImageDescriptor getImageDescriptorFromString(IMetaDataSourceModelProvider sourceModelProvider, String imgDesc, ImageDescriptor defaultValue){
- ImageDescriptor image = defaultValue;
- IImageDescriptorProvider imageProvider = (IImageDescriptorProvider)sourceModelProvider.getAdapter(IImageDescriptorProvider.class);
- if (imageProvider != null){
- image = imageProvider.getImageDescriptor(imgDesc);
- }
- return image;
- }
-
- private static void createTagEntry(TaglibPaletteDrawer category,
- CMElementDeclaration eledecl) {
-
- String tagName = eledecl.getElementName();
- String label = null;
- String desc = null;
-
- if (eledecl instanceof TLDElementDeclaration){
- TLDElementDeclaration tag = (TLDElementDeclaration)eledecl;
- label = tag.getDisplayName();
- desc = tag.getDescription();
- }
-
- if (label == null || label.equals(""))
- label = tagName;
-
- if (desc == null )
- desc = "";
- else
- desc = formatDescription(desc);
-
- TagToolPaletteEntry item = internalCreateTagEntry(category, tagName, tagName, label, desc, getDefaultSmallIcon(), getDefaultLargeIcon(), false);
- item.setToolProperty("CMElementDeclaration", eledecl);
-
- }
-
- /**
- * @return DEFAULT_LARGE_ICON
- */
- private static ImageDescriptor getDefaultLargeIcon() {
- return DEFAULT_LARGE_ICON;
- }
-
- /**
- * @return DEFAULT_SMALL_ICON
- */
- private static ImageDescriptor getDefaultSmallIcon() {
- return DEFAULT_SMALL_ICON;
- }
-
- private static String formatDescription(final String desc) {
- //TODO: modify and use a formatter in the future?
- String aDesc = filterConvertString(desc);
- if (aDesc != null){
- if (aDesc.length() > DESCRIPTION_TRUNCATE_HARD_LENGTH) {
- StringBuffer result = new StringBuffer(aDesc.substring(0, DESCRIPTION_TRUNCATE_HARD_LENGTH));
- result.append("...");
- return result.toString();
- }
- return aDesc;
-
- }
- return "";
- }
-
- private static String filterConvertString(String text) {
- if (text == null) {
- return "";
- }
-
- String result = removeHTMLTags.matcher(text).replaceAll("");
- result = removeNewLines.matcher(result).replaceAll(" ");
- result = trimInteriorWhitespace.matcher(result).replaceAll(" ");
-
- return result;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/impl/PaletteItemManager.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/impl/PaletteItemManager.java
deleted file mode 100644
index 3d9ce38..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/impl/PaletteItemManager.java
+++ /dev/null
@@ -1,341 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.palette.impl;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.gef.palette.PaletteEntry;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.CMDocumentFactoryTLD;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDDocument;
-import org.eclipse.jst.jsp.core.taglib.ITaglibRecord;
-import org.eclipse.jst.jsp.core.taglib.TaglibIndex;
-import org.eclipse.jst.pagedesigner.editors.palette.DesignerPaletteCustomizationsHelper;
-import org.eclipse.jst.pagedesigner.editors.palette.IEntryChangeListener;
-import org.eclipse.jst.pagedesigner.editors.palette.IPaletteConstants;
-import org.eclipse.jst.pagedesigner.editors.palette.IPaletteItemManager;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDocumentFactory;
-import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMDocType;
-
-/**
- * TODO: C.B.: parts of this class need a re-write. This is very complex.
- *
- * @author mengbo
- */
-public class PaletteItemManager implements IPaletteItemManager,
- IPaletteConstants {
-
- private static Map _managers = new HashMap();
- private List _categories = new ArrayList();
-
- // if _curProject is null, then is the default manager.
- private IProject _curProject = null;
- private IEntryChangeListener[] _listeners;
-
- // the default manager is for those _curProject == null
- private static PaletteItemManager _defaultManager = null;
- private static PaletteItemManager _currentInstance;
-
-
- /**
- * Return singleton paletteItemManager for a given project
- * @param project
- * @return PaletteItemManager
- */
- public static synchronized PaletteItemManager getInstance(IProject project) {
- if (project == null) {
- // sometimes when the editor is editing a file in jar file, may not
- // be able to
- // get the project.
- return getDefaultPaletteItemManager();
- }
- PaletteItemManager manager = (PaletteItemManager) _managers
- .get(project);
- if (manager == null) {
- manager = new PaletteItemManager(project);
- _managers.put(project, manager);
- }
- _currentInstance = manager;
-
- return manager;
- }
-
- /**
- * @return current PaletteItemManager instance. May return null
- */
- public static synchronized PaletteItemManager getCurrentInstance(){
- return _currentInstance != null ? _currentInstance : null;
- }
-
- private IProject getCurProject() {
- return _curProject;
- }
-
- /**
- * Removes an intstance of a paletteItemManager from the system
- * @param manager
- */
- public static synchronized void removePaletteItemManager(
- PaletteItemManager manager) {
- // FIXME: does nothing? manager.dispose();
- _managers.remove(manager.getCurProject());
- }
-
-
- /**
- *
- */
- public static synchronized void clearPaletteItemManager() {
- _managers.clear();
- }
-
- /**
- * @return
- */
- private static PaletteItemManager getDefaultPaletteItemManager() {
- if (_defaultManager == null) {
- _defaultManager = new PaletteItemManager(null);
-
- }
- return _defaultManager;
- }
-
- /**
- *
- */
- private PaletteItemManager(IProject project) {
- _curProject = project;
-
- init();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.sybase.stf.jmt.pagedesigner.editors.palette.IPaletteItemManager#getAllCategories()
- */
- public List getAllCategories() {
- if (_categories == null) {
- _categories = new ArrayList();
- }
- return _categories;
- }
-
- /**
- * Initializes the palette items for the current project
- */
- protected synchronized void init() {
- getAllCategories().clear();
- initFromProject(_curProject);
-
- DesignerPaletteCustomizationsHelper.loadUserCustomizations(this);
-
- sortCategories();
-
- }
-
- private void sortCategories() {
- //note that once we store ordering customizations, we will need to do something different
- Collections.sort(getAllCategories(), new Comparator(){
-
- public int compare(Object o1, Object o2) {
- String label1 = ((PaletteEntry)o1).getLabel();
- String label2 = ((PaletteEntry)o2).getLabel();
-
- return label1.compareTo(label2);
- }
-
- });
-
- }
-
- /**
- * Reinitializes the palatteItemManager and informs all palette roots that use the manager to refresh
- */
- public void reset() {
- init();
- fireModelChanged(null, null);
- }
-
- private void initFromProject(IProject project) {
- registerHTMLCategory();
- registerJSPCategory();
- registerTldFromClasspath(project);
- }
-
- private void registerHTMLCategory() {
- PaletteHelper.configPaletteItemsByTLD(this, getCurProject(), HTMLCMDocumentFactory
- .getCMDocument(CMDocType.HTML_DOC_TYPE));
- }
-
- private void registerJSPCategory() {
- PaletteHelper.configPaletteItemsByTLD(this, getCurProject(), HTMLCMDocumentFactory
- .getCMDocument(CMDocType.JSP11_DOC_TYPE));
- }
-
- /**
- * Search Classpath entry list to find if the entry is jar libraray and the
- * libray have the tld descriptor, if have ,build a palette category mapping
- * the tld descriptor.
- *
- * @param project
- */
- private void registerTldFromClasspath(IProject project) {
- if (project != null) {
- ITaglibRecord[] tldrecs = TaglibIndex.getAvailableTaglibRecords(project.getFullPath());
- CMDocumentFactoryTLD factory = new CMDocumentFactoryTLD();
- for (int i=0;i<tldrecs.length;i++){
- TLDDocument doc = (TLDDocument)factory.createCMDocument(tldrecs[i]);
- PaletteHelper.configPaletteItemsByTLD(this, getCurProject(), doc);
- }
- }
- }
-
- /**
- * @param id (most likely the uri)
- * @param label
- * @return TaglibPaletteDrawer
- */
- public TaglibPaletteDrawer findOrCreateCategory(String id, String label) {
- TaglibPaletteDrawer category;
- for (Iterator iter = getAllCategories().iterator(); iter.hasNext();) {
- category = (TaglibPaletteDrawer) iter.next();
- if (id.equals(category.getId())) {
- return category;
- }
- }
- category = createTaglibPaletteDrawer(id, label);
- return category;
- }
-
- /**
- * @param uri
- * @return TaglibPaletteDrawer
- */
- public TaglibPaletteDrawer findCategoryByURI(String uri) {
- TaglibPaletteDrawer category;
- for (Iterator iter = getAllCategories().iterator(); iter.hasNext();) {
- category = (TaglibPaletteDrawer) iter.next();
- if (uri.equals(category.getURI())) {
- return category;
- }
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.sybase.stf.jmt.pagedesigner.editors.palette.IPaletteItemManager#createCategory(java.lang.String)
- */
- public TaglibPaletteDrawer createTaglibPaletteDrawer(String uri, String label) {
- TaglibPaletteDrawer r = new TaglibPaletteDrawer(uri, label);
- getAllCategories().add(r);
- return r;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.sybase.stf.jmt.pagedesigner.editors.palette.IPaletteItemManager#getCategoryByURI(java.lang.String)
- */
- public TaglibPaletteDrawer getTaglibPalletteDrawer(String uri) {
- for (Iterator iter = getAllCategories().iterator(); iter.hasNext();) {
- TaglibPaletteDrawer cat = (TaglibPaletteDrawer) iter.next();
- if (uri.equals(cat.getId())) {
- return cat;
- }
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.sybase.stf.jmt.pagedesigner.editors.palette.IPaletteItemManager#addEntryChangeListener(com.sybase.stf.jmt.pagedesigner.editors.palette.IEntryChangeListener)
- */
- public void addEntryChangeListener(IEntryChangeListener listener) {
-
- if (_listeners == null) {
- _listeners = new IEntryChangeListener[] { listener };
- } else {
- IEntryChangeListener[] newListeners = new IEntryChangeListener[_listeners.length + 1];
- newListeners[0] = listener;
- System.arraycopy(_listeners, 0, newListeners, 1, _listeners.length);
- _listeners = newListeners;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.sybase.stf.jmt.pagedesigner.editors.palette.IPaletteItemManager#removeEntryChangeListener(com.sybase.stf.jmt.pagedesigner.editors.palette.IEntryChangeListener)
- */
- public void removeEntryChangeListener(IEntryChangeListener listener) {
- if (_listeners == null) {
- return;
- }
- if (_listeners.length == 1) {
- _listeners = null;
- } else {
- List newListenersList = new ArrayList(Arrays.asList(_listeners));
- newListenersList.remove(listener);
- IEntryChangeListener[] newListeners = new IEntryChangeListener[newListenersList
- .size() - 1];
- newListeners = (IEntryChangeListener[]) newListenersList
- .toArray(newListeners);
- _listeners = newListeners;
- }
- }
-
- /**
- * Notify model change event
- *
- * @param oldDefinitions
- * @param newDefinitions
- */
- private void fireModelChanged(List oldDefinitions, List newDefinitions) {
- if (_listeners == null) {
- return;
- }
- for (int i = 0; i < _listeners.length; i++) {
- _listeners[i].modelChanged(oldDefinitions, newDefinitions);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.editors.palette.IPaletteItemManager#getProject()
- */
- public IProject getProject() {
- return getCurProject();
- }
-
- /**
- * Informs all paletteItemManagers, except the notifying paletteManager, of updates to the customizations
- * All palette viewer roots will be notifed of possible updates
- * @param notifyingManager
- */
- public static void notifyPaletteItemManagersOfCustomizationsUpdate(IPaletteItemManager notifyingManager){
- for (Iterator it=_managers.values().iterator();it.hasNext();){
- PaletteItemManager mgr = (PaletteItemManager)it.next();
- if (mgr != null && notifyingManager != mgr)
- mgr.reset();
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/impl/TaglibPaletteDrawer.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/impl/TaglibPaletteDrawer.java
deleted file mode 100644
index 5f7ba74..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/palette/impl/TaglibPaletteDrawer.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.palette.impl;
-
-import java.util.Iterator;
-
-import org.eclipse.gef.palette.PaletteDrawer;
-import org.eclipse.gef.palette.ToolEntry;
-import org.eclipse.jst.pagedesigner.editors.palette.TagToolPaletteEntry;
-
-/**
- * Palette Drawer for Tag lib items
- *
- */
-public class TaglibPaletteDrawer extends PaletteDrawer {
- private String prefix;
-
- /**
- * Constructor
- * @param uri
- * @param label
- */
- public TaglibPaletteDrawer(String uri, String label) {
- super(label);
- super.setId(uri);
- setDrawerType(ToolEntry.PALETTE_TYPE_TOOL);
- }
-
- /**
- * @return default prefix for tag during creation
- */
- public String getDefaultPrefix() {
- return prefix;
- }
-
- /**
- * Set the default prefix for use during item creation
- * @param prefix
- */
- public void setDefaultPrefix(String prefix) {
- this.prefix = prefix;
- }
-
- /**
- * @return uri identifying the library of tags
- */
- public String getURI(){
- return getId();
- }
-
- /**
- * @param uri for the libary of tags
- */
- public void setURI(String uri){
- setId(uri);
- }
-
- /**
- * @param id
- * @return TagToolPaletteEntry for the tag using the id
- */
- public TagToolPaletteEntry getTagPaletteEntryById(String id){
- for (Iterator it=getChildren().iterator();it.hasNext();){
- TagToolPaletteEntry tag = (TagToolPaletteEntry)it.next();
- if (tag.getId().equals(id))
- return tag;
- }
- return null;
- }
-
- /**
- * @param tagName
- * @return TagToolPaletteEntry using the tag name
- */
- public TagToolPaletteEntry getTagPaletteEntryByTagName(String tagName){
- for (Iterator it=getChildren().iterator();it.hasNext();){
- TagToolPaletteEntry tag = (TagToolPaletteEntry)it.next();
- if (tag.getTagName().equalsIgnoreCase(tagName))
- return tag;
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.gef.palette.PaletteDrawer#acceptsType(java.lang.Object)
- */
- public boolean acceptsType(Object object){
- return true;
- }
-
- /**
- * @return PERMISSION_HIDE_ONLY
- * @see org.eclipse.gef.palette.PaletteEntry#getUserModificationPermission()
- */
- public int getUserModificationPermission() {
- return PERMISSION_HIDE_ONLY;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/IPropertyPageDescriptor.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/IPropertyPageDescriptor.java
deleted file mode 100644
index faa0e6e..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/IPropertyPageDescriptor.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.properties;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogField;
-import org.eclipse.jst.jsf.metadataprocessors.IMetaDataEnabledFeature;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Property descriptor for metadata enabled tag attributes in the WPE property pages.
- *
- * <p><b>Provisional API - subject to change</b></p>
- * Not intended to be implemented by clients.
- */
-public interface IPropertyPageDescriptor extends IMetaDataEnabledFeature, IAdaptable{
- /**
- * Trait id for defining quick edit tab sections. Value must be of type qe:QuickEditTabSections
- * eg. <value xsi:type="qe:QuickEditTabSections">
- */
- public static final String QUICK_EDIT_TAB = "quick-edit-tab";
- /**
- * Trait id for category name value
- */
- public static final String PROP_DESC_CATEGORY = "category";
-
-// /**
-// * Trait id for fully qualified cell editor class name
-// */
-// public static final String PROP_DESC_CELL_EDITOR = "cell-editor";
-// /**
-// * Trait id for fully qualified dialog field editor name
-// */
-// public static final String PROP_DESC_DIALOG_FIELD_EDITOR = "dialog-field-editor";
-
- /**
- * @return name of attribute. Must not be null.
- */
- public String getAttributeName();
- /**
- * @return category name. Must not be null.
- */
- public String getCategory();
- /**
- * @return label to use. Must not be null.
- */
- public String getLabel();
- /**
- * @return description. May return null.
- */
- public String getDescription();
- /**
- * @return whether this is a required property. Default false.
- */
- public boolean isRequired();
- /**
- * @param parent
- * @return cell editor to use. May be null.
- */
- public CellEditor getCellEditor(Composite parent);
- /**
- * @return dialog field editor to use. May be null.
- */
- public DialogField getDialogFieldEditor();
- /**
- * @return uri. Must not be null.
- */
- public String getUri();
- /**
- * @return tag name. Must not be null.
- */
- public String getTagName();
- /**
- * @return fully qualified attribute-value-runtime-type as String
- */
- public String getValueType();
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/internal/EditorValidatorAdapter.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/internal/EditorValidatorAdapter.java
deleted file mode 100644
index a2f6304..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/internal/EditorValidatorAdapter.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.properties.internal;
-
-import org.eclipse.jface.dialogs.IInputValidator;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidationMessage;
-
-/**
- * Adapts IValidValues to ICellEditorValidator
- *
- */
-public class EditorValidatorAdapter implements ICellEditorValidator, IInputValidator {
-
- private IValidValues _vvs;
-
- /**
- * Constructor
- * @param vvs
- */
- public EditorValidatorAdapter(IValidValues vvs) {
- _vvs = vvs;
- }
-
- public String isValid(Object value) {
- //for now, if value is not a string, return true
- if (value instanceof String)
- return isValid((String)value);
- return null;
- }
-
- public String isValid(String value) {
- _vvs.getValidationMessages().clear();
- if (_vvs.isValidValue(value))
- return null;//is valid
-
- return ((IValidationMessage)_vvs.getValidationMessages().get(0)).getMessage();
-
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/internal/PropertyDescriptor.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/internal/PropertyDescriptor.java
deleted file mode 100644
index acb552e..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/internal/PropertyDescriptor.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.properties.internal;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.dialogs.IInputValidator;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogField;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.metadataprocessors.AbstractMetaDataEnabledFeature;
-import org.eclipse.jst.jsf.metadataprocessors.IMetaDataEnabledFeature;
-import org.eclipse.jst.jsf.metadataprocessors.MetaDataEnabledProcessingFactory;
-import org.eclipse.jst.jsf.metadataprocessors.features.IDefaultValue;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-import org.eclipse.jst.pagedesigner.editors.properties.IPropertyPageDescriptor;
-import org.eclipse.jst.pagedesigner.meta.EditorCreator;
-import org.eclipse.jst.pagedesigner.meta.internal.CellEditorFactoryRegistry;
-import org.eclipse.jst.pagedesigner.properties.ITabbedPropertiesConstants;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.w3c.dom.Element;
-
-/**
- * MD enabled feature of an attribute value runtime type allowing for the tabbed property
- * page to work
- *
- */
-public class PropertyDescriptor extends AbstractMetaDataEnabledFeature
- implements IMetaDataEnabledFeature, IPropertyPageDescriptor, IAdaptable {
-
- /**
- * Constructor
- */
- public PropertyDescriptor() {
- // TODO Auto-generated constructor stub
- }
-
- //IPropertyPageDescriptor
- public String getCategory() {
- String cat = getTraitValueAsString(IPropertyPageDescriptor.PROP_DESC_CATEGORY);
- return cat != null ? cat : ITabbedPropertiesConstants.OTHER_CATEGORY;
- }
-
- public CellEditor getCellEditor(Composite parent) {
-// TODO: allow for override of the factory by using MD
-// Trait trait = TaglibDomainMetaDataQueryHelper.getTrait(
-// getMetaDataContext().getEntity(),
-// IPropertyPageDescriptor.PROP_DESC_CELL_EDITOR);
-//
-// if (trait != null) {
-// String classname = TraitValueHelper.getValueAsString(trait);
-// if (classname != null && ! classname.equals("")){
-// try {
-// Class klass = PDPlugin.getDefault().getBundle().loadClass(classname);
-// if (klass != null){
-// //
-// }
-// } catch (ClassNotFoundException e) {//
-// String msg = "Unable to locate cell editor:"+classname+ " for "+toString();
-// PDPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, PDPlugin.getPluginId(), msg));
-// }
-// }
-// }
- //otherwise use factory
- Element element = (Element)IStructuredDocumentContextResolverFactory.INSTANCE.getDOMContextResolver(getStructuredDocumentContext()).getNode();
- return CellEditorFactoryRegistry.getInstance().createCellEditor(parent, this, element);
- }
-
- public String getDescription() {
- return getTraitValueAsString("description");
- }
-
- public String getLabel() {
- String label = getTraitValueAsString("display-label");
- if (label == null) {
- label = getMetaDataContext().getEntity().getId();
- }
- return label + ":";
- }
-
- public boolean isRequired() {
- return getTraitValueAsBoolean("required");
- }
-
- public DialogField getDialogFieldEditor() {
- //TODO: allow for override of the factory by using MD
-// Trait trait = TaglibDomainMetaDataQueryHelper.getTrait(
-// getMetaDataContext().getEntity(),
-// IPropertyPageDescriptor.PROP_DESC_DIALOG_FIELD_EDITOR);
-//
-// if (trait != null) {
-// String classname = TraitValueHelper.getValueAsString(trait);
-// if (classname != null && ! classname.equals("")){
-// try {
-// Class klass = PDPlugin.getDefault().getBundle().loadClass(classname);
-// if (klass != null){
-// //
-// }
-// } catch (ClassNotFoundException e) {//
-// String msg = "Unable to locate cell editor:"+classname+ " for "+toString();
-// PDPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, PDPlugin.getPluginId(), msg));
-// }
-// }
-// }
- //otherwise use factory
- EditorCreator creator = EditorCreator.getInstance();
- return creator.createDialogFieldWithWrapper(getUri(),
- getTagName(),this, null);
- }
-
- public String getTagName() {
- return getTagEntity().getId();
- }
-
- public String getUri() {
- return getMetaDataContext().getEntity().getModel().getCurrentModelContext().getUri();
- }
-
- public String getValueType() {
- return getTraitValueAsString(MetaDataEnabledProcessingFactory.ATTRIBUTE_VALUE_RUNTIME_TYPE_PROP_NAME);
- }
-
- public String getAttributeName() {
- return getMetaDataContext().getEntity().getId();
- }
-
- public Object getAdapter(Class adapter) {
- if (IPropertyDescriptor.class == adapter) {
- return new PropertyDescriptorAdapter(this);
- }
- else if (IPossibleValues.class == adapter) {
- List pvs = MetaDataEnabledProcessingFactory.getInstance().getAttributeValueRuntimeTypeFeatureProcessors(
- IPossibleValues.class,
- getStructuredDocumentContext(),
- getAttributeEntity());
- if (!pvs.isEmpty())
- return pvs.get(0);
- }
- else if (IDefaultValue.class == adapter) {
- List dvs = MetaDataEnabledProcessingFactory.getInstance().getAttributeValueRuntimeTypeFeatureProcessors(
- IDefaultValue.class,
- getStructuredDocumentContext(),
- getAttributeEntity());
- if (!dvs.isEmpty())
- return dvs.get(0);
- }
- else if (ICellEditorValidator.class == adapter) {
- IValidValues vvs = (IValidValues)getAdapter(IValidValues.class);
- if (vvs != null)
- return new EditorValidatorAdapter(vvs);
-
- }
- else if (IInputValidator.class == adapter) {
- IValidValues vvs = (IValidValues)getAdapter(IValidValues.class);
- if (vvs != null)
- return new EditorValidatorAdapter(vvs);
- }
- else if (IValidValues.class == adapter) {
- List vvs = MetaDataEnabledProcessingFactory.getInstance().getAttributeValueRuntimeTypeFeatureProcessors(
- IValidValues.class,
- getStructuredDocumentContext(),
- getAttributeEntity());
- if (!vvs.isEmpty())
- return vvs.get(0);
- }
- return null;
- }
-
- private Entity getTagEntity() {
- return (Entity)getAttributeEntity().eContainer();
- }
-
- private Entity getAttributeEntity() {
- return getMetaDataContext().getEntity();
- }
-
- public String toString() {
- return getUri()+"/"+getTagName()+"/"+getAttributeName();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/internal/PropertyDescriptorAdapter.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/internal/PropertyDescriptorAdapter.java
deleted file mode 100644
index a946b29..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/internal/PropertyDescriptorAdapter.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editors.properties.internal;
-
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jst.pagedesigner.editors.properties.IPropertyPageDescriptor;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-
-/**
- * Adapts the MetadataEnabledFeature <code>org.eclipse.jst.pagedesigner.editors.properties.IPropertyPageDescriptor</code>, to a <code>org.eclipse.ui.views.properties.IPropertyDescriptor</code>
- *
- */
-public class PropertyDescriptorAdapter implements IPropertyDescriptor{
-
- private IPropertyPageDescriptor _ppd;
-
- /**
- * Constructor
- * @param propertyPageDescriptor
- */
- public PropertyDescriptorAdapter(IPropertyPageDescriptor propertyPageDescriptor) {
- _ppd = propertyPageDescriptor;
- }
-
- public CellEditor createPropertyEditor(Composite parent) {
- return _ppd.getCellEditor(parent);
- }
-
- public String getCategory() {
- return _ppd.getCategory();
- }
-
- public String getDescription() {
- return _ppd.getDescription();
- }
-
- public String getDisplayName() {
- return _ppd.getAttributeName();
- }
-
- public String[] getFilterFlags() {
- return null;
- }
-
- public Object getHelpContextIds() {
- return null;//FIXME
- }
-
- public Object getId() {
- return _ppd.getAttributeName();
- }
-
- public ILabelProvider getLabelProvider() {
- return null;//FIXME: do better? Used to supply labels for attribute property sheet (not quick edit)
- }
-
- public boolean isCompatibleWith(IPropertyDescriptor anotherProperty) {
- return false;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/package-info.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/package-info.java
deleted file mode 100644
index 4dae0fb..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/package-info.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-/**
- * Web Page Editor tag attribute property page interfaces.
- *
- * <p><b>Provisional API - subject to change</b></p>
- */
-package org.eclipse.jst.pagedesigner.editors.properties;
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/quickedittabsections/QuickEditTabSections.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/quickedittabsections/QuickEditTabSections.java
deleted file mode 100644
index f0cfad4..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/quickedittabsections/QuickEditTabSections.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/**
- * Copyright (c) 2007 Oracle Corporation
- *
- * $Id: QuickEditTabSections.java,v 1.1 2007/12/07 23:43:40 gkessler Exp $
- */
-package org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections;
-
-import org.eclipse.emf.common.util.EList;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Quick Edit Tab Sections</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.QuickEditTabSections#getSections <em>Sections</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.QuickEditTabSectionsPackage#getQuickEditTabSections()
- * @model
- * @generated
- */
-public interface QuickEditTabSections extends EObject {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * trait id to use
- * @generated NOT
- */
- String TRAIT_ID = "quick-edit-tab";
-
- /**
- * Returns the value of the '<em><b>Sections</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.SectionInfo}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Sections</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Sections</em>' containment reference list.
- * @see org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.QuickEditTabSectionsPackage#getQuickEditTabSections_Sections()
- * @model containment="true"
- * extendedMetaData="kind='element' name='section'"
- * @generated
- */
- EList<SectionInfo> getSections();
-
-} // QuickEditTabSections
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/quickedittabsections/QuickEditTabSectionsFactory.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/quickedittabsections/QuickEditTabSectionsFactory.java
deleted file mode 100644
index 3484b03..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/quickedittabsections/QuickEditTabSectionsFactory.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * Copyright (c) 2007 Oracle Corporation
- *
- * $Id: QuickEditTabSectionsFactory.java,v 1.1 2007/12/07 23:43:40 gkessler Exp $
- */
-package org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections;
-
-import org.eclipse.emf.ecore.EFactory;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Factory</b> for the model.
- * It provides a create method for each non-abstract class of the model.
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.QuickEditTabSectionsPackage
- * @generated
- */
-public interface QuickEditTabSectionsFactory extends EFactory {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * The singleton instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- QuickEditTabSectionsFactory eINSTANCE = org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.internal.impl.QuickEditTabSectionsFactoryImpl.init();
-
- /**
- * Returns a new object of class '<em>Quick Edit Tab Sections</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Quick Edit Tab Sections</em>'.
- * @generated
- */
- QuickEditTabSections createQuickEditTabSections();
-
- /**
- * Returns a new object of class '<em>Section Info</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Section Info</em>'.
- * @generated
- */
- SectionInfo createSectionInfo();
-
- /**
- * Returns the package supported by this factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the package supported by this factory.
- * @generated
- */
- QuickEditTabSectionsPackage getQuickEditTabSectionsPackage();
-
-} //QuickEditTabSectionsFactory
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/quickedittabsections/QuickEditTabSectionsPackage.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/quickedittabsections/QuickEditTabSectionsPackage.java
deleted file mode 100644
index 1367dfe..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/quickedittabsections/QuickEditTabSectionsPackage.java
+++ /dev/null
@@ -1,288 +0,0 @@
-/**
- * Copyright (c) 2007 Oracle Corporation
- *
- * $Id: QuickEditTabSectionsPackage.java,v 1.4 2008/02/01 21:52:33 gkessler Exp $
- */
-package org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Package</b> for the model.
- * It contains accessors for the meta objects to represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.QuickEditTabSectionsFactory
- * @model kind="package"
- * @generated
- */
-@SuppressWarnings("hiding")
-public interface QuickEditTabSectionsPackage extends EPackage {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * The package name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String eNAME = "quickedittabsections";
-
- /**
- * The package namespace URI.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String eNS_URI = "http://org.eclipse.jsf.pagedesigner/QuickEditTabSections.ecore";
-
- /**
- * The package namespace name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String eNS_PREFIX = "qe";
-
- /**
- * The singleton instance of the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- QuickEditTabSectionsPackage eINSTANCE = org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.internal.impl.QuickEditTabSectionsPackageImpl.init();
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.internal.impl.QuickEditTabSectionsImpl <em>Quick Edit Tab Sections</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.internal.impl.QuickEditTabSectionsImpl
- * @see org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.internal.impl.QuickEditTabSectionsPackageImpl#getQuickEditTabSections()
- * @generated
- */
- int QUICK_EDIT_TAB_SECTIONS = 0;
-
- /**
- * The feature id for the '<em><b>Sections</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int QUICK_EDIT_TAB_SECTIONS__SECTIONS = 0;
-
- /**
- * The number of structural features of the '<em>Quick Edit Tab Sections</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int QUICK_EDIT_TAB_SECTIONS_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.internal.impl.SectionInfoImpl <em>Section Info</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.internal.impl.SectionInfoImpl
- * @see org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.internal.impl.QuickEditTabSectionsPackageImpl#getSectionInfo()
- * @generated
- */
- int SECTION_INFO = 1;
-
- /**
- * The feature id for the '<em><b>Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int SECTION_INFO__ID = 0;
-
- /**
- * The feature id for the '<em><b>Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int SECTION_INFO__TYPE = 1;
-
- /**
- * The number of structural features of the '<em>Section Info</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int SECTION_INFO_FEATURE_COUNT = 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.SECTION_TYPE <em>SECTION TYPE</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.SECTION_TYPE
- * @see org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.internal.impl.QuickEditTabSectionsPackageImpl#getSECTION_TYPE()
- * @generated
- */
- int SECTION_TYPE = 2;
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.QuickEditTabSections <em>Quick Edit Tab Sections</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Quick Edit Tab Sections</em>'.
- * @see org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.QuickEditTabSections
- * @generated
- */
- EClass getQuickEditTabSections();
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.QuickEditTabSections#getSections <em>Sections</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Sections</em>'.
- * @see org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.QuickEditTabSections#getSections()
- * @see #getQuickEditTabSections()
- * @generated
- */
- EReference getQuickEditTabSections_Sections();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.SectionInfo <em>Section Info</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Section Info</em>'.
- * @see org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.SectionInfo
- * @generated
- */
- EClass getSectionInfo();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.SectionInfo#getId <em>Id</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Id</em>'.
- * @see org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.SectionInfo#getId()
- * @see #getSectionInfo()
- * @generated
- */
- EAttribute getSectionInfo_Id();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.SectionInfo#getType <em>Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Type</em>'.
- * @see org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.SectionInfo#getType()
- * @see #getSectionInfo()
- * @generated
- */
- EAttribute getSectionInfo_Type();
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.SECTION_TYPE <em>SECTION TYPE</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>SECTION TYPE</em>'.
- * @see org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.SECTION_TYPE
- * @generated
- */
- EEnum getSECTION_TYPE();
-
- /**
- * Returns the factory that creates the instances of the model.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the factory that creates the instances of the model.
- * @generated
- */
- QuickEditTabSectionsFactory getQuickEditTabSectionsFactory();
-
- /**
- * <!-- begin-user-doc -->
- * Defines literals for the meta objects that represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @generated
- */
-// @SuppressWarnings("hiding")
- interface Literals {
- /**
- * The meta object literal for the '{@link org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.internal.impl.QuickEditTabSectionsImpl <em>Quick Edit Tab Sections</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.internal.impl.QuickEditTabSectionsImpl
- * @see org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.internal.impl.QuickEditTabSectionsPackageImpl#getQuickEditTabSections()
- * @generated
- */
- EClass QUICK_EDIT_TAB_SECTIONS = eINSTANCE.getQuickEditTabSections();
-
- /**
- * The meta object literal for the '<em><b>Sections</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EReference QUICK_EDIT_TAB_SECTIONS__SECTIONS = eINSTANCE.getQuickEditTabSections_Sections();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.internal.impl.SectionInfoImpl <em>Section Info</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.internal.impl.SectionInfoImpl
- * @see org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.internal.impl.QuickEditTabSectionsPackageImpl#getSectionInfo()
- * @generated
- */
- EClass SECTION_INFO = eINSTANCE.getSectionInfo();
-
- /**
- * The meta object literal for the '<em><b>Id</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute SECTION_INFO__ID = eINSTANCE.getSectionInfo_Id();
-
- /**
- * The meta object literal for the '<em><b>Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute SECTION_INFO__TYPE = eINSTANCE.getSectionInfo_Type();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.SECTION_TYPE <em>SECTION TYPE</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.SECTION_TYPE
- * @see org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.internal.impl.QuickEditTabSectionsPackageImpl#getSECTION_TYPE()
- * @generated
- */
- EEnum SECTION_TYPE = eINSTANCE.getSECTION_TYPE();
-
- }
-
-} //QuickEditTabSectionsPackage
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/quickedittabsections/SECTION_TYPE.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/quickedittabsections/SECTION_TYPE.java
deleted file mode 100644
index b85aaa0..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/quickedittabsections/SECTION_TYPE.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/**
- * Copyright (c) 2007 Oracle Corporation
- *
- * $Id: SECTION_TYPE.java,v 1.2 2007/12/12 16:43:21 gkessler Exp $
- */
-package org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.emf.common.util.Enumerator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the literals of the enumeration '<em><b>SECTION TYPE</b></em>',
- * and utility methods for working with them.
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.QuickEditTabSectionsPackage#getSECTION_TYPE()
- * @model
- * @generated
- */
-public enum SECTION_TYPE implements Enumerator {
- /**
- * The '<em><b>ATTRIBUTE</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #ATTRIBUTE_VALUE
- * @generated
- * @ordered
- */
- ATTRIBUTE(0, "ATTRIBUTE", "ATTRIBUTE"),
-
- /**
- * The '<em><b>SECTION</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #SECTION_VALUE
- * @generated
- * @ordered
- */
- SECTION(1, "SECTION", "SECTION");
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * The '<em><b>ATTRIBUTE</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>ATTRIBUTE</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #ATTRIBUTE
- * @model
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTE_VALUE = 0;
-
- /**
- * The '<em><b>SECTION</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>SECTION</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #SECTION
- * @model
- * @generated
- * @ordered
- */
- public static final int SECTION_VALUE = 1;
-
- /**
- * An array of all the '<em><b>SECTION TYPE</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final SECTION_TYPE[] VALUES_ARRAY =
- new SECTION_TYPE[] {
- ATTRIBUTE,
- SECTION,
- };
-
- /**
- * A public read-only list of all the '<em><b>SECTION TYPE</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<SECTION_TYPE> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>SECTION TYPE</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param literal
- * @return SECTION_TYPE
- * @generated
- */
- public static SECTION_TYPE get(String literal) {
- for (int i = 0; i < VALUES_ARRAY.length; ++i) {
- SECTION_TYPE result = VALUES_ARRAY[i];
- if (result.toString().equals(literal)) {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>SECTION TYPE</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param name
- * @return SECTION_TYPE
- * @generated
- */
- public static SECTION_TYPE getByName(String name) {
- for (int i = 0; i < VALUES_ARRAY.length; ++i) {
- SECTION_TYPE result = VALUES_ARRAY[i];
- if (result.getName().equals(name)) {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>SECTION TYPE</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value
- * @return SECTION_TYPE
- * @generated
- */
- public static SECTION_TYPE get(int value) {
- switch (value) {
- case ATTRIBUTE_VALUE: return ATTRIBUTE;
- case SECTION_VALUE: return SECTION;
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final int value;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String name;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String literal;
-
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private SECTION_TYPE(int value, String name, String literal) {
- this.value = value;
- this.name = name;
- this.literal = literal;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getValue() {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName() {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getLiteral() {
- return literal;
- }
-
- /**
- * Returns the literal value of the enumerator, which is its string representation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString() {
- return literal;
- }
-
-} //SECTION_TYPE
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/quickedittabsections/SectionInfo.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/quickedittabsections/SectionInfo.java
deleted file mode 100644
index fcb9161..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/quickedittabsections/SectionInfo.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/**
- * Copyright (c) 2007 Oracle Corporation
- *
- * $Id: SectionInfo.java,v 1.1 2007/12/07 23:43:40 gkessler Exp $
- */
-package org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Section Info</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.SectionInfo#getId <em>Id</em>}</li>
- * <li>{@link org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.SectionInfo#getType <em>Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.QuickEditTabSectionsPackage#getSectionInfo()
- * @model
- * @generated
- */
-public interface SectionInfo extends EObject {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * Returns the value of the '<em><b>Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Id</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Id</em>' attribute.
- * @see #setId(String)
- * @see org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.QuickEditTabSectionsPackage#getSectionInfo_Id()
- * @model required="true"
- * @generated
- */
- String getId();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.SectionInfo#getId <em>Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Id</em>' attribute.
- * @see #getId()
- * @generated
- */
- void setId(String value);
-
- /**
- * Returns the value of the '<em><b>Type</b></em>' attribute.
- * The default value is <code>"ATTRIBUTE"</code>.
- * The literals are from the enumeration {@link org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.SECTION_TYPE}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type</em>' attribute.
- * @see org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.SECTION_TYPE
- * @see #setType(SECTION_TYPE)
- * @see org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.QuickEditTabSectionsPackage#getSectionInfo_Type()
- * @model default="ATTRIBUTE" unique="false"
- * @generated
- */
- SECTION_TYPE getType();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.SectionInfo#getType <em>Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Type</em>' attribute.
- * @see org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.SECTION_TYPE
- * @see #getType()
- * @generated
- */
- void setType(SECTION_TYPE value);
-
-} // SectionInfo
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/quickedittabsections/internal/impl/QuickEditTabSectionsFactoryImpl.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/quickedittabsections/internal/impl/QuickEditTabSectionsFactoryImpl.java
deleted file mode 100644
index 3e13edd..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/quickedittabsections/internal/impl/QuickEditTabSectionsFactoryImpl.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/**
- * Copyright (c) 2007 Oracle Corporation
- *
- * $Id: QuickEditTabSectionsFactoryImpl.java,v 1.2 2008/01/09 19:40:28 cbateman Exp $
- */
-package org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.internal.impl;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.impl.EFactoryImpl;
-import org.eclipse.emf.ecore.plugin.EcorePlugin;
-import org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.QuickEditTabSections;
-import org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.QuickEditTabSectionsFactory;
-import org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.QuickEditTabSectionsPackage;
-import org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.SECTION_TYPE;
-import org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.SectionInfo;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model <b>Factory</b>.
- * <!-- end-user-doc -->
- * @generated
- */
-public class QuickEditTabSectionsFactoryImpl extends EFactoryImpl implements QuickEditTabSectionsFactory {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * Creates the default factory implementation.
- * <!-- begin-user-doc -->
- * @return the factory
- * <!-- end-user-doc -->
- * @generated
- */
- public static QuickEditTabSectionsFactory init() {
- try {
- QuickEditTabSectionsFactory theQuickEditTabSectionsFactory = (QuickEditTabSectionsFactory)EPackage.Registry.INSTANCE.getEFactory("http://org.eclipse.jsf.pagedesigner/QuickEditTabSections.ecore");
- if (theQuickEditTabSectionsFactory != null) {
- return theQuickEditTabSectionsFactory;
- }
- }
- catch (Exception exception) {
- EcorePlugin.INSTANCE.log(exception);
- }
- return new QuickEditTabSectionsFactoryImpl();
- }
-
- /**
- * Creates an instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public QuickEditTabSectionsFactoryImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public EObject create(EClass eClass) {
- switch (eClass.getClassifierID()) {
- case QuickEditTabSectionsPackage.QUICK_EDIT_TAB_SECTIONS: return createQuickEditTabSections();
- case QuickEditTabSectionsPackage.SECTION_INFO: return createSectionInfo();
- default:
- throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object createFromString(EDataType eDataType, String initialValue) {
- switch (eDataType.getClassifierID()) {
- case QuickEditTabSectionsPackage.SECTION_TYPE:
- return createSECTION_TYPEFromString(eDataType, initialValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String convertToString(EDataType eDataType, Object instanceValue) {
- switch (eDataType.getClassifierID()) {
- case QuickEditTabSectionsPackage.SECTION_TYPE:
- return convertSECTION_TYPEToString(eDataType, instanceValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public QuickEditTabSections createQuickEditTabSections() {
- QuickEditTabSectionsImpl quickEditTabSections = new QuickEditTabSectionsImpl();
- return quickEditTabSections;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public SectionInfo createSectionInfo() {
- SectionInfoImpl sectionInfo = new SectionInfoImpl();
- return sectionInfo;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @param eDataType
- * @param initialValue
- * @return the SECTION_TYPE enumerator
- * <!-- end-user-doc -->
- * @generated
- */
- public SECTION_TYPE createSECTION_TYPEFromString(EDataType eDataType, String initialValue) {
- SECTION_TYPE result = SECTION_TYPE.get(initialValue);
- if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * @param eDataType
- * @param instanceValue
- * @return the String version of the section type
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertSECTION_TYPEToString(EDataType eDataType, Object instanceValue) {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public QuickEditTabSectionsPackage getQuickEditTabSectionsPackage() {
- return (QuickEditTabSectionsPackage)getEPackage();
- }
-
- /**
- * <!-- begin-user-doc -->
- * @return the package
- * <!-- end-user-doc -->
- * @deprecated
- * @generated
- */
- @Deprecated
- public static QuickEditTabSectionsPackage getPackage() {
- return QuickEditTabSectionsPackage.eINSTANCE;
- }
-
-} //QuickEditTabSectionsFactoryImpl
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/quickedittabsections/internal/impl/QuickEditTabSectionsImpl.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/quickedittabsections/internal/impl/QuickEditTabSectionsImpl.java
deleted file mode 100644
index b433d65..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/quickedittabsections/internal/impl/QuickEditTabSectionsImpl.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/**
- * Copyright (c) 2007 Oracle Corporation
- *
- * $Id: QuickEditTabSectionsImpl.java,v 1.1 2007/12/07 23:43:47 gkessler Exp $
- */
-package org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.internal.impl;
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.QuickEditTabSections;
-import org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.QuickEditTabSectionsPackage;
-import org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.SectionInfo;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Quick Edit Tab Sections</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.internal.impl.QuickEditTabSectionsImpl#getSections <em>Sections</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class QuickEditTabSectionsImpl extends EObjectImpl implements QuickEditTabSections {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * The cached value of the '{@link #getSections() <em>Sections</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSections()
- * @generated
- * @ordered
- */
- protected EList<SectionInfo> sections;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected QuickEditTabSectionsImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return QuickEditTabSectionsPackage.Literals.QUICK_EDIT_TAB_SECTIONS;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EList<SectionInfo> getSections() {
- if (sections == null) {
- sections = new EObjectContainmentEList<SectionInfo>(SectionInfo.class, this, QuickEditTabSectionsPackage.QUICK_EDIT_TAB_SECTIONS__SECTIONS);
- }
- return sections;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case QuickEditTabSectionsPackage.QUICK_EDIT_TAB_SECTIONS__SECTIONS:
- return ((InternalEList<?>)getSections()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case QuickEditTabSectionsPackage.QUICK_EDIT_TAB_SECTIONS__SECTIONS:
- return getSections();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case QuickEditTabSectionsPackage.QUICK_EDIT_TAB_SECTIONS__SECTIONS:
- getSections().clear();
- getSections().addAll((Collection<? extends SectionInfo>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID) {
- switch (featureID) {
- case QuickEditTabSectionsPackage.QUICK_EDIT_TAB_SECTIONS__SECTIONS:
- getSections().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case QuickEditTabSectionsPackage.QUICK_EDIT_TAB_SECTIONS__SECTIONS:
- return sections != null && !sections.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
-} //QuickEditTabSectionsImpl
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/quickedittabsections/internal/impl/QuickEditTabSectionsPackageImpl.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/quickedittabsections/internal/impl/QuickEditTabSectionsPackageImpl.java
deleted file mode 100644
index 3190f63..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/quickedittabsections/internal/impl/QuickEditTabSectionsPackageImpl.java
+++ /dev/null
@@ -1,283 +0,0 @@
-/**
- * Copyright (c) 2007 Oracle Corporation
- *
- * $Id: QuickEditTabSectionsPackageImpl.java,v 1.2 2008/01/09 19:40:28 cbateman Exp $
- */
-package org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.internal.impl;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.QuickEditTabSections;
-import org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.QuickEditTabSectionsFactory;
-import org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.QuickEditTabSectionsPackage;
-import org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.SectionInfo;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model <b>Package</b>.
- * <!-- end-user-doc -->
- * @generated
- */
-public class QuickEditTabSectionsPackageImpl extends EPackageImpl implements QuickEditTabSectionsPackage {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass quickEditTabSectionsEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass sectionInfoEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum sectioN_TYPEEEnum = null;
-
- /**
- * Creates an instance of the model <b>Package</b>, registered with
- * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
- * package URI value.
- * <p>Note: the correct way to create the package is via the static
- * factory method {@link #init init()}, which also performs
- * initialization of the package, or returns the registered package,
- * if one already exists.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.emf.ecore.EPackage.Registry
- * @see org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.QuickEditTabSectionsPackage#eNS_URI
- * @see #init()
- * @generated
- */
- private QuickEditTabSectionsPackageImpl() {
- super(eNS_URI, QuickEditTabSectionsFactory.eINSTANCE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static boolean isInited = false;
-
- /**
- * Creates, registers, and initializes the <b>Package</b> for this
- * model, and for any others upon which it depends. Simple
- * dependencies are satisfied by calling this method on all
- * dependent packages before doing anything else. This method drives
- * initialization for interdependent packages directly, in parallel
- * with this package, itself.
- * <p>Of this package and its interdependencies, all packages which
- * have not yet been registered by their URI values are first created
- * and registered. The packages are then initialized in two steps:
- * meta-model objects for all of the packages are created before any
- * are initialized, since one package's meta-model objects may refer to
- * those of another.
- * <p>Invocation of this method will not affect any packages that have
- * already been initialized.
- * <!-- begin-user-doc -->
- * @return the initialized package
- * <!-- end-user-doc -->
- * @see #eNS_URI
- * @see #createPackageContents()
- * @see #initializePackageContents()
- * @generated
- */
- public static QuickEditTabSectionsPackage init() {
- if (isInited) return (QuickEditTabSectionsPackage)EPackage.Registry.INSTANCE.getEPackage(QuickEditTabSectionsPackage.eNS_URI);
-
- // Obtain or create and register package
- QuickEditTabSectionsPackageImpl theQuickEditTabSectionsPackage = (QuickEditTabSectionsPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof QuickEditTabSectionsPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new QuickEditTabSectionsPackageImpl());
-
- isInited = true;
-
- // Create package meta-data objects
- theQuickEditTabSectionsPackage.createPackageContents();
-
- // Initialize created meta-data
- theQuickEditTabSectionsPackage.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- theQuickEditTabSectionsPackage.freeze();
-
- return theQuickEditTabSectionsPackage;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getQuickEditTabSections() {
- return quickEditTabSectionsEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EReference getQuickEditTabSections_Sections() {
- return (EReference)quickEditTabSectionsEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getSectionInfo() {
- return sectionInfoEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getSectionInfo_Id() {
- return (EAttribute)sectionInfoEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getSectionInfo_Type() {
- return (EAttribute)sectionInfoEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EEnum getSECTION_TYPE() {
- return sectioN_TYPEEEnum;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public QuickEditTabSectionsFactory getQuickEditTabSectionsFactory() {
- return (QuickEditTabSectionsFactory)getEFactoryInstance();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isCreated = false;
-
- /**
- * Creates the meta-model objects for the package. This method is
- * guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void createPackageContents() {
- if (isCreated) return;
- isCreated = true;
-
- // Create classes and their features
- quickEditTabSectionsEClass = createEClass(QUICK_EDIT_TAB_SECTIONS);
- createEReference(quickEditTabSectionsEClass, QUICK_EDIT_TAB_SECTIONS__SECTIONS);
-
- sectionInfoEClass = createEClass(SECTION_INFO);
- createEAttribute(sectionInfoEClass, SECTION_INFO__ID);
- createEAttribute(sectionInfoEClass, SECTION_INFO__TYPE);
-
- // Create enums
- sectioN_TYPEEEnum = createEEnum(SECTION_TYPE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isInitialized = false;
-
- /**
- * Complete the initialization of the package and its meta-model. This
- * method is guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void initializePackageContents() {
- if (isInitialized) return;
- isInitialized = true;
-
- // Initialize package
- setName(eNAME);
- setNsPrefix(eNS_PREFIX);
- setNsURI(eNS_URI);
-
- // Create type parameters
-
- // Set bounds for type parameters
-
- // Add supertypes to classes
-
- // Initialize classes and features; add operations and parameters
- initEClass(quickEditTabSectionsEClass, QuickEditTabSections.class, "QuickEditTabSections", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getQuickEditTabSections_Sections(), this.getSectionInfo(), null, "sections", null, 0, -1, QuickEditTabSections.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(sectionInfoEClass, SectionInfo.class, "SectionInfo", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getSectionInfo_Id(), ecorePackage.getEString(), "id", null, 1, 1, SectionInfo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getSectionInfo_Type(), this.getSECTION_TYPE(), "type", "ATTRIBUTE", 0, 1, SectionInfo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- // Initialize enums and add enum literals
- initEEnum(sectioN_TYPEEEnum, org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.SECTION_TYPE.class, "SECTION_TYPE");
- addEEnumLiteral(sectioN_TYPEEEnum, org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.SECTION_TYPE.ATTRIBUTE);
- addEEnumLiteral(sectioN_TYPEEEnum, org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.SECTION_TYPE.SECTION);
-
- // Create resource
- createResource(eNS_URI);
-
- // Create annotations
- // http:///org/eclipse/emf/ecore/util/ExtendedMetaData
- createExtendedMetaDataAnnotations();
- }
-
- /**
- * Initializes the annotations for <b>http:///org/eclipse/emf/ecore/util/ExtendedMetaData</b>.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected void createExtendedMetaDataAnnotations() {
- String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData";
- addAnnotation
- (getQuickEditTabSections_Sections(),
- source,
- new String[] {
- "kind", "element",
- "name", "section"
- });
- }
-
-} //QuickEditTabSectionsPackageImpl
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/quickedittabsections/internal/impl/SectionInfoImpl.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/quickedittabsections/internal/impl/SectionInfoImpl.java
deleted file mode 100644
index b3c7298..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/quickedittabsections/internal/impl/SectionInfoImpl.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/**
- * Copyright (c) 2007 Oracle Corporation
- *
- * $Id: SectionInfoImpl.java,v 1.1 2007/12/07 23:43:47 gkessler Exp $
- */
-package org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.internal.impl;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-import org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.QuickEditTabSectionsPackage;
-import org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.SECTION_TYPE;
-import org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.SectionInfo;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Section Info</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.internal.impl.SectionInfoImpl#getId <em>Id</em>}</li>
- * <li>{@link org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.internal.impl.SectionInfoImpl#getType <em>Type</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class SectionInfoImpl extends EObjectImpl implements SectionInfo {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * The default value of the '{@link #getId() <em>Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getId()
- * @generated
- * @ordered
- */
- protected static final String ID_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getId() <em>Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getId()
- * @generated
- * @ordered
- */
- protected String id = ID_EDEFAULT;
-
- /**
- * The default value of the '{@link #getType() <em>Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getType()
- * @generated
- * @ordered
- */
- protected static final SECTION_TYPE TYPE_EDEFAULT = SECTION_TYPE.ATTRIBUTE;
-
- /**
- * The cached value of the '{@link #getType() <em>Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getType()
- * @generated
- * @ordered
- */
- protected SECTION_TYPE type = TYPE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected SectionInfoImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return QuickEditTabSectionsPackage.Literals.SECTION_INFO;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getId() {
- return id;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setId(String newId) {
- String oldId = id;
- id = newId;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, QuickEditTabSectionsPackage.SECTION_INFO__ID, oldId, id));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public SECTION_TYPE getType() {
- return type;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setType(SECTION_TYPE newType) {
- SECTION_TYPE oldType = type;
- type = newType == null ? TYPE_EDEFAULT : newType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, QuickEditTabSectionsPackage.SECTION_INFO__TYPE, oldType, type));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case QuickEditTabSectionsPackage.SECTION_INFO__ID:
- return getId();
- case QuickEditTabSectionsPackage.SECTION_INFO__TYPE:
- return getType();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case QuickEditTabSectionsPackage.SECTION_INFO__ID:
- setId((String)newValue);
- return;
- case QuickEditTabSectionsPackage.SECTION_INFO__TYPE:
- setType((SECTION_TYPE)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID) {
- switch (featureID) {
- case QuickEditTabSectionsPackage.SECTION_INFO__ID:
- setId(ID_EDEFAULT);
- return;
- case QuickEditTabSectionsPackage.SECTION_INFO__TYPE:
- setType(TYPE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case QuickEditTabSectionsPackage.SECTION_INFO__ID:
- return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
- case QuickEditTabSectionsPackage.SECTION_INFO__TYPE:
- return type != TYPE_EDEFAULT;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString() {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (id: ");
- result.append(id);
- result.append(", type: ");
- result.append(type);
- result.append(')');
- return result.toString();
- }
-
-} //SectionInfoImpl
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/quickedittabsections/internal/util/QuickEditTabSectionsAdapterFactory.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/quickedittabsections/internal/util/QuickEditTabSectionsAdapterFactory.java
deleted file mode 100644
index 59994fd..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/quickedittabsections/internal/util/QuickEditTabSectionsAdapterFactory.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/**
- * Copyright (c) 2007 Oracle Corporation
- *
- * $Id: QuickEditTabSectionsAdapterFactory.java,v 1.1 2007/12/07 23:43:50 gkessler Exp $
- */
-package org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.internal.util;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-
-import org.eclipse.emf.ecore.EObject;
-
-import org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.*;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Adapter Factory</b> for the model.
- * It provides an adapter <code>createXXX</code> method for each class of the model.
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.QuickEditTabSectionsPackage
- * @generated
- */
-public class QuickEditTabSectionsAdapterFactory extends AdapterFactoryImpl {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * The cached model package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected static QuickEditTabSectionsPackage modelPackage;
-
- /**
- * Creates an instance of the adapter factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public QuickEditTabSectionsAdapterFactory() {
- if (modelPackage == null) {
- modelPackage = QuickEditTabSectionsPackage.eINSTANCE;
- }
- }
-
- /**
- * Returns whether this factory is applicable for the type of the object.
- * <!-- begin-user-doc -->
- * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
- * <!-- end-user-doc -->
- * @return whether this factory is applicable for the type of the object.
- * @generated
- */
- @Override
- public boolean isFactoryForType(Object object) {
- if (object == modelPackage) {
- return true;
- }
- if (object instanceof EObject) {
- return ((EObject)object).eClass().getEPackage() == modelPackage;
- }
- return false;
- }
-
- /**
- * The switch the delegates to the <code>createXXX</code> methods.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected QuickEditTabSectionsSwitch<Adapter> modelSwitch =
- new QuickEditTabSectionsSwitch<Adapter>() {
- @Override
- public Adapter caseQuickEditTabSections(QuickEditTabSections object) {
- return createQuickEditTabSectionsAdapter();
- }
- @Override
- public Adapter caseSectionInfo(SectionInfo object) {
- return createSectionInfoAdapter();
- }
- @Override
- public Adapter defaultCase(EObject object) {
- return createEObjectAdapter();
- }
- };
-
- /**
- * Creates an adapter for the <code>target</code>.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param target the object to adapt.
- * @return the adapter for the <code>target</code>.
- * @generated
- */
- @Override
- public Adapter createAdapter(Notifier target) {
- return modelSwitch.doSwitch((EObject)target);
- }
-
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.QuickEditTabSections <em>Quick Edit Tab Sections</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.QuickEditTabSections
- * @generated
- */
- public Adapter createQuickEditTabSectionsAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.SectionInfo <em>Section Info</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.SectionInfo
- * @generated
- */
- public Adapter createSectionInfoAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for the default case.
- * <!-- begin-user-doc -->
- * This default implementation returns null.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @generated
- */
- public Adapter createEObjectAdapter() {
- return null;
- }
-
-} //QuickEditTabSectionsAdapterFactory
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/quickedittabsections/internal/util/QuickEditTabSectionsSwitch.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/quickedittabsections/internal/util/QuickEditTabSectionsSwitch.java
deleted file mode 100644
index 3a7f3a7..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/quickedittabsections/internal/util/QuickEditTabSectionsSwitch.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/**
- * Copyright (c) 2007 Oracle Corporation
- *
- * $Id: QuickEditTabSectionsSwitch.java,v 1.2 2008/01/09 19:40:28 cbateman Exp $
- */
-package org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.internal.util;
-
-import java.util.List;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-
-import org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.*;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Switch</b> for the model's inheritance hierarchy.
- * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
- * to invoke the <code>caseXXX</code> method for each class of the model,
- * starting with the actual class of the object
- * and proceeding up the inheritance hierarchy
- * until a non-null result is returned,
- * which is the result of the switch.
- *
- * @param <T>
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.QuickEditTabSectionsPackage
- * @generated
- */
-public class QuickEditTabSectionsSwitch<T> {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * The cached model package
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected static QuickEditTabSectionsPackage modelPackage;
-
- /**
- * Creates an instance of the switch.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public QuickEditTabSectionsSwitch() {
- if (modelPackage == null) {
- modelPackage = QuickEditTabSectionsPackage.eINSTANCE;
- }
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc -->
- * @param theEObject
- * <!-- end-user-doc -->
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * @generated
- */
- public T doSwitch(EObject theEObject) {
- return doSwitch(theEObject.eClass(), theEObject);
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc -->
- * @param theEClass
- * @param theEObject
- * <!-- end-user-doc -->
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * @generated
- */
- protected T doSwitch(EClass theEClass, EObject theEObject) {
- if (theEClass.eContainer() == modelPackage) {
- return doSwitch(theEClass.getClassifierID(), theEObject);
- }
- List<EClass> eSuperTypes = theEClass.getESuperTypes();
- return
- eSuperTypes.isEmpty() ?
- defaultCase(theEObject) :
- doSwitch(eSuperTypes.get(0), theEObject);
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc -->
- * @param classifierID
- * @param theEObject
- * <!-- end-user-doc -->
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * @generated
- */
- protected T doSwitch(int classifierID, EObject theEObject) {
- switch (classifierID) {
- case QuickEditTabSectionsPackage.QUICK_EDIT_TAB_SECTIONS: {
- QuickEditTabSections quickEditTabSections = (QuickEditTabSections)theEObject;
- T result = caseQuickEditTabSections(quickEditTabSections);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case QuickEditTabSectionsPackage.SECTION_INFO: {
- SectionInfo sectionInfo = (SectionInfo)theEObject;
- T result = caseSectionInfo(sectionInfo);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- default: return defaultCase(theEObject);
- }
- }
-
- /**
- * Returns the result of interpreting the object as an instance of '<em>Quick Edit Tab Sections</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpreting the object as an instance of '<em>Quick Edit Tab Sections</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public T caseQuickEditTabSections(QuickEditTabSections object) {
- return null;
- }
-
- /**
- * Returns the result of interpreting the object as an instance of '<em>Section Info</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpreting the object as an instance of '<em>Section Info</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public T caseSectionInfo(SectionInfo object) {
- return null;
- }
-
- /**
- * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch, but this is the last case anyway.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject)
- * @generated
- */
- public T defaultCase(EObject object) {
- return null;
- }
-
-} //QuickEditTabSectionsSwitch
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/quickedittabsections/package-info.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/quickedittabsections/package-info.java
deleted file mode 100644
index e51e80c..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/properties/quickedittabsections/package-info.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-/**
- * Web Page Editor tag attribute QuickEdit property page classes.
- *
- * <p><b>Provisional API - subject to change</b></p>
- */
-package org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections;
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/AbsolutePointLocator.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/AbsolutePointLocator.java
deleted file mode 100644
index 0ebdeb2..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/AbsolutePointLocator.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editpolicies;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Locator;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-
-/**
- * @author cbateman
- *
- */
-public class AbsolutePointLocator implements Locator
-{
- private static AbsolutePointLocator INSTANCE;
- private final static Point DEFAULT_POINT = new Point(0,0);
-
- private Point _referencePoint = DEFAULT_POINT;
- private int _xOffset = 0;
- private int _yOffset = 0;
- private IFigure _intersectFigure;
-
- /**
- * @return the singleton instance
- */
- public synchronized static AbsolutePointLocator getInstance()
- {
- if (INSTANCE == null)
- {
- INSTANCE = new AbsolutePointLocator();
- }
- return INSTANCE;
- }
-
- /**
- * Relocates the target figure to the reference point with possible x and y
- * offsetting. Uses the target's preferredSize as the new size.
- */
- public void relocate(IFigure target)
- {
- Point leftTop = new Point(_referencePoint.x+_xOffset, _referencePoint.y+_yOffset);
-
-
- //figure.translateToAbsolute(leftTop);
- target.translateToRelative(leftTop);
- Dimension d = target.getPreferredSize();
- Rectangle rect = new Rectangle(leftTop, d);
-
- // to avoid enlargemeent
- if (_intersectFigure != null)
- {
- rect = rect.intersect(_intersectFigure.getBounds());
- }
-
- target.setBounds(rect);
- }
-
- /**
- * Sets the reference point used to calculate the location to which
- * relocate will relocate its target. The x and y offset values are added
- * to the reference point before final re-location. If point is null
- * then the reference is set to (0,0)
- * @param point
- * @param xoffset
- * @param yoffset
- */
- public void setReferencePoint(Point point, int xoffset, int yoffset)
- {
- if (point == null)
- {
- _referencePoint = DEFAULT_POINT;
- }
- else
- {
- _referencePoint = point;
- }
-
- _xOffset = xoffset;
- _yOffset = yoffset;
- }
-
- /**
- * Sets the figure used to calculate a rectangular intersect of the
- * relocated target. This normally set to the parent of the target
- * such as a layer to ensure that the relocate target does not enlarge
- * its parent by relocating outside it's rectangle.
- *
- * If intersectFigure is set to null, then no intersect calculation will
- * be performed.
- *
- * @param intersectFigure
- */
- public void setIntersectFigure(IFigure intersectFigure)
- {
- _intersectFigure = intersectFigure;
- }
-
- private AbsolutePointLocator() {/*no external instantiation*/}
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/BasicLabelToolTip.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/BasicLabelToolTip.java
deleted file mode 100644
index bd216a6..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/BasicLabelToolTip.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editpolicies;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.LineBorder;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * A tool tip based on a label
- * @author cbateman
- *
- */
-public class BasicLabelToolTip extends Label
-{
- /**
- * @param i
- */
- public BasicLabelToolTip(Image i) {
- super(i);
- initialize();
- }
-
- /**
- * @param s
- * @param i
- */
- public BasicLabelToolTip(String s, Image i) {
- super(s, i);
- initialize();
- }
-
- /**
- * @param s
- */
- public BasicLabelToolTip(String s) {
- super(s);
- initialize();
- }
-
- /**
- *
- */
- protected void initialize()
- {
- setOpaque(true);
- setBackgroundColor(ColorConstants.tooltipBackground);
- setBorder(
- new LineBorder(ColorConstants.tooltipForeground, 1)
- {
- // add an extra pixel of inset to make sure the text
- // isn't pressed against the border
- public Insets getInsets(IFigure figure) {
- return new Insets(getWidth()+1);
- }
- }
- );
- setTextAlignment(PositionConstants.CENTER);
- setForegroundColor(ColorConstants.tooltipForeground);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/ColumnHelper.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/ColumnHelper.java
deleted file mode 100644
index 6574e59..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/ColumnHelper.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editpolicies;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.LayoutManager;
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.draw2d.geometry.PrecisionRectangle;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.jst.pagedesigner.css2.layout.CSSFigure;
-import org.eclipse.jst.pagedesigner.css2.layout.table.CSSTableLayout2;
-
-/**
- * @author mengbo
- */
-public class ColumnHelper {
-
- /**
- * @param editPart
- * @return a rectangle that bounds the actual visual rectangle of the column represented
- * by editPart. The editPart's figure normally only maps to the td in the rendered table.
- *
- * The rectangle is translated to absolute bounds
- */
- public static Rectangle getAdjustedColumnBoundingRectangle(GraphicalEditPart editPart)
- {
- Rectangle bounds = editPart.getFigure().getBounds().getCopy();
-
- if (editPart.getParent() != null) {
- IFigure figure = ((GraphicalEditPart) editPart.getParent())
- .getFigure();
- if (figure instanceof CSSFigure) {
- CSSFigure cssFigure = (CSSFigure) figure;
- LayoutManager layoutManager = cssFigure.getLayoutManager();
- if (layoutManager instanceof CSSTableLayout2) {
- CSSTableLayout2 tableLayout = (CSSTableLayout2) layoutManager;
- bounds.y = tableLayout.getHSpacing();
- bounds.height = figure.getClientArea().height
- - tableLayout.getHSpacing() * 2;
- }
- }
- }
- bounds = new PrecisionRectangle(bounds.getResized(-1, -1));
- editPart.getFigure().translateToAbsolute(bounds);
-
- return bounds;
- }
-
- static Rectangle getColumnBounds(GraphicalEditPart editPart,
- IFigure target) {
- Rectangle bounds = getAdjustedColumnBoundingRectangle(editPart);
- target.translateToRelative(bounds);
- Insets insets = target.getInsets();
- bounds.translate(-insets.left, -insets.top);
- bounds.resize(insets.getWidth() + 1, insets.getHeight() + 1);
- return bounds;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/ColumnResizableEditPolicy.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/ColumnResizableEditPolicy.java
deleted file mode 100644
index 8530091..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/ColumnResizableEditPolicy.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editpolicies;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Locator;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.DragTracker;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Handle;
-import org.eclipse.gef.SharedCursors;
-import org.eclipse.gef.handles.MoveHandle;
-import org.eclipse.gef.handles.ResizeHandle;
-import org.eclipse.gef.handles.SquareHandle;
-import org.eclipse.gef.tools.DragEditPartsTracker;
-import org.eclipse.gef.tools.SelectEditPartTracker;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.graphics.Image;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- */
-public class ColumnResizableEditPolicy extends ElementResizableEditPolicy {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editpolicies.ResizableEditPolicy#createSelectionHandles()
- */
- protected List createSelectionHandles() {
- String elementName = ((Element) getHost().getModel()).getLocalName();
- if ("column".equalsIgnoreCase(elementName)) {
- List list = new ArrayList();
-
- GraphicalEditPart part = (GraphicalEditPart) getHost();
-
- {
- MoveHandle borderhandle = new MoveHandle(part, new ColumnBorderHandleLocator(
- part));
- list.add(borderhandle);
- }
-
- {
- MyMoveHandle cornerHandle = new MyMoveHandle(part, new ColumnHandleLocator(part, getHostFigure(),
- PositionConstants.NORTH_WEST));
- list.add(cornerHandle);
- }
-
- SelectEditPartTracker tracker = new SelectEditPartTracker(getHost());
- list.add(createHandle(part, PositionConstants.SOUTH_EAST, tracker,
- SharedCursors.ARROW));
- list.add(createHandle(part, PositionConstants.SOUTH_WEST, tracker,
- SharedCursors.ARROW));
- list.add(createHandle(part, PositionConstants.NORTH_WEST, tracker,
- SharedCursors.ARROW));
- list.add(createHandle(part, PositionConstants.NORTH_EAST, tracker,
- SharedCursors.ARROW));
- return list;
-
- }
- return super.createSelectionHandles();
- }
-
- private Handle createHandle(GraphicalEditPart owner, int direction,
- DragTracker tracker, Cursor cursor) {
- ResizeHandle handle = new ResizeHandle(owner, new ColumnCornerLocator(
- owner, direction), cursor);
- handle.setCursor(cursor);
- handle.setDragTracker(tracker);
- return handle;
- }
-
- private class ColumnHandleLocator extends CornerRelativeHandleLocator {
- private GraphicalEditPart editPart;
-
- /**
- * @param editPart
- * @param reference
- * @param location
- */
- public ColumnHandleLocator(GraphicalEditPart editPart, IFigure reference, int location) {
- super(reference, location);
- this.editPart = editPart;
- }
-
- protected Dimension getNewTargetSize(IFigure relocateFigure) {
- return relocateFigure.getPreferredSize();
- }
-
- protected Rectangle getCurrentTargetBounds(IFigure relocateFigure) {
- return ColumnHelper.getColumnBounds(editPart, relocateFigure);
- }
- }
-
- private class ColumnCornerLocator implements Locator {
- private double relativeX;
-
- private double relativeY;
-
- private GraphicalEditPart editPart;
-
- /**
- * Constructs a RelativeLocator with the given reference figure and
- * relative location. The location is a constant from
- * {@link PositionConstants} used as a convenient and readable way to
- * set both the relativeX and relativeY values.
- *
- * @param editPart
- * the reference figure
- * @param location
- * one of NORTH, NORTH_EAST, etc.
- */
- public ColumnCornerLocator(GraphicalEditPart editPart, int location) {
- this.editPart = editPart;
- switch (location & PositionConstants.NORTH_SOUTH) {
- case PositionConstants.NORTH:
- relativeY = 0;
- break;
- case PositionConstants.SOUTH:
- relativeY = 1.0;
- break;
- default:
- relativeY = 0.5;
- }
-
- switch (location & PositionConstants.EAST_WEST) {
- case PositionConstants.WEST:
- relativeX = 0;
- break;
- case PositionConstants.EAST:
- relativeX = 1.0;
- break;
- default:
- relativeX = 0.5;
- }
- }
-
- /**
- * Relocates the target using the relative offset locations.
- *
- * @see org.eclipse.draw2d.Locator#relocate(org.eclipse.draw2d.IFigure)
- */
- public void relocate(IFigure target) {
- Rectangle targetBounds = ColumnHelper.getColumnBounds(editPart,
- target);
-
- Dimension targetSize = target.getPreferredSize();
-
- targetBounds.x += (int) (targetBounds.width * relativeX - ((targetSize.width + 1) / 2));
- targetBounds.y += (int) (targetBounds.height * relativeY - ((targetSize.height + 1) / 2));
- targetBounds.setSize(targetSize);
- target.setBounds(targetBounds);
- }
- }
-
- private class ColumnBorderHandleLocator implements Locator {
- private GraphicalEditPart editPart;
-
- /**
- * @param editPart
- */
- public ColumnBorderHandleLocator(GraphicalEditPart editPart) {
- this.editPart = editPart;
- }
-
- public void relocate(IFigure target) {
- target.setBounds(ColumnHelper.getColumnBounds(editPart, target));
- }
- }
-
- private static class MyMoveHandle extends SquareHandle
- {
- /**
- * @param owner
- * @param loc
- */
- public MyMoveHandle(GraphicalEditPart owner, Locator loc) {
- super(owner, loc);
- setCursor(SharedCursors.SIZEALL);
- }
-
- protected void init() {
- setPreferredSize(16,16);
- }
-
- protected Color getBorderColor() {
- return ColorConstants.black;
- }
-
- protected Color getFillColor() {
- return ColorConstants.white;
- }
-
- protected DragTracker createDragTracker() {
- DragTracker tracker = new DragEditPartsTracker(getOwner());
-
- return tracker;
- }
-
- public void paintFigure(Graphics graphics) {
- super.paintFigure(graphics);
- final Image moveImage = PDPlugin.getDefault().getImage("MoveHandle.png");
- Point topLeft = getBounds().getTopLeft().getCopy();
- topLeft.performTranslate(3,3);
- graphics.drawImage(moveImage, topLeft);
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/CornerRelativeHandleLocator.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/CornerRelativeHandleLocator.java
deleted file mode 100644
index e43befe..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/CornerRelativeHandleLocator.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-/**
- *
- */
-package org.eclipse.jst.pagedesigner.editpolicies;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.PrecisionRectangle;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.handles.RelativeHandleLocator;
-
-/**
- * A locator for handles that attach to the corner of square figures
- * @author cbateman
- *
- */
-class CornerRelativeHandleLocator extends RelativeHandleLocator
-{
- private double relativeX = 0;
- private double relativeY = 0;
- private double offsetXMultiplier = 0;
- private double offsetYMultiplier = 0;
-
- /**
- * @param reference
- * @param location
- */
- public CornerRelativeHandleLocator(IFigure reference, int location) {
- super(reference, location);
-
- // unfortunately, relativeX and relativeY are private in super
- // so duplicate calc code here
- switch (location & PositionConstants.NORTH_SOUTH)
- {
- case PositionConstants.NORTH:
- relativeY = 0;
- offsetYMultiplier = -1.0;
- break;
-
- case PositionConstants.SOUTH:
- relativeY = 1.0;
- offsetYMultiplier = 0;
- break;
- default:
- relativeY = 0.5;
- }
-
- switch (location & PositionConstants.EAST_WEST)
- {
- case PositionConstants.WEST:
- relativeX = 0;
- offsetXMultiplier = -1.0;
- break;
- case PositionConstants.EAST:
- relativeX = 1.0;
- offsetXMultiplier = 0;
- break;
- default:
- relativeX = 0.5;
- }
- }
-
- /**
- * Pass in targetBounds to be updated and newTargetSize. targetBounds will
- * be applied to the figure that is being relocated immediately after this method
- * @param targetBounds
- * @param newTargetSize
- */
- protected void relocateBounds(Rectangle targetBounds, Dimension newTargetSize)
- {
- // copied from super.relocate because relativeX/Y are private in super
- // changed from super to remove div by 2 that centers target; we want
- // it to be corner-to-corner
- targetBounds.x
- += (int) (((targetBounds.width+2) * relativeX) + ((newTargetSize.width+1)*offsetXMultiplier));
- targetBounds.y
- += (int) (targetBounds.height * relativeY + ((newTargetSize.height+1)*offsetYMultiplier));
-
- targetBounds.setSize(newTargetSize);
- }
-
- /**
- * @param relocateFigure
- * @return a modifiable Rectangle that represents the bounds of the figure to be relocated
- */
- protected Rectangle getCurrentTargetBounds(IFigure relocateFigure)
- {
- IFigure reference = getReferenceFigure();
- Rectangle targetBounds = new PrecisionRectangle(getReferenceBox().getResized(-1, -1));
- reference.translateToAbsolute(targetBounds);
- relocateFigure.translateToRelative(targetBounds);
- return targetBounds;
- }
-
- /**
- * @param relocateFigure
- * @return the new target dimensions
- */
- protected Dimension getNewTargetSize(IFigure relocateFigure)
- {
- return relocateFigure.getPreferredSize();
- }
-
- public void relocate(IFigure target) {
- Rectangle targetBounds = getCurrentTargetBounds(target);
- Dimension targetSize = getNewTargetSize(target);
- relocateBounds(targetBounds, targetSize);
-
- target.setBounds(targetBounds);
- }
-}
\ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/DesignerElementEditPolicy.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/DesignerElementEditPolicy.java
deleted file mode 100644
index d374946..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/DesignerElementEditPolicy.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editpolicies;
-
-import org.eclipse.gef.editpolicies.ComponentEditPolicy;
-
-/**
- * @author mengbo
- */
-public class DesignerElementEditPolicy extends ComponentEditPolicy {
-
- // /*
- // * (non-Javadoc)
- // *
- // * @see
- // org.eclipse.gef.editpolicies.ComponentEditPolicy#createDeleteCommand(org.eclipse.gef.requests.GroupRequest)
- // */
- // protected Command createDeleteCommand(GroupRequest deleteRequest)
- // {
- // // Object model = getHost().getModel();
- // // ;
- // // Node parent = null;
- // // if (model instanceof Node)
- // // {
- // // parent = ((Node) model).getParentNode();
- // // }
- // // EditDomain domain = getHost().getViewer().getEditDomain();
- // // IEditorPart editor = null;
- // // //FIXME: must do this cast?
- // // if (domain instanceof DefaultEditDomain)
- // // {
- // // editor = ((DefaultEditDomain) domain).getEditorPart();
- // // }
- // // if (editor instanceof HTMLEditor)
- // // {
- // // DeleteNodeCommand deleteCmd = new DeleteNodeCommand(((HTMLEditor)
- // editor).getTextEditor().getTextViewer());
- // // deleteCmd.setParent(parent);
- // // deleteCmd.setChild((Node) getHost().getModel());
- // // return deleteCmd;
- // // }
- // // else
- // // {
- // // return null;
- // // }
- // }
- //
- // /*
- // * (non-Javadoc)
- // *
- // * @see org.eclipse.gef.EditPolicy#getCommand(org.eclipse.gef.Request)
- // */
- // public Command getCommand(Request request)
- // {
- // if (request.getType() == DesignCutAction.CUT_TYPE && request instanceof
- // GroupRequest)
- // {
- // return createCutCommand((GroupRequest) request);
- // }
- // else if (request.getType() == DesignPasteAction.PASTE_TYPE && request
- // instanceof GroupRequest)
- // {
- // return createPasteCommand((GroupRequest) request);
- // }
- // return super.getCommand(request);
- // }
- //
- // protected Command createCutCommand(GroupRequest cutRequest)
- // {
- // Object model = getHost().getModel();
- // ;
- // Node parent = null;
- // if (model instanceof Node)
- // {
- // parent = ((Node) model).getParentNode();
- // }
- // EditDomain domain = getHost().getViewer().getEditDomain();
- // IEditorPart editor = null;
- // //FIXME: must do this cast?
- // if (domain instanceof DefaultEditDomain)
- // {
- // editor = ((DefaultEditDomain) domain).getEditorPart();
- // }
- // if (editor instanceof HTMLEditor)
- // {
- // CutNodeCommand cutCmd = new CutNodeCommand(((HTMLEditor)
- // editor).getTextEditor().getTextViewer());
- // cutCmd.setParent(parent);
- // cutCmd.setChild((Node) getHost().getModel());
- // return cutCmd;
- // }
- // else
- // {
- // return null;
- // }
- // }
- //
- // protected Command createPasteCommand(GroupRequest cutRequest)
- // {
- // Object model = getHost().getModel();
- // ;
- // Node parent = null;
- // if (model instanceof Node)
- // {
- // parent = ((Node) model).getParentNode();
- // }
- // EditDomain domain = getHost().getViewer().getEditDomain();
- // IEditorPart editor = null;
- // //FIXME: must do this cast?
- // if (domain instanceof DefaultEditDomain)
- // {
- // editor = ((DefaultEditDomain) domain).getEditorPart();
- // }
- // if (editor instanceof HTMLEditor)
- // {
- // PasteNodeCommand pasteCmd = new PasteNodeCommand(((HTMLEditor)
- // editor).getTextEditor().getTextViewer());
- // pasteCmd.setParent(parent);
- // pasteCmd.setChild((Node) getHost().getModel());
- // return pasteCmd;
- // }
- // else
- // {
- // return null;
- // }
- // }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/DragMoveEditPolicy.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/DragMoveEditPolicy.java
deleted file mode 100644
index 0a805da..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/DragMoveEditPolicy.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editpolicies;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gef.requests.DropRequest;
-import org.eclipse.jst.pagedesigner.commands.CloneNodeCommand;
-import org.eclipse.jst.pagedesigner.commands.MoveNodeCommand;
-import org.eclipse.jst.pagedesigner.dom.DOMPositionHelper;
-import org.eclipse.jst.pagedesigner.dom.DOMUtil;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.jst.pagedesigner.parts.NodeEditPart;
-import org.eclipse.jst.pagedesigner.validation.caret.ActionData;
-import org.eclipse.jst.pagedesigner.validation.caret.DnDPositionValidator;
-import org.eclipse.jst.pagedesigner.validation.caret.DropActionData;
-import org.eclipse.jst.pagedesigner.validation.caret.IPositionMediator;
-import org.eclipse.jst.pagedesigner.validation.caret.DropActionData.DropData;
-import org.eclipse.jst.pagedesigner.viewer.DesignPosition;
-import org.eclipse.jst.pagedesigner.viewer.IDropLocationStrategy;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class DragMoveEditPolicy extends DropEditPolicy
-{
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editpolicies.AbstractEditPolicy#getCommand(org.eclipse.gef.Request)
- */
- public final Command getCommand(Request request) {
- if (!(request instanceof ChangeBoundsRequest)) {
- return null;
- }
-
- ChangeBoundsRequest r = (ChangeBoundsRequest) request;
-
- // we only support move/copy a single node.
- if (!MoveSupport.isSingleNode(r)) {
- return UnexecutableCommand.INSTANCE;
- }
-
- // the edit policy only handle at the target part, so only care about
- // the
- // target part request.
- final Object type = r.getType();
- if (type != REQ_ADD && type != REQ_CLONE && type != REQ_MOVE_CHILDREN) {
-
- return null;
- }
-
- Node draggedNode = MoveSupport.getDraggedNode(r);
- Node hostNode = ((NodeEditPart) getHost()).getIDOMNode();
-
- if (DOMUtil.isAncester(draggedNode, hostNode)) {
- return UnexecutableCommand.INSTANCE;
- }
-
- DesignPosition position = findPosition(r);
- if (position == null || !position.isValid()) {
- return null;
- }
-
- // can't move/copy into self.
- Node node = position.getContainerNode();
- if (DOMUtil.isAncester(draggedNode, node)) {
- return UnexecutableCommand.INSTANCE;
- }
-
- // ok, we are about to move/copy into the specified position.
- IDOMPosition domposition = DOMPositionHelper.toDOMPosition(position);
-
- if (REQ_CLONE.equals(type)) {
- return new CloneNodeCommand((IHTMLGraphicalViewer) getHost()
- .getViewer(), domposition, draggedNode);
- }
- return new MoveNodeCommand((IHTMLGraphicalViewer) getHost()
- .getViewer(), domposition, draggedNode);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editpolicies.AbstractEditPolicy#getTargetEditPart(org.eclipse.gef.Request)
- */
- public EditPart getTargetEditPart(Request request) {
- if (request instanceof ChangeBoundsRequest) {
- return this.getHost();
- }
- return super.getTargetEditPart(request);
- }
-
- protected final DesignPosition findPosition(DropRequest r) {
- final IPositionMediator mediator = getDropChildValidator(r);
- if (mediator == null)
- {
- return null;
- }
- final IDropLocationStrategy dropStrategy = createDropLocationStrategy(r);
- final DesignPosition position =
- dropStrategy.calculateDesignPosition(getHost(), r.getLocation(), mediator);
-
- // verify that the drop strategy has honoured it's contract that our
- // mediator be respected
- if (position != null)
- {
- if (!mediator.isValidPosition(position))
- {
- // if our mediator says no go, then veto the requestor
- // there is no drop location
- return null;
- }
- }
- return position;
- }
-
- public void showTargetFeedback(Request request)
- {
- Object type = request.getType();
- // only show feedback for these request types
- if (type == REQ_ADD || type == REQ_CLONE
- || type == REQ_MOVE_CHILDREN || type == REQ_MOVE) {
- super.showTargetFeedback(request);
- }
- }
-
- protected final IPositionMediator createDefaultDropChildValidator(DropData r)
- {
- return new DnDPositionValidator(new DropActionData(
- ActionData.COMPONENT_MOVE, r));
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/DropEditPolicy.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/DropEditPolicy.java
deleted file mode 100644
index 682243d..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/DropEditPolicy.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editpolicies;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.editpolicies.GraphicalEditPolicy;
-import org.eclipse.gef.requests.DropRequest;
-import org.eclipse.gef.requests.GroupRequest;
-import org.eclipse.jst.jsf.common.dom.TagIdentifier;
-import org.eclipse.jst.jsf.core.internal.tld.TagIdentifierFactory;
-import org.eclipse.jst.pagedesigner.editors.palette.TagToolPaletteEntry;
-import org.eclipse.jst.pagedesigner.elementedit.ElementEditFactoryRegistry;
-import org.eclipse.jst.pagedesigner.elementedit.IElementEdit;
-import org.eclipse.jst.pagedesigner.itemcreation.ItemCreationRequest;
-import org.eclipse.jst.pagedesigner.parts.NodeEditPart;
-import org.eclipse.jst.pagedesigner.validation.caret.IPositionMediator;
-import org.eclipse.jst.pagedesigner.validation.caret.DropActionData.DropData;
-import org.eclipse.jst.pagedesigner.viewer.DefaultDropLocationStrategy;
-import org.eclipse.jst.pagedesigner.viewer.DesignPosition;
-import org.eclipse.jst.pagedesigner.viewer.IDropLocationStrategy;
-
-/**
- * @author cbateman
- *
- */
-public abstract class DropEditPolicy extends GraphicalEditPolicy
-{
- private List _feedbackFigures;
-
- /**
- * @param r
- * @return a mediator that can validate valid model drops into the
- * host's edit part
- */
- protected IPositionMediator createDropChildValidator(DropRequest r)
- {
- // sub-class may override to customize the drop container validator
- return null;
- }
-
- /**
- * @param r
- * @return the appropriate design position for the drop request
- */
- protected abstract DesignPosition findPosition(DropRequest r);
-
- /**
- * @param data
- * @return a default validation mediator to be used if nothing custom is provided
- */
- protected abstract IPositionMediator createDefaultDropChildValidator(DropData data);
-
- /**
- * @param r
- * @return the validator to be used to validate the 'request' to drop
- * the edit parts specified by 'r' into this policy's host edit part
- */
- protected final IPositionMediator getDropChildValidator(DropRequest r)
- {
- IPositionMediator mediator = createDropChildValidator(r);
-
- if (mediator == null)
- {
- DropData data = createDropData(r);
-
- if (data == null)
- {
- return null;
- }
- mediator = createDefaultDropChildValidator(data);
- }
-
- return mediator;
- }
-
- /**
- * @param request
- * @return the data about the drop request
- */
- protected DropData createDropData(DropRequest request)
- {
- if (request instanceof GroupRequest)
- {
- List editParts = ((GroupRequest)request).getEditParts();
-
- // TODO: currently we only support one drop item
- if (editParts.size() > 0)
- {
- EditPart part = (EditPart) editParts.get(0);
- if (part instanceof NodeEditPart)
- {
- NodeEditPart nodePart = (NodeEditPart) part;
- TagIdentifier tagId = nodePart.getTagIdentifier();
- if (tagId != null)
- {
- List tagIds = new ArrayList();
- tagIds.add(tagId);
- return new DropData(tagIds);
- }
- }
- }
- }
- else if (request instanceof ItemCreationRequest)
- {
- TagToolPaletteEntry desc = ((ItemCreationRequest)request).getTagToolPaletteEntry();
- TagIdentifier tagId =
- TagIdentifierFactory.
- createJSPTagWrapper(desc.getURI(), desc.getTagName());
- List tagIds = new ArrayList();
- tagIds.add(tagId);
- return new DropData(tagIds);
- }
-
- return null;
- }
-
- /**
- * @param r
- * @return the drop location strategy
- */
- protected final IDropLocationStrategy createDropLocationStrategy(DropRequest r)
- {
- DropData dropData = createDropData(r);
- if (dropData != null && dropData.getTagIdentifiers().size() > 0)
- {
- // TODO: only supporting single item drop currently
- TagIdentifier tagIdentifier =
- (TagIdentifier) dropData.getTagIdentifiers().get(0);
-
- IElementEdit elementEdit =
- ElementEditFactoryRegistry.getInstance()
- .createElementEdit(tagIdentifier);
-
- // element edit not guaranteed to exist
- if (elementEdit != null)
- {
- IDropLocationStrategy strategy =
- elementEdit.getDropRequestorLocationStrategy(tagIdentifier, getHost().getViewer());
-
- if (strategy != null)
- {
- return strategy;
- }
- }
- }
-
- // by default, return the default strategy
- return new DefaultDropLocationStrategy(getHost().getViewer());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editpolicies.AbstractEditPolicy#eraseTargetFeedback(org.eclipse.gef.Request)
- */
- public void eraseTargetFeedback(Request request) {
- if (_feedbackFigures != null)
- {
- for (final Iterator it = _feedbackFigures.iterator(); it.hasNext();)
- {
- final IFigure figure = (IFigure) it.next();
-
- if (figure != null)
- {
- removeFeedback(figure);
- }
- }
-
- _feedbackFigures.clear();
- _feedbackFigures = null;
- }
- }
-
- public void showTargetFeedback(Request request)
- {
- if (request instanceof DropRequest)
- {
- DesignPosition position = findPosition((DropRequest)request);
- if (position != null) {
- // erase any prior feedback
- eraseTargetFeedback(request);
- // add figures to feedback layer and save them in _feedbackFigures
- // for later.
- _feedbackFigures = createDropLocationStrategy((DropRequest)request).showTargetFeedback(getHost(), position, (DropRequest)request);
- }
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/ElementDecoratorSquareHandle.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/ElementDecoratorSquareHandle.java
deleted file mode 100644
index 5ba2257..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/ElementDecoratorSquareHandle.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editpolicies;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.Locator;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.DragTracker;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.handles.SquareHandle;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Cursor;
-
-/**
- * A square handle for element decoration
- * @author cbateman
- *
- */
-public class ElementDecoratorSquareHandle extends SquareHandle {
-
-
- /**
- * @param owner
- * @param loc
- * @param c
- */
- public ElementDecoratorSquareHandle(GraphicalEditPart owner, Locator loc,
- Cursor c) {
- super(owner, loc, c);
- }
- /**
- * @param owner
- * @param loc
- */
- public ElementDecoratorSquareHandle(GraphicalEditPart owner, Locator loc) {
- super(owner, loc);
- }
- protected DragTracker createDragTracker() {
- return null;
- }
- protected Color getBorderColor() {
- return ColorConstants.black;
- }
-
- protected Color getFillColor()
- {
- return ColorConstants.white;
- }
-
- /**
- * @return the transparency alpha channel (0-255)
- */
- protected int getAlpha()
- {
- return 255;
- }
-
- /**
- * Draws the handle with fill color and outline color dependent
- * on the primary selection status of the owner editpart.
- *
- * @param g The graphics used to paint the figure.
- */
- public void paintFigure(Graphics g) {
- Rectangle r = getBounds();
- r.shrink(1, 1);
- try {
- g.setBackgroundColor(getFillColor());
- g.setAlpha(getAlpha());
- g.fillRectangle(r.x, r.y, r.width, r.height);
- g.setForegroundColor(getBorderColor());
- g.drawRectangle(r.x, r.y, r.width, r.height);
- } finally {
- //We don't really own rect 'r', so fix it.
- r.expand(1, 1);
- }
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/ElementMenuBar.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/ElementMenuBar.java
deleted file mode 100644
index ee61b03..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/ElementMenuBar.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-/**
- *
- */
-package org.eclipse.jst.pagedesigner.editpolicies;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.gef.EditPart;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jst.pagedesigner.parts.ElementEditPart;
-import org.eclipse.jst.pagedesigner.parts.NonVisualComponentEditPart;
-
-/**
- * A menu bar for a specific element edit part
- *
- * @author cbateman
- *
- */
-public class ElementMenuBar extends Figure implements ISelectionProvider, ISelectionChangedListener
-{
- private ElementEditPart _hostPart;
- /**
- * Should always be accessed for use through getChildParts(). Not automatically
- * allocated because of high probability that a host part will have no children of interest
- */
- private Set _childParts;
- private List _selectionListeners;
- private IStructuredSelection _selection;
-
- /**
- * @param hostPart
- */
- public ElementMenuBar(ElementEditPart hostPart)
- {
- hostPart.getViewer().addSelectionChangedListener(this);
-
- _hostPart = hostPart;
- ToolbarLayout layout = new ToolbarLayout(false);
- layout.setSpacing(4);
- setLayoutManager(layout);
- }
-
- /**
- * @return true if there are child parts in the menu
- */
- public boolean hasChildParts()
- {
- return _childParts != null &&_childParts.size() > 0;
- }
-
- /**
- *
- */
- public void dispose()
- {
- _hostPart.getViewer().removeSelectionChangedListener(this);
- if (_childParts != null)
- {
- _childParts.clear();
- _childParts = null;
- }
-
- if (_selectionListeners != null)
- {
- _selectionListeners.clear();
- _selectionListeners = null;
- }
-
- _selection = null;
- }
-
- /**
- * @param editpart
- */
- public void addNonVisualChild(NonVisualComponentEditPart editpart)
- {
- add(editpart.getFigure());
- getChildParts().add(editpart);
- }
-
- /**
- * Removes editpart from the list of non-visual edit parts that this menu
- * bar is managing the visuals for.
- * @param editpart
- */
- public void removeNonVisualChild(final NonVisualComponentEditPart editpart)
- {
- // TODO: I have relaxed the checking to see if editpart is valid
- // child because of the way ElementEditPart refreshes itself
- // when the model changes. It's possible this will get called more
- // than once for the same editpart argument
- getChildParts().remove(editpart);
- if (editpart.getFigure().getParent() == this)
- {
- remove(editpart.getFigure());
- }
- }
-
- /**
- * @return true if a member of the menu bar has edit part focus
- */
- public boolean hasEditPartFocus()
- {
- for (Iterator it = getChildParts().iterator(); it.hasNext();)
- {
- EditPart editPart = (EditPart) it.next();
-
- if (editPart.getSelected() == EditPart.SELECTED_PRIMARY)
- {
- return true;
- }
- }
- return false;
- }
-
- private Set getChildParts()
- {
- if (_childParts == null)
- {
- _childParts = new HashSet();
- }
-
- return _childParts;
- }
-
- protected void paintChildren(Graphics graphics)
- {
- // force all children to paint with my alpha setting
- graphics.setAlpha(getAlpha());
- //push the current state so it is what the children revert to
- graphics.pushState();
- super.paintChildren(graphics);
- // pop that state we pushed above
- graphics.popState();
- }
-
- private int getAlpha()
- {
- return isEnabled() ? 255 : 75;
- }
-
- public void addSelectionChangedListener(ISelectionChangedListener listener) {
- List listeners = getSelectionListeners();
-
- if (!listeners.contains(listener))
- {
- listeners.add(listener);
- }
- }
-
- public ISelection getSelection() {
- return _selection;
- }
-
- public void removeSelectionChangedListener(
- ISelectionChangedListener listener) {
- getSelectionListeners().remove(listener);
- }
-
- public void setSelection(ISelection selection) {
- // no external selection change supported
- }
-
- private List getSelectionListeners()
- {
- if (_selectionListeners == null)
- {
- _selectionListeners = new ArrayList(1);
- }
-
- return _selectionListeners;
- }
-
- private void fireSelectionChanged()
- {
- for (final Iterator it = _selectionListeners.iterator(); it.hasNext();)
- {
- ISelectionChangedListener listener = (ISelectionChangedListener) it.next();
- listener.selectionChanged(new SelectionChangedEvent(this, _selection));
- }
- }
-
- public void selectionChanged(SelectionChangedEvent event) {
- ISelection selection = event.getSelection();
-
- if (selection instanceof IStructuredSelection)
- {
- // the number of selections we care about will be no bigger than the total number of selections
- final List mySelections = new ArrayList(((IStructuredSelection)selection).size());
-
- if (_childParts != null)
- {
- for (final Iterator it = ((IStructuredSelection)selection).iterator()
- ; it.hasNext();)
- {
- Object selectedObj = it.next();
- if (_childParts.contains(selectedObj))
- {
- mySelections.add(selectedObj);
- }
- }
- }
-
- _selection = new StructuredSelection(mySelections);
-
- fireSelectionChanged();
- }
- }
-}
\ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/ElementResizableEditPolicy.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/ElementResizableEditPolicy.java
deleted file mode 100644
index 7109d86..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/ElementResizableEditPolicy.java
+++ /dev/null
@@ -1,493 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editpolicies;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.PrecisionRectangle;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.DragTracker;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.LayerConstants;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.SharedCursors;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.ResizableEditPolicy;
-import org.eclipse.gef.handles.NonResizableHandleKit;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gef.requests.LocationRequest;
-import org.eclipse.gef.requests.SelectionRequest;
-import org.eclipse.gef.tools.SelectEditPartTracker;
-import org.eclipse.jst.pagedesigner.commands.single.ChangeStyleCommand;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.layout.BlockBox;
-import org.eclipse.jst.pagedesigner.css2.layout.CSSFigure;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.eclipse.jst.pagedesigner.parts.ElementEditPart;
-import org.eclipse.jst.pagedesigner.parts.NodeEditPart;
-import org.eclipse.jst.pagedesigner.requests.LocationModifierRequest;
-import org.eclipse.jst.pagedesigner.tools.ObjectModeDragTracker;
-import org.eclipse.jst.pagedesigner.tools.RangeDragTracker;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class ElementResizableEditPolicy extends ResizableEditPolicy implements IEnhancedSelectionEditPolicy
-{
- private static final Insets INSETS_1 = new Insets(1, 1, 1, 1);
-
- private static final int THRESHHOLD = 3;
-
- // the number of pixels to offset the top left of tooltop feedback
- // below the current mouse cursor location
- private static final int TOOLTIP_VERTICAL_OFFSET = 25;
-
- private static final Insets INSETS_CONST = new Insets(THRESHHOLD,
- THRESHHOLD, THRESHHOLD, THRESHHOLD);
-
- private boolean _showLabelFeedback = true;
-
- private IFigure[] _hoverFeedbackFigure;
-
- //private NonVisualChildDecorator _selectionDecoratorNorthWest; // = null;
- private MouseSelectableChildDecorator _nonVisualChildDecorator; // = null;
-
- private final static Color HOVER_FEEDBACK_COLOR = ColorConstants.blue;
-
- public void deactivate()
- {
- super.deactivate();
- if (_nonVisualChildDecorator != null)
- {
- _nonVisualChildDecorator.dispose();
- _nonVisualChildDecorator = null;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editpolicies.AbstractEditPolicy#showTargetFeedback(org.eclipse.gef.Request)
- */
- public void showTargetFeedback(Request request) {
- if (RequestConstants.REQ_SELECTION_HOVER.equals(request.getType())) {
- if (_hoverFeedbackFigure != null) {
- for (int i = 0; i < _hoverFeedbackFigure.length; i++) {
- removeFeedback(_hoverFeedbackFigure[i]);
- }
- _hoverFeedbackFigure = null;
- }
-
- // <gripe>this is what I hate about GEF, if it's a location dependent
- // request why aren't we guaranteed a LocationRequest?!
- // even GEF interal code protects casts by checking getType()
- // rather than an instanceof!</gripe>
- Assert.isTrue(request instanceof LocationRequest);
- // don't show tooltip if drag is active
- _showLabelFeedback = !((NodeEditPart)getHost()).isDragActive();
- _hoverFeedbackFigure = showHoverFeedback((LocationRequest)request);
- } else {
- super.showTargetFeedback(request);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editpolicies.AbstractEditPolicy#eraseTargetFeedback(org.eclipse.gef.Request)
- */
- public void eraseTargetFeedback(Request request) {
- if (RequestConstants.REQ_SELECTION_HOVER.equals(request.getType())) {
- if (_hoverFeedbackFigure != null) {
- for (int i = 0; i < _hoverFeedbackFigure.length; i++) {
- removeFeedback(_hoverFeedbackFigure[i]);
- }
- _hoverFeedbackFigure = null;
- getNonVisualChildDecorator().updateState(MouseSelectableChildDecorator.EVENT_HOST_HOVER_LOST);
- }
- } else {
- super.eraseTargetFeedback(request);
- }
- }
-
- /**
- * @param request
- */
- private IFigure[] showHoverFeedback(LocationRequest request) {
- if (!shouldUseObjectMode(request) && !isStyleTags(getHost())) {
- return null;
- }
-
- final IFigure figure = this.getHostFigure();
- Rectangle[] rects;
- if (figure instanceof CSSFigure) {
- rects = ((CSSFigure) figure).getFragmentsBounds();
- } else {
- rects = new Rectangle[] { figure.getBounds() };
- }
- int figureSize = rects.length;
-
- if (_showLabelFeedback)
- {
- figureSize++;
- }
-
- IFigure[] figures = new IFigure[figureSize];
- for (int i = 0; i < rects.length; i++) {
- RectangleFigure fig = new RectangleFigure();
- fig.setFill(false);
- fig.setOutline(true);
- fig.setLineWidth(1);
- fig.setForegroundColor(HOVER_FEEDBACK_COLOR);
- addFeedback(fig);
-
- Rectangle r = rects[i].getCopy();
- figure.translateToAbsolute(r);
- fig.translateToRelative(r);
- fig.setBounds(r);
-
- figures[i] = fig;
- }
-
- if (_showLabelFeedback)
- {
- getNonVisualChildDecorator().updateState(MouseSelectableChildDecorator.EVENT_HOST_HOVER_RECEIVED);
-
- BasicLabelToolTip label = new BasicLabelToolTip(getTooltipText());
- addFeedback(label);
-
- // use mouse cursor plus an offset so the tooltip doesn't
- // appear z-ordered below the mouse cursor
- AbsolutePointLocator locator = AbsolutePointLocator.getInstance();
- locator.setReferencePoint(request.getLocation(), 0, TOOLTIP_VERTICAL_OFFSET);
- // to avoid enlargemeent of the feedback layer
- locator.setIntersectFigure(getFeedbackLayer());
- locator.relocate(label);
- figures[rects.length] = label;
- }
- return figures;
- }
-
- private String getTooltipText() {
- Element element = (Element) this.getHost().getModel();
- StringBuffer text = new StringBuffer(element.getTagName());
- return text.toString();
- }
-
- private boolean isStyleTags(EditPart part) {
- if (part != null && part.getModel() instanceof Node) {
- return EditModelQuery.HTML_STYLE_NODES.contains(((Node) part
- .getModel()).getNodeName());
- }
- return false;
- }
- private MouseSelectableChildDecorator getNonVisualChildDecorator()
- {
- if (_nonVisualChildDecorator == null)
- {
- _nonVisualChildDecorator =
- new MouseSelectableChildDecorator((GraphicalEditPart)getHost()
- , PositionConstants.NORTH_EAST
- , getLayer(LayerConstants.FEEDBACK_LAYER)
- , getLayer(LayerConstants.HANDLE_LAYER));
- }
- return _nonVisualChildDecorator;
- }
-
- /**
- * @param request
- * @return true if we should be using object mode for this request
- */
- public boolean shouldUseObjectMode(Request request) {
- ElementEditPart part = (ElementEditPart) this.getHost();
- if (isStyleTags(part)) {
- return false;
- }
- if (part.isWidget()
- || (!part.canHaveDirectTextChild() && !part
- .haveNonWhitespaceTextChild())) {
- return true;
- }
- if (request instanceof SelectionRequest
- && ((SelectionRequest) request).isControlKeyPressed()) {
- return true;
- }
- if (request instanceof LocationModifierRequest
- && ((LocationModifierRequest) request).isControlKeyPressed()) {
- return true;
- }
-
- // for other elements
- if (request instanceof LocationRequest) {
- Point location = ((LocationRequest) request).getLocation()
- .getCopy();
- part.getFigure().translateToRelative(location);
- return shouldUseObjectMode(location);
- }
- return false; // should not happen
- }
-
- /**
- * @param location
- * @return
- */
- private boolean shouldUseObjectMode(Point location) {
- // when the location is close to the border/padding of the element, then
- // we think it is default to
- // object mode selection.
- CSSFigure figure = (CSSFigure) this.getHostFigure();
- if (figure.getFragmentsBounds().length != 1) {
- return false;
- }
- Rectangle bounds = figure.getBounds().getCopy();
- Insets insets = figure.getInsets();
- bounds.crop(insets);
- if (insets.top > THRESHHOLD && insets.left > THRESHHOLD
- && insets.right > THRESHHOLD && insets.bottom > THRESHHOLD) {
- return !bounds.contains(location);
- }
-
- // since the figure insets could be 0, so we expand it a little, thus
- // even the point is
- // a little inside the content area, we still think it is selection the
- // object.
- if (bounds.height < 3 * THRESHHOLD || bounds.width < 3 * THRESHHOLD) {
- bounds.crop(INSETS_1);
- } else {
- bounds.crop(INSETS_CONST);
- }
- return !bounds.contains(location);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editpolicies.ResizableEditPolicy#createSelectionHandles()
- */
- protected List createSelectionHandles() {
- // we have three different kinds of handles.
- // 1. Those element that is resizable.
- // 2. Those element that is rectangle but not resizable.
- // 3. Those element that is not rectangle (fragments)
-
- IFigure figure = this.getHostFigure();
- if (figure instanceof CSSFigure && getHost() instanceof ElementEditPart) {
- CSSFigure cssfigure = (CSSFigure) figure;
- List fragments = cssfigure.getFragmentsForRead();
-
- // XXX: only one fragment and is blockbox, then we think it is
- // resizable by figure
- // should move this test to somewhere else.
- if (fragments != null && fragments.size() == 1
- && fragments.get(0) instanceof BlockBox) {
- if (((ElementEditPart) getHost()).isResizable()) {
- // super is Resizable policy, will create a resize handles.
- return super.createSelectionHandles();
- }
- return createNonResizeHandles();
- }
- return createFragmentsHandles();
- }
- // second case
- return createNonResizeHandles();
- }
-
- /**
- * @return
- */
- private List createFragmentsHandles() {
- List list = new ArrayList();
- list.add(new FragmentHandle((GraphicalEditPart) getHost()));
- return list;
- }
-
- /**
- * @return
- */
- private List createNonResizeHandles() {
- // following code copied from NonResizableEditPolicy
- List list = new ArrayList();
- if (isDragAllowed()) {
- NonResizableHandleKit.addHandles((GraphicalEditPart) getHost(),
- list);
- } else {
- NonResizableHandleKit.addHandles((GraphicalEditPart) getHost(),
- list, new SelectEditPartTracker(getHost()),
- SharedCursors.ARROW);
- }
-
- return list;
- }
-
-
- protected void hideSelection() {
- super.hideSelection();
- // handle removing the menu bar handle separately because it will decide
- // when to remove itself (not removeSelectionHandles)
- getNonVisualChildDecorator().updateState(MouseSelectableChildDecorator.EVENT_HOST_SELECTION_LOST);
-
- }
-
- protected void showSelection() {
- super.showSelection();
- // handle adding the menu bar handle separately because it will decide
- // when to remove itself (not removeSelectionHandles
- getNonVisualChildDecorator().updateState(MouseSelectableChildDecorator.EVENT_HOST_SELECTION_RECEIVED);
- }
-
- /**
- * child class could override this method.
- *
- * @param element
- * @param width
- * @param height
- * @return the resize command or null if none
- */
- protected Command getResizeCommand(IDOMElement element, int width,
- int height) {
- Map map = new HashMap();
- if (width > 0) {
- map.put("width", width + "px");
- }
- if (height > 0) {
- map.put("height", height + "px");
- }
- if (!map.isEmpty()) {
- return new ChangeStyleCommand(element, map);
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editpolicies.ResizableEditPolicy#getResizeCommand(org.eclipse.gef.requests.ChangeBoundsRequest)
- */
- protected Command getResizeCommand(ChangeBoundsRequest request) {
- ElementEditPart part = (ElementEditPart) this.getHost();
-
- Rectangle rect = part.getFigure().getBounds();
- rect = request.getTransformedRectangle(rect);
- int width = rect.width;
- int height = rect.height;
-
- // since the user dragged rectangle included border/padding of the
- // element. And if the element's
- // width/height style setting don't include border padding, then we need
- // to set the element's width/height
- // style property a little smaller.
- if (part.getFigure() instanceof CSSFigure) {
- CSSFigure cssfigure = (CSSFigure) part.getFigure();
- ICSSStyle style = cssfigure.getCSSStyle();
- if (style != null && !style.isSizeIncludeBorderPadding()) {
- width -= (style.getBorderInsets().getWidth() + style
- .getPaddingInsets().getWidth());
- height -= (style.getBorderInsets().getHeight() + style
- .getPaddingInsets().getHeight());
- }
- }
-
- //make sure to only change the dimensions for the direction of the resize request.
- int resizeDirection = request.getResizeDirection();
- switch (resizeDirection) {
- case PositionConstants.EAST:
- case PositionConstants.WEST:
- //resizing, only the width, so set the height to -1;
- height = -1;
- break;
- case PositionConstants.NORTH:
- case PositionConstants.SOUTH:
- //resizing only the height, so set the width to -1
- width = -1;
- break;
- default:
- //all others are changing both directions...
- }
- return getResizeCommand((IDOMElement) part.getIDOMNode(), width, height);
- }
-
- /**
- * Shows or updates feedback for a change bounds request.
- *
- * @param request
- * the request
- */
- protected void showChangeBoundsFeedback(ChangeBoundsRequest request) {
- IFigure feedback = getDragSourceFeedbackFigure();
-
- PrecisionRectangle rect = new PrecisionRectangle(
- getInitialFeedbackBounds().getCopy());
- getHostFigure().translateToAbsolute(rect);
- rect.translate(request.getMoveDelta());
- rect.resize(request.getSizeDelta());
-
- // to avoid enlarge feedback pane.
- // when draging a editpart inside designer to move/copy it, we do not
- // want to
- // enlarge the canvas, since that may resulting in relayout.
- rect = (PrecisionRectangle) rect.intersect(getFeedbackLayer()
- .getBounds());
-
- feedback.translateToRelative(rect);
- feedback.setBounds(rect);
- }
-
- public Cursor getSelectionToolCursor(Point mouseLocation) {
- // by default return null to indicate system default.
- // sub-classes should override to customize
- return null;
- }
-
- /**
- * by default, return null
- * sub-classes should override to customize
- * @param request
- * @return the selectin tracker
- */
- protected DragTracker getSelectionTracker(LocationRequest request)
- {
- return null;
- }
-
- public DragTracker getSelectionDragTracker(LocationRequest request)
- {
- if (org.eclipse.jst.pagedesigner.requests.PageDesignerRequestConstants.REQ_SELECTION_TRACKER.equals(request.getType())){
- return getSelectionTracker(request);
- }
-
- // be default don't specify a selection drag tracker
- // sub-classes should override to customize
- if (shouldUseObjectMode(request)) {
- return new ObjectModeDragTracker(getHost());
- }
- return new RangeDragTracker(getHost());
-
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/FragmentCornerHandle.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/FragmentCornerHandle.java
deleted file mode 100644
index ad3bd87..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/FragmentCornerHandle.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editpolicies;
-
-import org.eclipse.gef.DragTracker;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.handles.SquareHandle;
-import org.eclipse.jst.pagedesigner.tableedit.EmptyLocator;
-
-/**
- * A Handle used to mark the fragment.
- */
-public class FragmentCornerHandle extends SquareHandle {
- FragmentCornerHandle(GraphicalEditPart owner) {
- super(owner, new EmptyLocator());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.handles.AbstractHandle#createDragTracker()
- */
- protected DragTracker createDragTracker() {
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/FragmentHandle.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/FragmentHandle.java
deleted file mode 100644
index 5efd984..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/FragmentHandle.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editpolicies;
-
-import java.util.List;
-
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.LineBorder;
-import org.eclipse.draw2d.Locator;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.PrecisionRectangle;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.DragTracker;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Handle;
-import org.eclipse.gef.handles.AbstractHandle;
-import org.eclipse.gef.tools.DragEditPartsTracker;
-import org.eclipse.jst.pagedesigner.css2.layout.CSSFigure;
-import org.eclipse.jst.pagedesigner.css2.layout.FlowBox;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class FragmentHandle extends AbstractHandle implements Handle {
- /**
- * @param owner
- */
- public FragmentHandle(GraphicalEditPart owner) {
- super(owner, new FragmentLocator());
- this.setOpaque(false);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.draw2d.IFigure#paint(org.eclipse.draw2d.Graphics)
- */
- public void paint(Graphics graphics) {
- graphics.setClip(this.getBounds().getCopy().expand(7, 7));
- super.paint(graphics);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.handles.AbstractHandle#createDragTracker()
- */
- protected DragTracker createDragTracker() {
- DragEditPartsTracker tracker = new DragEditPartsTracker(getOwner());
- tracker.setDefaultCursor(getCursor());
- return tracker;
- }
-
- private void refresh() {
-
- // set the bounds of this figure, so it could cover all children.
- bounds = getOwnerFigure().getBounds();
- bounds = new PrecisionRectangle(bounds.getResized(-1, -1));
- getOwnerFigure().translateToAbsolute(bounds);
- this.translateToRelative(bounds);
- this.setBounds(bounds);
-
- this.removeAll();
- // ok, recreate all children.
- CSSFigure cssfigure = (CSSFigure) getOwner().getFigure();
- List fragments = cssfigure.getFragmentsForRead();
- for (int i = 0, size = fragments.size(); i < size; i++) {
- // the rectangle.
- Figure childFigure = new BorderFigure();
- childFigure.setBorder(new LineBorder(1));
- this.add(childFigure);
-
- FlowBox box = (FlowBox) fragments.get(i);
- Rectangle rect = new Rectangle(box.getX(), box.getY(), box.getWidth(), box
- .getHeight());
- cssfigure.translateToAbsolute(rect);
-
- childFigure.translateToRelative(rect);
- childFigure.setBounds(rect);
-
- createCornerHandles(cssfigure, box);
- }
- }
-
- /**
- *
- */
- private void createCornerHandles(CSSFigure reference, FlowBox referencebox) {
- createHandle(reference, referencebox, PositionConstants.SOUTH_EAST);
- createHandle(reference, referencebox, PositionConstants.SOUTH_WEST);
- createHandle(reference, referencebox, PositionConstants.NORTH_WEST);
- createHandle(reference, referencebox, PositionConstants.NORTH_EAST);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.draw2d.IFigure#containsPoint(int, int)
- */
- public boolean containsPoint(int x, int y) {
- List children = this.getChildren();
- for (int i = 0, n = children.size(); i < n; i++) {
- if (((IFigure) children.get(i)).containsPoint(x, y)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * @param north_east
- */
- private void createHandle(CSSFigure reference, FlowBox referencebox,
- int location) {
- double relativeX, relativeY;
- switch (location & PositionConstants.NORTH_SOUTH) {
- case PositionConstants.NORTH:
- relativeY = 0;
- break;
- case PositionConstants.SOUTH:
- relativeY = 1.0;
- break;
- default:
- relativeY = 0.5;
- }
-
- switch (location & PositionConstants.EAST_WEST) {
- case PositionConstants.WEST:
- relativeX = 0;
- break;
- case PositionConstants.EAST:
- relativeX = 1.0;
- break;
- default:
- relativeX = 0.5;
- }
-
- FragmentCornerHandle target = new FragmentCornerHandle(getOwner());
- this.add(target);
-
- // for corner small box.
- Rectangle targetBounds = new Rectangle(referencebox.getX(),
- referencebox.getY(), referencebox.getWidth(), referencebox
- .getHeight());
- targetBounds = new PrecisionRectangle(targetBounds);
- reference.translateToAbsolute(targetBounds);
- target.translateToRelative(targetBounds);
- // targetBounds.resize(1, 1);
-
- Dimension targetSize = target.getPreferredSize();
-
- targetBounds.x += (int) (targetBounds.width * relativeX - ((targetSize.width + 1) / 2));
- targetBounds.y += (int) (targetBounds.height * relativeY - ((targetSize.height + 1) / 2));
- targetBounds.setSize(targetSize);
- target.setBounds(targetBounds);
- }
-
- static class FragmentLocator implements Locator {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.draw2d.Locator#relocate(org.eclipse.draw2d.IFigure)
- */
- public void relocate(IFigure target) {
- ((FragmentHandle) target).refresh();
- }
- }
-
- static class BorderFigure extends Figure {
- /**
- * the bounds padding
- */
- public static final int INNER_PAD = 2;
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.draw2d.IFigure#containsPoint(int, int)
- */
- public boolean containsPoint(int x, int y) {
- if (!super.containsPoint(x, y))
- return false;
- return !Rectangle.SINGLETON.setBounds(getBounds()).shrink(
- INNER_PAD, INNER_PAD).contains(x, y);
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/IEnhancedSelectionEditPolicy.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/IEnhancedSelectionEditPolicy.java
deleted file mode 100644
index 779762b..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/IEnhancedSelectionEditPolicy.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editpolicies;
-
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.DragTracker;
-import org.eclipse.gef.requests.LocationRequest;
-import org.eclipse.swt.graphics.Cursor;
-
-/**
- * Allows a selection edit policy to specify extra capabilities
- *
- * @author cbateman
- */
-public interface IEnhancedSelectionEditPolicy
-{
- /**
- * @param mouseLocation
- * @return the cursor that should be displayed when a selection tool
- * enters the hit box (mouses over) of an edit part but no selection
- * or drag operations have occurred yet. Null indicates the caller should
- * use whatever default it deems appropriate.
- */
- Cursor getSelectionToolCursor(Point mouseLocation);
-
- /**
- * @param request
- * @param mouseLocator
- * @return a drag tracker to be used when the mouse moves over a certain
- * location and mouse state is in initial state or null if the policy
- * doesn't wish to customize this. This allows an edit part
- * to customize what drag tracker is used depending on where the mouse is positioned
- * on its figure.
- */
- DragTracker getSelectionDragTracker(LocationRequest request);
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/ITableEditAdapter.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/ITableEditAdapter.java
deleted file mode 100644
index 0795c8a..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/ITableEditAdapter.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editpolicies;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public interface ITableEditAdapter {
- /**
- * @return the column count
- */
- public int getColumnCount();
-
- /**
- * @return the row count
- */
- public int getRowCount();
-
- /**
- * @param atPosition
- */
- public void insertColumn(int atPosition);
-
- /**
- * @param rowPosition
- */
- public void insertRow(int rowPosition);
-
- /**
- * @param columnIndex
- * @return the starting point for resize
- */
- public int getColumnResizeStart(int columnIndex);
-
- /**
- * @return the resize width
- */
- public int getColumnResizeWidth();
-
- /**
- * @param columnIndex
- * @return column start
- */
- public int getColumnStart(int columnIndex);
-
- /**
- * @param columnIndex
- * @return the column width
- */
- public int getColumnWidth(int columnIndex);
-
- /**
- * @param rowIndex
- * @return the row start
- */
- public int getRowStart(int rowIndex);
-
- /**
- * @param rowIndex
- * @return the row height
- */
- public int getRowHeight(int rowIndex);
-
- /**
- * @param rowIndex
- * @return starting point of the row resize
- */
- public int getRowResizeStart(int rowIndex);
-
- /**
- * @return the row resize width
- */
- public int getRowResizeWidth();
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/JSFDropEditPolicy.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/JSFDropEditPolicy.java
deleted file mode 100644
index 0b36919..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/JSFDropEditPolicy.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editpolicies;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.GraphicalEditPolicy;
-import org.eclipse.jst.pagedesigner.commands.PDDropRequest;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- */
-public class JSFDropEditPolicy extends GraphicalEditPolicy {
- String _attrName;
-
- /**
- * @param attrname
- */
- public JSFDropEditPolicy(String attrname) {
- _attrName = attrname;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editpolicies.AbstractEditPolicy#getTargetEditPart(org.eclipse.gef.Request)
- */
- public EditPart getTargetEditPart(Request request) {
- if (request instanceof PDDropRequest) {
- return getHost();
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editpolicies.AbstractEditPolicy#getCommand(org.eclipse.gef.Request)
- */
- public Command getCommand(Request request) {
- if (request instanceof PDDropRequest) {
- PDDropRequest r = (PDDropRequest) request;
- final String s = (String) r.getCurrentEvent().data;
- return new Command() {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.commands.Command#execute()
- */
- public void execute() {
- // XXX: should check whether alreayd set the attribute,
- // maybe
- // should also popup dialog etc.
- ((Element) getHost().getModel()).setAttribute(_attrName, s);
- }
- };
- }
-
- return super.getCommand(request);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editpolicies.AbstractEditPolicy#eraseTargetFeedback(org.eclipse.gef.Request)
- */
- public void eraseTargetFeedback(Request request) {
- //
- super.eraseTargetFeedback(request);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editpolicies.AbstractEditPolicy#showTargetFeedback(org.eclipse.gef.Request)
- */
- public void showTargetFeedback(Request request) {
- super.showTargetFeedback(request);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/LinkEditPolicy.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/LinkEditPolicy.java
deleted file mode 100644
index ad222be..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/LinkEditPolicy.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editpolicies;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.GraphicalEditPolicy;
-import org.eclipse.jst.pagedesigner.actions.link.LinkRequest;
-import org.eclipse.jst.pagedesigner.actions.link.MakeLinkCommand;
-import org.eclipse.jst.pagedesigner.parts.TextEditPart;
-import org.eclipse.jst.pagedesigner.viewer.DesignRange;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class LinkEditPolicy extends GraphicalEditPolicy {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.EditPolicy#getCommand(org.eclipse.gef.Request)
- */
- public Command getCommand(Request request) {
- EditPart part = this.getHost();
- IHTMLGraphicalViewer viewer = null;
- if (part instanceof TextEditPart) {
- //TODO: ?? part = (TextEditPart) part;
- viewer = (IHTMLGraphicalViewer) part.getViewer();
- }
- if (request instanceof LinkRequest) {
- LinkRequest req = (LinkRequest) request;
- String identifier = req.getIdentifier();
- DesignRange range = req.getDesignRange();
- // TODO: when part !instancof TextEditPart, viewer == null
- Command command = new MakeLinkCommand(identifier, viewer, part,
- range);
- return command;
- }
- return super.getCommand(request);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/LocationHelper.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/LocationHelper.java
deleted file mode 100644
index b6e09fe..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/LocationHelper.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editpolicies;
-
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.jst.pagedesigner.css2.layout.FlowBox;
-import org.eclipse.jst.pagedesigner.css2.layout.ICSSFigure;
-import org.eclipse.jst.pagedesigner.parts.DocumentEditPart;
-import org.eclipse.jst.pagedesigner.parts.ElementEditPart;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- */
-public final class LocationHelper {
- /**
- * @param host
- * @param p
- * @param result
- * @param tagName
- * @param skip
- * @return true if insertion point is found
- */
- public static boolean findInsertLocation(GraphicalEditPart host, Point p,
- GraphicalEditPart[] result, String tagName, Node skip) {
- if (isHostInsideSkip(host, skip))
- return false;
-
- while (isValidHost(host) && !canHostContainTag(host, tagName)) {
- if (host.getParent() instanceof GraphicalEditPart)
- host = (GraphicalEditPart) host.getParent();
- else
- host = null;
- }
- if (!isValidHost(host))
- return false;
-
- // ok, next we try to find a insertion point inside host
- result[0] = host;
- List children = host.getChildren();
- if (children.isEmpty()) {
- result[1] = null;
- return true;
- }
- // TODO: never read GraphicalEditPart ref = null;
- for (int i = 0, size = children.size(); i < size; i++) {
- GraphicalEditPart child = (GraphicalEditPart) children.get(i);
- Rectangle rect = getAbsoluteBounds(child);
-
- if (rect.contains(p)) {
- IFigure figure = child.getFigure();
- if (figure instanceof ICSSFigure) {
- List frags = ((ICSSFigure) figure).getFragmentsForRead();
- if (frags.size() > 1) // more than one frags, so is a zig
- // zag.
- {
- // check whether is before the first box.
- FlowBox box = (FlowBox) frags.get(0);
- Rectangle rect1 = getAbsoluteBounds(figure, box);
- if (rect1.x > p.x && rect1.y + rect1.height > p.y) {
- // p is at left/above the first box. so we think p
- // is before this child
- result[1] = child;
- return true;
- }
- // check whether is after the last box
- box = (FlowBox) frags.get(frags.size() - 1);
- rect1 = getAbsoluteBounds(figure, box);
- if (rect1.x < p.x && rect1.y < p.y) {
- continue;
- }
- }
- }
- // ok, treat as the point in a rect figure, see which side is
- // closer.
- if (p.x > rect.x + rect.width / 2) {
- continue;
- }
- result[1] = child;
- return true;
- } else if (rect.x + rect.width < p.x || rect.y + rect.height < p.y) {
- // p is at right or below rect. so the point is "after" the
- // rect.
- continue;
- } else {
- // ok, p is "before" rect.
- result[1] = child;
- return true;
- }
- }
- // we search through all.
- result[1] = null;
- return true;
- }
-
- /**
- * @param figure
- * @param box
- * @return the bounding rectangle
- */
- public static Rectangle getAbsoluteBounds(IFigure figure, FlowBox box) {
- Rectangle r = new Rectangle(box.getX(), box.getY(), box.getWidth(), box
- .getHeight());
- figure.translateToAbsolute(r);
- return r;
- }
-
- /**
- * @param child
- * @return the bounding rectangle
- */
- public static Rectangle getAbsoluteBounds(GraphicalEditPart child) {
- Rectangle bounds = child.getFigure().getBounds().getCopy();
- child.getFigure().translateToAbsolute(bounds);
- return bounds;
- }
-
- /**
- * @param host
- * @param tagName
- * @return
- */
- private static boolean canHostContainTag(GraphicalEditPart host,
- String tagName) {
- if (host == null)
- return false;
- Node node = (Node) host.getModel();
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- ModelQuery modelQuery = getModelQuery(node);
- if (modelQuery != null) {
- CMElementDeclaration elementDecl = modelQuery
- .getCMElementDeclaration((Element) node);
- if (elementDecl == null) {
- return true;
- }
- if (elementDecl.getContentType() == CMElementDeclaration.EMPTY)
- return false;
- }
- }
- return true;
- }
-
- /**
- * @param host
- * @return
- */
- private static boolean isValidHost(GraphicalEditPart host) {
- return host != null
- && (host instanceof ElementEditPart || host instanceof DocumentEditPart);
- }
-
- /**
- * @param host
- * @param skip
- * @return
- */
- private static boolean isHostInsideSkip(GraphicalEditPart host, Node skip) {
- if (skip == null)
- return false;
-
- // XXX: not done.
- return false;
- }
-
- private static ModelQuery getModelQuery(Node node) {
- Document doc = node.getOwnerDocument();
-
- if (node.getNodeType() == Node.DOCUMENT_NODE) {
- doc = (Document) node;
- }
- return ModelQueryUtil.getModelQuery(doc);
- }
-
- private LocationHelper()
- {
- // util class, no external instantiation
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/MouseSelectableChildDecorator.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/MouseSelectableChildDecorator.java
deleted file mode 100644
index 0da7f9b..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/MouseSelectableChildDecorator.java
+++ /dev/null
@@ -1,627 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-/**
- *
- */
-package org.eclipse.jst.pagedesigner.editpolicies;
-
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Locator;
-import org.eclipse.draw2d.MouseEvent;
-import org.eclipse.draw2d.MouseListener;
-import org.eclipse.draw2d.MouseMotionListener;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.PrecisionRectangle;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.parts.ElementEditPart;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * A child decorator that supports mouse selection
- *
- * @author cbateman
- *
- */
-class MouseSelectableChildDecorator extends NonVisualChildDecorator
-{
- // no visual or affordance showing
- private static final int STATE_START = 0;
-
- // the host is showing hover feedback, but is not selected
- private static final int STATE_HOST_HOVER = 1;
-
- // the host has primary selection
- private static final int STATE_HOST_SELECTED = 2;
-
- // the selection handle for the decorator has mouse hover
- private static final int STATE_HANDLE_HOVER = 3;
-
- // the selection handle has been selected (is showing)
- private static final int STATE_HANDLE_MENU_BAR_SHOWING = 4;
-
- // the menu bar has hover
- private static final int STATE_HANDLE_MENU_BAR_HOVER = 5;
-
- // the menu bar has primary selection
- private static final int STATE_HANDLE_MENU_BAR_SELECTED = 6;
-
- /**
- * An event indicating the host received hover
- */
- public static final int EVENT_HOST_HOVER_RECEIVED = 31;
- /**
- * An event indicating the host lost hover
- */
- public static final int EVENT_HOST_HOVER_LOST = 32;
- /**
- * An event indicating the host received selection
- */
- public static final int EVENT_HOST_SELECTION_RECEIVED = 33;
- /**
- * An event indicating the host lost selection
- */
- public static final int EVENT_HOST_SELECTION_LOST = 34;
- private static final int EVENT_HANDLE_HOVER_RECEIVED = 35;
- private static final int EVENT_HANDLE_HOVER_LOST = 36;
- private static final int EVENT_HANDLE_SELECTED = 37;
- private static final int EVENT_ALL_SELECTION_LOST = 38;
- private static final int EVENT_MENU_BAR_SELECTION_RECEIVED = 39;
-
- private MouseMotionListener _motionListener;
- private MouseListener _mouseListener;
- private boolean _isMouseOver = false;
- private ElementMenuBar _elementMenuBar;
-
- private DisplayStateMachine _stateMachine;
- private VerticalMenuLocator _menuLocator;
- private AnimatedHideLocator _hideLocator;
- private IFigure _hoverParent;
- private IFigure _selectionParent;
-
- private ISelectionChangedListener _menuSelectionListener;
-
- MouseSelectableChildDecorator(final GraphicalEditPart hostPart, int location,
- IFigure hoverParent, IFigure selectionParent) {
- super(hostPart, location);
- _menuLocator = new VerticalMenuLocator(hostPart, this);
- _hideLocator = new AnimatedHideLocator();
- _elementMenuBar = ((ElementEditPart)hostPart).getElementMenuBar();
- _stateMachine = new DisplayStateMachine();
- _hoverParent = hoverParent;
- _selectionParent = selectionParent;
-
- _motionListener = new MouseMotionListener.Stub()
- {
- public void mouseEntered(MouseEvent me) {
- _isMouseOver = true;
- updateState(EVENT_HANDLE_HOVER_RECEIVED);
- }
-
- public void mouseExited(MouseEvent me) {
- _isMouseOver = false;
- updateState(EVENT_HANDLE_HOVER_LOST);
- }
- };
- addMouseMotionListener(_motionListener);
-
- _mouseListener = new MouseListener.Stub()
- {
- public void mousePressed(MouseEvent me) {
- updateState(EVENT_HANDLE_SELECTED);
- }
- };
- addMouseListener(_mouseListener);
-
- _menuSelectionListener = new ISelectionChangedListener()
- {
- public void selectionChanged(SelectionChangedEvent event) {
- IStructuredSelection selection = (IStructuredSelection) event.getSelection();
- if (selection.size() == 0)
- {
- // if the host part has been given back selection, then
- // we have a host selection event
- if (getOwner().getSelected() == EditPart.SELECTED_PRIMARY)
- {
- updateState(EVENT_HOST_SELECTION_RECEIVED);
- }
- // otherwise, both the host and the non-visual children are lost,
- // so fire all selection lost
- else
- {
- updateState(EVENT_ALL_SELECTION_LOST);
- }
- }
- // otherwise, one or more non-visual children have selection
- else
- {
- updateState(EVENT_MENU_BAR_SELECTION_RECEIVED);
- }
- }
- };
- _elementMenuBar.addSelectionChangedListener(_menuSelectionListener);
- }
-
- public void paintFigure(Graphics g) {
- // TODO: could we use an image label toggle button here instead?
- Image arrowImage = null;
-
- if (_stateMachine.isMenuShowing())
- {
- arrowImage = PDPlugin.getDefault().getImage("pin_down.gif");
- }
- else
- {
- arrowImage = PDPlugin.getDefault().getImage("pin_up.gif");
- }
-
- Rectangle r = getBounds();
- g.setAlpha(75);
- g.setBackgroundColor(getFillColor());
- g.fillRectangle(r.x, r.y, r.width, r.height);
- g.setAlpha(getAlpha());
- g.drawImage(arrowImage, r.x+1, r.y+1);
- g.setForegroundColor(getBorderColor());
- g.drawRectangle(r.x, r.y, r.width-1, r.height-1);
- }
-
- /**
- * @param event
- */
- public void updateState(int event)
- {
- int oldState = _stateMachine.doTransition(event);
- updateVisual(oldState);
- }
-
- /**
- * @param oldState
- */
- protected void updateVisual(int oldState)
- {
- // overriding all other considerations is whether the menu bar even has
- // any items to show. If not don't show anything
- if (!_elementMenuBar.hasChildParts())
- {
- if (getParent() != null)
- {
- getParent().remove(this);
- }
-
- return;
- }
-
- switch (_stateMachine._curState)
- {
- case STATE_START:
- hide(_elementMenuBar, false);
- IFigure parent = getParent();
- if (parent != null)
- {
- parent.remove(this);
- }
- break;
-
- case STATE_HOST_HOVER:
- if (_hoverParent != null)
- {
- _hoverParent.add(this);
- validate();
- }
- show(_elementMenuBar, false);
- setVisible(false);
- break;
-
- case STATE_HOST_SELECTED:
- if (_selectionParent != null)
- {
- _selectionParent.add(this);
- validate();
- }
-
- setVisible(true);
-
- if (oldState != STATE_HOST_SELECTED
- && oldState != STATE_HANDLE_HOVER)
- {
- show(_elementMenuBar, true);
- hide(_elementMenuBar, true);
- }
- else
- {
- if (!_hideLocator._isAnimating)
- {
- hide(_elementMenuBar, false);
- }
- }
- repaint();
- break;
-
- case STATE_HANDLE_HOVER:
- if (_stateMachine.isMenuShowing(oldState))
- {
- hide(_elementMenuBar, false);
- }
- else
- {
- show(_elementMenuBar, false);
- }
- repaint();
- break;
-
- case STATE_HANDLE_MENU_BAR_SHOWING:
- show(_elementMenuBar, true);
- repaint();
- break;
-
- case STATE_HANDLE_MENU_BAR_HOVER:
- case STATE_HANDLE_MENU_BAR_SELECTED:
- //revalidate();
- break;
-
-
- default:
-
- }
- }
-
- protected void init() {
- setPreferredSize(new Dimension(12, 12));
- }
-
- /**
- *
- */
- public void dispose()
- {
- hide(_elementMenuBar, false);
-
- if (_motionListener != null)
- {
- removeMouseMotionListener(_motionListener);
- _motionListener = null;
- }
-
- if (_mouseListener != null)
- {
- removeMouseListener(_mouseListener);
- _mouseListener = null;
- }
-
- if (_menuSelectionListener != null)
- {
- _elementMenuBar.removeSelectionChangedListener(_menuSelectionListener);
- _menuSelectionListener = null;
- }
- }
-
- private void hide(ElementMenuBar menuBar, boolean animate)
- {
- if (animate)
- {
- final Point endPoint = this.getLocation().getCopy();
- //TODO: don't understand when translation is necessary...
- //this.translateToAbsolute(endPoint);
-
- endPoint.x += this.getBounds().width / 2;
- endPoint.y += this.getBounds().height / 2;
- _hideLocator.setHideEndPoint(endPoint);
- _hideLocator.relocate(menuBar);
- }
- else
- {
- if (menuBar.getParent() != null)
- {
- getParent().remove(menuBar);
- }
- }
- }
-
- private void show(ElementMenuBar menuBar, boolean enabled)
- {
- menuBar.setEnabled(enabled);
- getParent().add(menuBar);
- _menuLocator.relocate(menuBar);
- }
-
- protected int getAlpha()
- {
- return (_isMouseOver || _stateMachine.isMenuShowing()) ? 255 : 75;
- }
-
- private class DisplayStateMachine
- {
- private int _curState = STATE_START;
-
- /**
- * @param event
- * @return execute a state machine transition on event
- */
- public int doTransition(int event)
- {
- final int oldState = _curState;
-
- switch(_curState)
- {
- case STATE_START:
- // can only transition from start state
- // on a host event
- if (event == EVENT_HOST_HOVER_RECEIVED)
- {
- _curState = STATE_HOST_HOVER;
- }
- else if (event == EVENT_HOST_SELECTION_RECEIVED)
- {
- _curState = STATE_HOST_SELECTED;
- }
- break;
-
- case STATE_HOST_HOVER:
- if (event == EVENT_HOST_SELECTION_RECEIVED)
- {
- _curState = STATE_HOST_SELECTED;
- }
- else if (event == EVENT_HOST_SELECTION_LOST
- || event == EVENT_HOST_HOVER_LOST)
- {
- _curState = STATE_START;
- }
- else if (event == EVENT_HOST_HOVER_RECEIVED)
- {
- // preserve state in this case
- }
- break;
-
- case STATE_HOST_SELECTED:
- // once the host is selected,the only host event that
- // that can change state is selection lost
- if (event == EVENT_HOST_SELECTION_LOST)
- {
- _curState = STATE_START;
- }
- else if (event == EVENT_HANDLE_HOVER_RECEIVED)
- {
- _curState = STATE_HANDLE_HOVER;
- }
- else if (event == EVENT_HANDLE_SELECTED)
- {
- _curState = STATE_HANDLE_MENU_BAR_SHOWING;
- }
- else if (event == EVENT_ALL_SELECTION_LOST)
- {
- _curState = STATE_START;
- }
- break;
-
- case STATE_HANDLE_HOVER:
- if (event == EVENT_HANDLE_HOVER_LOST)
- {
- _curState = STATE_HOST_SELECTED;
- }
- else if (event == EVENT_HANDLE_SELECTED)
- {
- _curState = STATE_HANDLE_MENU_BAR_SHOWING;
- }
- else if (event == EVENT_HOST_SELECTION_LOST)
- {
- _curState = STATE_START;
- }
- break;
- case STATE_HANDLE_MENU_BAR_SHOWING:
- if (event == EVENT_HANDLE_SELECTED)
- {
- _curState = STATE_HANDLE_HOVER;
- }
- else if (event == EVENT_MENU_BAR_SELECTION_RECEIVED)
- {
- _curState = STATE_HANDLE_MENU_BAR_SELECTED;
- }
- else if (event == EVENT_ALL_SELECTION_LOST)
- {
- _curState = STATE_START;
- }
- break;
-
- case STATE_HANDLE_MENU_BAR_HOVER:
- break;
-
- case STATE_HANDLE_MENU_BAR_SELECTED:
- if (event == EVENT_ALL_SELECTION_LOST)
- {
- _curState = STATE_START;
- }
- else if (event == EVENT_HANDLE_SELECTED)
- {
- _curState = STATE_HANDLE_HOVER;
- }
- break;
-
- }
-
-
- return oldState;
- }
-
- /**
- * @return true if the menu should be showing in the current state
- */
- public boolean isMenuShowing()
- {
- return isMenuShowing(_curState);
- }
-
- /**
- * @param state
- * @return true if state is one in which the menu should be showing
- */
- public boolean isMenuShowing(int state)
- {
- return _curState == STATE_HANDLE_MENU_BAR_SHOWING
- || _curState == STATE_HANDLE_MENU_BAR_HOVER
- || _curState == STATE_HANDLE_MENU_BAR_SELECTED;
- }
- }
-
- private static class VerticalMenuLocator implements Locator
- {
- private IFigure _referenceFigure;
-
- VerticalMenuLocator(GraphicalEditPart owner, IFigure reference)
- {
- _referenceFigure = reference;
- }
-
- public void relocate(IFigure target)
- {
- final Rectangle finalBounds = getFinalMenuBounds(target);
- target.setBounds(finalBounds);
- }
-
-
- private Rectangle getInitialMenuBounds(final IFigure target)
- {
- Rectangle targetBounds =
- new PrecisionRectangle(_referenceFigure.getBounds().getResized(-1, -1));
- _referenceFigure.translateToAbsolute(targetBounds);
- target.translateToRelative(targetBounds);
- return targetBounds;
- }
-
- private Rectangle getFinalMenuBounds(final IFigure target)
- {
- final IFigure referenceFigure = _referenceFigure;
-
- Rectangle targetBounds = getInitialMenuBounds(target);
- Dimension targetSize = target.getPreferredSize();
-
- // copied from super.relocate because relativeX/Y are private in super
- // changed from super to remove div by 2 that centers target; we want
- // it to be corner-to-corner
- targetBounds.x
- += targetBounds.width+4;
- targetBounds.y
- -= (targetSize.height / 2) - referenceFigure.getBounds().height/2;
- targetBounds.setSize(targetSize);
- //target.setBounds(targetBounds);
-
-// final Rectangle viewPortRect =
-// ((IHTMLGraphicalViewer)_owner.getViewer()).getViewport().getBounds();
-// final Rectangle targetRect = targetBounds.getCopy();
-//
-// targetRect.intersect(viewPortRect);
-
-// int width = targetBounds.width - targetRect.width;
-// int height = targetBounds.height - targetRect.height;
-
-// if (width != 0)
-// {
-// targetBounds.x -= width;
-// }
-//
-// if (height != 0)
-// {
-// targetBounds.y += height;
-// }
-
- return targetBounds;
- }
- }
-
- private static class AnimatedHideLocator implements Locator
- {
- private Point _endPoint;
- private boolean _isAnimating;
-
- /**
- * @param endPoint -- must be absolute coordinate
- */
- public void setHideEndPoint(Point endPoint)
- {
- _endPoint = endPoint;
- }
-
- public void relocate(IFigure target)
- {
- final Point newEndPoint = _endPoint.getCopy();
- target.translateToRelative(_endPoint);
- Rectangle startBounds = target.getBounds().getCopy();
- animateBoundsChange(target, startBounds, newEndPoint);
- }
-
- private void animateBoundsChange(final IFigure target,
- final Rectangle startBounds,
- final Point endPoint)
- {
- final int numSteps = 5;
- final int numMs = 500;
- final int timeSteps = numMs/numSteps;
-
- int xDelta = endPoint.x - startBounds.x;
- int yDelta = endPoint.y - startBounds.y;
-
- final int widthIncrement = -1 * startBounds.width / numSteps;
- final int heightIncrement = -1 * startBounds.height / numSteps;
- int xIncrement = xDelta / numSteps;
- int yIncrement = yDelta / numSteps;
-
- target.setBounds(startBounds);
- if (widthIncrement != 0 || heightIncrement != 0)
- {
- _isAnimating = true;
- doAnimation(numMs, timeSteps, widthIncrement, heightIncrement, xIncrement, yIncrement, endPoint, target);
- }
- }
-
- private void doAnimation(final int remainingTime,
- final int timeIncrement,
- final int widthIncrement, final int heightIncrement
- , final int xIncrement, final int yIncrement
- , final Point endPoint
- , final IFigure target)
- {
- Display.getCurrent().timerExec(timeIncrement,
- new Runnable()
- {
- public void run()
- {
- if (remainingTime <= 0)
- {
- if (target.getParent() != null)
- {
- target.getParent().remove(target);
- }
- _isAnimating = false;
- }
- else
- {
- final Rectangle curBounds = target.getBounds().getCopy();
- curBounds.width += widthIncrement;
- curBounds.height += heightIncrement;
- curBounds.x += xIncrement;
- curBounds.y += yIncrement;
- target.setBounds(curBounds);
- target.revalidate();
- doAnimation(remainingTime-timeIncrement, timeIncrement, widthIncrement, heightIncrement, xIncrement, yIncrement, endPoint, target);
- }
- }
- });
- }
- }
-}
-
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/MoveSupport.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/MoveSupport.java
deleted file mode 100644
index dc420cf..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/MoveSupport.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editpolicies;
-
-import java.util.List;
-
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.jst.pagedesigner.parts.NodeEditPart;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class MoveSupport {
- /**
- * Check whether the move operation only drags a single node.
- *
- * @param request
- * @return true if the request affects a single node
- */
- public static boolean isSingleNode(ChangeBoundsRequest request) {
- List parts = request.getEditParts();
- if (parts == null || parts.size() != 1
- || !(parts.get(0) instanceof NodeEditPart)) {
- return false;
- }
- return true;
- }
-
- /**
- * this method must be called after isSingleNode
- *
- * @param request
- * @return the dragged part
- */
- public static NodeEditPart getDraggedPart(ChangeBoundsRequest request) {
- List parts = request.getEditParts();
- NodeEditPart part = (NodeEditPart) parts.get(0);
- return part;
- }
-
- /**
- * this method must be called after isSingleNode
- *
- * @param request
- * @return the dragged node
- */
- public static Node getDraggedNode(ChangeBoundsRequest request) {
- return getDraggedPart(request).getIDOMNode();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/NonVisualChildDecorator.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/NonVisualChildDecorator.java
deleted file mode 100644
index 2f9c1e6..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/NonVisualChildDecorator.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-/**
- *
- */
-package org.eclipse.jst.pagedesigner.editpolicies;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.gef.DragTracker;
-import org.eclipse.gef.GraphicalEditPart;
-
-class NonVisualChildDecorator extends ElementDecoratorSquareHandle
-{
-
- NonVisualChildDecorator(final GraphicalEditPart hostPart, int location)
- {
- super(hostPart, new CornerRelativeHandleLocator(hostPart.getFigure(), location));
- }
-
- protected void init() {
- setPreferredSize(new Dimension(8, 8));
- }
-
- public void ancestorMoved(IFigure ancestor) {
- // TODO: for some reason this causes an infinite loop
- // when in the feedback layer...
- //super.ancestorMoved(ancestor);
- }
-
- protected DragTracker createDragTracker() {
- return null;
- }
-
- protected int getAlpha()
- {
- return 255;
- }
-
-}
\ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/NonVisualChildGraphicalEditPolicy.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/NonVisualChildGraphicalEditPolicy.java
deleted file mode 100644
index 59678d2..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/NonVisualChildGraphicalEditPolicy.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editpolicies;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.requests.LocationRequest;
-import org.eclipse.jst.pagedesigner.parts.NodeEditPart;
-import org.eclipse.jst.pagedesigner.parts.NonVisualComponentEditPart;
-import org.eclipse.swt.graphics.Color;
-import org.w3c.dom.Element;
-
-/**
- * An edit policy for non visual child edit parts
- * @author cbateman
- *
- */
-public class NonVisualChildGraphicalEditPolicy extends NonResizableEditPolicy
-{
- // the number of pixels to offset the top left of tooltop feedback
- // below the current mouse cursor location
- private static final int TOOLTIP_VERTICAL_OFFSET = 25;
- private final static Color HOVER_FEEDBACK_COLOR = ColorConstants.blue;
-
-
- private BasicLabelToolTip _toolTip;
- private boolean _showLabelFeedback;
- private RectangleFigure _mouseOverBorder;
-
- public void showTargetFeedback(Request request) {
- if (RequestConstants.REQ_SELECTION_HOVER.equals(request.getType())) {
- removeToolTipLabel();
- removeMouseOverBorder();
- Assert.isTrue(request instanceof LocationRequest);
- // don't show tooltip if drag is active
- _showLabelFeedback = !((NodeEditPart)getHost()).isDragActive();
- showHoverFeedback((LocationRequest)request);
- } else {
- super.showTargetFeedback(request);
- }
-
- }
-
- public void eraseTargetFeedback(Request request) {
- removeToolTipLabel();
- removeMouseOverBorder();
- }
-
- /**
- * @param request
- */
- private void showHoverFeedback(LocationRequest request)
- {
- if (_showLabelFeedback)
- {
- addMouseOverBorder();
- _toolTip = new BasicLabelToolTip(getTooltipText());
- addFeedback(_toolTip);
-
- // use mouse cursor plus an offset so the tooltip doesn't
- // appear z-ordered below the mouse cursor
- AbsolutePointLocator locator = AbsolutePointLocator.getInstance();
- locator.setReferencePoint(request.getLocation(), 0, TOOLTIP_VERTICAL_OFFSET);
- // to avoid enlargemeent of the feedback layer
- locator.setIntersectFigure(getFeedbackLayer());
- locator.relocate(_toolTip);
- }
- }
-
- private String getTooltipText() {
- Element element = (Element) ((NonVisualComponentEditPart)getHost()).getDOMNode();
- StringBuffer text = new StringBuffer(element.getTagName());
- return text.toString();
- }
-
- private void addMouseOverBorder()
- {
- if (_mouseOverBorder == null)
- {
- _mouseOverBorder = new RectangleFigure();
- _mouseOverBorder.setFill(false);
- _mouseOverBorder.setOutline(true);
- _mouseOverBorder.setLineWidth(1);
- _mouseOverBorder.setForegroundColor(HOVER_FEEDBACK_COLOR);
- }
-
- addFeedback(_mouseOverBorder);
-
- IFigure hostFigure = getHostFigure();
- Rectangle r = hostFigure.getBounds().getCopy().expand(1, 1);
- hostFigure.translateToAbsolute(r);
- _mouseOverBorder.translateToRelative(r);
-
- _mouseOverBorder.setBounds(r);
- }
-
- /**
- *
- */
- private void removeMouseOverBorder()
- {
- if (_mouseOverBorder != null) {
- removeFeedback(_mouseOverBorder);
- _mouseOverBorder = null;
- }
- }
-
- protected List createSelectionHandles() {
-// return super.createSelectionHandles();
- return Collections.EMPTY_LIST;
- }
-
- /**
- *
- */
- private void removeToolTipLabel()
- {
- if (_toolTip != null) {
- removeFeedback(_toolTip);
- _toolTip = null;
- }
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/PDEditPolicy.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/PDEditPolicy.java
deleted file mode 100644
index 72e76d6..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/PDEditPolicy.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editpolicies;
-
-/**
- * @author mengbo
- */
-public interface PDEditPolicy {
- /**
- * the edit policy for PD Drop
- */
- String PDDROP_ROLE = "PDDropEditPolicy"; //$NON-NLS-1$
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/PolicyHelper.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/PolicyHelper.java
deleted file mode 100644
index 79b8f7f..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editpolicies/PolicyHelper.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.editpolicies;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-
-/**
- * @author mengbo
- */
-public class PolicyHelper {
- private static Logger _log = PDPlugin.getLogger(PolicyHelper.class);
-
- /**
- * @param part
- * @return the current viewer's status line manager or null
- */
- public static IStatusLineManager getStatusLineManager(EditPart part) {
- EditPartViewer v = part.getViewer();
- if (v instanceof IHTMLGraphicalViewer) {
- IHTMLGraphicalViewer htmlviewer = (IHTMLGraphicalViewer) v;
- IStatusLineManager m = htmlviewer.getStatusLineManager();
- if (m == null) {
- _log.info("Warn.PolicyHelper.0", (String) null); //$NON-NLS-1$
- }
- return m;
- }
- _log.info("Warn.PolicyHelper.1", (String)null); //$NON-NLS-1$
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/elementedit/AbstractElementEdit.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/elementedit/AbstractElementEdit.java
deleted file mode 100644
index ac2c123..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/elementedit/AbstractElementEdit.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.elementedit;
-
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jst.jsf.common.dom.TagIdentifier;
-import org.eclipse.jst.jsf.core.internal.tld.CMUtil;
-import org.eclipse.jst.pagedesigner.itemcreation.ITagCreator;
-import org.eclipse.jst.pagedesigner.itemcreation.customizer.AbstractDropCustomizer;
-import org.eclipse.jst.pagedesigner.itemcreation.customizer.IDropCustomizer;
-import org.eclipse.jst.pagedesigner.parts.ElementEditPart;
-import org.eclipse.jst.pagedesigner.parts.NodeEditPart;
-import org.eclipse.jst.pagedesigner.viewer.IDropLocationStrategy;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.w3c.dom.Element;
-
-/**
- * <p><b>Provisional API - subject to change</b></p>
- * @author mengbo
- * @version 1.5
- */
-// TODO: should this be abstract?
-public class AbstractElementEdit implements IElementEdit {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.elementedit.IElementEdit#createEditPolicies(org.eclipse.jst.pagedesigner.parts.ElementEditPart)
- */
- public void createEditPolicies(ElementEditPart part) {
- // do nothing; sub-classes should override to add edit policies a part
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.elementedit.IElementEdit#handleModelChange(org.w3c.dom.Element,
- * org.eclipse.jst.pagedesigner.parts.ElementEditPart)
- */
- public boolean handleModelChange(Element ele, ElementEditPart part,
- boolean recursive) {
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.elementedit.IElementEdit#fillContextMenu(org.eclipse.jface.action.IMenuManager,
- * org.w3c.dom.Element)
- */
- public void fillContextMenu(IMenuManager contextMenu, Element ele) {
- // default do nothing, child class could override.
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.elementedit.IElementEdit#fillContainerContextMenu(org.eclipse.jface.action.IMenuManager,
- * org.eclipse.jst.pagedesigner.parts.ElementEditPart,
- * org.eclipse.jst.pagedesigner.parts.NodeEditPart,
- * org.eclipse.jface.viewers.ISelection)
- */
- public boolean fillContainerContextMenu(IMenuManager contextMenu,
- ElementEditPart elePart, NodeEditPart nodePart,
- ISelection innerSelection) {
- return false;
- }
-
- /**
- * Child class should override this method if they have different way for
- * resizing. e.g. DataWindow use "width/height" attribute, not "style".
- * Also, the default ResizeCommand will adjust "style", so if child class
- * override this method, they should also use different command.
- *
- * @see org.eclipse.jst.pagedesigner.editpolicies.ElementResizableEditPolicy#getResizeCommand(org.eclipse.gef.requests.ChangeBoundsRequest)
- */
- public boolean isResizable(Element ele) {
- CMElementDeclaration decl = CMUtil.getElementDeclaration(ele);
- if (decl != null) {
- // XXX: default implementation, if this element support "style"
- // attribute,
- // then we think it support resize.
- return decl.getAttributes().getNamedItem("style") != null;
- }
- return true;
- }
-
- /**
- * By default, return null to signal caller should use its default strategy
- */
- public IDropLocationStrategy getDropRequestorLocationStrategy(TagIdentifier tag, EditPartViewer viewer) {
- return null;
- }
-
- private final static IDropCustomizer DEFAULT_DROP_CUSTOMIZER =
- new AbstractDropCustomizer(){/* do nothing; use defaults */};
-
- public IDropCustomizer getDropCustomizer(TagIdentifier tagId)
- {
- return DEFAULT_DROP_CUSTOMIZER;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.elementedit.IElementEdit#getTagCreator(org.eclipse.jst.jsf.common.dom.TagIdentifier)
- */
- public ITagCreator getTagCreator(TagIdentifier tagId)
- {
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/elementedit/AbstractElementEditFactory.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/elementedit/AbstractElementEditFactory.java
deleted file mode 100644
index b7e42a5..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/elementedit/AbstractElementEditFactory.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.elementedit;
-
-import org.eclipse.jst.jsf.common.dom.TagIdentifier;
-
-/**
- * @author cbateman
- *
- */
-public abstract class AbstractElementEditFactory implements IElementEditFactory
-{
- private String _supportedUri;
-
- /**
- * @param uri
- */
- protected AbstractElementEditFactory(final String uri)
- {
- _supportedUri = uri;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.elementedit.IElementEditFactory#createElementEdit(org.eclipse.jst.jsf.common.dom.TagIdentifier)
- */
- public abstract IElementEdit createElementEdit(TagIdentifier tag);
-
- public String getSupportedURI()
- {
- return _supportedUri;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/elementedit/ElementEditFacRegistryReader.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/elementedit/ElementEditFacRegistryReader.java
deleted file mode 100644
index e0e1b7b..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/elementedit/ElementEditFacRegistryReader.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.elementedit;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jst.pagedesigner.IJMTConstants;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class ElementEditFacRegistryReader {
- private static List<IElementEditFactory> _handlers = null;
-
- /**
- * @return all available handers for the ext-pt. List is not
- * modifiable
- */
- public static synchronized List<IElementEditFactory> getAllHandlers() {
- if (_handlers == null) {
- _handlers = readAllHandlers();
- }
- return Collections.unmodifiableList(_handlers);
- }
-
- private static List<IElementEditFactory> readAllHandlers() {
- List result = new ArrayList();
- IExtensionPoint extensionPoint = Platform.getExtensionRegistry()
- .getExtensionPoint(PDPlugin.getPluginId(),
- IJMTConstants.EXTENSION_POINT_PAGEDESIGNER);
- IExtension[] extensions = extensionPoint.getExtensions();
-
- for (int i = 0; i < extensions.length; i++) {
- IExtension ext = extensions[i];
- IConfigurationElement[] dropHandlers = ext
- .getConfigurationElements();
-
- for (int j = 0; j < dropHandlers.length; j++) {
- if (dropHandlers[j].getName().equals(
- IJMTConstants.ELEMENT_EDIT_FACTORY)) {
- dropHandlers[j].getAttribute("class");
- Object obj;
- try {
- obj = dropHandlers[j]
- .createExecutableExtension("class");
-
- if (obj instanceof IElementEditFactory) {
- result.add(obj);
- }
- } catch (CoreException e) {
- // ignore the exception
- e.printStackTrace();
- }
- }
- }
- }
- return result;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/elementedit/ElementEditFactoryRegistry.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/elementedit/ElementEditFactoryRegistry.java
deleted file mode 100644
index 7ca7daf..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/elementedit/ElementEditFactoryRegistry.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.elementedit;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jst.jsf.common.dom.TagIdentifier;
-import org.eclipse.jst.jsf.core.internal.tld.TagIdentifierFactory;
-import org.eclipse.jst.pagedesigner.elementedit.html.HTMLElementEditFactory;
-import org.eclipse.jst.pagedesigner.elementedit.jsp.JSPElementEditFactory;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class ElementEditFactoryRegistry {
- List _factories = new ArrayList();
-
- private static ElementEditFactoryRegistry _instance;
-
- /**
- *
- */
- private ElementEditFactoryRegistry() {
- addFactory(new HTMLElementEditFactory());
- addFactory(new JSPElementEditFactory());
-
- List<IElementEditFactory> facs =
- ElementEditFacRegistryReader.getAllHandlers();
-
- if (facs != null)
- {
- for (IElementEditFactory fac : facs)
- {
- addFactory(fac);
- }
- }
- }
-
- /**
- * Add a factory to list available.
- *
- * @param fac
- */
- public void addFactory(IElementEditFactory fac) {
- _factories.add(fac);
- }
-
- /**
- * @param tagIdentifier
- * @return an IElementEdit constructed for the tag uniquely identified
- * by the ns uri (tag uri for JSP tags) and tagName (element name) or null
- * if the system can't create one.
- */
- public IElementEdit createElementEdit(final TagIdentifier tagIdentifier)
- {
- final String uri = tagIdentifier.getUri();
-
- // first round, match uri
- for (int i = 0, size = _factories.size(); i < size; i++) {
- IElementEditFactory fac = (IElementEditFactory) _factories.get(i);
- String facuri = fac.getSupportedURI();
- if (facuri != null && facuri.equals(uri)) {
- IElementEdit elementEdit = fac.createElementEdit(tagIdentifier);
- if (elementEdit != null) {
- return elementEdit;
- }
- }
- }
- // second round
- for (int i = 0, size = _factories.size(); i < size; i++) {
- IElementEditFactory fac = (IElementEditFactory) _factories.get(i);
- String facuri = fac.getSupportedURI();
- if (facuri == null) {
- IElementEdit elementEdit = fac.createElementEdit(tagIdentifier);
- if (elementEdit != null) {
- return elementEdit;
- }
- }
- }
- return null;
- }
-
- /**
- * Convenience method for createElementEdit(uri, tagName) that takes
- * a tag element.
- *
- * @param ele
- * @return an element edit
- */
- public IElementEdit createElementEdit(Element ele) {
- final TagIdentifier tagIdentifier = TagIdentifierFactory.createDocumentTagWrapper(ele);
- return createElementEdit(tagIdentifier);
- }
-
- /**
- * @return the single instance of the factory registry
- */
- public static ElementEditFactoryRegistry getInstance() {
- if (_instance == null) {
- _instance = new ElementEditFactoryRegistry();
- }
- return _instance;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/elementedit/IElementEdit.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/elementedit/IElementEdit.java
deleted file mode 100644
index bdd91a3..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/elementedit/IElementEdit.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.elementedit;
-
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jst.jsf.common.dom.TagIdentifier;
-import org.eclipse.jst.pagedesigner.itemcreation.ITagCreator;
-import org.eclipse.jst.pagedesigner.itemcreation.customizer.IDropCustomizer;
-import org.eclipse.jst.pagedesigner.parts.ElementEditPart;
-import org.eclipse.jst.pagedesigner.parts.NodeEditPart;
-import org.eclipse.jst.pagedesigner.viewer.IDropLocationStrategy;
-import org.w3c.dom.Element;
-
-/**
- * IElementEdit support additional edit support to an element.
- *
- * This interface should not be extended by clients. Extend AbstractElementEdit
- * instead.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author mengbo
- * @version 1.5
- */
-public interface IElementEdit
-{
- /**
- * override default edit policies on part
- * @param part
- */
- public void createEditPolicies(ElementEditPart part);
-
- /**
- * The element (or its decendent) changed.
- *
- * @param ele
- * @param part
- * @param recursive
- * @return handle model changes on part.
- */
- public boolean handleModelChange(Element ele, ElementEditPart part,
- boolean recursive);
-
- /**
- * Add special menu items for the particular element to the context menu.
- *
- * @param contextMenu
- * @param ele
- */
- public void fillContextMenu(IMenuManager contextMenu, Element ele);
-
- /**
- * This method is called when current selection is inside "ele". And this
- * method should fill in menu items relating to the "ele" context and the
- * current "innerSelection". For example, this "ele" could be a table,
- * "innerSelection" could be something inside a cell. Then could fill in
- * actions relating to the table and the cell, such as "add row before",
- * "delete current column", etc.
- *
- * @param contextMenu
- * @param elePart
- * the elementeditpart corresponding to this ElementEdit
- * @param nodePart
- * the smallest part covers the current selection. nodePart will
- * always be a decedent of the elePart.
- * @param innerSelection
- * the selection
- * @return true if added actions.
- */
- public boolean fillContainerContextMenu(IMenuManager contextMenu,
- ElementEditPart elePart, NodeEditPart nodePart,
- ISelection innerSelection);
-
- /**
- * whether the corresponding element support resize. If it does, then the
- * corresponding policy installed through <code>createEditPolicies</code>
- * should handle resize.
- * @param ele
- *
- * @return true if ele has resize support
- */
- public boolean isResizable(Element ele);
-
- /**
- * @param tag the element to return a drop location strategy for.
- * This is the requesting element (being dropped), not the drop target
- *
- * @param viewer is the viewer where the new strategy will optionally
- * add feedback
- *
- * @return the strategy to be used to use to find a drop location when
- * the corresponding element is being dropped (the source part). May
- * be null signalling that the caller should use its default strategy.
- *
- */
- public IDropLocationStrategy getDropRequestorLocationStrategy(TagIdentifier tag, EditPartViewer viewer);
-
- /**
- * @param tagId
- * @return the drop customizer for this edit's element. May return null.
- * Returning null and returning a IDropCustomizer whose runCustomizer always returns
- * OK and getDropCustomizationData always returns null will be considered
- * equivalent by the framework.
- */
- public IDropCustomizer getDropCustomizer(TagIdentifier tagId);
-
- /**
- * @param tagId
- * @return a tag creator for the indicated tag or null to indicate that the
- * system should use it's default tag creator
- */
- public ITagCreator getTagCreator(TagIdentifier tagId);
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/elementedit/IElementEditFactory.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/elementedit/IElementEditFactory.java
deleted file mode 100644
index 052275a..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/elementedit/IElementEditFactory.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.elementedit;
-
-import org.eclipse.jst.jsf.common.dom.TagIdentifier;
-
-
-/**
- * @author mengbo
- * @version 1.5
- *
- * Clients should not implement this interface. Extend AbstractElementEditFactory instead.
- */
-public interface IElementEditFactory {
- /**
- *
- * @param tag
- * @return null if this factory don't support this element
- */
- public IElementEdit createElementEdit(TagIdentifier tag);
-
- /**
- * get the URI namespace that this factory support. "null" means this
- * factory can be used as default factory.
- *
- * @return null if this factory don't have a specific URI to support.
- */
- public String getSupportedURI();
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/elementedit/html/HTMLElementEditFactory.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/elementedit/html/HTMLElementEditFactory.java
deleted file mode 100644
index f4804c1..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/elementedit/html/HTMLElementEditFactory.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.elementedit.html;
-
-import org.eclipse.jst.jsf.common.dom.TagIdentifier;
-import org.eclipse.jst.jsf.core.internal.tld.ITLDConstants;
-import org.eclipse.jst.jsf.core.internal.tld.TagIdentifierFactory;
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.elementedit.IElementEdit;
-import org.eclipse.jst.pagedesigner.elementedit.IElementEditFactory;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class HTMLElementEditFactory implements IElementEditFactory
-{
- final static TagIdentifier HTMLTABLE_TAG_IDENTIFIER =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_HTML, IHTMLConstants.TAG_TABLE);
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.elementedit.IElementEditFactory#createElementEdit(org.w3c.dom.Element)
- */
- public IElementEdit createElementEdit(TagIdentifier tagIdentifier) {
- if (HTMLTABLE_TAG_IDENTIFIER.isSameTagType(tagIdentifier)) {
- return new TableElementEdit();
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.elementedit.IElementEditFactory#getSupportedURI()
- */
- public String getSupportedURI() {
- return ITLDConstants.URI_HTML;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/elementedit/html/TableElementEdit.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/elementedit/html/TableElementEdit.java
deleted file mode 100644
index 31b9127..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/elementedit/html/TableElementEdit.java
+++ /dev/null
@@ -1,274 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.elementedit.html;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.actions.single.SelectEditPartAction;
-import org.eclipse.jst.pagedesigner.commands.html.TableDeleteColumnCommand;
-import org.eclipse.jst.pagedesigner.commands.html.TableDeleteHeaderFooterCommand;
-import org.eclipse.jst.pagedesigner.commands.html.TableDeleteRowCommand;
-import org.eclipse.jst.pagedesigner.commands.html.TableInsertColumnCommand;
-import org.eclipse.jst.pagedesigner.commands.html.TableInsertHeaderFooterCommand;
-import org.eclipse.jst.pagedesigner.commands.html.TableInsertRowCommand;
-import org.eclipse.jst.pagedesigner.commands.html.TableResizeColumnCommand;
-import org.eclipse.jst.pagedesigner.commands.html.TableResizeRowCommand;
-import org.eclipse.jst.pagedesigner.dom.html.TableChildElementPosition;
-import org.eclipse.jst.pagedesigner.dom.html.TableUtil;
-import org.eclipse.jst.pagedesigner.editors.PageDesignerActionConstants;
-import org.eclipse.jst.pagedesigner.elementedit.AbstractElementEdit;
-import org.eclipse.jst.pagedesigner.parts.ElementEditPart;
-import org.eclipse.jst.pagedesigner.parts.NodeEditPart;
-import org.eclipse.jst.pagedesigner.tableedit.DeleteHeaderFooterAction;
-import org.eclipse.jst.pagedesigner.tableedit.DeleteHeaderFooterRequest;
-import org.eclipse.jst.pagedesigner.tableedit.DeleteRowColumnAction;
-import org.eclipse.jst.pagedesigner.tableedit.InsertHeaderFooterAction;
-import org.eclipse.jst.pagedesigner.tableedit.InsertHeaderFooterRequest;
-import org.eclipse.jst.pagedesigner.tableedit.InsertRowColumnAction;
-import org.eclipse.jst.pagedesigner.tableedit.TableInsertRequest;
-import org.eclipse.jst.pagedesigner.tableedit.TableResizableEditPolicy;
-import org.eclipse.jst.pagedesigner.tableedit.TableResizeRequest;
-import org.eclipse.jst.pagedesigner.tableedit.TableRowColumnDeleteRequest;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class TableElementEdit extends AbstractElementEdit {
- private final static Action action = new Action() {
- // TODO: what's this for?
- };
-
- private static int FAKE_INDEX = -10;
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.elementedit.IElementEdit#fillContextMenu(org.eclipse.jface.action.IMenuManager,
- * org.w3c.dom.Element)
- */
- public void fillContextMenu(IMenuManager contextMenu, Element ele) {
- final IMenuManager tableMenu = new MenuManager(PDPlugin
- .getResourceString("ElementEdit.Submenu.Table"));//$NON-NLS-1$
- tableMenu.add(action);
- final ElementEditPart tablePart = (ElementEditPart) ((IDOMElement) ele)
- .getAdapterFor(EditPart.class);
- // ok, we passed the checking, now let's create the actions.
- tableMenu.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager manager) {
- tableMenu.removeAll();
- fillTableMenu(tablePart, FAKE_INDEX, FAKE_INDEX, tableMenu);
- }
- });
-
- contextMenu.appendToGroup(PageDesignerActionConstants.GROUP_CONTAINER,
- tableMenu);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.elementedit.AbstractElementEdit#fillContainerContextMenu(org.eclipse.jface.action.IMenuManager,
- * org.eclipse.jst.pagedesigner.parts.ElementEditPart,
- * org.eclipse.jst.pagedesigner.parts.NodeEditPart,
- * org.eclipse.jface.viewers.ISelection)
- */
- public boolean fillContainerContextMenu(IMenuManager contextMenu,
- final ElementEditPart tablePart, NodeEditPart nodePart,
- ISelection innerSelection) {
- super.fillContainerContextMenu(contextMenu,
- tablePart, nodePart, innerSelection);
-
- Element table = (Element) tablePart.getModel();
- Node node = (Node) nodePart.getModel();
-
- TableChildElementPosition position = new TableUtil(table)
- .getPosition(node);
- final int cellRow = position.getRowIndex();
- final int cellColumn = position.getColumnIndex();
-
- final IMenuManager tableMenu = new MenuManager(PDPlugin
- .getResourceString("ElementEdit.Submenu.Table"));//$NON-NLS-1$
- tableMenu.add(action);
- // ok, we passed the checking, now let's create the actions.
- tableMenu.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager manager) {
- tableMenu.removeAll();
- fillTableMenu(tablePart, cellRow, cellColumn, tableMenu);
- }
- });
-
- contextMenu.appendToGroup(PageDesignerActionConstants.GROUP_CONTAINER,
- tableMenu);
- return true;
- }
-
- /**
- * @param tablePart
- * @param cellRow
- * @param cellColumn
- * @param tableMenu
- */
- private void fillTableMenu(ElementEditPart tablePart, int cellRow,
- int cellColumn, IMenuManager tableMenu) {
- SelectEditPartAction action1 = SelectEditPartAction.create(
- PDPlugin.getResourceString("ElementEdit.Submenu.SelectTable"), tablePart);//$NON-NLS-1$
- tableMenu.add(action1);
-
- tableMenu.add(new Separator());
-
- {
- InsertRowColumnAction insertRowBeforeAction = new InsertRowColumnAction(
- PDPlugin
- .getResourceString("ElementEdit.Submenu.InsertRowBefore"),//$NON-NLS-1$
- tablePart, cellRow, true, true);
- tableMenu.add(insertRowBeforeAction);
-
- InsertRowColumnAction insertRowAfterAction = new InsertRowColumnAction(
- PDPlugin
- .getResourceString("ElementEdit.Submenu.InsertRowAfter"),//$NON-NLS-1$
- tablePart, cellRow, true, false);
- tableMenu.add(insertRowAfterAction);
-
- tableMenu.add(new Separator());
- }
-
- {
- InsertRowColumnAction insertColumnBeforeAction = new InsertRowColumnAction(
- PDPlugin
- .getResourceString("ElementEdit.Submenu.InsertColumnBefore"),//$NON-NLS-1$
- tablePart, cellColumn, false, true);
- tableMenu.add(insertColumnBeforeAction);
-
- InsertRowColumnAction insertColumnAfterAction = new InsertRowColumnAction(
- PDPlugin
- .getResourceString("ElementEdit.Submenu.InsertColumnAfter"),//$NON-NLS-1$
- tablePart, cellColumn, false, false);
- tableMenu.add(insertColumnAfterAction);
-
- tableMenu.add(new Separator());
- }
-
- {
- DeleteRowColumnAction deleteRowAction = new DeleteRowColumnAction(
- PDPlugin.getResourceString("ElementEdit.Submenu.DeleteRow"),//$NON-NLS-1$
- tablePart, cellRow, true);
- tableMenu.add(deleteRowAction);
-
- DeleteRowColumnAction deleteColumnAction = new DeleteRowColumnAction(
- PDPlugin
- .getResourceString("ElementEdit.Submenu.DeleteColumn"),//$NON-NLS-1$
- tablePart, cellColumn, false);
- tableMenu.add(deleteColumnAction);
- tableMenu.add(new Separator());
- }
-
- {
- InsertHeaderFooterAction headerAction = new InsertHeaderFooterAction(
- PDPlugin
- .getResourceString("ElementEdit.Submenu.InsertHeader"), tablePart, true);//$NON-NLS-1$
- tableMenu.add(headerAction);
- InsertHeaderFooterAction footerAction = new InsertHeaderFooterAction(
- PDPlugin
- .getResourceString("ElementEdit.Submenu.InsertFooter"), tablePart, false);//$NON-NLS-1$
- tableMenu.add(footerAction);
- DeleteHeaderFooterAction delHeaderAction = new DeleteHeaderFooterAction(
- PDPlugin
- .getResourceString("ElementEdit.Submenu.DeleteHeader"), tablePart, true);//$NON-NLS-1$
- tableMenu.add(delHeaderAction);
- DeleteHeaderFooterAction delFooterAction = new DeleteHeaderFooterAction(
- PDPlugin
- .getResourceString("ElementEdit.Submenu.DeleteFooter"), tablePart, false);//$NON-NLS-1$
- tableMenu.add(delFooterAction);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.elementedit.IElementEdit#createEditPolicies(org.eclipse.jst.pagedesigner.parts.ElementEditPart)
- */
- public void createEditPolicies(ElementEditPart part) {
- part.installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE,
- new TableResizePolicy(part));
- }
-
- static class TableResizePolicy extends TableResizableEditPolicy {
- ElementEditPart _part;
-
- /**
- * @param part
- */
- public TableResizePolicy(ElementEditPart part) {
- _part = part;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editpolicies.ResizableEditPolicy#getCommand(org.eclipse.gef.Request)
- */
- public Command getCommand(Request request) {
- IHTMLGraphicalViewer viewer = (IHTMLGraphicalViewer) _part
- .getViewer();
- Element table = (Element) _part.getIDOMNode();
- if (request instanceof TableResizeRequest) {
- TableResizeRequest trq = (TableResizeRequest) request;
- if (trq.isRow()) {
- return new TableResizeRowCommand(viewer, table, trq
- .getIndex(), trq.getDelta());
- }
- return new TableResizeColumnCommand(viewer, table, trq
- .getIndex(), trq.getDelta());
- } else if (request instanceof TableInsertRequest) {
- TableInsertRequest tableInsertRequest = (TableInsertRequest) request;
- int index = tableInsertRequest.getIndex()
- + (tableInsertRequest.isBefore() ? 0 : 1);
- if (tableInsertRequest.isRow()) {
- return new TableInsertRowCommand(viewer, table, index,
- tableInsertRequest.isBefore());
- }
- return new TableInsertColumnCommand(viewer, table, index);
- } else if (request instanceof TableRowColumnDeleteRequest) {
- TableRowColumnDeleteRequest deleteReq = (TableRowColumnDeleteRequest) request;
- if (deleteReq.isRow()) {
- return new TableDeleteRowCommand(viewer, table, deleteReq
- .getIndex());
- }
- return new TableDeleteColumnCommand(viewer, table,
- deleteReq.getIndex());
- } else if (request instanceof InsertHeaderFooterRequest) {
- InsertHeaderFooterRequest hfRequest = (InsertHeaderFooterRequest) request;
- return new TableInsertHeaderFooterCommand(viewer, table,
- hfRequest.isHeader());
- } else if (request instanceof DeleteHeaderFooterRequest) {
- DeleteHeaderFooterRequest hfRequest = (DeleteHeaderFooterRequest) request;
- return new TableDeleteHeaderFooterCommand(viewer, table,
- hfRequest.isHeader());
- }
- return super.getCommand(request);
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/elementedit/jsp/JSPElementEditFactory.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/elementedit/jsp/JSPElementEditFactory.java
deleted file mode 100644
index 9dc4f9e..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/elementedit/jsp/JSPElementEditFactory.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.elementedit.jsp;
-
-import org.eclipse.jst.jsf.common.dom.TagIdentifier;
-import org.eclipse.jst.jsf.core.internal.tld.ITLDConstants;
-import org.eclipse.jst.jsf.core.internal.tld.TagIdentifierFactory;
-import org.eclipse.jst.pagedesigner.elementedit.IElementEdit;
-import org.eclipse.jst.pagedesigner.elementedit.IElementEditFactory;
-import org.eclipse.jst.pagedesigner.jsp.core.IJSPCoreConstants;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class JSPElementEditFactory implements IElementEditFactory
-{
- final static TagIdentifier TAG_DIRECTIVE_TAGLIB_TAG_IDENTIFIER =
- TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSP, IJSPCoreConstants.TAG_DIRECTIVE_TAGLIB);
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.elementedit.IElementEditFactory#createElementEdit(org.w3c.dom.Element)
- */
- public IElementEdit createElementEdit(TagIdentifier tagIdentifier) {
- if (TAG_DIRECTIVE_TAGLIB_TAG_IDENTIFIER.isSameTagType(tagIdentifier)) {
- return new TaglibElementEdit();
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.elementedit.IElementEditFactory#getSupportedURI()
- */
- public String getSupportedURI() {
- return ITLDConstants.URI_JSP;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/elementedit/jsp/TaglibElementEdit.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/elementedit/jsp/TaglibElementEdit.java
deleted file mode 100644
index 9c82880..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/elementedit/jsp/TaglibElementEdit.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.elementedit.jsp;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.jst.pagedesigner.editors.PageDesignerActionConstants;
-import org.eclipse.jst.pagedesigner.elementedit.AbstractElementEdit;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class TaglibElementEdit extends AbstractElementEdit {
- private TaglibURIAction action;
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.elementedit.IElementEdit#fillContextMenu(org.eclipse.jface.action.IMenuManager,
- * org.w3c.dom.Element)
- */
- public void fillContextMenu(IMenuManager contextMenu, Element ele) {
- super.fillContextMenu(contextMenu, ele);
-
- TaglibURIAction action1 = getAction();
-
- action1.setURI(ele.getAttribute(ICSSPropertyID.ATTR_URI));
-
- action1.setElement(ele);
-
- contextMenu.appendToGroup(PageDesignerActionConstants.GROUP_SPECIAL,
- action1);
- }
-
- private TaglibURIAction getAction() {
- if (action == null) {
- action = new TaglibURIAction();
- }
- return action;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/elementedit/jsp/TaglibURIAction.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/elementedit/jsp/TaglibURIAction.java
deleted file mode 100644
index eefc1b3..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/elementedit/jsp/TaglibURIAction.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.elementedit.jsp;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.wst.sse.core.internal.util.URIResolver;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class TaglibURIAction extends Action {
- private String URI;
-
- private Element element;
-
- /**
- * Default constructor
- */
- public TaglibURIAction() {
- setText(PDPlugin.getResourceString("ElementEdit.Submenu.Taglib"));//$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#isEnabled()
- */
- public boolean isEnabled() {
- if (element == null || URI == null || "".equals(URI))//$NON-NLS-1$
- {
- return false;
- }
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- String fileName = getResolvedURL(getElement(), URI);
-
- if (fileName != null && fileName.length() > 0) {
- IPath includedPath = new Path(fileName);
- includedPath.makeAbsolute();
-
- IFile file = getFile(includedPath);
- if (file != null && file.exists()) {
- try {
- IDE.openEditor(getPage(), file);
- return;
- } catch (PartInitException e) {
- PDPlugin.getAlerts().warning(
- "Message.Warning.Title", e.getLocalizedMessage());//$NON-NLS-1$
- }
- }
- }
- PDPlugin.getAlerts().warning(
- "Message.Warning.Title", "Taglib.OpenFile.ERROR");//$NON-NLS-1$ //$NON-NLS-2$
- }
-
- private IWorkbenchPage getPage() {
- IWorkbench workbench = PlatformUI.getWorkbench();
- IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
- return window.getActivePage();
- }
-
- /**
- * @param uri
- */
- public void setURI(String uri) {
- this.URI = uri;
- }
-
- private IFile getFile(IPath includedPath) {
- IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
- IProject[] projects = workspaceRoot.getProjects();
-
- for (int i = 0, length = projects.length; i < length; i++) {
- IPath path = projects[i].getLocation();
- path = path.makeAbsolute();
- if (path != null && path.isPrefixOf(includedPath)) {
- // -1 so we still have the project path
- includedPath = includedPath.removeFirstSegments(path
- .segmentCount() - 1);
- return ResourcesPlugin.getWorkspace().getRoot().getFile(
- includedPath);
- }
- }
- return null;
- }
-
- private String getResolvedURL(Element element_, String attrName) {
- URIResolver resolver = null;
- if (element_ instanceof IDOMNode) {
- resolver = ((IDOMNode) element_).getModel().getResolver();
- }
- if (null == resolver) {
- return null;
- }
- String src = URI;
- if (src != null && src.length() > 0) {
- return resolver.getLocationByURI(src);
- }
- return null;
- }
-
- /**
- * @return Returns the element.
- */
- public Element getElement() {
- return element;
- }
-
- /**
- * @param element
- * The element to set.
- */
- public void setElement(Element element) {
- this.element = element;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/extensionpoint/IContextMenuItemContributor.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/extensionpoint/IContextMenuItemContributor.java
deleted file mode 100644
index 83bd334..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/extensionpoint/IContextMenuItemContributor.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.extensionpoint;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-
-/**
- * @author mengbo
- *
- * <p><b>Provisional API - subject to change</b></p>
- */
-
-public interface IContextMenuItemContributor {
- /**
- * @param uri
- */
- void setURI(String uri);
-
- /**
- * @return the uri
- */
- String getURI();
-
- /**
- * @param manager
- * @param selection
- * @param model
- * @param parentUI
- */
- void fillContextMenu(IMenuManager manager, ISelection selection,
- IStructuredModel model, Control parentUI);
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/extensionpoint/package-info.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/extensionpoint/package-info.java
deleted file mode 100644
index 547f3b3..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/extensionpoint/package-info.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-/**
- * Web Page Editor Extension Point Interfaces.
- *
- * <p><b>Provisional API - subject to change</b></p>
- */
-package org.eclipse.jst.pagedesigner.extensionpoint;
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/figurehandler/AbstractFigureHandler.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/figurehandler/AbstractFigureHandler.java
deleted file mode 100644
index 06090c3..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/figurehandler/AbstractFigureHandler.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.figurehandler;
-
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.layout.CSSFigure;
-import org.eclipse.jst.pagedesigner.css2.style.DefaultStyle;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public abstract class AbstractFigureHandler implements IFigureHandler {
- private CSSFigure _figure;
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.internal.provisional.INodeAdapter#isAdapterForType(java.lang.Object)
- */
- public boolean isAdapterForType(Object type) {
- return (type == IFigureHandler.class);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.internal.provisional.INodeAdapter#notifyChanged(org.eclipse.wst.sse.core.internal.provisional.INodeNotifier,
- * int, java.lang.Object, java.lang.Object, java.lang.Object, int)
- */
- public void notifyChanged(INodeNotifier notifier, int eventType,
- Object changedFeature, Object oldValue, Object newValue, int pos) {
- // TODO: anything?
- }
-
- /**
- * @param node
- * @return the css style on the node
- */
- protected ICSSStyle getCSSStyle(Element node) {
- ICSSStyle style = null;
- if (node instanceof IDOMElement) {
- style = (ICSSStyle) ((IDOMElement) node)
- .getAdapterFor(ICSSStyle.class);
- }
- if (style == null) {
- style = DefaultStyle.getInstance();
- }
-
- return style;
- }
-
- /**
- * @param oldFigure
- */
- protected void setCurrentFigure(CSSFigure oldFigure) {
- this._figure = oldFigure;
- }
-
- public CSSFigure getFigure() {
- return this._figure;
- }
-
- /**
- * child class could override this method
- */
- public void dispose() {
- // TODO: anything to dispose?
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/figurehandler/BRFigureHandler.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/figurehandler/BRFigureHandler.java
deleted file mode 100644
index ff32c72..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/figurehandler/BRFigureHandler.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.figurehandler;
-
-import org.eclipse.jst.pagedesigner.css2.layout.CSSBrFlowLayout;
-import org.eclipse.jst.pagedesigner.css2.layout.CSSFigure;
-import org.eclipse.jst.pagedesigner.css2.layout.CSSLayout;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- */
-public class BRFigureHandler extends AbstractFigureHandler {
- /**
- * @param figure
- * @return the CSS layout for fixed layout
- */
- protected CSSLayout getFixedCSSLayout(CSSFigure figure) {
- return new CSSBrFlowLayout(figure);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.figurehandler.IFigureHandler#isWidget()
- */
- public boolean isWidget() {
- return false;
- }
-
- public void updateFigure(Element node, CSSFigure oldFigure) {
- oldFigure.setCSSStyle(getCSSStyle(node));
- oldFigure.setFixedLayoutManager(getFixedCSSLayout(oldFigure));
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/figurehandler/DefaultFigureHandler.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/figurehandler/DefaultFigureHandler.java
deleted file mode 100644
index 82cc075..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/figurehandler/DefaultFigureHandler.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.figurehandler;
-
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.layout.CSSFigure;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class DefaultFigureHandler extends AbstractFigureHandler {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.figurehandler.IFigureHandler#updateFigure(org.w3c.dom.Element,
- * org.eclipse.jst.pagedesigner.css2.layout.CSSFigure)
- */
- public void updateFigure(Element node, CSSFigure oldFigure) {
- setCurrentFigure(oldFigure);
- ICSSStyle style = getCSSStyle(node);
- oldFigure.setCSSStyle(style);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.figurehandler.IFigureHandler#isWidget()
- */
- public boolean isWidget() {
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/figurehandler/FigureFactory.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/figurehandler/FigureFactory.java
deleted file mode 100644
index c0070ef..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/figurehandler/FigureFactory.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.figurehandler;
-
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.jst.jsf.common.ui.JSFUICommonPlugin;
-import org.eclipse.jst.jsf.common.ui.internal.utils.JSFSharedImages;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IWorkspaceContextResolver;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContextFactory2;
-import org.eclipse.jst.pagedesigner.css2.layout.CSSFigure;
-import org.eclipse.jst.pagedesigner.css2.layout.CSSTextFigure;
-import org.eclipse.jst.pagedesigner.css2.provider.ICSSTextProvider;
-import org.eclipse.jst.pagedesigner.editors.palette.TagImageManager;
-import org.eclipse.jst.pagedesigner.utils.HTMLUtil;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public final class FigureFactory
-{
- /**
- * @param figure
- * @param node
- */
- private static void createFigureDeep(IFigure parentFigure, final Node node) {
- if (node instanceof Element) {
- IFigureHandler handler = createAndAdapt((Element) node);
- if (handler instanceof HiddenFigureHandler) {
- // for deep hidden element, we don't create figure for them.
- // this will remove the small <> icon for data window.
- return;
- }
- CSSFigure figure = new CSSFigure();
- handler.updateFigure((Element) node, figure);
- // IFigure figure = handler.createFigure((Element) node);
- parentFigure.add(figure);
- if (!handler.isWidget()) {
- NodeList children = node.getChildNodes();
-
- for (int i = 0, size = children.getLength(); i < size; i++) {
- createFigureDeep(figure, children.item(i));
- }
- }
- } else if (node instanceof Text) {
- final String data = HTMLUtil.compactWhitespaces((Text) node, node
- .getNodeValue());
- // XXX: seemed there is some bug in handling whitespace (unnecessary
- // take additional space)
- // so skip it here.
- if (data.trim().length() == 0) {
- return;
- }
- // XXX: currently creating of CSSTextFigure is distributed both here
- // and TextEditPart. We may want to unify them later.
- CSSTextFigure figure = new CSSTextFigure(new ICSSTextProvider() {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.provider.ICSSTextProvider#getCSSStyle()
- */
- // TODO: dead?
-// public ICSSStyle getCSSStyle() {
-// INodeNotifier notifier = (INodeNotifier) node
-// .getParentNode();
-// return (ICSSStyle) notifier.getAdapterFor(ICSSStyle.class);
-// }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.provider.ICSSTextProvider#getTextData()
- */
- public String getTextData() {
- return data;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.provider.ICSSTextProvider#getSelectedRange()
- */
- public int[] getSelectedRange() {
- // text figure created here will not be real text in
- // original doc.
- // so don't support their selection.
- return null;
- }
- });
- parentFigure.add(figure);
- }
- }
-
- /**
- * @param ele
- * @param old
- * @param figure
- * @return the figure
- */
- public static IFigure updateDeepFigure(Element ele, Element old,
- CSSFigure figure) {
- recursiveDisposeAndUnadapt(old);
- List figureChildren = figure.getChildren();
- for (int i = figureChildren.size() - 1; i >= 0; i--) {
- figure.remove((IFigure) figureChildren.get(i));
- }
-
- IFigureHandler handler = createAndAdapt(ele);
- handler.updateFigure(ele, figure);
- if (!handler.isWidget()) {
- NodeList children = ele.getChildNodes();
- for (int i = 0, size = children.getLength(); i < size; i++) {
- createFigureDeep(figure, children.item(i));
- }
- }
- return figure;
- }
-
-
- private static void recursiveDisposeAndUnadapt(Element ele) {
- disposeAndUnadapt(ele);
- NodeList nl = ele.getChildNodes();
- for (int i = 0, size = nl.getLength(); i < size; i++) {
- Node n = nl.item(i);
- if (n instanceof Element) {
- recursiveDisposeAndUnadapt((Element) n);
- }
- }
- }
-
- private static void disposeAndUnadapt(Element ele) {
- IFigureHandler handler = getHandler(ele);
- if (handler != null) {
- handler.dispose();
- ((IDOMElement) ele).removeAdapter(handler);
- }
- }
-
- private static IFigureHandler getHandler(Element ele) {
- if (ele instanceof IDOMElement) {
- IDOMElement xmlele = (IDOMElement) ele;
- return (IFigureHandler) xmlele.getAdapterFor(IFigureHandler.class);
- }
- return null;
- }
-
- private static IFigureHandler createAndAdapt(Element ele) {
- IFigureHandler handler = createFigureHandler(ele);
- if (ele instanceof IDOMElement) {
- ((IDOMElement) ele).addAdapter(handler);
- }
- return handler;
- }
-
- private static IFigureHandler createFigureHandler(Element ele) {
- String tag = ele.getTagName();
- if ("input".equalsIgnoreCase(tag)) {
- return new InputFigureHandler();
- } else if ("select".equalsIgnoreCase(tag)) {
- return new SelectFigureHandler();
- } else if ("img".equalsIgnoreCase(tag)) {
- return new ImgFigureHandler();
- } else if ("object".equalsIgnoreCase(tag)) {
- return new ObjectFigureHandler();
- } else if ("textarea".equalsIgnoreCase(tag)) {
- return new TextareaFigureHandler();
- } else if ("br".equalsIgnoreCase(tag)) {
- return new BRFigureHandler();
- } else if (!HTMLUtil.isVisualHtmlElement(tag)) {
- return new HiddenFigureHandler(getSharedHTMLImage(ele));
- } else {
- return new DefaultFigureHandler();
- }
- }
-
- /**
- * @param tag
- * @return
- */
- private static Image getSharedHTMLImage(Element element) {
- Image image = null;
-
- IStructuredDocumentContext context = IStructuredDocumentContextFactory2.INSTANCE.getContext(element);
- if (context != null){
- IWorkspaceContextResolver wsResolver = IStructuredDocumentContextResolverFactory.INSTANCE.getWorkspaceContextResolver(context);
- if (wsResolver != null){
- image = TagImageManager.getInstance().getSmallIconImage(wsResolver.getProject(),"HTML", element.getLocalName());
- }
- }
- return image != null ? image : JSFUICommonPlugin.getDefault().getImage(
- JSFSharedImages.DEFAULT_PALETTE_TAG_IMG);
- }
-
- private FigureFactory()
- {
- // no external instantiation
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/figurehandler/HiddenFigureHandler.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/figurehandler/HiddenFigureHandler.java
deleted file mode 100644
index 4a253cd..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/figurehandler/HiddenFigureHandler.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.figurehandler;
-
-import org.eclipse.jst.pagedesigner.css2.provider.ICSSWidgetProvider;
-import org.eclipse.jst.pagedesigner.css2.style.DefaultStyle;
-import org.eclipse.jst.pagedesigner.css2.widget.ImageWidgetProvider;
-import org.eclipse.swt.graphics.Image;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-/*package*/ class HiddenFigureHandler extends WidgetFigureHandler {
- private Image _image;
-
- /**
- * @param image
- */
- public HiddenFigureHandler(Image image) {
- _image = image;
- }
-
- protected ICSSWidgetProvider initializeWidgetProvider(Element ele) {
- return new ImageWidgetProvider(getImage(), DefaultStyle.getInstance());
- }
-
- /**
- * @return
- */
- private Image getImage() {
- return _image;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/figurehandler/IFigureHandler.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/figurehandler/IFigureHandler.java
deleted file mode 100644
index 99cfe3a..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/figurehandler/IFigureHandler.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.figurehandler;
-
-import org.eclipse.jst.pagedesigner.css2.layout.CSSFigure;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.w3c.dom.Element;
-
-/**
- * IFigureHandler is similiar to EditPart in some sence. Each IFigureHandler is
- * adapted to an HTML element node, and provide a figure for it.
- *
- * @author mengbo
- * @version 1.5
- */
-public interface IFigureHandler extends INodeAdapter {
- /**
- * @param node
- * @param oldFigure
- */
- public void updateFigure(Element node, CSSFigure oldFigure);
-
- /**
- *
- */
- public void dispose();
-
- /**
- * @return true if the node is deemed a widget
- */
- public boolean isWidget();
-
- /**
- * @return the figure
- */
- public CSSFigure getFigure();
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/figurehandler/ImgFigureHandler.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/figurehandler/ImgFigureHandler.java
deleted file mode 100644
index b47e945..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/figurehandler/ImgFigureHandler.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.figurehandler;
-
-import org.eclipse.jst.pagedesigner.css2.provider.ICSSWidgetProvider;
-import org.eclipse.jst.pagedesigner.css2.widget.ImageWidgetProvider;
-import org.eclipse.jst.pagedesigner.utils.ImageResolver;
-import org.eclipse.swt.graphics.Image;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- */
-/*package*/ class ImgFigureHandler extends WidgetFigureHandler {
- /**
- * the image provided for a widget
- */
- protected Image _image;
-
- /**
- * child class can override this method.
- *
- * @param node
- */
- protected void initializeImage(Element node) {
- if (_image != null) {
- _image.dispose();
- }
- _image = ImageResolver.initializeImage(node, "src");
- }
-
- public void dispose() {
- if (_image != null) {
- _image.dispose();
- _image = null;
- }
- }
-
- protected ICSSWidgetProvider initializeWidgetProvider(Element ele) {
- initializeImage(ele);
- ImageWidgetProvider provider = new ImageWidgetProvider(_image,
- getCSSStyle(ele));
- return provider;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/figurehandler/InputFigureHandler.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/figurehandler/InputFigureHandler.java
deleted file mode 100644
index bc767b7..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/figurehandler/InputFigureHandler.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.figurehandler;
-
-import org.eclipse.jst.jsf.common.ui.JSFUICommonPlugin;
-import org.eclipse.jst.jsf.common.ui.internal.utils.JSFSharedImages;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.jst.pagedesigner.css2.provider.ICSSWidgetProvider;
-import org.eclipse.jst.pagedesigner.css2.widget.ButtonWidgetProvider;
-import org.eclipse.jst.pagedesigner.css2.widget.CheckboxWidgetProvider;
-import org.eclipse.jst.pagedesigner.css2.widget.HiddenProvider;
-import org.eclipse.jst.pagedesigner.css2.widget.ImageWidgetProvider;
-import org.eclipse.jst.pagedesigner.css2.widget.InputFileWidgetProvider;
-import org.eclipse.jst.pagedesigner.css2.widget.RadioWidgetProvider;
-import org.eclipse.jst.pagedesigner.css2.widget.TextInputWidgetProvider;
-import org.eclipse.jst.pagedesigner.utils.DOMUtil;
-import org.eclipse.jst.pagedesigner.utils.ImageResolver;
-import org.eclipse.swt.graphics.Image;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- */
-/*package*/ class InputFigureHandler extends WidgetFigureHandler {
- private Image _image;
-
- void initializeImage(Element node) {
- if (_image != null) {
- _image.dispose();
- }
- _image = ImageResolver.initializeImage(node, "src");
- }
-
- ImageWidgetProvider getImageProvider(Element node) {
- initializeImage(node);
- ImageWidgetProvider provider = new ImageWidgetProvider(_image,
- getCSSStyle(node));
- return provider;
- }
-
- ICSSWidgetProvider getButtonProvider(Element node) {
- ButtonWidgetProvider provider = new ButtonWidgetProvider(
- getCSSStyle(node));
- provider.setValue(getButtonValue(node));
- return provider;
- }
-
- ICSSWidgetProvider getFileProvider(Element node) {
- // ICSSWidgetProvider textprovider = getTextInputProvider();
- // // XXX: should we use the defaultstyle for the button?
- // ButtonWidgetProvider browsebutton = new
- // ButtonWidgetProvider(getCSSStyle());
- // browsebutton.setValue("Browse...");
- // CompositeWidgetProvider provider = new
- // CompositeWidgetProvider(getCSSStyle(), textprovider, browsebutton,
- // false);
- // return provider;
- ICSSWidgetProvider textprovider = getTextInputProvider(node);
- // XXX: should we use the defaultstyle for the button?
- ButtonWidgetProvider browsebutton = new ButtonWidgetProvider(
- getCSSStyle(node));
- browsebutton.setValue("Browse...");
- InputFileWidgetProvider provider = new InputFileWidgetProvider(
- getCSSStyle(node), textprovider, browsebutton);
- return provider;
- }
-
- /**
- * should not return null
- *
- * @return the image
- */
- protected Image getHiddenImage() {
- return JSFUICommonPlugin.getDefault().getImage(
- JSFSharedImages.DEFAULT_PALETTE_TAG_IMG);
- }
-
- ICSSWidgetProvider getHiddenProvider(Element node) {
- return new HiddenProvider(getHiddenImage(), node);
- }
-
- ICSSWidgetProvider getPasswordProvider(Element node) {
- TextInputWidgetProvider provider = new TextInputWidgetProvider(
- getCSSStyle(node), TextInputWidgetProvider.PWD_SIZE);
- provider.setSize(getSize(node));
- provider.setValue("********");
- return provider;
- }
-
- ICSSWidgetProvider getTextInputProvider(Element node) {
- TextInputWidgetProvider provider = new TextInputWidgetProvider(
- getCSSStyle(node));
- provider.setSize(getSize(node));
- provider.setValue(getValue(node));
- return provider;
- }
-
- private int getSize(Element node) {
- String s = DOMUtil.getAttributeIgnoreCase(node, "size");
- try {
- if (s != null) {
- return Integer.parseInt(s);
- }
- } catch (NumberFormatException ex) {
- // suppress and fall-through; return 0
- }
- return 0;
- }
-
- /**
- * @return
- */
- private String getValue(Element node) {
- return DOMUtil.getAttributeIgnoreCase(node, "value");
- }
-
- private String getButtonValue(Element node) {
- String value = getValue(node);
- if (value == null) {
- String type = DOMUtil.getAttributeIgnoreCase(node,
- ICSSPropertyID.ATTR_TYPE);
- if (type.equalsIgnoreCase(ICSSPropertyID.VAL_SUBMIT)) {
- return "Submit Query";
- } else if (type.equalsIgnoreCase(ICSSPropertyID.VAL_RESET)) {
- return "Reset";
- }
- }
- return value;
- }
-
- /**
- * @return the widget provider
- */
- protected ICSSWidgetProvider initializeWidgetProvider(Element node) {
- reset();
-
- String type = DOMUtil.getAttributeIgnoreCase(node,
- ICSSPropertyID.ATTR_TYPE);
-
- if (type == null) {
- return getTextInputProvider(node);
- } else if (type.equalsIgnoreCase(ICSSPropertyID.VAL_SUBMIT)
- || type.equalsIgnoreCase(ICSSPropertyID.VAL_RESET)
- || type.equalsIgnoreCase(ICSSPropertyID.VAL_BUTTON)) {
- return getButtonProvider(node);
- } else if (type.equalsIgnoreCase(ICSSPropertyID.VAL_IMAGE)) {
- return getImageProvider(node);
- } else if (type.equalsIgnoreCase(ICSSPropertyID.VAL_FILE)) {
- return getFileProvider(node);
- } else if (type.equalsIgnoreCase(ICSSPropertyID.VAL_RADIO)) {
- RadioWidgetProvider provider = new RadioWidgetProvider(
- getCSSStyle(node));
- provider.setChecked(node.hasAttribute("checked"));
- return provider;
- } else if (type.equalsIgnoreCase(ICSSPropertyID.VAL_CHECKBOX)) {
- CheckboxWidgetProvider provider = new CheckboxWidgetProvider(
- getCSSStyle(node));
- provider.setChecked(node.hasAttribute("checked"));
- return provider;
- } else if (type.equalsIgnoreCase(ICSSPropertyID.VAL_HIDDEN)) {
- return getHiddenProvider(node);
- }
- if (type.equalsIgnoreCase(ICSSPropertyID.VAL_PASSWORD)) {
- return getPasswordProvider(node);
- }
- return getTextInputProvider(node);
- }
-
- /**
- *
- */
- private void reset() {
- if (_image != null) {
- _image.dispose();
- _image = null;
- }
- }
-
- public void dispose() {
- reset();
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/figurehandler/ObjectFigureHandler.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/figurehandler/ObjectFigureHandler.java
deleted file mode 100644
index 0b136d5..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/figurehandler/ObjectFigureHandler.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.figurehandler;
-
-import org.eclipse.jst.pagedesigner.editors.palette.TagImageManager;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-/*package*/ class ObjectFigureHandler extends ImgFigureHandler {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.figurehandler.ImgFigureHandler#initializeImage()
- */
- protected void initializeImage(Element node) {
- if (_image == null) {
- _image = TagImageManager.getInstance().getSmallIconImage(null, "HTML", node.getTagName());
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/figurehandler/SelectFigureHandler.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/figurehandler/SelectFigureHandler.java
deleted file mode 100644
index 6876b54..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/figurehandler/SelectFigureHandler.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.figurehandler;
-
-import java.util.List;
-
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.jst.pagedesigner.css2.provider.ICSSWidgetProvider;
-import org.eclipse.jst.pagedesigner.css2.widget.ComboWidgetProvider;
-import org.eclipse.jst.pagedesigner.css2.widget.ListWidgetProvider;
-import org.eclipse.jst.pagedesigner.utils.DOMUtil;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- */
-/*package*/ class SelectFigureHandler extends WidgetFigureHandler {
-
- /**
- * @param node
- * @return the labels
- */
- public String[] getOptionLabels(Element node) {
- List options = DOMUtil.getChildElementsByTagIgnoreCase(node,
- IHTMLConstants.TAG_OPTION);
- String[] ret = new String[options.size()];
- for (int i = 0; i < ret.length; i++) {
- Element option = (Element) options.get(i);
- ret[i] = DOMUtil.getTextElementValue(option);
- }
- return ret;
- }
-
- /**
- * @param node
- * @return the label
- */
- public String getSelectedLabels(Element node) {
- List options = DOMUtil.getChildElementsByTagIgnoreCase(node,
- IHTMLConstants.TAG_OPTION);
- String result = null;
- for (int i = 0, n = options.size(); i < n; i++) {
- Element option = (Element) options.get(i);
- if (option.hasAttribute(IHTMLConstants.ATTR_SELECTED)) {
- result = DOMUtil.getTextElementValue(option);
- }
- }
- return result;
- }
-
- /**
- * @param node
- * @return true if is multiple
- */
- private boolean isMultiple(Element node) {
- return DOMUtil
- .getAttributeIgnoreCase(node, ICSSPropertyID.VAL_MULTIPLE) != null;
- }
-
- /**
- * @return the provider
- */
- protected final ICSSWidgetProvider initializeWidgetProvider(Element node) {
- String[] labels = getOptionLabels(node);
- String rows = DOMUtil.getAttributeIgnoreCase(node,
- IHTMLConstants.ATTR_SIZE);
- int rowsInt = 0;
- try {
- if (rows != null) {
- rowsInt = Integer.parseInt(rows);
- }
- } catch (Exception ex) {
- // ignore
- }
- if (isMultiple(node) || rowsInt > 1) {
- ListWidgetProvider provider = new ListWidgetProvider(
- getCSSStyle(node));
- provider.setOptions(labels);
- provider.setRows(rowsInt);
- return provider;
- }
- ComboWidgetProvider provider = new ComboWidgetProvider(
- getCSSStyle(node));
- provider.setOptions(labels);
- provider.setSelectedLabel(getSelectedLabels(node));
- return provider;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/figurehandler/TextareaFigureHandler.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/figurehandler/TextareaFigureHandler.java
deleted file mode 100644
index 2b42a4f..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/figurehandler/TextareaFigureHandler.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.figurehandler;
-
-import org.eclipse.jst.pagedesigner.css2.provider.ICSSWidgetProvider;
-import org.eclipse.jst.pagedesigner.css2.widget.TextAreaWidgetProvider;
-import org.eclipse.jst.pagedesigner.utils.DOMUtil;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-/*package*/ class TextareaFigureHandler extends WidgetFigureHandler {
- protected ICSSWidgetProvider initializeWidgetProvider(Element node) {
- TextAreaWidgetProvider provider = new TextAreaWidgetProvider(
- getCSSStyle(node));
- String s = DOMUtil.getAttributeIgnoreCase(node, "cols");
- if (s != null) {
- try {
- provider.setColumns(Integer.parseInt(s));
- } catch (Exception ex) {
- // ignore
- }
- }
- s = DOMUtil.getAttributeIgnoreCase(node, "rows");
- if (s != null) {
- try {
- provider.setRows(Integer.parseInt(s));
- } catch (Exception ex) {
- // ignore
- }
- }
- s = DOMUtil.getTextElementValue(node);
- if (s != null) {
- provider.setValue(s);
- }
- return provider;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/figurehandler/WidgetFigureHandler.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/figurehandler/WidgetFigureHandler.java
deleted file mode 100644
index d2a3421..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/figurehandler/WidgetFigureHandler.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.figurehandler;
-
-import org.eclipse.jst.pagedesigner.css2.layout.CSSFigure;
-import org.eclipse.jst.pagedesigner.css2.layout.CSSWidgetLayout;
-import org.eclipse.jst.pagedesigner.css2.provider.ICSSWidgetProvider;
-import org.w3c.dom.Element;
-
-/**
- * A widget figure handler
- *
- */
-abstract class WidgetFigureHandler extends AbstractFigureHandler {
-
- /**
- * default constructor
- */
- public WidgetFigureHandler() {
- super();
- }
-
- public void updateFigure(Element node, CSSFigure oldFigure) {
- setCurrentFigure(oldFigure);
- ICSSWidgetProvider provider = initializeWidgetProvider(node);
- oldFigure.setCSSStyle(provider.getCSSStyle());
- oldFigure
- .setFixedLayoutManager(new CSSWidgetLayout(oldFigure, provider));
- }
-
- /**
- * @param ele
- * @return the widget provider
- */
- protected abstract ICSSWidgetProvider initializeWidgetProvider(Element ele);
-
- public boolean isWidget() {
- return true;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/AbstractTagCreationAdvisor.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/AbstractTagCreationAdvisor.java
deleted file mode 100644
index 1ccd833..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/AbstractTagCreationAdvisor.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.itemcreation;
-
-import java.util.Collection;
-
-import org.eclipse.jst.pagedesigner.dom.DOMPositionHelper;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.jst.pagedesigner.itemcreation.command.ContainerCreationCommand;
-import org.eclipse.jst.pagedesigner.itemcreation.command.ElementCustomizationCommand;
-import org.eclipse.jst.pagedesigner.utils.BodyHelper;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Element;
-
-/**
- * Clients should sub-class in order to create a new ITagCreationAdvisor type,
- * however, it is preferable to extend DefaultTagCreationAdvisor where possible.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author cbateman
- *
- */
-public abstract class AbstractTagCreationAdvisor implements ITagCreationAdvisor
-{
- /**
- * Information passed by the framework about the tag to be created
- * {@link CreationData}
- */
- protected final CreationData _creationData;
-
- /**
- * @param creationData
- */
- public AbstractTagCreationAdvisor(CreationData creationData)
- {
- this._creationData = creationData;
- }
-
- /**
- * @param model
- * @param tagElement
- */
- public final void applyCustomization(IDOMModel model, Element tagElement)
- {
- ElementCustomizationCommand command =
- getElementCustomizationCommand(model, tagElement);
-
- if (command != null && command.canExecute())
- {
- command.execute();
- }
- }
-
- /**
- * @param model
- * @param tagElement
- * @return the customization command
- */
- protected abstract ElementCustomizationCommand getElementCustomizationCommand(IDOMModel model, Element tagElement);
-
- /**
- * Return position for tag after all necessary containers are created.
- * If necessary containers cannot be created and do not exist for any reason,
- * implementer should return null
- * to signal that the tag creation should not occur.
- *
- * Clients may override this method to provide custom container positioning
- *
- * @param model
- * @param domPosition
- * @return position after necessary containers are created
- */
- public final IDOMPosition checkAndApplyNecessaryContainers(
- IDOMModel model, IDOMPosition domPosition)
- {
- IDOMPosition position = DOMPositionHelper.splitText(domPosition);
-
- position = BodyHelper.adjustInsertPosition
- (_creationData.getUri(), _creationData.getTagName(), position);
-
- //position = getContainerCreationCommands(position);
- ContainerCreationCommand command = getContainerCreationCommand(position);
-
- if (command != null)
- {
- command.execute();
- Collection<IDOMPosition> collection = command.getResult();
-
- if (collection.size()==1)
- {
- position = collection.iterator().next();
- }
- else
- {
- position = null;
- }
- }
-
- if (position == null) {
- // user cancelled
- return null;
- }
-
- // because the next call of getPrefix() may insert new taglib node
- // into the document, if we use the normal
- // DOMPositin which use index, maybe it will be invalidated by the
- // new taglib node. So use RefPosition here.
- return DOMPositionHelper.toDOMRefPosition(position);
- }
-
- /**
- * @param position
- * @return a command (could be CompoundCommand or chained command) that when executed
- * will add any necessary containers.
- */
- protected abstract ContainerCreationCommand getContainerCreationCommand(IDOMPosition position);
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/AbstractTagCreator.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/AbstractTagCreator.java
deleted file mode 100644
index afc5b69..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/AbstractTagCreator.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.itemcreation;
-
-import org.eclipse.jst.jsf.core.internal.tld.ITLDConstants;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.w3c.dom.Element;
-
-/**
- * The abstract class from which all client ITagCreator instances
- * should be derived.
- *
- * The createTag method enforces a set of steps required by the framework
- * to create a new tag. However, it allows you to configure some of the steps
- * by providing an ITagCreationAdvisor through the doSelectCreationAdvisor.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author cbateman
- *
- */
-public abstract class AbstractTagCreator implements ITagCreator
-{
- /* (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.itemcreation.ITagCreator#createTag(org.eclipse.jst.pagedesigner.editors.palette.TagToolPaletteEntry, org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel, org.eclipse.jst.pagedesigner.dom.IDOMPosition)
- */
- public final Element createTag(final CreationData creationData)
- {
- final ITagCreationAdvisor advisor = selectCreationAdvisor(creationData);
-
- // adjust the creation position to accommodate required containers
- final IDOMPosition position =
- advisor.checkAndApplyNecessaryContainers(creationData.getModel(), creationData.getDomPosition());
-
- if (position == null) return null;//throw exception?
-
- creationData.setAdjustedPosition(position);
-
- // create the element
- final Element ele = createElement(creationData);
- if (ele == null) return null;//throw exception?
-
- // apply tag customization
- advisor.applyCustomization(creationData.getModel(), ele);
-
- // ensure that any attributes required by the tag's definition
- // is initialized.
- // TODO: a drawback of this approach is that it leaves the tag in
- // a state where there are no error flags to tell the user something is
- // missing, but may initialize the tag with an (empty) invalid value
- //ensureRequiredAttrs(ele, creationData);
-
- addTagToContainer(position, ele);
-
- return ele;
- }
-
- private ITagCreationAdvisor selectCreationAdvisor(CreationData creationData)
- {
- ITagCreationAdvisor advisor = doSelectCreationAdvisor(creationData);
-
- // enforce that the advisor must be an AbstractTagCreationAdvisor to
- // avoid using the default (not this case also covers advisor == null)
- if (! (advisor instanceof AbstractTagCreationAdvisor))
- {
- advisor = new DefaultTagCreationAdvisor(creationData);
- }
-
- return advisor;
- }
-
- /**
- * @param creationData
- * @return a tag creation advisor or null to indicate the use of the system default
- */
- protected abstract ITagCreationAdvisor doSelectCreationAdvisor(CreationData creationData);
-
- /**
- * @param creationData
- * @return {@link Element}
- */
- protected final Element createElement(final CreationData creationData)
- {
- Element ele = creationData.getModel().getDocument().createElement(creationData.getTagName());
- if (ele == null) return null;
-
- //ugly... fix me
-
- // TODO: move this into an ensure method?
- // XXX: we are using "startsWith("directive.")" to test whether
- // should setJSPTag, this
- // maybe is not the best way. Need check whether SSE have special
- // API for it.
- if (ITLDConstants.URI_JSP.equals(creationData.getUri())
- && (ele.getLocalName().startsWith("directive.")
- || "declaration".equals(ele.getLocalName())
- || "expression".equals(ele.getLocalName()) || "scriptlet"
- .equals(ele.getLocalName()))) {
- // it is a jsp tag
- ((IDOMElement) ele).setJSPTag(true);
- }
-
- if (creationData.getPrefix() != null)
- {
- ele.setPrefix(creationData.getPrefix());
- }
-
- return ele;
- }
-
- /**
- * @param position
- * @param tagElement
- */
- private void addTagToContainer(final IDOMPosition position, final Element tagElement) {
- if (position == null || position.getContainerNode() == null) {
- return;
- }
-
- if (position.getNextSiblingNode() == null) {
- position.getContainerNode().appendChild(tagElement);
- } else {
- position.getContainerNode().insertBefore(tagElement,
- position.getNextSiblingNode());
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/CreationData.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/CreationData.java
deleted file mode 100644
index e4d908c..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/CreationData.java
+++ /dev/null
@@ -1,261 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.itemcreation;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jst.jsf.common.dom.TagIdentifier;
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.internal.TraitValueHelper;
-import org.eclipse.jst.jsf.common.metadata.query.ITaglibDomainMetaDataModelContext;
-import org.eclipse.jst.jsf.common.metadata.query.TaglibDomainMetaDataQueryHelper;
-import org.eclipse.jst.jsf.core.internal.tld.ITLDConstants;
-import org.eclipse.jst.jsf.core.internal.tld.TagIdentifierFactory;
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo;
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfos;
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationInfo;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.jst.pagedesigner.editors.palette.TagToolPaletteEntry;
-import org.eclipse.jst.pagedesigner.utils.JSPUtil;
-import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMDocType;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-
-/**
- * Value object that wraps creation data
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author cbateman
- *
- */
-public final class CreationData
-{
- private final TagToolPaletteEntry _tagEntry;
- private final String _prefix;
- private final IDOMPosition _domPosition;
- private final IDOMModel _model;
- private final IAdaptable _customizationData;
-
- private TagIdentifier _tagId; // = null; lazy init on creation
-
- /**
- * The tag {@link Entity} being created
- */
- private Entity _tagEntity; // = null; lazy load because derived from
- // potentially expensive meta-data search
-
- /**
- * The {@link ITaglibDomainMetaDataModelContext} for the tag creation
- */
- private final ITaglibDomainMetaDataModelContext _taglibMetaDataContext;
-
- // mutable because it may be changed from the original _domPosition
- private IDOMPosition _adjustedPosition;
-
-
- /**
- * @param tagEntry TODO: remove this direct dependence on the palette
- * @param model
- * @param domPosition
- * @param taglibMetaDataContext
- * @param customizationData
- */
- public CreationData(final TagToolPaletteEntry tagEntry, final IDOMModel model, final IDOMPosition domPosition, final ITaglibDomainMetaDataModelContext taglibMetaDataContext, final IAdaptable customizationData)
- {
- super();
- this._tagEntry = tagEntry;
- this._prefix = getPrefix(getUri(), model, getDefaultPrefix());
- this._taglibMetaDataContext = taglibMetaDataContext;
- this._domPosition = domPosition;
- this._adjustedPosition = _domPosition;
- this._model = model;
- this._customizationData = customizationData;
- }
-
- /**
- * Returns the ns prefix for the tag and also creates taglib reference if necessary
- * @param uri
- * @param model
- * @param suggested
- * @return prefix to use
- */
- protected static String getPrefix(String uri, IDOMModel model,
- String suggested) {
- // TODO: this shouldn't really add to the document
- if (ITLDConstants.URI_HTML.equalsIgnoreCase(uri)
- || ITLDConstants.URI_JSP.equalsIgnoreCase(uri)
- || CMDocType.JSP11_DOC_TYPE.equalsIgnoreCase(uri)) {
- return null;
- }
-
- // now handles custom tag lib
- return JSPUtil.getOrCreatePrefix(model, uri, suggested);
- }
-
- /**
- * @return the tag identifier uri
- */
- public String getUri() {
- return _tagEntry.getURI();
- }
-
- /**
- * @return the default prefix
- */
- public String getDefaultPrefix() {
- return _tagEntry.getDefaultPrefix();
- }
-
- /**
- * @return the local prefix for the tag
- */
- public String getPrefix() {
- return _prefix;
- }
-
- /**
- * @return the tag name
- */
- public String getTagName() {
- return _tagEntry.getTagName();
- }
-
- /**
- * @return the id
- */
- private String getItemId() {
- return _tagEntry.getId();
- }
-
- /**
- * @return the palette entry that this creation info is based on
- */
- public TagToolPaletteEntry getTagEntry() {
- return _tagEntry;
- }
-
- /**
- * @return {@link TagCreationInfo} for the tag entity
- */
- public TagCreationInfo getTagCreationInfo(){
- Model model = TaglibDomainMetaDataQueryHelper.getModel(_taglibMetaDataContext);
- if (model != null){
- Trait trait = TaglibDomainMetaDataQueryHelper.getTrait(model, PaletteInfos.TRAIT_ID);
- if (trait != null){
- PaletteInfos pis = (PaletteInfos)trait.getValue();
- PaletteInfo pi = pis.findPaletteInfoById(getItemId());
- if (pi != null){
- return pi.getTagCreation();
- }
- }
- //tag-creation trait on entity directly?
- Entity tag = getTagEntity();
- if (tag != null){//metadata exists
- trait = TaglibDomainMetaDataQueryHelper.getTrait(tag, "tag-create");
- if (trait != null && trait.getValue() != null){
- return (TagCreationInfo)trait.getValue();
- }
- }
- }
- return null;
- }
-
-
- /**
- * @return the {@link Entity} for this tag element being created
- */
- public Entity getTagEntity() {
- if (_tagEntity == null){
- _tagEntity = TaglibDomainMetaDataQueryHelper.getEntity(_taglibMetaDataContext, getTagName());
-
- }
- return _tagEntity;
- }
-
- /**
- * @return flag indicating that html form container ancestor is required
- */
- public boolean isHTMLFormRequired() {
- Trait t = TaglibDomainMetaDataQueryHelper.getTrait(getTagEntity(), "requires-html-form");
- if (t != null)
- return TraitValueHelper.getValueAsBoolean(t);
-
- return false;
- }
-
- /**
- * @return flag indicating that jsf component
- */
- public boolean isJSFComponent() {
- Model model = TaglibDomainMetaDataQueryHelper.getModel(_taglibMetaDataContext);
- Trait t = TaglibDomainMetaDataQueryHelper.getTrait(model, "is-jsf-component-library");
- if (t != null)
- return TraitValueHelper.getValueAsBoolean(t);
-
- return false;
- }
-
- /**
- * @return the metadata context for the tag
- */
- public ITaglibDomainMetaDataModelContext getTaglibMetaDataContext() {
- return _taglibMetaDataContext;
- }
-
- /**
- * @return the original dom position of the tag creation
- */
- public IDOMPosition getDomPosition() {
- return _domPosition;
- }
-
- /**
- * @return the dom model
- */
- public IDOMModel getModel()
- {
- return _model;
- }
-
- /**
- * @return the adjusted position (calculated to account for containers etc.)
- */
- public IDOMPosition getAdjustedPosition() {
- return _adjustedPosition;
- }
-
- /**
- * @param adjustedPosition
- */
- /*package*/ void setAdjustedPosition(IDOMPosition adjustedPosition) {
- _adjustedPosition = adjustedPosition;
- }
-
- /**
- * @return the TagIdentifer for the tag to be created
- */
- public TagIdentifier getTagId()
- {
- if (_tagId == null)
- {
- _tagId = TagIdentifierFactory.createJSPTagWrapper(getUri(), getTagName());
- }
- return _tagId;
- }
-
- /**
- * @return the customization data passed in from the tool. May be null.
- */
- public IAdaptable getDropCustomizationData() {
- return _customizationData;
- }
-}
\ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/DefaultTagCreationAdvisor.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/DefaultTagCreationAdvisor.java
deleted file mode 100644
index a6dfca0..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/DefaultTagCreationAdvisor.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.itemcreation;
-
-import org.eclipse.jst.jsf.core.internal.tld.IJSFConstants;
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.jst.pagedesigner.itemcreation.command.ContainerCreationCommand;
-import org.eclipse.jst.pagedesigner.itemcreation.command.ElementCustomizationCommand;
-import org.eclipse.jst.pagedesigner.itemcreation.command.SingletonContainerCreationCommand;
-import org.eclipse.jst.pagedesigner.itemcreation.command.TagContainerCreationCommand;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Element;
-
-/**
- * The default advisor.
- *
- * Clients may extend this class.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author cbateman
- *
- */
-public class DefaultTagCreationAdvisor extends AbstractTagCreationAdvisor
-{
- /**
- * @param creationData
- */
- public DefaultTagCreationAdvisor(CreationData creationData)
- {
- super(creationData);
- }
-
-
- @Override
- protected ElementCustomizationCommand getElementCustomizationCommand(
- IDOMModel model, Element tagElement) {
- return new ElementCustomizationCommand(model, tagElement, _creationData);
- }
-
- /**
- * @param position the initial drop position
- * @return position after creating required containers
- */
- protected ContainerCreationCommand getContainerCreationCommand(final IDOMPosition position) {
- if (_creationData.isJSFComponent()) {
- return getJSFContainerCommand(position);
- }
- else if (_creationData.isHTMLFormRequired()){
- return getHtmlFormCommand(position);
- }
- return null;
- }
-
- /**
- * @param position
- * @return the default container creation command for a JSF tag
- */
- protected ContainerCreationCommand getJSFContainerCommand(final IDOMPosition position)
- {
- ContainerCreationCommand command =
- new SingletonContainerCreationCommand(position, IJSFConstants.TAG_IDENTIFIER_VIEW, _creationData.getTagId());
-
- if (_creationData.isHTMLFormRequired())
- {
- command.chain(new TagContainerCreationCommand(position, IJSFConstants.TAG_IDENTIFIER_FORM, _creationData.getTagId()));
- }
-
- return command;
- }
-
- /**
- * @param position
- * @return the default container creation command for an HTML form tag
- */
- protected ContainerCreationCommand getHtmlFormCommand(final IDOMPosition position)
- {
- return new TagContainerCreationCommand(position, IHTMLConstants.TAG_IDENTIFIER_HTML_FORM, _creationData.getTagId());
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/ITagCreationAdvisor.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/ITagCreationAdvisor.java
deleted file mode 100644
index 97e19c4..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/ITagCreationAdvisor.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.itemcreation;
-
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Element;
-
-/**
- * An advisor object that allows customization of tag creation in an ITagCreator
- *
- * Clients should *not* implement this interface. Extend AbstractTagCreationAdvisor
- * or DefaultTagCreationAdvisor instead.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author cbateman
- *
- */
-public interface ITagCreationAdvisor
-{
- /**
- * @param model
- * @param domPosition
- * @return a new IDOMPosition adjust for required containers or domPosition
- * if no adjust is required. ???May return null???
- */
- IDOMPosition checkAndApplyNecessaryContainers(IDOMModel model,
- IDOMPosition domPosition);
-
- /**
- * Apply customization to tagElement. May use to modify
- * attributes and child elements of the tag.
- *
- * @param model
- * @param tagElement
- * @param tagToolItem
- */
- void applyCustomization(IDOMModel model, Element tagElement);
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/ITagCreator.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/ITagCreator.java
deleted file mode 100644
index c8d56e0..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/ITagCreator.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.itemcreation;
-
-import org.w3c.dom.Element;
-
-/**
- * The interface type of all tag creators.
- *
- * Clients should *not* implement this interface. Extend AbstractTagCreator instead.
- *
- * <p><b>Provisional API - subject to change</b></p>
- */
-public interface ITagCreator {
- /**
- * @param creationData
- * @return W3C Element for the tag at the correct position in the DOM. May be null if creation cannot occur.
- */
- public Element createTag(final CreationData creationData);
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/ItemCreationEditPolicy.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/ItemCreationEditPolicy.java
deleted file mode 100644
index 96929a0..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/ItemCreationEditPolicy.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.itemcreation;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.requests.DropRequest;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.commands.CreateItemCommand;
-import org.eclipse.jst.pagedesigner.dom.DOMPositionHelper;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.jst.pagedesigner.editpolicies.DropEditPolicy;
-import org.eclipse.jst.pagedesigner.tools.ExposeHelper;
-import org.eclipse.jst.pagedesigner.validation.caret.ActionData;
-import org.eclipse.jst.pagedesigner.validation.caret.DnDPositionValidator;
-import org.eclipse.jst.pagedesigner.validation.caret.DropActionData;
-import org.eclipse.jst.pagedesigner.validation.caret.IPositionMediator;
-import org.eclipse.jst.pagedesigner.validation.caret.DropActionData.DropData;
-import org.eclipse.jst.pagedesigner.viewer.DesignPosition;
-import org.eclipse.jst.pagedesigner.viewer.IDropLocationStrategy;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-
-/**
- * @author mengbo
- */
-public class ItemCreationEditPolicy extends DropEditPolicy
-{
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editpolicies.AbstractEditPolicy#getCommand(org.eclipse.gef.Request)
- */
- public Command getCommand(Request request) {
- if (request instanceof ItemCreationRequest) {
- ItemCreationRequest r = (ItemCreationRequest) request;
- DesignPosition position = findPosition((ItemCreationRequest)request);
-
- if (position == null) {
- return null;
- }
- IDOMPosition domposition = DOMPositionHelper.toDOMPosition(position);
- if (domposition == null) {
- return null;
- }
- return new CreateItemCommand(
- PDPlugin
- .getResourceString("ItemCreationEditPolicy.CommandLabel.CreateItem"),//$NON-NLS-1$
- getViewer(getHost()).getModel(), domposition, r.getTagToolPaletteEntry());
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editpolicies.AbstractEditPolicy#getTargetEditPart(org.eclipse.gef.Request)
- */
- public EditPart getTargetEditPart(Request request) {
- if (request instanceof ItemCreationRequest) {
- DesignPosition position = findPosition((ItemCreationRequest)request);
-
- if (position == null) {
- return null;
- }
-
- EditPart container = position.getContainerPart();
- return container;
- }
- return null;
- }
-
- /**
- * @param host
- * @return
- */
- private IHTMLGraphicalViewer getViewer(EditPart host) {
- return (IHTMLGraphicalViewer) ((GraphicalEditPart) host).getViewer();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editpolicies.AbstractEditPolicy#showTargetFeedback(org.eclipse.gef.Request)
- */
- public void showTargetFeedback(Request request)
- {
- if (request instanceof DropRequest
- && request.getType() == ItemCreationRequest.REQ_ITEM_CREATION)
- {
- super.showTargetFeedback(request);
- if (getHost() instanceof GraphicalEditPart) {
- ExposeHelper exposeHelper = new ExposeHelper(
- getViewer(getHost()));
- exposeHelper.adjustVertical(((DropRequest)request).getLocation());
- }
- }
- }
-
- protected DesignPosition findPosition(DropRequest request) {
- final IPositionMediator mediator = getDropChildValidator(request);
- if (mediator == null)
- {
- return null;
- }
-
- final IDropLocationStrategy dropStrategy = createDropLocationStrategy(request);
- final DesignPosition position =
- dropStrategy.calculateDesignPosition(getHost(), request.getLocation(), mediator);
-
- // verify that the drop strategy has honoured it's contract that our
- // mediator be respected
- if (position != null)
- {
- if (!mediator.isValidPosition(position))
- {
- // if our mediator says no go, then veto the requestor
- // there is no drop location
- return null;
- }
- }
- return position;
- }
-
- protected final IPositionMediator createDefaultDropChildValidator(DropData data) {
- return new DnDPositionValidator(new DropActionData(
- ActionData.PALETTE_DND, data)); }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/ItemCreationRequest.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/ItemCreationRequest.java
deleted file mode 100644
index 27715c6..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/ItemCreationRequest.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.itemcreation;
-
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DropRequest;
-import org.eclipse.jst.pagedesigner.editors.palette.TagToolPaletteEntry;
-
-/**
- * Tag tool item creation request class
- *
- * @author mengbo
- */
-public class ItemCreationRequest extends Request implements DropRequest {
- /**
- * Constant used for item creation request
- */
- public static final String REQ_ITEM_CREATION = "Item Creation";
- /**
- * Constant used for tag tool item
- */
- public static final String TAG_TOOL_PALETTE_ENTRY = "TagToolPaletteEntry";
- /**
- * Constant used for location during creation request
- */
- public static final String LOCATION = "location";
-
-
- /**
- * Constructor
- */
- public ItemCreationRequest() {
- super(REQ_ITEM_CREATION);
- }
-
- /**
- * Constructor
- * @param type
- */
- public ItemCreationRequest(Object type) {
- super(type);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.requests.DropRequest#getLocation()
- */
- public Point getLocation() {
- return (Point)getExtendedData().get(LOCATION);
- }
-
- /**
- * Sets the location where the new object will be placed.
- *
- * @param location
- * the location
- */
- public void setLocation(Point location) {
- getExtendedData().remove(LOCATION);
- getExtendedData().put(LOCATION, location);
- }
-
- /**
- * Set the tag tool item for creation request
- * @param tagToolPaletteEntryItem
- */
- public void setTagToolPaletteEntry(TagToolPaletteEntry tagToolPaletteEntryItem) {
- getExtendedData().remove(TAG_TOOL_PALETTE_ENTRY);
- getExtendedData().put(TAG_TOOL_PALETTE_ENTRY, tagToolPaletteEntryItem);
- }
-
- /**
- * @return {@link TagToolPaletteEntry} requesting creation
- */
- public TagToolPaletteEntry getTagToolPaletteEntry() {
- return (TagToolPaletteEntry)getExtendedData().get(TAG_TOOL_PALETTE_ENTRY);
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/ItemCreationTool.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/ItemCreationTool.java
deleted file mode 100644
index 4e3c9c1..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/ItemCreationTool.java
+++ /dev/null
@@ -1,324 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.itemcreation;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.SharedCursors;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.tools.TargetingTool;
-import org.eclipse.jst.jsf.common.dom.TagIdentifier;
-import org.eclipse.jst.jsf.core.internal.tld.TagIdentifierFactory;
-import org.eclipse.jst.pagedesigner.commands.CreateItemCommand;
-import org.eclipse.jst.pagedesigner.editors.palette.TagToolPaletteEntry;
-import org.eclipse.jst.pagedesigner.elementedit.ElementEditFactoryRegistry;
-import org.eclipse.jst.pagedesigner.elementedit.IElementEdit;
-import org.eclipse.jst.pagedesigner.itemcreation.customizer.IDropCustomizer;
-import org.eclipse.swt.graphics.Cursor;
-
-/**
- * This Tool is used to create items. It is to replace the default CreationTool
- * of GEF. We are not using CreationToolEntry for creating item, since the
- * default GEF implementation require creating of the object before drop into
- * the view. We do not want to create the XML element (and possibly its taglib
- * declaration) before the drop is really performed.)
- *
- * @author mengbo
- */
-public class ItemCreationTool extends TargetingTool {
- TagToolPaletteEntry _tagPaletteItem; //can we get rid of this?
-
- /**
- * Default constructor. Sets the default and disabled cursors.
- * @param tagToolPaletteEntryItem
- */
- public ItemCreationTool(TagToolPaletteEntry tagToolPaletteEntryItem) {
- setDefaultCursor(SharedCursors.CURSOR_TREE_ADD);
- setDisabledCursor(SharedCursors.NO);
-
- this._tagPaletteItem = tagToolPaletteEntryItem;
- }
-
- /**
- * @see org.eclipse.gef.tools.AbstractTool#calculateCursor()
- */
- protected Cursor calculateCursor() {
- /*
- * Fix for Bug# 66010 The following two lines of code were added for the
- * case where a tool is activated via the keyboard (that code hasn't
- * been released yet). However, they were causing a problem as described
- * in 66010. Since the keyboard activation code is not being released
- * for 3.0, the following lines are being commented out.
- */
- // if (isInState(STATE_INITIAL))
- // return getDefaultCursor();
- return super.calculateCursor();
- }
-
- /**
- * Creates a {@link ItemCreationRequest}and sets this tool's factory on the
- * request.
- *
- * @see org.eclipse.gef.tools.TargetingTool#createTargetRequest()
- */
- protected Request createTargetRequest() {
- ItemCreationRequest request = new ItemCreationRequest();
- request.setTagToolPaletteEntry(_tagPaletteItem);
- return request;
- }
-
- /**
- * @see org.eclipse.gef.Tool#deactivate()
- */
- public void deactivate() {
- super.deactivate();
- // TODO: never read helper = null;
- }
-
- /**
- * @see org.eclipse.gef.tools.AbstractTool#getCommandName()
- */
- protected String getCommandName() {
- return ItemCreationRequest.REQ_ITEM_CREATION;
- }
-
- /**
- * Cast the target request to a CreateRequest and returns it.
- *
- * @return the target request as a CreateRequest
- * @see TargetingTool#getTargetRequest()
- */
- protected ItemCreationRequest getCreateRequest() {
- return (ItemCreationRequest) getTargetRequest();
- }
-
- /**
- * @see org.eclipse.gef.tools.AbstractTool#getDebugName()
- */
- protected String getDebugName() {
- return "Item Creation Tool";//$NON-NLS-1$
- }
-
- /**
- * The creation tool only works by clicking mouse button 1 (the left mouse
- * button in a right-handed world). If any other button is pressed, the tool
- * goes into an invalid state. Otherwise, it goes into the drag state,
- * updates the request's location and calls
- * {@link TargetingTool#lockTargetEditPart(org.eclipse.gef.EditPart)}with the edit part
- * that was just clicked on.
- *
- * @see org.eclipse.gef.tools.AbstractTool#handleButtonDown(int)
- */
- protected boolean handleButtonDown(int button) {
- if (button != 1) {
- setState(STATE_INVALID);
- handleInvalidInput();
- return true;
- }
- if (stateTransition(STATE_INITIAL, STATE_DRAG)) {
- if (getTargetEditPart() != null) {
- getCreateRequest().setLocation(getLocation());
- lockTargetEditPart(getTargetEditPart());
- // Snap only when size on drop is employed
- // TODO: never read helper = (SnapToHelper) getTargetEditPart().getAdapter(
- //SnapToHelper.class);
- }
- }
- return true;
- }
-
- /**
- * If the tool is currently in a drag or drag-in-progress state, it goes
- * into the terminal state, performs some cleanup (erasing feedback,
- * unlocking target edit part), and then calls {@link #performCreation(int)}.
- *
- * @see org.eclipse.gef.tools.AbstractTool#handleButtonUp(int)
- */
- protected boolean handleButtonUp(int button)
- {
- if (stateTransition(STATE_DRAG | STATE_DRAG_IN_PROGRESS, STATE_TERMINAL))
- {
- eraseTargetFeedback();
- unlockTargetEditPart();
-
- // customizer may cancel the drop
- customizeDropAndMaybeExecute(button);
- }
-
- setState(STATE_TERMINAL);
- handleFinished();
-
- return true;
- }
-
- /**
- * @param button
- */
- protected void customizeDropAndMaybeExecute(final int button)
- {
- Command command = getCurrentCommand();
-
- int status = IStatus.OK;
- if (command instanceof CreateItemCommand)
- {
- status = performCustomization((CreateItemCommand)command);
- }
-
- if (status == IStatus.OK)
- {
- performCreation(button);
- }
- }
-
- private int performCustomization(CreateItemCommand command)
- {
- IStatus status = Status.OK_STATUS;
- TagIdentifier tagId =
- TagIdentifierFactory.createJSPTagWrapper
- (_tagPaletteItem.getURI(), _tagPaletteItem.getTagName());
-
- IElementEdit elementEdit = ElementEditFactoryRegistry.getInstance().createElementEdit(tagId);
-
- if (elementEdit != null)
- {
- IDropCustomizer customizer = elementEdit.getDropCustomizer(tagId);
-
- if (customizer != null)
- {
- status = customizer.runCustomizer();
-
- if (status.getSeverity() == IStatus.OK)
- {
- command.setCustomizationData(customizer.getDropCustomizationData());
- }
- }
- }
- return status.getSeverity();
- }
-
- /**
- * Updates the request, sets the current command, and asks to show feedback.
- *
- * @see org.eclipse.gef.tools.AbstractTool#handleDragInProgress()
- */
- protected boolean handleDragInProgress() {
- if (isInState(STATE_DRAG_IN_PROGRESS)) {
- updateTargetRequest();
- setCurrentCommand(getCommand());
- showTargetFeedback();
- }
- return true;
- }
-
- /**
- * @see org.eclipse.gef.tools.AbstractTool#handleDragStarted()
- */
- protected boolean handleDragStarted() {
- return stateTransition(STATE_DRAG, STATE_DRAG_IN_PROGRESS);
- }
-
- /**
- * If the user is in the middle of creating a new edit part, the tool erases
- * feedback and goes into the invalid state when focus is lost.
- *
- * @see org.eclipse.gef.tools.AbstractTool#handleFocusLost()
- */
- protected boolean handleFocusLost() {
- if (isInState(STATE_DRAG | STATE_DRAG_IN_PROGRESS)) {
- eraseTargetFeedback();
- setState(STATE_INVALID);
- handleFinished();
- return true;
- }
- return false;
- }
-
- /**
- * @see org.eclipse.gef.tools.TargetingTool#handleHover()
- */
- protected boolean handleHover() {
- if (isInState(STATE_INITIAL))
- updateAutoexposeHelper();
- return true;
- }
-
- /**
- * Updates the request and mouse target, gets the current command and asks
- * to show feedback.
- *
- * @see org.eclipse.gef.tools.AbstractTool#handleMove()
- */
- protected boolean handleMove() {
- updateTargetRequest();
- updateTargetUnderMouse();
- setCurrentCommand(getCommand());
- showTargetFeedback();
- return true;
- }
-
- /**
- * Executes the current command and selects the newly created object. The
- * button that was released to cause this creation is passed in, but since
- * {@link #handleButtonDown(int)}goes into the invalid state if the button
- * pressed is not button 1, this will always be button 1.
- *
- * @param button
- * the button that was pressed
- */
- protected void performCreation(int button) {
- executeCurrentCommand();
- // selectAddedObject();
- }
-
- // /*
- // * Add the newly created object to the viewer's selected objects.
- // */
- // private void selectAddedObject() {
- // final Object model = getCreateRequest().getNewObject();
- // if (model == null)
- // return;
- // EditPartViewer viewer = getCurrentViewer();
- // Object editpart = viewer.getEditPartRegistry().get(model);
- // if (editpart instanceof EditPart) {
- // viewer.flush();
- // viewer.select((EditPart)editpart);
- // }
- // }
-
- /**
- * Sets the location (and size if the user is performing size-on-drop) of
- * the request.
- *
- * @see org.eclipse.gef.tools.TargetingTool#updateTargetRequest()
- */
- protected void updateTargetRequest() {
- ItemCreationRequest req = getCreateRequest();
- req.setLocation(getLocation());
- // if (isInState(STATE_DRAG_IN_PROGRESS)) {
- // Point loq = getStartLocation();
- // req.setLocation(bounds.getLocation());
- // req.getExtendedData().clear();
- // if (!getCurrentInput().isAltKeyDown() && helper != null) {
- // PrecisionRectangle baseRect = new PrecisionRectangle(bounds);
- // PrecisionRectangle result = baseRect.getPreciseCopy();
- // helper.snapRectangle(req, PositionConstants.NSEW,
- // baseRect, result);
- // req.setLocation(result.getLocation());
- // req.setSize(result.getSize());
- // }
- // } else {
- // req.setLocation(getLocation());
- // }
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/command/ContainerCreationCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/command/ContainerCreationCommand.java
deleted file mode 100644
index 23f429f..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/command/ContainerCreationCommand.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.itemcreation.command;
-
-import java.util.Collection;
-import java.util.Collections;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.jst.jsf.common.dom.TagIdentifier;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.jst.pagedesigner.itemcreation.internal.AbstractCreationCommand;
-
-/**
- * Command for creating containers.
- *
- * * <p><b>Provisional API - subject to change</b></p>
- *
- * Clients may sub-class, but is preferable to use {@link SingletonContainerCreationCommand}
- * or {@link TagContainerCreationCommand} instead.
- *
- * @author cbateman
- *
- */
-public abstract class ContainerCreationCommand extends AbstractCreationCommand
-{
- private final IDOMPosition _originalDomPosition;
- private final TagIdentifier _containerTag;
- private final TagIdentifier _tagBeingCreated;
- private IDOMPosition _domPosition;
- private ContainerCreationCommand _nextCommand = null;
-
- /**
- * @param domPosition
- * @param containerTag
- */
- /*package*/ ContainerCreationCommand(IDOMPosition domPosition, TagIdentifier containerTag, TagIdentifier tagBeingCreated)
- {
- _domPosition = domPosition;
- _originalDomPosition = domPosition;
- _containerTag = containerTag;
- _tagBeingCreated = tagBeingCreated;
- }
-
- @Override
- public final void execute()
- {
- _domPosition = doExecute();
-
- if (_nextCommand != null)
- {
- _nextCommand.setDomPosition(_domPosition);
- _nextCommand.execute();
- // update the dom position
- _domPosition = _nextCommand.getDomPosition();
- }
- }
-
- @Override
- public final Collection<IDOMPosition> getResult()
- {
- return Collections.singletonList(_domPosition);
- }
-
- /**
- * @return the new dom position after the container insert
- */
- protected abstract IDOMPosition doExecute();
-
- @Override
- public final ContainerCreationCommand chain(Command command)
- {
- if (!(command instanceof ContainerCreationCommand))
- {
- throw new IllegalArgumentException("Can only chain ContainerCreationCommand's");
- }
-
- if (_nextCommand == null)
- {
- _nextCommand = (ContainerCreationCommand) command;
- }
- else
- {
- _nextCommand.chain(command);
- }
-
- return this;
- }
-
- /**
- * Update the domPosition
- *
- * @param domPosition
- */
- public final void setDomPosition(final IDOMPosition domPosition)
- {
- if (_domPosition.getContainerNode().getOwnerDocument() ==
- domPosition.getContainerNode().getOwnerDocument())
- {
- _domPosition = domPosition;
- }
- else
- {
- // if not in same document, then error
- throw new IllegalArgumentException("New domPosition must be in same document as old domPosition");
- }
- }
-
- /**
- * @return the dom position
- */
- protected final IDOMPosition getDomPosition() {
- return _domPosition;
- }
-
- /**
- * @return the original dom position that this container creation command
- * was created with.
- */
- protected final IDOMPosition getOriginalDomPosition() {
- return _originalDomPosition;
- }
-
- /**
- * @return the container tag to be created
- */
- protected final TagIdentifier getContainerTag() {
- return _containerTag;
- }
-
- /**
- * @return the tag that is being created for which we are adding the container
- */
- protected final TagIdentifier getTagBeingCreated() {
- return _tagBeingCreated;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/command/ElementCustomizationCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/command/ElementCustomizationCommand.java
deleted file mode 100644
index e1a56ba..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/command/ElementCustomizationCommand.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.itemcreation.command;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jst.jsf.core.internal.tld.CMUtil;
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationAttribute;
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationInfo;
-import org.eclipse.jst.pagedesigner.editors.palette.impl.PaletteElementTemplateHelper;
-import org.eclipse.jst.pagedesigner.itemcreation.CreationData;
-import org.eclipse.jst.pagedesigner.itemcreation.internal.AbstractCreationCommand;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Element;
-
-/**
- * A command to customize a new tag element
- * <p>
- * <b>Provisional API - subject to change</b>
- * </p>
- *
- * Clients may sub-class.
- *
- * @author cbateman
- *
- */
-public class ElementCustomizationCommand extends AbstractCreationCommand
-{
- /**
- * the dom model where the element will be added
- */
- protected final IDOMModel _model;
- /**
- * the element to be customized
- */
- protected final Element _element;
- /**
- * the creation data for the new tag
- */
- protected final CreationData _creationData;
-
- /**
- * @param model
- * @param element
- * @param creationData
- */
- public ElementCustomizationCommand(final IDOMModel model,
- final Element element, final CreationData creationData)
- {
- _model = model;
- _element = element;
- _creationData = creationData;
- }
-
- @Override
- public void execute()
- {
- applyChildElementCustomization();
- applyAttributeCustomization();
- }
-
- @Override
- protected boolean prepare()
- {
- // do nothing by default; return true to indicate can execute
- return true;
- }
-
- /**
- * Override to customize the children of the tag being created
- *
- * Default implementation uses meta-data to load a template. This is the
- * prefered method for static child values (i.e. those that are not
- * calculated dynamically at runtime).
- */
- protected void applyChildElementCustomization()
- {
- final TagCreationInfo tagCreationInfo = _creationData.getTagCreationInfo();
- if (tagCreationInfo != null)
- {
- PaletteElementTemplateHelper.applyTemplate(_model, _element,
- _creationData.getTagEntry(), tagCreationInfo);
- }
- }
-
- /**
- * Add required attributes and default values, if set, to the created tag
- * element
- *
- * To customize the attributes that get added, use TagCreationInfo metadata
- *
- * This method is provided as a utility for clients. It is not used by
- * default
- *
- * @param element
- * @param creationData
- */
- protected final void ensureRequiredAttrs(final Element element,
- final CreationData creationData)
- {
- final CMElementDeclaration ed = CMUtil.getTLDElementDeclaration(creationData
- .getUri(), creationData.getTagName(), creationData.getModel()
- .getDocument().getStructuredDocument());
-
- if (ed != null)
- {
- for (final Iterator it = ed.getAttributes().iterator(); it.hasNext();)
- {
- final CMAttributeDeclaration attr = (CMAttributeDeclaration) it
- .next();
- if (attr.getUsage() == CMAttributeDeclaration.REQUIRED
- && element.getAttribute(attr.getAttrName()) == null)
- {
- element.setAttribute(attr.getAttrName(), attr
- .getDefaultValue());
- }
- }
- }
- }
-
- /**
- * Override to customize the attributes of the tag being created
- *
- * Default implementation uses meta-data to set the attribut values. This is
- * the prefered method for static attribute values (i.e. those that are not
- * calculated dynamically at runtime).
- *
- */
- protected void applyAttributeCustomization()
- {
- final TagCreationInfo info = _creationData.getTagCreationInfo();
- if (info != null)
- {
- final EList list = info.getAttributes();
- if (list != null)
- {
- for (final Iterator it = list.iterator(); it.hasNext();)
- {
- final TagCreationAttribute attr = (TagCreationAttribute) it
- .next();
- _element.setAttribute(attr.getId(),
- (attr.getValue() == null ? "" : attr.getValue()));
- }
- }
- }
- }
-
- @Override
- public final Command chain(final Command command)
- {
- return super.chain(command);
- }
-
- @Override
- public final Collection<Element> getResult()
- {
- return Collections.singletonList(_element);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/command/SingletonContainerCreationCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/command/SingletonContainerCreationCommand.java
deleted file mode 100644
index 841aad9..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/command/SingletonContainerCreationCommand.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.itemcreation.command;
-
-import org.eclipse.jst.jsf.common.dom.TagIdentifier;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.jst.pagedesigner.utils.BodyHelper;
-import org.eclipse.jst.pagedesigner.validation.caret.JSFRootContainerPositionRule;
-import org.w3c.dom.Document;
-
-/**
- * Used to create a container that should only occur once per document. Typically
- * used for HTML body and JSF f:view tags.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * Clients may reference but not sub-class.
- * @author cbateman
- *
- */
-public final class SingletonContainerCreationCommand extends ContainerCreationCommand
-{
- private static final int MAX_DEPTH_TO_SEARCH_FOR_CONTAINER = 10;
-
- /**
- * @param domPosition
- * @param containerTag
- * @param tagBeingCreated
- */
- public SingletonContainerCreationCommand(IDOMPosition domPosition,
- TagIdentifier containerTag, TagIdentifier tagBeingCreated)
- {
- super(domPosition, containerTag, tagBeingCreated);
- }
-
- @Override
- protected IDOMPosition doExecute()
- {
- return insertSingletonIfNotPresent();
- }
-
- private IDOMPosition insertSingletonIfNotPresent()
- {
- IDOMPosition domPosition = getDomPosition();
- final TagIdentifier containerTag = getContainerTag();
- final TagIdentifier tagBeingCreated = getTagBeingCreated();
-
- final Document document = EditModelQuery.getDocumentNode(domPosition
- .getContainerNode());
-
- final boolean isContainerAlreadyPresent =
- JSFRootContainerPositionRule.hasBasicContainers
- (document, MAX_DEPTH_TO_SEARCH_FOR_CONTAINER);
-
- if (isContainerAlreadyPresent)
- {
- // if the container and element to be created are the same,
- // then return null indicating to abort
- if (containerTag.equals(tagBeingCreated))
- {
- domPosition = null;
- }
- // otherwise, simply fall through keeping domPosition unchanged
- }
- // if the container isn't already present
- else
- {
-
- if (!containerTag.equals(tagBeingCreated))
- {
- // if the container is different and doesn't exist, then add it.
- domPosition = BodyHelper.insertBody(domPosition, containerTag.asQName(), "f");
- }
- // otherwise, fall through leaving domPosition unchanged
- }
-
- return domPosition;
- }
-
- @Override
- protected boolean prepare()
- {
- throw new UnsupportedOperationException("don't use");
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/command/TagContainerCreationCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/command/TagContainerCreationCommand.java
deleted file mode 100644
index 12f030a..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/command/TagContainerCreationCommand.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.itemcreation.command;
-
-import javax.xml.namespace.QName;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jst.jsf.common.dom.TagIdentifier;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.jst.pagedesigner.dom.ValidatorSupport;
-
-/**
- * @author cbateman
- *
- * * <p><b>Provisional API - subject to change</b></p>
- *
- * Clients may sub-class
- *
- */
-public class TagContainerCreationCommand extends ContainerCreationCommand {
-
- /**
- * @param domPosition
- * @param containerTag
- * @param tagBeingCreated
- */
- public TagContainerCreationCommand(IDOMPosition domPosition,
- TagIdentifier containerTag, TagIdentifier tagBeingCreated)
- {
- super(domPosition, containerTag, tagBeingCreated);
- }
-
- @Override
- protected IDOMPosition doExecute()
- {
- final IDOMPosition domPosition = getDomPosition();
- final QName containerQName = getContainerTag().asQName();
- boolean hasform = ValidatorSupport.checkContainer(domPosition, containerQName);
- IDOMPosition newPosition = domPosition;
- if (!hasform) {
- newPosition = ValidatorSupport
- .insertContainer(domPosition, containerQName, getContainerCustomizationData());
- if (newPosition == null) {
- newPosition = domPosition;
- }
- }
- return newPosition;
- }
-
- /**
- * Override to inject customization data into the tag creation
- * @return a customization data for the container.
- */
- protected IAdaptable getContainerCustomizationData()
- {
- return null;
- }
-
- @Override
- protected final boolean prepare()
- {
- throw new UnsupportedOperationException("don't use");
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/customizer/AbstractDropCustomizer.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/customizer/AbstractDropCustomizer.java
deleted file mode 100644
index 043d2aa..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/customizer/AbstractDropCustomizer.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle Corporation
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.itemcreation.customizer;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-
-/**
- * Clients should extend to implement their own IDropCustomizer.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author cbateman
- *
- */
-public abstract class AbstractDropCustomizer implements IDropCustomizer
-{
- /* (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.itemcreation.customizer.IDropCustomizer#getDropCustomizationData()
- */
- public IAdaptable getDropCustomizationData()
- {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.itemcreation.customizer.IDropCustomizer#runCustomizer()
- */
- public IStatus runCustomizer()
- {
- return Status.OK_STATUS;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/customizer/IDropCustomizer.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/customizer/IDropCustomizer.java
deleted file mode 100644
index 6b4cb2b..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/customizer/IDropCustomizer.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle Corporation
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.itemcreation.customizer;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IStatus;
-
-/**
- * Interface used to declare an object that customizes tag creation data prior
- * to a drop. The drop customizer should be used to illicit data on per-drop basis.
- *
- * Clients should not implement this interface. Extend AbstractDropCustomizer instead.
- *
- * <p><b>Provisional API - subject to change</b></p>
- * @author cbateman
- *
- */
-public interface IDropCustomizer
-{
- /**
- * Executed when the user performs a drop gesture for a tag, but before the
- * command is dispatched to create the tag in the target document. Implementers
- * may do calculations or raise customization UI. There return value is used
- * to decide whether to continue. Values other than OK and CANCEL are currently
- * ignored. If the return value has a severity of CANCEL, then the drop will
- * be aborted. If the return severity is OK, then getDropCustomizationData will
- * be called and it's value will be passed to the ITagCreator framework through
- * the CreationData object.
- *
- * NOTE: This method may be called on the UI thread, although this is not guaranteed.
- * Implementer should ensure that anything that is long-running (such as a dialog)
- * is user-cancellable and that any UI code is run on the display thread.
- *
- * @return the status condition of the customizer
- */
- public IStatus runCustomizer();
-
- /**
- * @return the customization data. This method will only be called after runCustomizer
- * and only if runCustomizer returns IStatus.OK in its severity. The adaptable will
- * be passed to the ITagCreator framework through the CreationData value object. You
- * may return null even if runCustomizer() returns OK.
- */
- public IAdaptable getDropCustomizationData();
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/internal/AbstractCreationCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/internal/AbstractCreationCommand.java
deleted file mode 100644
index 9a17e1f..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/internal/AbstractCreationCommand.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.itemcreation.internal;
-
-import java.util.Collection;
-import java.util.Collections;
-
-import org.eclipse.emf.common.command.AbstractCommand;
-import org.eclipse.emf.common.command.Command;
-
-/**
- * Internal super-class of all tag creation commands.
- *
- * @author cbateman
- *
- */
-public abstract class AbstractCreationCommand extends AbstractCommand implements
- ICreationCommand
-{
- public abstract void execute();
-
- public final void redo()
- {
- throw new UnsupportedOperationException("don't use");
- }
-
- @Override
- public final boolean canExecute()
- {
- return super.canExecute();
- }
-
- @Override
- public final boolean canUndo() {
- return super.canUndo();
- }
-
- @Override
- public Command chain(Command command) {
- if (command instanceof ICreationCommand)
- {
- return super.chain(command);
- }
- throw new IllegalArgumentException("command must an ICreationCommand");
- }
-
- @Override
- public final void dispose()
- {
- throw new UnsupportedOperationException("don't use");
- }
-
- @Override
- public final Collection<?> getAffectedObjects() {
- return super.getAffectedObjects();
- }
-
- @Override
- public final String getDescription()
- {
- return super.getDescription();
- }
-
- @Override
- public final String getLabel()
- {
- return super.getLabel();
- }
-
- @Override
- public Collection<?> getResult()
- {
- return Collections.EMPTY_LIST;
- }
-
- @Override
- protected abstract boolean prepare();
-
- @Override
- public final void setDescription(String description)
- {
- super.setDescription(description);
- }
-
- @Override
- public final void setLabel(String label)
- {
- super.setLabel(label);
- }
-
- @Override
- public final void undo()
- {
- // for now, there is no undo
- super.undo();
- }
-
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/internal/DefaultTagCreator.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/internal/DefaultTagCreator.java
deleted file mode 100644
index bcb087c..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/internal/DefaultTagCreator.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.itemcreation.internal;
-
-import org.eclipse.jst.pagedesigner.itemcreation.AbstractTagCreator;
-import org.eclipse.jst.pagedesigner.itemcreation.CreationData;
-import org.eclipse.jst.pagedesigner.itemcreation.ITagCreationAdvisor;
-
-/**
- * {@link org.eclipse.jst.pagedesigner.itemcreation.ITagCreator} used by the Web Page Editor palette.
- *
- * Uses org.eclipse.jst.jsf.common.metadata
- */
-public class DefaultTagCreator extends AbstractTagCreator
-{
-
- @Override
- protected ITagCreationAdvisor doSelectCreationAdvisor(
- CreationData creationData) {
- // return null by default. This causes the default advisor to be used.
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/internal/ICreationCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/internal/ICreationCommand.java
deleted file mode 100644
index bc2f25d..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/internal/ICreationCommand.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.itemcreation.internal;
-
-
-/**
- * Implemented by commands that do tag model creation. NOTE: this interface is highly provisional
- * and mainly exists to provide a facade to the future use of an existing Command infrastructure:
- * probably the EMF commands. We haven't decided yet so it is important that:
- *
- * This interface should NOT be implemented by clients
- *
- * @author cbateman
- *
- */
-public interface ICreationCommand
-{
- // tagging interface only
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/internal/TagCreationFactory.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/internal/TagCreationFactory.java
deleted file mode 100644
index 38ab707..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/internal/TagCreationFactory.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.itemcreation.internal;
-
-import org.eclipse.jst.jsf.common.dom.TagIdentifier;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.elementedit.ElementEditFactoryRegistry;
-import org.eclipse.jst.pagedesigner.elementedit.IElementEdit;
-import org.eclipse.jst.pagedesigner.itemcreation.AbstractTagCreator;
-import org.eclipse.jst.pagedesigner.itemcreation.ITagCreator;
-
-/**
- * Creates instances of
- * {@link org.eclipse.jst.pagedesigner.itemcreation.ITagCreator}s for a the
- * given
- * {@link org.eclipse.jst.pagedesigner.editors.palette.TagToolPaletteEntry}
- * (Eventually) Will use TagCreavtorFactories registered using
- * org.eclipse.jst.jsf.pagedesigner.tagcreationfactories ext-pt. Currently only
- * using DefaultTagCreator.
- */
-public class TagCreationFactory
-{
- private static TagCreationFactory INSTANCE = null;
-
- /**
- * @return singleton instance
- */
- public synchronized static TagCreationFactory getInstance()
- {
- if (INSTANCE == null)
- {
- INSTANCE = new TagCreationFactory();
- }
- return INSTANCE;
- }
-
- /**
- * Using the TagToolPaletteEntry, locate the factory to use for tag creation
- *
- * @param tagId
- *
- * @return ITagCreator
- */
- public ITagCreator createTagCreator(final TagIdentifier tagId)
- {
-
- IElementEdit elementEdit = ElementEditFactoryRegistry.getInstance()
- .createElementEdit(tagId);
-
- if (elementEdit != null)
- {
- // for (ITagCreatorFactory factory : factories)
- // {
- ITagCreator tagCreator = null;
- try
- {
- tagCreator = elementEdit.getTagCreator(tagId);
- }
- catch (Exception e)
- {
- PDPlugin.getLogger(getClass()).error(
- "Error.ProblemLoadingTagCreatorFactory",
- elementEdit.getClass().toString(), e);
- }
-
- if (tagCreator != null)
- {
- if (tagCreator instanceof AbstractTagCreator)
- {
- return tagCreator;
- }
- // if non-null, skipped, log the issue
- PDPlugin.getLogger(getClass()).error(
- "Error.ProblemLoadingTagCreatorFactory",
- "Tag creator must extend AbstractTagCreator",
- new Throwable());
- }
- }
-
- // all else fails, use the internal default
- return new DefaultTagCreator();
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/internal/TagCreatorFactoryRegistryReader.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/internal/TagCreatorFactoryRegistryReader.java
deleted file mode 100644
index ea06009..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/itemcreation/internal/TagCreatorFactoryRegistryReader.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.itemcreation.internal;
-
-
-/**
- * A registry reader that lazy initializes a list of uri-sensitive
- * extensions
- *
- * @author cbateman
- *
- */
-public final class TagCreatorFactoryRegistryReader
-{
- // TODO: move this logic into the ElementEditFacRegistryReader
-// private static Map<String, List<ITagCreatorFactory>> _handlers = null;
-//
-// /**
-// * @param uri the uri to get a list of factories for
-// * @return all available handers for the ext-pt
-// */
-// public static synchronized List<ITagCreatorFactory> getAllHandlers(final String uri)
-// {
-// if (_handlers == null) {
-// _handlers = readAllHandlers();
-// }
-// return _handlers.get(uri);
-// }
-//
-// private static Map<String, List<ITagCreatorFactory>> readAllHandlers()
-// {
-// final Map<String, List<ExtElement>> map =
-// new HashMap<String, List<ExtElement>>();
-//
-// IExtensionPoint extensionPoint = Platform.getExtensionRegistry()
-// .getExtensionPoint(PDPlugin.getPluginId(),
-// IJMTConstants.TAG_CREATOR_FACTORY_EXT_NAME);
-// IExtension[] extensions = extensionPoint.getExtensions();
-//
-// for (int i = 0; i < extensions.length; i++)
-// {
-// IExtension ext = extensions[i];
-// IConfigurationElement[] tagCreationHandlers = ext
-// .getConfigurationElements();
-//
-// for (int j = 0; j < tagCreationHandlers.length; j++) {
-// if (tagCreationHandlers[j].getName().equals(
-// IJMTConstants.TAG_CREATOR_FACTORY_ELEMENT_NAME))
-// {
-// try
-// {
-// final ExtElement extElement =
-// new ExtElement(tagCreationHandlers[j]);
-// List<ExtElement> elements =
-// map.get(extElement.getUri());
-//
-// if (elements == null)
-// {
-// elements = new ArrayList<ExtElement>();
-// map.put(extElement.getUri(), elements);
-// }
-//
-// elements.add(extElement);
-// }
-// catch (CoreException ce)
-// {
-// PDPlugin.getLogger(ExtElement.class)
-// .error("Error.ProblemLoadingExtensionPoint", ce);
-// }
-// }
-// }
-// }
-//
-// final Map<String, List<ITagCreatorFactory>> handlers =
-// new HashMap<String, List<ITagCreatorFactory>>();
-//
-// // now loop through the extensions, looking for collisions
-// // on the same uri
-// for (String uri : map.keySet())
-// {
-// List<ExtElement> elements = map.get(uri);
-//
-// if (elements.size() > 1)
-// {
-// Collections.sort(elements);
-//
-// MultiStatus chainedStatus = new MultiStatus(PDPlugin.getPluginId(), 0, "Collision detected in ITagCreatorFactory extensions for uri: "+uri+". Factories will be queried in the following order with the first contender to provide a ITagCreator winning",
-// new Throwable());
-//
-// for (ExtElement element : elements)
-// {
-// IStatus status =
-// new Status(IStatus.WARNING, PDPlugin.getPluginId(), element.getClassName());
-// chainedStatus.add(status);
-// }
-//
-// PDPlugin.log(chainedStatus);
-// }
-//
-// List<ITagCreatorFactory> factories =
-// new ArrayList<ITagCreatorFactory>();
-//
-// for (ExtElement element : elements)
-// {
-// factories.add(element.getFactoryInstance());
-// }
-//
-// handlers.put(uri, factories);
-// }
-//
-// return handlers;
-// }
-//
-// private static class ExtElement implements Comparable<ExtElement>
-// {
-// private final IConfigurationElement _element;
-//
-// private final ITagCreatorFactory _factoryInstance;
-//
-// ExtElement(IConfigurationElement element) throws CoreException
-// {
-// _element = element;
-//
-// final String uri = getUri();
-// final String factory = getClassName();
-//
-// if (uri == null || factory == null)
-// {
-// throw new CoreException(new Status(IStatus.ERROR,PDPlugin.getPluginId(), "uri and factory must not be null: uri="+uri+", factory="+factory));
-// }
-//
-// Object obj = _element.createExecutableExtension("factory");
-//
-// if (obj instanceof ITagCreatorFactory)
-// {
-// _factoryInstance = (ITagCreatorFactory) obj;
-// }
-// else
-// {
-// throw new CoreException(new Status(IStatus.ERROR,PDPlugin.getPluginId(), "Factory must be instanceof ITagCreatorFactory"));
-// }
-// }
-//
-// /**
-// * @return the uri
-// */
-// public String getUri() {
-// return _element.getAttribute("uri");
-// }
-//
-// /**
-// * @return the class name
-// */
-// public String getClassName() {
-// return _element.getAttribute("factory");
-// }
-//
-// /**
-// * @return the factory instance or null
-// */
-// public ITagCreatorFactory getFactoryInstance()
-// {
-// return _factoryInstance;
-// }
-//
-// /*
-// * Two elements compare by the canonical comparision of their
-// * contributor's bundle name string
-// */
-// public int compareTo(ExtElement o)
-// {
-// return _element.getContributor().getName().compareTo
-// (o._element.getContributor().getName());
-// }
-//
-// @Override
-// public boolean equals(Object obj)
-// {
-// // ensure that x.equals(y) iff x.compareTo(y) == 0
-// if (obj instanceof ExtElement)
-// {
-// return compareTo((ExtElement) obj) == 0;
-// }
-//
-// return false;
-// }
-//
-// @Override
-// public int hashCode()
-// {
-// // ensure that x.equals(y) => x.hashCode == y.hashCode
-// return _element.getContributor().getName().hashCode();
-// }
-// }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/AttributeDescriptor.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/AttributeDescriptor.java
deleted file mode 100644
index c05f6f1..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/AttributeDescriptor.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.meta;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-import org.eclipse.jst.jsf.common.ui.internal.utils.StringUtil;
-
-/**
- * @author mengbo
- * @deprecated
- */
-public class AttributeDescriptor implements IAttributeDescriptor {
- private String _attributeName;
-
- private String _category;
-
- private String _valueType;
-
- private String _typeParameter;
-
- private String _labelString;
-
- private String _defaultValue;
-
- private String _description;
-
- private Map _parameterMap;
-
- private Map _options;
-
- private boolean _required;
-
- /**
- *
- */
- public AttributeDescriptor() {
- super();
- }
-
- /**
- * @param attrName
- */
- public AttributeDescriptor(String attrName) {
- this.setAttributeName(attrName);
- }
-
- /**
- * @param attributeName
- */
- public void setAttributeName(String attributeName) {
- this._attributeName = attributeName;
- }
-
- /**
- * @param category
- */
- public void setCategory(String category) {
- this._category = category;
- }
-
- /**
- * @param valueType
- */
- public void setValueType(String valueType) {
- this._valueType = valueType;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.cm.IAttributeDescriptor#getAttributeName()
- */
- public String getAttributeName() {
- return _attributeName;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.cm.IAttributeDescriptor#getDescription()
- */
- public String getDescription() {
- return _description;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.cm.IAttributeDescriptor#getCategory()
- */
- public String getCategory() {
- return _category;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.cm.IAttributeDescriptor#getValueType()
- */
- public String getValueType() {
- return _valueType;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.cm.IAttributeDescriptor#getOptions()
- */
- public Map getOptions() {
- return _options;
- }
-
- /**
- * @param description
- */
- public void setDescription(String description) {
- _description = description;
- }
-
- /**
- * @param map
- * @param defaultValue
- */
- public void setOptions(Map map, String defaultValue) {
- _options = map;
- _defaultValue = defaultValue;
- }
-
- /**
- * @return Returns the typeParameter.
- */
- public String getTypeParameter() {
- return _typeParameter;
- }
-
- /**
- * @param typeParameter
- * The typeParameter to set.
- */
- public void setTypeParameter(String typeParameter) {
- this._typeParameter = typeParameter;
- _parameterMap = null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.meta.IAttributeDescriptor#getLabelString()
- */
- public String getLabelString() {
- if (_labelString == null) {
- _labelString = StringUtil.splitVariable(getAttributeName());
- }
- return _labelString;
- }
-
- /**
- * @param labelString
- * The labelString to set.
- */
- public void setLabelString(String labelString) {
- this._labelString = labelString;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.meta.IAttributeDescriptor#getParameterByName(java.lang.String)
- */
- public String getParameterByName(String name) {
- if (_parameterMap == null) {
- parseParameter();
- }
- Object value = _parameterMap.get(name);
- return value == null ? "" : value.toString();
- }
-
- /**
- *
- */
- private void parseParameter() {
- _parameterMap = new HashMap();
- if (_typeParameter == null) {
- return;
- }
- StringTokenizer tokenizer = new StringTokenizer(_typeParameter, "||");
- while (tokenizer.hasMoreTokens()) {
- String parameterEntry = tokenizer.nextToken();
- int index = parameterEntry.indexOf('=');
- if (index != -1) {
- _parameterMap.put(parameterEntry.substring(0, index),
- parameterEntry.substring(index + 1));
- }
- }
- }
-
- public String getDefaultValue() {
- return _defaultValue;
- }
-
- /**
- * @param value
- */
- public void setDefaultValue(String value) {
- _defaultValue = value;
- }
-
- public boolean isRequired() {
- return _required;
- }
-
- /**
- * @param required
- */
- public void setRequired(boolean required) {
- this._required = required;
- }
-
- public String toString(){
- StringBuffer buf = new StringBuffer("AttributeDescriptor: ");
- buf.append(this.getAttributeName());
- return buf.toString();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/BindingHandlerDelegate.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/BindingHandlerDelegate.java
deleted file mode 100644
index 9a75e8d..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/BindingHandlerDelegate.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.meta;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.utils.StructuredModelUtil;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-
-/**
- * @author mengbo
- * @version 1.5
- * @deprecated
- */
-public class BindingHandlerDelegate implements IBindingHandler {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.meta.IBindingHandler#handleBinding(org.eclipse.swt.widgets.Shell,
- * org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode,
- * org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement,
- * java.lang.String)
- */
- public String handleBinding(Shell shell, IDOMNode ancester,
- IDOMElement element, String currentValue) {
- IBindingHandler handler = getDelegatedHandler(ancester, element);
- if (handler != null) {
- return handler
- .handleBinding(shell, ancester, element, currentValue);
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.meta.IBindingHandler#isEnabled(org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode,
- * org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement)
- */
- // public boolean isEnabled(IDOMNode ancester, IDOMElement element)
- // {
- // IBindingHandler handler = getDelegatedHandler(ancester, element);
- // return (handler == null) ? false : handler.isEnabled(ancester, element);
- // }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.meta.IBindingHandler#isEnabled(org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode,
- * org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement,
- * java.lang.String, java.lang.String,
- * org.eclipse.jst.pagedesigner.meta.IAttributeDescriptor)
- */
- public boolean isEnabled(IDOMNode ancester, IDOMElement element,
- String uri, String tagName, IAttributeDescriptor attr) {
- IBindingHandler handler = getDelegatedHandler(ancester, element);
- return (handler == null) ? false : handler.isEnabled(ancester, element,
- uri, tagName, attr);
- }
-
-// public boolean isEnabled(IDOMNode ancester, IDOMElement element,
-// IPropertyPageDescriptor attr) {
-// IBindingHandler handler = getDelegatedHandler(ancester, element);
-// return (handler == null) ? false : handler.isEnabled(ancester, element,
-// attr);
-// }
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.meta.IBindingHandler#getImage()
- */
- public Image getImage() {
- return PDPlugin.getDefault().getImage("PD_Binding.gif");
- }
-
- public Image getDisabledImage() {
- return PDPlugin.getDefault().getImage("PD_Binding_disabled.gif");
- }
-
- private IBindingHandler getDelegatedHandler(IDOMNode ancester,
- IDOMElement element) {
- IProject project = getProject(ancester, element);
- if (project != null) {
- Object obj = project.getAdapter(IBindingHandler.class);
- if (obj instanceof IBindingHandler) {
- return (IBindingHandler) obj;
- }
- }
-
- return null;
- }
-
- private IProject getProject(IDOMNode ancester, IDOMElement element) {
- IDOMModel model = getModel(ancester, element);
- if (model != null) {
- return StructuredModelUtil.getProjectFor(model);
- }
- return null;
- }
-
- private IDOMModel getModel(IDOMNode ancester, IDOMElement element) {
- if (ancester != null) {
- return ancester.getModel();
- } else if (element != null) {
- return element.getModel();
- } else {
- return null;
- }
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/DefaultEditorCreator.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/DefaultEditorCreator.java
deleted file mode 100644
index 2275079..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/DefaultEditorCreator.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.meta;
-
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogField;
-import org.eclipse.jst.pagedesigner.editors.properties.IPropertyPageDescriptor;
-import org.eclipse.jst.pagedesigner.meta.internal.CellEditorFactoryRegistry;
-import org.eclipse.jst.pagedesigner.ui.dialogfields.DialogFieldWrapper;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class DefaultEditorCreator extends EditorCreator {
- static IPropertyPageDescriptor _staticAttr;
-
- static IDOMElement _staticElement;
-
- //static IBindingHandler _staticHandler;
-
- static CellEditorHolder _staticHolder;
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.meta.EditorCreator#createCellEditor(org.eclipse.swt.widgets.Composite,
- * org.eclipse.jst.pagedesigner.meta.IPropertyPageDescriptor,
- * org.w3c.dom.Element)
- */
- public CellEditor createCellEditor(Composite parent,
- IPropertyPageDescriptor attr, IDOMElement element) {
- return CellEditorFactoryRegistry.getInstance().createCellEditor(parent,
- attr, element);
- }
-
-// /*
-// * (non-Javadoc)
-// *
-// * @see org.eclipse.jst.pagedesigner.meta.EditorCreator#createDialogField(org.eclipse.jst.pagedesigner.meta.IPropertyPageDescriptor)
-// */
-// public DialogField createDialogField(IPropertyPageDescriptor attr) {
-// return CellEditorFactoryRegistry.getInstance().createDialogField(attr);
-// }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.meta.EditorCreator#createCellEditorWithWrapper(org.eclipse.swt.widgets.Composite,
- * org.eclipse.jst.pagedesigner.meta.IPropertyPageDescriptor,
- * org.w3c.dom.Element,
- * org.eclipse.jst.pagedesigner.meta.IBindingHandler,
- * org.eclipse.swt.graphics.Image)
- */
- @SuppressWarnings("deprecation")
- public CellEditor createCellEditorWithWrapper(Composite parent,
- IPropertyPageDescriptor attr, final IDOMElement element,
- IBindingHandler handler1) {
-// final IBindingHandler handler = (handler1 == null ? getSystemDefaultBindingHandler()
-// : handler1);
-// String uri = CMUtil.getElementNamespaceURI(element);
-// String tagName = element.getLocalName();
-
- return createCellEditor(parent, attr, element);
-//
-// if (!handler.isEnabled(element, element, uri, tagName, attr)) {
-// // should not enabled, so directly return original cell editor
-// return createCellEditor(parent, attr, element);
-// }
-// try {
-// // since "createWrappedCellEditor()" and "getBindingImage()" is
-// // called from the constructor of CellEditorWrapper, at that time,
-// // can't reference this DefaultEditorCreator and final fields yet,
-// // so use static variable for it.
-// _staticAttr = attr;
-// _staticElement = element;
-// _staticHandler = handler;
-//
-// return new CellEditorWrapper(parent) {
-// /*
-// * (non-Javadoc)
-// *
-// * @see org.eclipse.jst.pagedesigner.properties.celleditors.CellEditorWrapper#createWrappedCellEditor(org.eclipse.swt.widgets.Composite)
-// */
-// protected CellEditor createWrappedCellEditor(Composite cell) {
-// return EditorCreator.getInstance().createCellEditor(cell,
-// _staticAttr, _staticElement);
-// }
-//
-// /*
-// * (non-Javadoc)
-// *
-// * @see org.eclipse.jst.pagedesigner.properties.celleditors.CellEditorWrapper#openDialogBox(org.eclipse.swt.widgets.Control)
-// */
-// protected Object openDialogBox(Control cellEditorWindow) {
-// return handler.handleBinding(cellEditorWindow.getShell(),
-// element, element, convertToString(this.getValue()));
-// }
-//
-// /*
-// * (non-Javadoc)
-// *
-// * @see org.eclipse.jst.pagedesigner.properties.celleditors.CellEditorWrapper#getBindingImage()
-// */
-// protected Image getBindingImage() {
-// return _staticHandler.getImage();
-// }
-// };
-// } finally {
-// _staticAttr = null;
-// _staticElement = null;
-// _staticHandler = null;
-// _staticHolder = null;
-// }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.meta.EditorCreator#createCellEditorWithWrapper(org.eclipse.swt.widgets.Composite,
- * org.eclipse.jst.pagedesigner.meta.IPropertyPageDescriptor,
- * org.eclipse.jst.pagedesigner.meta.EditorCreator.CellEditorHolder,
- * org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement,
- * org.eclipse.jst.pagedesigner.meta.IBindingHandler)
- */
- @SuppressWarnings("deprecation")
- public CellEditor createCellEditorWithWrapper(Composite parent,
- IPropertyPageDescriptor attr, CellEditorHolder holder,
- final IDOMElement element, IBindingHandler handler1) {
-// final IBindingHandler handler = (handler1 == null ? getSystemDefaultBindingHandler()
-// : handler1);
-// String uri = CMUtil.getElementNamespaceURI(element);
-// String tagName = element.getLocalName();
-
- return holder.createCellEditor(parent);
-
-// if (!handler.isEnabled(element, element, uri, tagName, attr)) {
-// // should not enabled, so directly return original cell editor
-// return holder.createCellEditor(parent);
-// }
-// try {
-// // since "createWrappedCellEditor()" and "getBindingImage()" is
-// // called from the constructor of CellEditorWrapper, at that time,
-// // can't reference this DefaultEditorCreator and final fields yet,
-// // so use static variable for it.
-// _staticElement = element;
-// _staticHandler = handler;
-// _staticHolder = holder;
-//
-// return new CellEditorWrapper(parent) {
-// /*
-// * (non-Javadoc)
-// *
-// * @see org.eclipse.jst.pagedesigner.properties.celleditors.CellEditorWrapper#createWrappedCellEditor(org.eclipse.swt.widgets.Composite)
-// */
-// protected CellEditor createWrappedCellEditor(Composite cell) {
-// return _staticHolder.createCellEditor(cell);
-// }
-//
-// /*
-// * (non-Javadoc)
-// *
-// * @see org.eclipse.jst.pagedesigner.properties.celleditors.CellEditorWrapper#openDialogBox(org.eclipse.swt.widgets.Control)
-// */
-// protected Object openDialogBox(Control cellEditorWindow) {
-// return handler.handleBinding(cellEditorWindow.getShell(),
-// element, element, convertToString(this.getValue()));
-// }
-//
-// /*
-// * (non-Javadoc)
-// *
-// * @see org.eclipse.jst.pagedesigner.properties.celleditors.CellEditorWrapper#getBindingImage()
-// */
-// protected Image getBindingImage() {
-// return _staticHandler.getImage();
-// }
-// };
-// } finally {
-// _staticAttr = null;
-// _staticElement = null;
-// _staticHandler = null;
-// _staticHolder = null;
-// }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.meta.EditorCreator#createDialogFieldWithWrapper(java.lang.String,
- * java.lang.String,
- * org.eclipse.jst.pagedesigner.meta.IPropertyPageDescriptor,
- * org.eclipse.jst.pagedesigner.meta.IBindingHandler)
- */
- @SuppressWarnings("deprecation")
- public DialogField createDialogFieldWithWrapper(String uri, String tagName,
- IPropertyPageDescriptor attr, IBindingHandler handler1) {
- final IBindingHandler handler = (handler1 == null ? getSystemDefaultBindingHandler()
- : handler1);
- DialogField field = createDialogField(attr);
- // if (field instanceof StringButtonDialogField)
- // {
- // ((StringButtonDialogField) field).setButtonLabel("...");
- // }
- DialogFieldWrapper wrapper = new DialogFieldWrapper(field, handler
- .getImage(), handler.getDisabledImage(), uri, tagName, attr,
- handler);
- wrapper.setDatabindingEnabled(true);
-
- return wrapper;
- }
-
-
-// private String convertToString(Object value) {
-// if (value == null) {
-// return null;
-// }
-// return value.toString();
-// }
-
- @SuppressWarnings("deprecation")
- @Override
- public DialogField createDialogFieldWithWrapper(
- IPropertyPageDescriptor attr, IBindingHandler handler1) {
- final IBindingHandler handler = (handler1 == null ? getSystemDefaultBindingHandler()
- : handler1);
- DialogField field = createDialogField(attr);
- // if (field instanceof StringButtonDialogField)
- // {
- // ((StringButtonDialogField) field).setButtonLabel("...");
- // }
- DialogFieldWrapper wrapper = new DialogFieldWrapper(field, handler
- .getImage(), handler.getDisabledImage(), attr.getUri(), attr.getTagName(), attr,
- handler);
- wrapper.setDatabindingEnabled(true);
-
- return wrapper;
- }
-
- @Override
- public DialogField createDialogField(IPropertyPageDescriptor attr) {
- return CellEditorFactoryRegistry.getInstance().createDialogField(attr);
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/EditorCreator.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/EditorCreator.java
deleted file mode 100644
index a6d6bb6..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/EditorCreator.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.meta;
-
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogField;
-import org.eclipse.jst.pagedesigner.editors.properties.IPropertyPageDescriptor;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public abstract class EditorCreator {
- static EditorCreator _instance;
-
- @SuppressWarnings("deprecation")
- static IBindingHandler _defaultHandler = new BindingHandlerDelegate();
-
- /**
- *
- */
- public static interface CellEditorHolder {
- /**
- * @param parent
- * @return the cell editor
- */
- public CellEditor createCellEditor(Composite parent);
- }
-
- /**
- * Create a dialog field without databinding using the specified attribute
- * descriptor.
- *
- * @param attr
- * @return DialogField
- */
- public abstract DialogField createDialogField(IPropertyPageDescriptor attr);
-
- /**
- * Create a dialog field that will have databinding support. Basically, this
- * method will create a normal dialog field using the attribute descriptor,
- * then make a wrapper on it.
- *
- * @param uri
- * the namespace uri
- * @param tagName
- * the local tag name
- * @param attr
- * @param handler
- * if null, system default mechanism will be used.
- * @return DialogField
- */
- @SuppressWarnings("deprecation")
- public abstract DialogField createDialogFieldWithWrapper(String uri,
- String tagName, IPropertyPageDescriptor attr, IBindingHandler handler);
-
-
- /**
- * @param descriptor
- * @param handler
- * @return the dialog field
- */
- @SuppressWarnings("deprecation")
- public abstract DialogField createDialogFieldWithWrapper(IPropertyPageDescriptor descriptor, IBindingHandler handler);
-//
-// /**
-// * Create a dialog field that will have databinding support. Basically, this
-// * method will create a normal dialog field using the attribute descriptor,
-// * then make a wrapper on it.
-// *
-// * @param uri
-// * the namespace uri
-// * @param tagName
-// * the local tag name
-// * @param attrName
-// * @param handler
-// * if null, system default mechanism will be used.
-// * @return DialogField
-// */
-// public abstract DialogField createDialogFieldWithWrapper(String uri,
-// String tagName, String attrName, IBindingHandler handler);
- /**
- * Create a cell editor.
- *
- * @param parent
- * @param attr
- * @param element
- * @return CellEditor
- */
- public abstract CellEditor createCellEditor(Composite parent,
- IPropertyPageDescriptor attr, IDOMElement element);
-
- /**
- * Create a cell editor that will have databinding support.
- *
- * @param parent
- * @param attr
- * @param element
- * @param handler
- * if null, system default mechanism will be used.
- * @return CellEditor
- */
- @SuppressWarnings("deprecation")
- public abstract CellEditor createCellEditorWithWrapper(Composite parent,
- IPropertyPageDescriptor attr, IDOMElement element,
- IBindingHandler handler);
-
- /**
- * Create a cell edtior that will have databinding support. This method
- * don't provide an attribute descriptor, but it provide a CellEditorHolder
- * to create whatever normal cell editor it wants.
- *
- * @param parent
- * @param attr
- * could be null
- * @param holder
- * @param element
- * @param handler
- * if null, system default mechanism will be used.
- * @return CellEditor
- */
- @SuppressWarnings("deprecation")
- public abstract CellEditor createCellEditorWithWrapper(Composite parent,
- IPropertyPageDescriptor attr, CellEditorHolder holder,
- IDOMElement element, IBindingHandler handler);
-
- /**
- * @return the singleton instance
- */
- public static EditorCreator getInstance() {
- if (_instance == null) {
- _instance = new DefaultEditorCreator();
- }
- return _instance;
- }
-
- /**
- * @return the binding handler
- */
- @SuppressWarnings("deprecation")
- public IBindingHandler getSystemDefaultBindingHandler() {
- return _defaultHandler;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/IAttributeCellEditorFactory.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/IAttributeCellEditorFactory.java
deleted file mode 100644
index f3d53c1..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/IAttributeCellEditorFactory.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.meta;
-
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogField;
-import org.eclipse.swt.widgets.Composite;
-import org.w3c.dom.Element;
-
-/**
- * Factory for creating CellEditors to edit element attributes.
- *
- * @author mengbo
- * @deprecated - not to be used. use ITagAttributeCellEditorFactory
- */
-public interface IAttributeCellEditorFactory {
- /**
- * create cell editor
- *
- * @param parent
- * @param attr
- * @param ele
- * @return null means failed to create cell editor
- */
- public CellEditor createCellEditor(Composite parent,
- IAttributeDescriptor attr, Element ele);
-
- /**
- * Normally, the DialogField for an attribute may appear in the following
- * places.
- * <ol>
- * <li>In the Quick Editor properties view, used to edit an element.
- * <li>In a dialog to edit an element
- * <li>In a dialog, to create an element
- * </ol>
- *
- * It is the caller's responsibility to add valueChanged listener to the
- * dialog field to decide how to apply the value.
- *
- * It is also the caller's responsibility to set the initial value of the
- * field.
- *
- * The field should always be an instanceof <code>ISupportTextValue</code>,
- * it could also optionally implement <code>IElementContextable</code>
- *
- * @param attr
- * the attribute descriptor, meta data
- * @return A dialog field. null means this factory can't create one.
- *
- * @see org.eclipse.jst.jsf.common.ui.internal.dialogfield.ISupportTextValue
- */
- public DialogField createDialogField(IAttributeDescriptor attr);
-
- /**
- * The value types supported by this factory.
- *
- * @return null means this factory can behave as default factory.
- */
- public String[] getSupportedValueTypes();
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/IAttributeDescriptor.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/IAttributeDescriptor.java
deleted file mode 100644
index 2953efe..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/IAttributeDescriptor.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.meta;
-
-import java.util.Map;
-
-/**
- *
- * @author mengbo
- * @deprecated
- */
-public interface IAttributeDescriptor {
- /**
- * suffix
- */
- final String PARAMETER_SUFFIX = "suffix";
-
- /**
- * style
- */
- final String PARAMETER_STYLE = "style";
-
- /**
- * super type
- */
- final String PARAMETER_SUPER_TYPE = "superType";
-
- /**
- * separator
- */
- final String PARAMETER_SEPARATOR = "separator";
-
- /**
- * default
- */
- final String PARAMETER_DEFAULT = "default";
-
- /**
- * get the name of the attribute.
- *
- * @return the attribute name
- */
- public String getAttributeName();
-
- /**
- * Returns a brief description of this property. This localized string is
- * shown to the user when this property is selected. and it is used as
- * tooltip of the property now.
- *
- * @return a brief description, or <code>null</code> if none
- */
- public String getDescription();
-
- /**
- * return the category for this attribute.
- *
- * @return the category
- */
- public String getCategory();
-
- /**
- * value type is used to construct the cell editor.
- *
- * @return the value type
- */
- public String getValueType();
-
- /**
- * Some value type contains additional parameter information. For example,
- * if valueType is CLASSNAME, the typeParameter could be super
- * interface/super class name.
- *
- * NOTE: if valueType is ENUMERATION, caller should use
- * <code>getOptions()</code>
- *
- * @return null if there is no type parameter.
- */
- public String getTypeParameter();
-
- /**
- * @param name
- * @return the parameter
- */
- public String getParameterByName(String name);
-
- /**
- * when the value type is "enumeration", this method will be called to
- * construct the drop downlist.
- *
- * The Map will be (key->display string)
- *
- * @return the options
- */
- public Map getOptions();
-
- /**
- * Gets the default value of Options
- *
- * @return the default value
- */
- public String getDefaultValue();
-
- /**
- * A human readable string as the label of the attribute.
- *
- * @return the label
- */
- public String getLabelString();
-
- /**
- * Indicate whether the attribute is required.
- *
- * @return true if is required
- */
- public boolean isRequired();
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/IAttributeRuntimeValueType.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/IAttributeRuntimeValueType.java
deleted file mode 100644
index 7c3bf3f..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/IAttributeRuntimeValueType.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.meta;
-
-/**
- * Enumeration of core attribute-value-runtime-types.
- * Not to be implemented by clients.
- */
-public interface IAttributeRuntimeValueType {
- // shared for html and jsf
- /**
- *
- */
- static final String prefix1 = "org.eclipse.jst.jsf.core.attributevalues.";
- /**
- *
- */
- static final String prefix2 = "org.eclipse.jst.pagedesigner.attributevalues.";
-
- /**
- *
- */
- public static final String BASE = prefix1+"BaseType";
-
- /**
- *
- */
- public static final String CSSSTYLE = prefix1+"CSSStyleType";
-
- /**
- *
- */
- public static final String CSSCLASS = prefix1+"CSSClassType";
-
- /**
- *
- */
- public static final String CSSID = prefix1+"CSSIdType";
-
- /**
- *
- */
- public static final String STRING = prefix1+"StringType";
-
- /**
- *
- */
- public static final String BOOLEAN = prefix1+"BooleanType";
-
- /**
- *
- */
- public static final String RELATIVEPATH = prefix1+"RelativePathType";
-
- /**
- *
- */
- public static final String WEBPATH = prefix1+"WebPathType"; //FIXME
-
- /**
- *
- */
- public static final String COLOR = prefix1+"ColorType";
-
-// public static final String NAMED_BOOLEAN = prefix1+"NAMED-BOOLEAN";
-
- /**
- *
- */
- public static final String LONG = prefix1+"LongType";
-
- /**
- *
- */
- public static final String INTEGER = prefix1+"IntegerType";
-
- /**
- *
- */
- public static final String DOUBLE = prefix1+"DoubleType";
-
- /**
- *
- */
- public static final String METHODBINDING = prefix1+"MethodBindingType";
-
- /**
- *
- */
- public static final String JAVACLASS = prefix1+"JavaClassType";
-
- /**
- *
- */
- public static final String SCRIPT = prefix1+"ScriptType";
-
-// public static final String PROPERTYBINDING = prefix1+"PROPERTYBINDING";
-
- /**
- *
- */
- public static final String VALUE = prefix1+"ValueType";
-
- /**
- *
- */
- public static final String VALUEBINDING = prefix1+"ValueBindingType";
-
- /**
- *
- */
- public static final String TIMEZONE = prefix1+"TimeZoneType";
-
- /**
- *
- */
- public static final String ACTION = prefix1+"ActionType";
-
- /**
- *
- */
- public static final String CLASSPATH_RESOURCE = prefix1+"CLASSPATH_RESOURCE";
-
- /**
- *
- */
- public static final String CURRENCYCODE = prefix1+"CurrencyCodeType";
-
- /**
- *
- */
- public static final String LINK = prefix1+"LinkType";
-
- /**
- *
- */
- public static final String LOCALE = prefix1+"LocaleType";
-
-// public static final String MULTICHOICE = prefix1+"MULTICHOICE";
-
- /**
- *
- */
- public static final String FACESCONFIGIDENTIFIER = prefix1+"FacesConfigIdentifierType";
-
- /**
- *
- */
- public static final String FACESCONFIGVALIDATORID = prefix1+"FacesConfigValidatorIDType";
-
- /**
- *
- */
- public static final String FACESCONFIGCONVERTERID = prefix1+"FacesConfigConverterIDType";
-
- /**
- *
- */
- public static final String COMPONENTBINDING = prefix1+"ComponentBindingType";
-
- /**
- *
- */
- public static final String COMPONENTID = prefix1+"ComponentIDType";
-
- /**
- *
- */
- public static final String LENGTH = prefix1+"LengthType";
-
- /**
- *
- */
- public static final String RESOURCEBUNDLE = prefix1+"ResourceBundleType";
-
- /**
- *
- */
- public static final String LANGUAGECODE = prefix1+"LanguageCodeType";
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/IBindingHandler.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/IBindingHandler.java
deleted file mode 100644
index 514cb41..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/IBindingHandler.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.meta;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-
-/**
- * @author mengbo
- * @version 1.5
- * @deprecated
- */
-public interface IBindingHandler {
- /**
- * This handler should open a dialog to accept user input.
- *
- * @param shell
- * @param ancester
- * @param element
- * @param currentValue
- * @return null means user canceled the operation.
- */
- public String handleBinding(Shell shell, IDOMNode ancester,
- IDOMElement element, String currentValue);
-
- /**
- * Whether should the binding be enabled for the specified element context.
- * element could be null.
- *
- * @param ancester
- * @param element
- * @param uri
- * @param tagName
- * @param attr
- * could be null.
- * @return true if is enabled
- */
- public boolean isEnabled(IDOMNode ancester, IDOMElement element,
- String uri, String tagName, IAttributeDescriptor attr);
-
-
-// public boolean isEnabled(IDOMNode ancester, IDOMElement element,
-// IPropertyPageDescriptor attr);
-
- /**
- * given the meta data of an attribute, to see whether should enable binding
- * handler for it.
- *
- * @param uri
- * @param tagName
- * @param attr
- * @return
- */
- // public boolean isEnabled(String uri, String tagName, IAttributeDescriptor
- // attr);
- /**
- * Image used for the small button.
- *
- * @return the image
- */
- public Image getImage();
-
- /**
- * @return the image indicating disablement
- */
- public Image getDisabledImage();
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/ICMRegistry.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/ICMRegistry.java
deleted file mode 100644
index 5c047fe..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/ICMRegistry.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.meta;
-
-/**
- *
- * @author mengbo
- * @deprecated
- */
-public interface ICMRegistry {
- /**
- * get the URI supported by this registry.
- *
- * @return null if this is the global registry that support all the URI.
- */
- public String getSupportedURI();
-
- /**
- * get element descriptor by URI and tagname.
- *
- * @param uri
- * @param tagname
- * @return the element descriptor
- */
- public IElementDescriptor getElementDescriptor(String uri, String tagname);
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/IElementDescriptor.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/IElementDescriptor.java
deleted file mode 100644
index e16246c..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/IElementDescriptor.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.meta;
-
-/**
- *
- * @author mengbo
- * * @deprecated
- */
-public interface IElementDescriptor {
- /**
- * get the tagname
- *
- * @return the tag name
- */
- public String getTagName();
-
- /**
- * get the namespace URI
- *
- * @return te namespace
- */
- public String getNamespaceURI();
-
- /**
- * get all attribute descriptors
- *
- * @return the attribute descriptors
- */
- public IAttributeDescriptor[] getAttributeDescriptors();
-
- /**
- * @param attributeName
- * @return the attribute by name
- */
- public IAttributeDescriptor getAttributeDescriptor(String attributeName);
-
- /**
- * get attribute descriptor by name
- *
- * @param attrname
- * @return
- */
- // public IAttributeDescriptor getAttributeDescriptor(String attrname);
- /**
- * get reference. The ElementDescriptor being referenced may provide more
- * information. For example, <h:inputText> may reference
- * <input>. So those attribute descriptor not provided by
- * <h:inputText> could still be provided by <input>.
- *
- * @return the reference
- */
- public IElementDescriptor getReference();
-
- /**
- * if this element have eclipse help topic, then could use this method to
- * return a context id.
- *
- * @return could be null
- */
- public String getHelpContextID();
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/ITagAttributeCellEditorFactory.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/ITagAttributeCellEditorFactory.java
deleted file mode 100644
index 363f858..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/ITagAttributeCellEditorFactory.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.meta;
-
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogField;
-import org.eclipse.jst.pagedesigner.editors.properties.IPropertyPageDescriptor;
-import org.eclipse.swt.widgets.Composite;
-import org.w3c.dom.Element;
-
-/**
- * Factory for creating CellEditors and DialogFields to edit element attributes.
- */
-public interface ITagAttributeCellEditorFactory {
- /**
- * create cell editor
- *
- * @param parent
- * @param attr
- * @param ele
- * @return null means failed to create cell editor
- */
- public CellEditor createCellEditor(Composite parent,
- IPropertyPageDescriptor attr, Element ele);
-
- /**
- * Normally, the DialogField for an attribute may appear in the following
- * places.
- * <ol>
- * <li>In the Quick Editor properties view, used to edit an element.
- * <li>In a dialog to edit an element
- * <li>In a dialog, to create an element
- * </ol>
- *
- * It is the caller's responsibility to add valueChanged listener to the
- * dialog field to decide how to apply the value.
- *
- * It is also the caller's responsibility to set the initial value of the
- * field.
- *
- * The field should always be an instanceof <code>ISupportTextValue</code>,
- * it could also optionally implement <code>IElementContextable</code>
- *
- * @param attr
- * the attribute descriptor, meta data
- * @return A dialog field. null means this factory can't create one.
- *
- * @see org.eclipse.jst.jsf.common.ui.internal.dialogfield.ISupportTextValue
- */
- public DialogField createDialogField(IPropertyPageDescriptor attr);
-
- /**
- * The attribute runtime value types supported by this factory.
- *
- * @return null means this factory can behave as default factory.
- */
- public String[] getSupportedValueTypes();
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/OLDIValueType.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/OLDIValueType.java
deleted file mode 100644
index e702a15..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/OLDIValueType.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.meta;
-
-/**
- * All value types will be upcased.
- *
- * @author mengbo
- * @deprecated
- */
-public interface OLDIValueType {
- // shared for html and jsf
- /**
- *
- */
- public static final String CSSSTYLE = "CSSSTYLE";
-
- /**
- *
- */
- public static final String CSSCLASS = "CSSCLASS";
-
- /**
- *
- */
- public static final String CSSID = "CSSID";
-
- /**
- *
- */
- public static final String ENUMERATED = "ENUMERATED";
-
- /**
- *
- */
- public static final String BOOLEAN = "BOOLEAN";
-
- /**
- *
- */
- public static final String RELATIVEPATH = "RELATIVEPATH";
-
- /**
- *
- */
- public static final String WEBPATH = "WEBPATH";
-
- /**
- *
- */
- public static final String COLOR = "COLOR";
-
- /**
- *
- */
- public static final String NAMED_BOOLEAN = "NAMED-BOOLEAN";
-
- // for jsf only
- /**
- *
- */
- public static final String METHODBINDING = "METHODBINDING";
-
- /**
- *
- */
- public static final String CLASSNAME = "CLASSNAME";
-
- // new types
- /**
- *
- */
- public static final String LINK = "LINK";
-
- /**
- *
- */
- public static final String JAVASCRIPT = "JAVASCRIPT";
-
- /**
- *
- */
- public static final String PROPERTYBINDING = "PROPERTYBINDING";
-
- /**
- *
- */
- public static final String TIMEZONE = "TIMEZONE";
-
- /**
- *
- */
- public static final String CLASSPATH_RESOURCE = "CLASSPATH_RESOURCE";
-
- /**
- *
- */
- public static final String CURRENCYCODE = "CURRENCYCODE";
-
- /**
- *
- */
- public static final String LOCALE = "LOCALE";
-
- /**
- *
- */
- public static final String MULTICHOICE = "MULTICHOICE";
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/XXXEditorCreator.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/XXXEditorCreator.java
deleted file mode 100644
index ec1bf2c..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/XXXEditorCreator.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.meta;
-
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogField;
-import org.eclipse.jst.pagedesigner.editors.properties.IPropertyPageDescriptor;
-import org.eclipse.jst.pagedesigner.meta.internal.XXXDefaultEditorCreator;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- * @author mengbo
- * @version 1.5
- * @deprecated
- * will be deleted (was EditorCreator)
- */
-public abstract class XXXEditorCreator {
- static XXXEditorCreator _instance;
-
- static IBindingHandler _defaultHandler = new BindingHandlerDelegate();
-
- /**
- * Cell editor holder
- *
- */
- public static interface CellEditorHolder {
- /**
- * @param parent
- * @return the cell editor
- */
- public CellEditor createCellEditor(Composite parent);
- }
-
- /**
- * Create a dialog field without databinding using the specified attribute
- * descriptor.
- *
- * @param attr
- * @return DialogField
- */
- public abstract DialogField createDialogField(IAttributeDescriptor attr);
-
- /**
- * Create a dialog field that will have databinding support. Basically, this
- * method will create a normal dialog field using the attribute descriptor,
- * then make a wrapper on it.
- *
- * @param uri
- * the namespace uri
- * @param tagName
- * the local tag name
- * @param attr
- * @param handler
- * if null, system default mechanism will be used.
- * @return DialogField
- */
- public abstract DialogField createDialogFieldWithWrapper(String uri,
- String tagName, IAttributeDescriptor attr, IBindingHandler handler);
-
- /**
- * @param descriptor
- * @param handler
- * @return the dialog field
- */
- public abstract DialogField createDialogFieldWithWrapper(IPropertyPageDescriptor descriptor, IBindingHandler handler);
-//
-// /**
-// * Create a dialog field that will have databinding support. Basically, this
-// * method will create a normal dialog field using the attribute descriptor,
-// * then make a wrapper on it.
-// *
-// * @param uri
-// * the namespace uri
-// * @param tagName
-// * the local tag name
-// * @param attrName
-// * @param handler
-// * if null, system default mechanism will be used.
-// * @return DialogField
-// */
-// public abstract DialogField createDialogFieldWithWrapper(String uri,
-// String tagName, String attrName, IBindingHandler handler);
- /**
- * Create a cell editor.
- *
- * @param parent
- * @param attr
- * @param element
- * @return CellEditor
- */
- public abstract CellEditor createCellEditor(Composite parent,
- IAttributeDescriptor attr, IDOMElement element);
-
- /**
- * Create a cell editor that will have databinding support.
- *
- * @param parent
- * @param attr
- * @param element
- * @param handler
- * if null, system default mechanism will be used.
- * @return CellEditor
- */
- public abstract CellEditor createCellEditorWithWrapper(Composite parent,
- IAttributeDescriptor attr, IDOMElement element,
- IBindingHandler handler);
-
- /**
- * Create a cell edtior that will have databinding support. This method
- * don't provide an attribute descriptor, but it provide a CellEditorHolder
- * to create whatever normal cell editor it wants.
- *
- * @param parent
- * @param attr
- * could be null
- * @param holder
- * @param element
- * @param handler
- * if null, system default mechanism will be used.
- * @return CellEditor
- */
- public abstract CellEditor createCellEditorWithWrapper(Composite parent,
- IAttributeDescriptor attr, CellEditorHolder holder,
- IDOMElement element, IBindingHandler handler);
-
- /**
- * @return the singleton instance
- */
- public static XXXEditorCreator getInstance() {
- if (_instance == null) {
- _instance = new XXXDefaultEditorCreator();
- }
- return _instance;
- }
-
- /**
- * @return the binding handler
- */
- public IBindingHandler getSystemDefaultBindingHandler() {
- return _defaultHandler;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/internal/CMRegistry.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/internal/CMRegistry.java
deleted file mode 100644
index d231517..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/internal/CMRegistry.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.meta.internal;
-
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.parsers.FactoryConfigurationError;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.jsf.core.internal.tld.ITLDConstants;
-import org.eclipse.jst.pagedesigner.IJMTConstants;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.meta.ICMRegistry;
-import org.eclipse.jst.pagedesigner.meta.IElementDescriptor;
-import org.osgi.framework.Bundle;
-import org.xml.sax.SAXException;
-
-/**
- * XXX: temp implementation. In the future, will need add more things to allow
- * other plugins to contribute things.
- *
- * @author mengbo
- * @deprecated
- */
-public class CMRegistry implements ICMRegistry {
- static Logger _log = PDPlugin.getLogger(CMRegistry.class);
-
- private Map _htmlMap = new HashMap();
-
- private Map _jspMap = new HashMap();
-
- private List _contributedRegistries = new ArrayList();
-
- private static CMRegistry _instance = null;
-
- /**
- * @return the singleton instance
- */
- public static CMRegistry getInstance() {
- if (_instance == null) {
- _instance = new CMRegistry();
- }
- return _instance;
- }
-
- /**
- *
- */
- private CMRegistry() {
- ProgressMonitorDialog progress = new ProgressMonitorDialog(null);
- try {
- progress.run(true, false, new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor)
- throws InvocationTargetException {
- try {
- monitor
- .beginTask(
- PDPlugin
- .getResourceString("CMRegistry.ReadConfigration"),
- IProgressMonitor.UNKNOWN);
- monitor
- .subTask(PDPlugin
- .getResourceString("CMRegistry.HTMLConfigration"));
- loadCM("configs/cm/html.xml", _htmlMap);
- monitor
- .subTask(PDPlugin
- .getResourceString("CMRegistry.JSPConfigration"));
- loadCM("configs/cm/jsp.xml", _jspMap);
- monitor
- .subTask(PDPlugin
- .getResourceString("CMRegistry.OtherConfigration"));
- readExtensions();
- } finally {
- monitor.done();
- }
- }
- });
- } catch (InvocationTargetException e) {
- // ignore
- } catch (InterruptedException e) {
- // ignore
- }
- }
-
- /**
- *
- */
- private void readExtensions() {
- IExtensionPoint extensionPoint = Platform.getExtensionRegistry()
- .getExtensionPoint(PDPlugin.getPluginId(),
- IJMTConstants.EXTENSION_POINT_CMREGISTRY);
- IConfigurationElement[] eles = extensionPoint
- .getConfigurationElements();
-
- for (int i = 0; i < eles.length; i++) {
- if (eles[i].getName().equals("registry")) {
- String uri = eles[i].getAttribute("uri");
- if (uri == null || uri.length() == 0) {
- // no uri, skip
- continue;
- }
- String configFile = eles[i].getAttribute("configFile");
- if (configFile != null && configFile.length() > 0) {
- String bundleName = eles[i].getDeclaringExtension()
- .getContributor().getName();
- try {
- Bundle bundle = Platform.getBundle(bundleName);
- URL cmFileUrl = bundle.getEntry(configFile);
- SimpleCMRegistry reg = new SimpleCMRegistry(uri,
- cmFileUrl);
- _contributedRegistries.add(reg);
- } catch (ParserConfigurationException e) {
- PDPlugin.getLogger(getClass()).error(new Throwable(e));
- } catch (FactoryConfigurationError e) {
- PDPlugin.getLogger(getClass()).error(new Throwable(e));
- } catch (SAXException e) {
- PDPlugin.getLogger(getClass()).error(new Throwable(e));
- } catch (IOException e) {
- PDPlugin.getLogger(getClass()).error(new Throwable(e));
- }
- }
- String className = eles[i].getAttribute("class");
- if (className != null && className.length() > 0) {
- try {
- Object obj = eles[i].createExecutableExtension("class");
-
- if (obj instanceof ICMRegistry) {
- _contributedRegistries.add(obj);
- }
- } catch (CoreException e) {
- PDPlugin.getLogger(getClass()).error(new Throwable(e));
- }
- }
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.meta.ICMRegistry#getSupportedURI()
- */
- public String getSupportedURI() {
- return null;
- }
-
- private void loadCM(String fileName, Map map) {
- try {
- URL url = PDPlugin.getDefault().getBundle().getEntry(fileName);
- ElementDescReader reader = new ElementDescReader(url);
- reader.readElements(map);
- } catch (Exception e) {
- _log.error("Error loading " + fileName + ": " + e.getMessage());
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.cm.ICMRegistry#getElementDescriptor(java.lang.String,
- * java.lang.String)
- */
- public IElementDescriptor getElementDescriptor(String uri, String tagname) {
- if (uri == null) {
- uri = ITLDConstants.URI_HTML;
- }
- if (ITLDConstants.URI_HTML.equals(uri)) {
- IElementDescriptor desc = getHTMLElementDescriptor(tagname);
- if (desc != null) {
- return desc;
- }
- }
- if (ITLDConstants.URI_JSP.equals(uri)) {
- return getJSPElementDescriptor(tagname);
- }
- for (int i = 0, size = _contributedRegistries.size(); i < size; i++) {
- ICMRegistry reg = (ICMRegistry) _contributedRegistries.get(i);
- if (uri.equals(reg.getSupportedURI())) {
- IElementDescriptor ret = reg.getElementDescriptor(uri, tagname);
- if (ret != null) {
- return ret;
- }
- }
- }
-
- return null;
- }
-
- private IElementDescriptor getHTMLElementDescriptor(String tagname) {
- return (IElementDescriptor) _htmlMap.get(tagname.toLowerCase());
- }
-
- private IElementDescriptor getJSPElementDescriptor(String tagname) {
- return (IElementDescriptor) _jspMap.get(tagname.toLowerCase());
- }
-
- /**
- * @return list of {@link ICMRegistry}
- */
- public List<ICMRegistry> getRegistries() {
- List<ICMRegistry> ret = new ArrayList<ICMRegistry>(_contributedRegistries);
- ret.add(this);
- return ret;
- }
-
- /**
- * call to free up memory used
- */
- public void unloadRegistry(){
- _instance = null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/internal/CategoryNameComparator.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/internal/CategoryNameComparator.java
deleted file mode 100644
index 2a438b3..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/internal/CategoryNameComparator.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.meta.internal;
-
-import java.util.Comparator;
-import java.util.HashSet;
-
-/**
- * Sorts categories and ensures that @see{ITabbedPropertiesConstants.OTHER_CATEGORY} comes last
- * @author mengbo
- */
-public class CategoryNameComparator implements Comparator {
- static HashSet _pairs = new HashSet();
-
- private final static CategoryNameComparator _instance = new CategoryNameComparator();
-
- static class Pair {
- String s1;
-
- String s2;
-
- Pair(String a, String b) {
- s1 = a;
- s2 = b;
- }
-
- public int hashCode() {
- return s1.hashCode() + s2.hashCode();
- }
-
- public boolean equals(Object o) {
- if (o instanceof Pair) {
- Pair p = (Pair) o;
- return s1.equals(p.s1) && s2.equals(p.s2);
- }
- return false;
- }
- }
-
- /**
- * @param s1
- * @param s2
- */
- public static void addPair(String s1, String s2) {
- _pairs.add(new Pair(s1, s2));
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
- */
- public int compare(Object o1, Object o2) {
- if (o1.equals(o2))
- return 0;
-
- //Below code sorted OTHER category ("Attributes") to the bottom
- //Commenting out as it just looks strange
-// if (ITabbedPropertiesConstants.OTHER_CATEGORY.equals(o1))
-// return 1;
-// if (ITabbedPropertiesConstants.OTHER_CATEGORY.equals(o2))
-// return -1;
-
-// Pair p = new Pair((String) o1, (String) o2);
-// if (_pairs.contains(p))
-// return -1;
- return ((String)o1).compareTo(((String)o2));
- }
-
- /**
- * @return the instance
- */
- public static CategoryNameComparator getInstance() {
- return _instance;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/internal/CellEditorFacRegistryReader.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/internal/CellEditorFacRegistryReader.java
deleted file mode 100644
index 36b9ac2..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/internal/CellEditorFacRegistryReader.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.meta.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jst.pagedesigner.IJMTConstants;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.meta.ITagAttributeCellEditorFactory;
-
-/**
- * Read the registry to find out all the CellEditorFactory.
- *
- * @author mengbo
- */
-public class CellEditorFacRegistryReader {
- static ITagAttributeCellEditorFactory[] _factories = null;
-
- /**
- * @return ITagAttributeCellEditorFactory[]
- */
- public static synchronized ITagAttributeCellEditorFactory[] getAllFactories() {
- if (_factories == null) {
- _factories = readAllFactories();
- }
- return _factories;
-
- }
-
- private static ITagAttributeCellEditorFactory[] readAllFactories() {
- List result = new ArrayList();
- IExtensionPoint extensionPoint = Platform.getExtensionRegistry()
- .getExtensionPoint(PDPlugin.getPluginId(),
- IJMTConstants.EXTENSION_POINT_PAGEDESIGNER);
- IExtension[] extensions = extensionPoint.getExtensions();
-
- for (int i = 0; i < extensions.length; i++) {
- IExtension ext = extensions[i];
- IConfigurationElement[] facs = ext.getConfigurationElements();
-
- for (int j = 0; j < facs.length; j++) {
- if (facs[j].getName().equals(
- IJMTConstants.TAG_ATTRIBUTE_CELLEDITOR_FACTORY)) {
- Object obj;
- try {
- obj = facs[j].createExecutableExtension("class");
-
- if (obj instanceof ITagAttributeCellEditorFactory) {
- result.add(obj);
- }
- } catch (CoreException e) {
- // ignore the exception
- e.printStackTrace();
- }
- }
- }
- }
- ITagAttributeCellEditorFactory[] ret = new ITagAttributeCellEditorFactory[result
- .size()];
- result.toArray(ret);
- return ret;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/internal/CellEditorFactoryRegistry.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/internal/CellEditorFactoryRegistry.java
deleted file mode 100644
index 2435800..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/internal/CellEditorFactoryRegistry.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.meta.internal;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogField;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.ISupportTextValue;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.StringDialogField;
-import org.eclipse.jst.pagedesigner.editors.properties.IPropertyPageDescriptor;
-import org.eclipse.jst.pagedesigner.meta.ITagAttributeCellEditorFactory;
-import org.eclipse.jst.pagedesigner.properties.celleditors.CellEditorFactory;
-import org.eclipse.swt.widgets.Composite;
-import org.w3c.dom.Element;
-
-/**
- * CellEditorFactoryRegistry also read information from plugin.xml extension to
- * allow other plugins to contribute new kinds of cell editors.
- *
- */
-public class CellEditorFactoryRegistry {
-// private static final Logger _log = PDPlugin
-// .getLogger(CellEditorFactoryRegistry.class);
-
- private static CellEditorFactoryRegistry _instance;
-
- private Map _factoryMap = new HashMap();
-
- private List _defaultFactories = new ArrayList();
-
- /**
- * @return singleton CellEditorFactoryRegistry
- */
- public static CellEditorFactoryRegistry getInstance() {
- if (_instance == null) {
- _instance = new CellEditorFactoryRegistry();
- }
- return _instance;
- }
-
- private CellEditorFactoryRegistry() {
- ITagAttributeCellEditorFactory[] facs = CellEditorFacRegistryReader
- .getAllFactories();
- if (facs != null) {
- for (int i = 0; i < facs.length; i++) {
- addCellEditorFactory(facs[i]);
- }
- }
- addCellEditorFactory(new CellEditorFactory());
- }
-
- /**
- * @param fac
- */
- public void addCellEditorFactory(ITagAttributeCellEditorFactory fac) {
- String[] types = fac.getSupportedValueTypes();
- if (types == null || types.length == 0) {
- _defaultFactories.add(fac);
- } else {
- for (int i = 0; i < types.length; i++) {
- _factoryMap.put(types[i], fac);
- }
- }
- }
-
- /**
- * Return cell editor for attribute based upon runtime value type
- * @param parent
- * @param attr
- * @param element
- * @return CellEditor
- */
- public CellEditor createCellEditor(Composite parent,
- IPropertyPageDescriptor attr, Element element) {
- String type = attr.getValueType();
- if (type == null || type.length() == 0)
- return null;
-
- CellEditor result = null;
- ITagAttributeCellEditorFactory fac = (ITagAttributeCellEditorFactory) _factoryMap
- .get(type);
-
- if (fac != null) {
- result = fac.createCellEditor(parent, attr, element);
- }
- if (result == null) {
- for (int i = 0, size = _defaultFactories.size(); i < size; i++) {
- result = ((ITagAttributeCellEditorFactory) _defaultFactories
- .get(i)).createCellEditor(parent, attr, element);
- if (result != null)
- break;
- }
- }
- return result;
- }
-
- /**
- * @param attr
- * @return DialogField
- */
- public DialogField createDialogField(IPropertyPageDescriptor attr) {
- String type = attr.getValueType();
- if (type == null || type.length() == 0) {
- DialogField result = createTextDialogField(attr);
- result.setLabelText(attr.getLabel()); //labelProvider???
- return result;
- }
-// type = type.toUpperCase();
-
- DialogField result = null;
- ITagAttributeCellEditorFactory fac = (ITagAttributeCellEditorFactory) _factoryMap
- .get(type);
- if (fac != null) {
- result = fac.createDialogField(attr);
- }
- if (result == null) {
- for (int i = 0, size = _defaultFactories.size(); i < size; i++) {
- result = ((ITagAttributeCellEditorFactory) _defaultFactories
- .get(i)).createDialogField(attr);
- if (result != null) {
- break;
- }
- }
- }
- if (result == null) {
- result = createTextDialogField(attr);
- }
- if (!(result instanceof ISupportTextValue)) {
- result = createTextDialogField(attr);
- }
-// result.setLabelText(attr.getLabel() + ":"); //$NON-NLS-1$
- return result;
- }
-
- /**
- * @param attr
- * @return DialogField
- */
- public DialogField createTextDialogField(IPropertyPageDescriptor attr) {
- StringDialogField field = new StringDialogField();
- field.setLabelText(attr.getLabel());
- field.setRequired(attr.isRequired());
- field.setToolTip(attr.getDescription());
- return field;
- }
-// /**
-// * This is NOT a product method. It should only be used by testing code.
-// *
-// * @return String[] of value types
-// */
-// public String[] getAllValueTypes() {
-// //FIXME
-// Set valueTypes = new HashSet();
-// for (Iterator iter = _factoryMap.values().iterator(); iter.hasNext();) {
-// ITagAttributeCellEditorFactory fac = (ITagAttributeCellEditorFactory) iter
-// .next();
-// String[] supportedTypes = fac.getSupportedValueTypes();
-//
-// if (supportedTypes != null) {
-// for (int i = 0; i < supportedTypes.length; i++) {
-// valueTypes.add(supportedTypes[i]);
-// }
-// }
-// }
-// // add those default ones.
-// Field[] fields = OLDIValueType.class.getFields();
-// for (int i = 0; i < fields.length; i++) {
-// int modifiers = fields[i].getModifiers();
-// if (Modifier.isStatic(modifiers) && Modifier.isFinal(modifiers)) {
-// if (fields[i].getType() == String.class) {
-// try {
-// valueTypes.add(fields[i].get(null));
-// } catch (IllegalArgumentException ex) {
-// // "Error in fields retrieving:"
-// _log.info("CellEditorFactoryRegistry.Info.2", ex); //$NON-NLS-1$
-// } catch (IllegalAccessException ex) {
-// // "Error in fields retrieving:"
-// _log.info("CellEditorFactoryRegistry.Info.3", ex); //$NON-NLS-1$
-// }
-// }
-// }
-// }
-// String[] ret = new String[valueTypes.size()];
-// valueTypes.toArray(ret);
-// return ret;
-// }
-
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/internal/ElementDescReader.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/internal/ElementDescReader.java
deleted file mode 100644
index b0c970a..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/internal/ElementDescReader.java
+++ /dev/null
@@ -1,445 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.meta.internal;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.PropertyResourceBundle;
-import java.util.ResourceBundle;
-import java.util.Set;
-import java.util.StringTokenizer;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.FactoryConfigurationError;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.jsf.common.ui.internal.utils.ResourceUtils;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.meta.AttributeDescriptor;
-import org.eclipse.jst.pagedesigner.meta.IAttributeDescriptor;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
-
-/**
- * Used by Sybase CMConfig model loader
- * @author mengbo
- * @deprecated
- */
-public class ElementDescReader {
- private static Logger _log = PDPlugin.getLogger(ElementDescReader.class);
-
- private Map _definedCategoryMap = new HashMap();
-
- private Map _definedAttributeMap = new HashMap();
-
- private URL _url;
-
- private String[] _optimizedLocales = null;
-
- /**
- * @param url
- */
- public ElementDescReader(URL url) {
- this._url = url;
- }
-
- /**
- * Read xml information and fill the map
- *
- * @param map
- * @throws ParserConfigurationException
- * @throws FactoryConfigurationError
- * @throws SAXException
- * @throws IOException
- */
- public void readElements(Map map) throws ParserConfigurationException,
- FactoryConfigurationError, SAXException, IOException {
- DocumentBuilder builder = DocumentBuilderFactory.newInstance()
- .newDocumentBuilder();
-
- InputStream stream = null;
- Document doc = null;
- try
- {
- stream = this._url.openStream();
- doc = builder.parse(stream);
- }
- finally
- {
- ResourceUtils.ensureClosed(stream);
- }
-
- Element taglib = doc.getDocumentElement();
- String nameSpace = taglib.getAttribute("uri");
-
- NodeList list = doc.getElementsByTagName("tag");
- if (list != null && list.getLength() != 0) {
- int size = list.getLength();
- for (int i = 0; i < size; i++) {
- Element tag = (Element) list.item(i);
- ElementDescriptor desc = new ElementDescriptor();
- desc.setTagName(tag.getAttribute("name"));
- desc.setNamespaceURI(nameSpace);
-
- // support for help context id.
- desc.setHelpContextID(tag.getAttribute("helpContextId"));
-
- NodeList children = tag.getChildNodes();
- // first calculate category and refered category quantity
- NodeList cateNodes = tag.getElementsByTagName("category");
- NodeList referedCateNodes = tag
- .getElementsByTagName("referedcategory");
- int cateNum = 0;
- if (cateNodes != null) {
- cateNum += cateNodes.getLength();
- }
- if (referedCateNodes != null) {
- cateNum += referedCateNodes.getLength();
- }
-
- if (cateNum > 0) {
- int length = children.getLength();
- String[] cates = new String[cateNum];
- List attrList = new ArrayList();
- int realCate = 0;
- for (int j = 0; j < length; j++) {
- Node node = children.item(j);
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- Element element = (Element) node;
- String tagName = element.getTagName();
- if ("category".equals(tagName)
- || "referedcategory".equals(tagName)) {
- String categoryName = element
- .getAttribute("name");
- if (categoryName != null
- && !"".equals(categoryName)) {
- cates[realCate++] = categoryName;
- parseCategory(element, element, attrList);
- } else {
- Element definedCategory = handleReference(
- doc, element, true);
- String labelKey = definedCategory
- .getAttribute("displaylabel");
- if (labelKey != null
- && !"".equals(labelKey)) {
- cates[realCate++] = getValue(labelKey);
- } else {
- cates[realCate++] = calculateDisplayLabel(definedCategory);
- }
-
- parseCategory(element, definedCategory,
- attrList);
- }
- }
- }
-
- }
-
- // for sort categories
- for (int m = 0, len = cates.length; m < len; m++) {
- for (int j = m + 1; j < len; j++) {
- CategoryNameComparator.addPair(cates[m], cates[j]);
- }
- }
- desc.setAttributeDescriptors(attrList);
- }
-
- map.put(desc.getTagName(), desc);
- }
- }
- }
-
- private String calculateDisplayLabel(Element definedElement) {
- String label = definedElement.getAttribute("displaylabel");
- return getValue(label);
- }
-
- private void parseCategory(Element category, Element definedCategory,
- List attrList) {
- String cateLabel = calculateDisplayLabel(definedCategory);
- // if the category is a referedcategory tag
- if (category != definedCategory) {
- String labelKey = category.getAttribute("displaylabel");
- if (labelKey != null && !"".equals(labelKey)) {
- cateLabel = getValue(labelKey);
- }
- }
- handleAttributes(definedCategory, cateLabel, attrList);
- if (category == definedCategory) {
- return;
- }
-
- // the category should be a referedcategory tag
- // include/add more attributes to category
- NodeList includes = category.getElementsByTagName("includeattrs");
- if (includes != null && includes.getLength() != 0) {
- Element includeAttrsTag = (Element) includes.item(0);
- handleAttributes(includeAttrsTag, cateLabel, attrList);
-
- // handle attribute override
- HashMap tempMap = new HashMap();
- Iterator itor = attrList.iterator();
- while (itor.hasNext()) {
- AttributeDescriptor adp = (AttributeDescriptor) itor.next();
- tempMap.put(adp.getAttributeName(), adp);
- }
- int listSize = attrList.size();
- int mapSize = tempMap.size();
- if (listSize != mapSize) {
- attrList.clear();
- Set set = tempMap.keySet();
- Iterator setor = set.iterator();
- while (setor.hasNext()) {
- String atName = (String) setor.next();
- AttributeDescriptor ad = (AttributeDescriptor) tempMap
- .get(atName);
- attrList.add(ad);
- }
- }
-
- }
-
- // exclude attributes from category
- NodeList excludes = category.getElementsByTagName("excludeattrs");
- if (excludes != null && excludes.getLength() != 0) {
- String displayNames = ((Element) excludes.item(0))
- .getAttribute("refs");
- StringTokenizer tokenizer = new StringTokenizer(displayNames, ", ");
-
- while (tokenizer.hasMoreTokens()) {
- String name = tokenizer.nextToken();
- Iterator itr = attrList.iterator();
- while (itr.hasNext()) {
- IAttributeDescriptor atr = (IAttributeDescriptor) itr
- .next();
- String atrName = atr.getAttributeName();
- if (name.equals(atrName)) {
- attrList.remove(atr);
- break;
- }
- }
- }
- }
- }
-
- /**
- * handle all attribute element and referedattribute element under the root
- * element
- *
- * @param root
- * @param cateLabel
- * @param list
- */
- private void handleAttributes(Element root, String cateLabel, List attrList) {
- NodeList allNodes = root.getChildNodes();
- NodeList attrNodes = root.getElementsByTagName("attribute");
- NodeList referedattrNodes = root
- .getElementsByTagName("referedattribute");
- int attrNum = 0;
- if (attrNodes != null) {
- attrNum += attrNodes.getLength();
- }
- if (referedattrNodes != null) {
- attrNum += referedattrNodes.getLength();
- }
-
- if (attrNum > 0) {
- int incAttrLength = allNodes.getLength();
- for (int i = 0; i < incAttrLength; i++) {
- Node node = allNodes.item(i);
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- Element incAttr = (Element) node;
- String tagName = incAttr.getTagName();
- if ("attribute".equals(tagName)
- || "referedattribute".equals(tagName)) {
- String incAtrName = incAttr.getAttribute("name");
- Element refAttr = incAttr;
- if (incAtrName == null || "".equals(incAtrName)) {
- incAttr = handleReference(root.getOwnerDocument(),
- incAttr, false);
- }
- AttributeDescriptor attrDesc = parseAttribute(
- cateLabel, incAttr);
- String overrideName = refAttr
- .getAttribute("overridename");
- if (overrideName != null
- && !"".equalsIgnoreCase(overrideName)) {
- attrDesc.setAttributeName(overrideName);
- }
- String ovDisplayLabel = refAttr
- .getAttribute("displaylabel");
- if (ovDisplayLabel != null
- && !"".equalsIgnoreCase(ovDisplayLabel)) {
- attrDesc.setLabelString(getValue(ovDisplayLabel));
- }
- attrList.add(attrDesc);
- }
-
- }
-
- }
- }
- }
-
- private Element handleReference(Document doc, Element refElment,
- boolean isCategory) {
- String refName = refElment.getAttribute("ref");
- if (isCategory) {
- if (_definedCategoryMap.get(refName) != null) {
- Element definedCategory = (Element) _definedCategoryMap
- .get(refName);
- return definedCategory;
- }
- } else {
- if (_definedAttributeMap.get(refName) != null) {
- Element definedAttribute = (Element) _definedAttributeMap
- .get(refName);
- return definedAttribute;
- }
- }
-
- NodeList catgs = null;
- if (isCategory) {
- NodeList defineCates = doc.getElementsByTagName("categories");
- Element firstCate = (Element) defineCates.item(0);
- catgs = firstCate.getElementsByTagName("category");
- } else {
- NodeList defineCates = doc.getElementsByTagName("attributes");
- Element firstCate = (Element) defineCates.item(0);
- catgs = firstCate.getElementsByTagName("attribute");
- }
- int cateLen = catgs.getLength();
- Element definedElement = null;
- for (int n = 0; n < cateLen; n++) {
- String cateName = ((Element) catgs.item(n)).getAttribute("name");
- if (refName.equals(cateName) && !"".equals(refName)) {
- definedElement = (Element) catgs.item(n);
- break;
- }
- }
- if (isCategory) {
- _definedCategoryMap.put(refName, definedElement);
- } else {
- _definedAttributeMap.put(refName, definedElement);
- }
- return definedElement;
- }
-
- private AttributeDescriptor parseAttribute(String categoryName,
- Element attribute) {
- AttributeDescriptor attrDesc = new AttributeDescriptor();
- attrDesc.setCategory(categoryName);
-
- attrDesc.setAttributeName(attribute.getAttribute("name"));
- attrDesc.setDescription(attribute.getAttribute("description"));
- attrDesc.setValueType(attribute.getAttribute("type"));
- attrDesc.setRequired(attribute.hasAttribute("required"));
- attrDesc.setTypeParameter(attribute.getAttribute("typeparam"));
- String labelKey = attribute.getAttribute("displaylabel");
- attrDesc.setLabelString(getValue(labelKey));
-
- NodeList optionNodes = attribute.getElementsByTagName("option");
- if (optionNodes != null && optionNodes.getLength() != 0) {
- HashMap optionMap = new HashMap();
- int opLength = optionNodes.getLength();
- String defaultValue = null;
- for (int m = 0; m < opLength; m++) {
- Element optNode = (Element) optionNodes.item(m);
- String key = optNode.getAttribute("key");
- String value = optNode.getAttribute("value");
- if (value == null || value.length() == 0) {
- value = key;
- }
- if (optNode.hasAttribute("default")) {
- defaultValue = value;
- }
- optionMap.put(key, value);
- }
- attrDesc.setOptions(optionMap, defaultValue);
- }
-
- return attrDesc;
- }
-
- private String getValue(String key) {
- if (key != null && key.startsWith("%")) {
- String cmStr = this._url.toString();
- String propBaseStr = cmStr.substring(0, cmStr.lastIndexOf("."));
-
- String[] localeOptions = LocaleFallback.fallBack(Locale
- .getDefault());
- String[] options = localeOptions;
- if (_optimizedLocales != null) {
- options = _optimizedLocales;
- }
- for (int i = 0, size = options.length; i < size; i++) {
- StringBuffer sb = new StringBuffer();
- sb.append(propBaseStr);
- sb.append(options[i]);
- sb.append(".properties");
- String str = sb.toString();
-
- ResourceBundle rb = null;
- try {
- URL propUrl = new URL(str);
- rb = new PropertyResourceBundle(propUrl.openStream());
- } catch (Exception e1) {
- // we don't handle the exception here,since it is in a
- // fallback route,it is possible of not exist
- // _log.info("Info.ElementDescReader.ReadPropertyFile",
- // str);
- continue;
- }
- if (_optimizedLocales == null) {
- setOptimizedLocales(localeOptions, i);
- }
-
- String rbKey = key.substring(1);
- String value = null;
- try {
- value = rb.getString(rbKey);
- } catch (Exception e) {
- _log.info("Info.ElementDescReader.ReadPropertyFile.Key",
- rbKey, str, null);
- continue;
- }
-
- if (value != null) {
- return value;
- }
-
- }
- return null;
- }
- return key;
- }
-
- private void setOptimizedLocales(String[] originalLocales, int startPoint) {
- int size = originalLocales.length - startPoint;
- _optimizedLocales = new String[size];
- for (int i = 0; i < size; i++) {
- _optimizedLocales[i] = originalLocales[i + startPoint];
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/internal/ElementDescriptor.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/internal/ElementDescriptor.java
deleted file mode 100644
index 91dd59c..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/internal/ElementDescriptor.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.meta.internal;
-
-import java.util.List;
-
-import org.eclipse.jst.pagedesigner.meta.IAttributeDescriptor;
-import org.eclipse.jst.pagedesigner.meta.IElementDescriptor;
-
-/**
- * @author mengbo
- * @deprecated
- */
-public class ElementDescriptor implements IElementDescriptor {
- String _tagName;
-
- String _namespaceURI;
-
- IAttributeDescriptor[] _attrs;
-
- private String _helpContextID;
-
- /**
- *
- */
- public ElementDescriptor() {
- super();
- // TODO Auto-generated constructor stub
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.cm.IElementDescriptor#getTagName()
- */
- public String getTagName() {
- return _tagName;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.cm.IElementDescriptor#getNamespaceURI()
- */
- public String getNamespaceURI() {
- return _namespaceURI;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.cm.IElementDescriptor#getAttributeDescriptors()
- */
- public IAttributeDescriptor[] getAttributeDescriptors() {
- return _attrs;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.cm.IElementDescriptor#getReference()
- */
- public IElementDescriptor getReference() {
- return null;
- }
-
- /**
- * @param namespaceURI
- */
- public void setNamespaceURI(String namespaceURI) {
- this._namespaceURI = namespaceURI;
- }
-
- /**
- * @param tagName
- */
- public void setTagName(String tagName) {
- this._tagName = tagName;
- }
-
- /**
- * @param attrs
- */
- public void setAttributeDescriptors(List attrs) {
- if (attrs == null || attrs.isEmpty()) {
- _attrs = new IAttributeDescriptor[0];
- } else {
- _attrs = new IAttributeDescriptor[attrs.size()];
- attrs.toArray(_attrs);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.meta.IElementDescriptor#getAttributeDescriptor(java.lang.String)
- */
- public IAttributeDescriptor getAttributeDescriptor(String attributeName) {
- if (_attrs != null) {
- for (int i = 0; i < _attrs.length; i++) {
- IAttributeDescriptor descriptor = _attrs[i];
- if (descriptor.getAttributeName().equalsIgnoreCase(
- attributeName)) {
- return descriptor;
- }
- }
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.meta.IElementDescriptor#getHelpContextID()
- */
- public String getHelpContextID() {
- return _helpContextID;
- }
-
- /**
- * @param contextid
- */
- public void setHelpContextID(String contextid) {
- _helpContextID = contextid;
- }
-
- public String toString(){
- StringBuffer buf = new StringBuffer("ElementDescriptor: ");
- buf.append(this.getTagName()).append("(").append(this.getNamespaceURI()).append(")");
- return buf.toString();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/internal/LocaleFallback.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/internal/LocaleFallback.java
deleted file mode 100644
index d99b6d5..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/internal/LocaleFallback.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.meta.internal;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-
-/**
- * @author mengbo
- * @version 1.5
- * @deprecated
- */
-public class LocaleFallback {
- private static Map map = new HashMap();
-
- /**
- * @param locale
- * @return the list of local values
- */
- public static synchronized String[] fallBack(Locale locale) {
- if (map.get(locale) != null) {
- return (String[]) map.get(locale);
- }
- // first compute the fallback locales according to the input locale
- List inputLocaleList = calculateLocaleNames(locale);
- String[] ins = reverseList(inputLocaleList);
- // then compute the fallback locales accroding to the system default
- // locale
- int defsSize = 0;
- String[] defs = null;
- if (!locale.equals(Locale.getDefault())) {
- List defLocaleList = calculateLocaleNames(Locale.getDefault());
- defs = reverseList(defLocaleList);
- defsSize = defs.length;
- }
-
- int insSize = ins.length;
- int size = insSize + defsSize;
-
- String[] options = new String[size + 1];
- for (int i = 0; i < size; i++) {
- if (i < insSize) {
- options[i] = ins[i];
- } else {
- options[i] = defs[i - insSize];
- }
- }
- // last add blank string in order to search the base file
- options[size] = "";
- map.put(locale, options);
-
- return options;
-
- }
-
- private static List calculateLocaleNames(Locale locale) {
- List list = new ArrayList();
- StringBuffer item;
-
- String language = locale.getLanguage();
- String country = locale.getCountry();
- String variant = locale.getVariant();
-
- int languageLength = language.length();
- int countryLength = country.length();
- int variantLength = variant.length();
-
- if (languageLength == 0 && countryLength == 0 && variantLength == 0) {
- // The locale is "", "", "".
- return list;
- }
- item = new StringBuffer();
- item = item.append('_').append(language);
- list.add(item.toString());
-
- if (countryLength == 0 && variantLength == 0) {
- return list;
- }
- item.append('_').append(country);
- list.add(item.toString());
-
- if (variantLength == 0) {
- return list;
- }
- item.append('_').append(variantLength);
- list.add(item.toString());
-
- return list;
- }
-
- private static String[] reverseList(List list) {
- int size = list.size();
- String[] vals = new String[size];
- for (int i = 0; i < size; i++) {
- vals[i] = (String) list.get(size - 1 - i);
- }
- return vals;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/internal/SimpleCMRegistry.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/internal/SimpleCMRegistry.java
deleted file mode 100644
index 5d4e73f..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/internal/SimpleCMRegistry.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.meta.internal;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.xml.parsers.FactoryConfigurationError;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.eclipse.jst.pagedesigner.meta.ICMRegistry;
-import org.eclipse.jst.pagedesigner.meta.IElementDescriptor;
-import org.xml.sax.SAXException;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-@SuppressWarnings("deprecation")
-public class SimpleCMRegistry implements ICMRegistry {
- String _uri;
-
- Map _map = new HashMap();
-
- /**
- * @param uri
- * @param cmFileUrl
- * @throws IOException
- * @throws SAXException
- * @throws FactoryConfigurationError
- * @throws ParserConfigurationException
- *
- */
- public SimpleCMRegistry(String uri, URL cmFileUrl)
- throws ParserConfigurationException, FactoryConfigurationError,
- SAXException, IOException {
- this._uri = uri;
- ElementDescReader reader = new ElementDescReader(cmFileUrl);
- reader.readElements(_map);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.meta.ICMRegistry#getSupportedURI()
- */
- public String getSupportedURI() {
- return _uri;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.meta.ICMRegistry#getElementDescriptor(java.lang.String,
- * java.lang.String)
- */
- public IElementDescriptor getElementDescriptor(String uri, String tagname) {
- if (uri.equals(_uri)) {
- return (IElementDescriptor) _map.get(tagname);
- }
- return null;
- }
-
- /**
- * @return an unmodifiable map of the registry
- */
- public Map getMap(){
- return Collections.unmodifiableMap(_map);
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/internal/XXXCellEditorFacRegistryReader.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/internal/XXXCellEditorFacRegistryReader.java
deleted file mode 100644
index b8cab33..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/internal/XXXCellEditorFacRegistryReader.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.meta.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jst.pagedesigner.IJMTConstants;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.meta.IAttributeCellEditorFactory;
-
-/**
- * Read the registry to find out all the CellEditorFactory.
- *
- * @author mengbo
- * will be deleted
- */
-@SuppressWarnings("deprecation")
-public class XXXCellEditorFacRegistryReader {
- static IAttributeCellEditorFactory[] _factories = null;
-
- /**
- * @return the factories
- */
- public static synchronized IAttributeCellEditorFactory[] getAllFactories() {
- if (_factories == null) {
- _factories = readAllFactories();
- }
- return _factories;
-
- }
-
- private static IAttributeCellEditorFactory[] readAllFactories() {
- List result = new ArrayList();
- IExtensionPoint extensionPoint = Platform.getExtensionRegistry()
- .getExtensionPoint(PDPlugin.getPluginId(),
- IJMTConstants.EXTENSION_POINT_PAGEDESIGNER);
- IExtension[] extensions = extensionPoint.getExtensions();
-
- for (int i = 0; i < extensions.length; i++) {
- IExtension ext = extensions[i];
- IConfigurationElement[] facs = ext.getConfigurationElements();
-
- for (int j = 0; j < facs.length; j++) {
- if (facs[j].getName().equals(
- IJMTConstants.ATTRIBUTE_CELLEDITOR_FACTORY)) {
-// facs[j].getAttribute("class");
- Object obj;
- try {
- obj = facs[j].createExecutableExtension("class");
-
- if (obj instanceof IAttributeCellEditorFactory) {
- result.add(obj);
- }
- } catch (CoreException e) {
- // ignore the exception
- e.printStackTrace();
- }
- }
- }
- }
- IAttributeCellEditorFactory[] ret = new IAttributeCellEditorFactory[result
- .size()];
- result.toArray(ret);
- return ret;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/internal/XXXCellEditorFactoryRegistry.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/internal/XXXCellEditorFactoryRegistry.java
deleted file mode 100644
index d55c586..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/internal/XXXCellEditorFactoryRegistry.java
+++ /dev/null
@@ -1,293 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.meta.internal;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogField;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.ISupportTextValue;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.StringDialogField;
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.editors.properties.IPropertyPageDescriptor;
-import org.eclipse.jst.pagedesigner.meta.IAttributeCellEditorFactory;
-import org.eclipse.jst.pagedesigner.meta.IAttributeDescriptor;
-import org.eclipse.jst.pagedesigner.meta.OLDIValueType;
-import org.eclipse.jst.pagedesigner.properties.celleditors.OLDCellEditorFactory;
-import org.eclipse.swt.widgets.Composite;
-import org.w3c.dom.Element;
-
-/**
- * CellEditorFactoryRegistry also read information from plugin.xml extension to
- * allow other plugins to contribute new kinds of cell editors.
- *
- * @author mengbo
- * will be deleted
- */
-@SuppressWarnings("deprecation")
-public class XXXCellEditorFactoryRegistry {
- private static final Logger _log = PDPlugin
- .getLogger(XXXCellEditorFactoryRegistry.class);
-
- private static XXXCellEditorFactoryRegistry _instance;
-
- private Map _factoryMap = new HashMap();
-
- private List _defaultFactories = new ArrayList();
-
- /**
- * @return the singleton registry instance
- */
- public static XXXCellEditorFactoryRegistry getInstance() {
- if (_instance == null) {
- _instance = new XXXCellEditorFactoryRegistry();
- }
- return _instance;
- }
-
- private XXXCellEditorFactoryRegistry() {
- IAttributeCellEditorFactory[] facs = XXXCellEditorFacRegistryReader
- .getAllFactories();
- if (facs != null) {
- for (int i = 0; i < facs.length; i++) {
- addCellEditorFactory(facs[i]);
- }
- }
- addCellEditorFactory(new OLDCellEditorFactory());
- }
-
- /**
- * @param fac
- */
- public void addCellEditorFactory(IAttributeCellEditorFactory fac) {
- String[] types = fac.getSupportedValueTypes();
- if (types == null || types.length == 0) {
- _defaultFactories.add(fac);
- } else {
- for (int i = 0; i < types.length; i++) {
- _factoryMap.put(types[i].toUpperCase(), fac);
- }
- }
- }
-
- /**
- * @param parent
- * @param attr
- * @param element
- * @return the cell editor
- */
- public CellEditor createCellEditor(Composite parent,
- IAttributeDescriptor attr, Element element) {
- String type = attr.getValueType();
- if (type == null || type.length() == 0)
- return null;
- type = type.toUpperCase();
-
- CellEditor result = null;
- IAttributeCellEditorFactory fac = (IAttributeCellEditorFactory) _factoryMap
- .get(type);
- if (fac != null) {
- result = fac.createCellEditor(parent, attr, element);
- }
- if (result == null) {
- for (int i = 0, size = _defaultFactories.size(); i < size; i++) {
- result = ((IAttributeCellEditorFactory) _defaultFactories
- .get(i)).createCellEditor(parent, attr, element);
- if (result != null)
- break;
- }
- }
- return result;
- }
-
- /**
- * @param parent
- * @param attr
- * @param element
- * @return the cell editor
- */
- public CellEditor createCellEditor(Composite parent,
- IPropertyPageDescriptor attr, Element element) {
-// String type = attr.getValueType();
-// if (type == null || type.length() == 0)
-// return null;
-// type = type.toUpperCase();
-
- CellEditor result = null;
- result = new TextCellEditor(parent);
-// IAttributeCellEditorFactory fac = (IAttributeCellEditorFactory) _factoryMap
-// .get(type);
-// if (fac != null) {
-// result = fac.createCellEditor(parent, attr, element);
-// }
-// if (result == null) {
-// for (int i = 0, size = _defaultFactories.size(); i < size; i++) {
-// result = ((IAttributeCellEditorFactory) _defaultFactories
-// .get(i)).createCellEditor(parent, attr, element);
-// if (result != null)
-// break;
-// }
-// }
- return result;
- }
-
- /**
- * @param attr
- * @return DialogField
- */
- public DialogField createDialogField(IAttributeDescriptor attr) {
- String type = attr.getValueType();
- if (type == null || type.length() == 0) {
- DialogField result = createTextDialogField(attr);
- result.setLabelText(attr.getLabelString() + ":"); //$NON-NLS-1$
- return result;
- }
- type = type.toUpperCase();
-
- DialogField result = null;
- IAttributeCellEditorFactory fac = (IAttributeCellEditorFactory) _factoryMap
- .get(type);
- if (fac != null) {
- result = fac.createDialogField(attr);
- }
- if (result == null) {
- for (int i = 0, size = _defaultFactories.size(); i < size; i++) {
- result = ((IAttributeCellEditorFactory) _defaultFactories
- .get(i)).createDialogField(attr);
- if (result != null) {
- break;
- }
- }
- }
- if (result == null) {
- result = createTextDialogField(attr);
- }
- if (!(result instanceof ISupportTextValue)) {
- result = createTextDialogField(attr);
- }
- result.setLabelText(attr.getLabelString() + ":"); //$NON-NLS-1$
- return result;
- }
-
- /**
- * @param attr
- * @return the dialog field
- */
- public DialogField createDialogField(IPropertyPageDescriptor attr) {
- String type = attr.getValueType();
- if (type == null || type.length() == 0) {
- DialogField result = createTextDialogField(attr);
- result.setLabelText(attr.getLabel()); //labelProvider???
- return result;
- }
- type = type.toUpperCase();
-
- DialogField result = null;
-// IAttributeCellEditorFactory fac = (IAttributeCellEditorFactory) _factoryMap
-// .get(type);
-// if (fac != null) {
-// result = fac.createDialogField(attr);
-// }
-// if (result == null) {
-// for (int i = 0, size = _defaultFactories.size(); i < size; i++) {
-// result = ((IAttributeCellEditorFactory) _defaultFactories
-// .get(i)).createDialogField(attr);
-// if (result != null) {
-// break;
-// }
-// }
-// }
-// if (result == null) {
- result = createTextDialogField(attr);
-// }
- if (!(result instanceof ISupportTextValue)) {
- result = createTextDialogField(attr);
- }
-// result.setLabelText(attr.getLabel() + ":"); //$NON-NLS-1$
- return result;
- }
- /**
- * @param attr
- * @return DialogField
- */
- public DialogField createTextDialogField(IAttributeDescriptor attr) {
- StringDialogField field = new StringDialogField();
- field.setLabelText(attr.getLabelString());
- field.setRequired(attr.isRequired());
- field.setToolTip(attr.getDescription());
- return field;
- }
-
- /**
- * @param attr
- * @return DialogField
- */
- public DialogField createTextDialogField(IPropertyPageDescriptor attr) {
- StringDialogField field = new StringDialogField();
- field.setLabelText(attr.getLabel());
- field.setRequired(attr.isRequired());
- field.setToolTip(attr.getDescription());
- return field;
- }
- /**
- * This is NOT a product method. It should only be used by testing code.
- *
- * @return String[] of value types
- */
- public String[] getAllValueTypes() {
- Set valueTypes = new HashSet();
- for (Iterator iter = _factoryMap.values().iterator(); iter.hasNext();) {
- IAttributeCellEditorFactory fac = (IAttributeCellEditorFactory) iter
- .next();
- String[] supportedTypes = fac.getSupportedValueTypes();
-
- if (supportedTypes != null) {
- for (int i = 0; i < supportedTypes.length; i++) {
- valueTypes.add(supportedTypes[i]);
- }
- }
- }
- // add those default ones.
- Field[] fields = OLDIValueType.class.getFields();
- for (int i = 0; i < fields.length; i++) {
- int modifiers = fields[i].getModifiers();
- if (Modifier.isStatic(modifiers) && Modifier.isFinal(modifiers)) {
- if (fields[i].getType() == String.class) {
- try {
- valueTypes.add(fields[i].get(null));
- } catch (IllegalArgumentException ex) {
- // "Error in fields retrieving:"
- _log.info("CellEditorFactoryRegistry.Info.2", ex); //$NON-NLS-1$
- } catch (IllegalAccessException ex) {
- // "Error in fields retrieving:"
- _log.info("CellEditorFactoryRegistry.Info.3", ex); //$NON-NLS-1$
- }
- }
- }
- }
- String[] ret = new String[valueTypes.size()];
- valueTypes.toArray(ret);
- return ret;
- }
-
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/internal/XXXDefaultEditorCreator.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/internal/XXXDefaultEditorCreator.java
deleted file mode 100644
index 1facad9..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/meta/internal/XXXDefaultEditorCreator.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.meta.internal;
-
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogField;
-import org.eclipse.jst.jsf.core.internal.tld.CMUtil;
-import org.eclipse.jst.pagedesigner.editors.properties.IPropertyPageDescriptor;
-import org.eclipse.jst.pagedesigner.meta.IAttributeDescriptor;
-import org.eclipse.jst.pagedesigner.meta.IBindingHandler;
-import org.eclipse.jst.pagedesigner.meta.XXXEditorCreator;
-import org.eclipse.jst.pagedesigner.properties.celleditors.CellEditorWrapper;
-import org.eclipse.jst.pagedesigner.ui.dialogfields.DialogFieldWrapper;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- * @author mengbo
- * @version 1.5
- * will be deleted
- */
-@SuppressWarnings("deprecation")
-public class XXXDefaultEditorCreator extends XXXEditorCreator {
- static IAttributeDescriptor _staticAttr;
-
- static IDOMElement _staticElement;
-
- static IBindingHandler _staticHandler;
-
- static CellEditorHolder _staticHolder;
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.meta.EditorCreator#createCellEditor(org.eclipse.swt.widgets.Composite,
- * org.eclipse.jst.pagedesigner.meta.IAttributeDescriptor,
- * org.w3c.dom.Element)
- */
- public CellEditor createCellEditor(Composite parent,
- IAttributeDescriptor attr, IDOMElement element) {
- return XXXCellEditorFactoryRegistry.getInstance().createCellEditor(parent,
- attr, element);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.meta.EditorCreator#createDialogField(org.eclipse.jst.pagedesigner.meta.IAttributeDescriptor)
- */
- public DialogField createDialogField(IAttributeDescriptor attr) {
- return XXXCellEditorFactoryRegistry.getInstance().createDialogField(attr);
- }
-
- /**
- * @param attr
- * @return the dialog field
- */
- public DialogField createDialogField(IPropertyPageDescriptor attr) {
- return XXXCellEditorFactoryRegistry.getInstance().createDialogField(attr);
- }
-
-
-
-// /*
-// * (non-Javadoc)
-// *
-// * @see org.eclipse.jst.pagedesigner.meta.EditorCreator#createDialogField(org.eclipse.jst.pagedesigner.meta.IAttributeDescriptor)
-// */
-// public DialogField createDialogField(IAttributeDescriptor attr) {
-// return XXXCellEditorFactoryRegistry.getInstance().createDialogField(attr);
-// }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.meta.EditorCreator#createCellEditorWithWrapper(org.eclipse.swt.widgets.Composite,
- * org.eclipse.jst.pagedesigner.meta.IAttributeDescriptor,
- * org.w3c.dom.Element,
- * org.eclipse.jst.pagedesigner.meta.IBindingHandler,
- * org.eclipse.swt.graphics.Image)
- */
- public CellEditor createCellEditorWithWrapper(Composite parent,
- IAttributeDescriptor attr, final IDOMElement element,
- IBindingHandler handler1) {
- final IBindingHandler handler = (handler1 == null ? getSystemDefaultBindingHandler()
- : handler1);
- String uri = CMUtil.getElementNamespaceURI(element);
- String tagName = element.getLocalName();
- if (!handler.isEnabled(element, element, uri, tagName, attr)) {
- // should not enabled, so directly return original cell editor
- return createCellEditor(parent, attr, element);
- }
- try {
- // since "createWrappedCellEditor()" and "getBindingImage()" is
- // called from the constructor of CellEditorWrapper, at that time,
- // can't reference this XXXDefaultEditorCreator and final fields yet,
- // so use static variable for it.
- _staticAttr = attr;
- _staticElement = element;
- _staticHandler = handler;
-
- return new CellEditorWrapper(parent) {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.properties.celleditors.CellEditorWrapper#createWrappedCellEditor(org.eclipse.swt.widgets.Composite)
- */
- protected CellEditor createWrappedCellEditor(Composite cell) {
- return XXXEditorCreator.getInstance().createCellEditor(cell,
- _staticAttr, _staticElement);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.properties.celleditors.CellEditorWrapper#openDialogBox(org.eclipse.swt.widgets.Control)
- */
- protected Object openDialogBox(Control cellEditorWindow) {
- return handler.handleBinding(cellEditorWindow.getShell(),
- element, element, convertToString(this.getValue()));
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.properties.celleditors.CellEditorWrapper#getBindingImage()
- */
- protected Image getBindingImage() {
- return _staticHandler.getImage();
- }
- };
- } finally {
- _staticAttr = null;
- _staticElement = null;
- _staticHandler = null;
- _staticHolder = null;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.meta.EditorCreator#createCellEditorWithWrapper(org.eclipse.swt.widgets.Composite,
- * org.eclipse.jst.pagedesigner.meta.IAttributeDescriptor,
- * org.eclipse.jst.pagedesigner.meta.EditorCreator.CellEditorHolder,
- * org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement,
- * org.eclipse.jst.pagedesigner.meta.IBindingHandler)
- */
- public CellEditor createCellEditorWithWrapper(Composite parent,
- IAttributeDescriptor attr, CellEditorHolder holder,
- final IDOMElement element, IBindingHandler handler1) {
- final IBindingHandler handler = (handler1 == null ? getSystemDefaultBindingHandler()
- : handler1);
- String uri = CMUtil.getElementNamespaceURI(element);
- String tagName = element.getLocalName();
- if (!handler.isEnabled(element, element, uri, tagName, attr)) {
- // should not enabled, so directly return original cell editor
- return holder.createCellEditor(parent);
- }
- try {
- // since "createWrappedCellEditor()" and "getBindingImage()" is
- // called from the constructor of CellEditorWrapper, at that time,
- // can't reference this XXXDefaultEditorCreator and final fields yet,
- // so use static variable for it.
- _staticElement = element;
- _staticHandler = handler;
- _staticHolder = holder;
-
- return new CellEditorWrapper(parent) {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.properties.celleditors.CellEditorWrapper#createWrappedCellEditor(org.eclipse.swt.widgets.Composite)
- */
- protected CellEditor createWrappedCellEditor(Composite cell) {
- return _staticHolder.createCellEditor(cell);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.properties.celleditors.CellEditorWrapper#openDialogBox(org.eclipse.swt.widgets.Control)
- */
- protected Object openDialogBox(Control cellEditorWindow) {
- return handler.handleBinding(cellEditorWindow.getShell(),
- element, element, convertToString(this.getValue()));
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.properties.celleditors.CellEditorWrapper#getBindingImage()
- */
- protected Image getBindingImage() {
- return _staticHandler.getImage();
- }
- };
- } finally {
- _staticAttr = null;
- _staticElement = null;
- _staticHandler = null;
- _staticHolder = null;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.meta.EditorCreator#createDialogFieldWithWrapper(java.lang.String,
- * java.lang.String,
- * org.eclipse.jst.pagedesigner.meta.IAttributeDescriptor,
- * org.eclipse.jst.pagedesigner.meta.IBindingHandler)
- */
- public DialogField createDialogFieldWithWrapper(String uri, String tagName,
- IAttributeDescriptor attr, IBindingHandler handler1) {
- final IBindingHandler handler = (handler1 == null ? getSystemDefaultBindingHandler()
- : handler1);
- DialogField field = createDialogField(attr);
- // if (field instanceof StringButtonDialogField)
- // {
- // ((StringButtonDialogField) field).setButtonLabel("...");
- // }
- DialogFieldWrapper wrapper = new DialogFieldWrapper(field, handler
- .getImage(), handler.getDisabledImage(), uri, tagName, attr,
- handler);
- wrapper.setDatabindingEnabled(true);
-
- return wrapper;
- }
-
-
- private String convertToString(Object value) {
- if (value == null) {
- return null;
- }
- return value.toString();
- }
-
- @Override
- public DialogField createDialogFieldWithWrapper(
- IPropertyPageDescriptor attr, IBindingHandler handler1) {
- final IBindingHandler handler = (handler1 == null ? getSystemDefaultBindingHandler()
- : handler1);
- DialogField field = createDialogField(attr);
- // if (field instanceof StringButtonDialogField)
- // {
- // ((StringButtonDialogField) field).setButtonLabel("...");
- // }
- DialogFieldWrapper wrapper = new DialogFieldWrapper(field, handler
- .getImage(), handler.getDisabledImage(), attr.getUri(), attr.getTagName(), attr,
- handler);
- wrapper.setDatabindingEnabled(true);
-
- return wrapper;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/parts/CSSStyleAdapterFactory.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/parts/CSSStyleAdapterFactory.java
deleted file mode 100644
index 1ba1fd0..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/parts/CSSStyleAdapterFactory.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.parts;
-
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.style.AbstractStyle;
-import org.eclipse.wst.sse.core.internal.provisional.AbstractAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class CSSStyleAdapterFactory extends AbstractAdapterFactory {
- static Class ADAPTERKEY = ICSSStyle.class;
-
- // TODO: dead? private static CSSStyleAdapterFactory _instance = new CSSStyleAdapterFactory();
-
- private CSSStyleAdapterFactory() {
- super(ADAPTERKEY, true);
- }
-
- /*
- * (non-Javadoc)
- * @seeorg.eclipse.wst.sse.core.internal.provisional.AbstractAdapterFactory#createAdapter(org.eclipse.wst.sse.core.internal.provisional.INodeNotifier)
- */
- protected INodeAdapter createAdapter(INodeNotifier target) {
- if (target instanceof Element) {
- return new AbstractStyle((Element) target);
- }
- return null;
- }
-
- /**
- * @return the factory instance
- */
- public static CSSStyleAdapterFactory getInstance() {
- // TODO: this 'singleton' is broken
- return new CSSStyleAdapterFactory();
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/parts/DocumentEditPart.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/parts/DocumentEditPart.java
deleted file mode 100644
index 71a4214..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/parts/DocumentEditPart.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.parts;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.gef.EditPart;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.layout.FlowPage;
-import org.eclipse.wst.css.core.internal.event.ICSSStyleListener;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector;
-import org.eclipse.wst.html.core.internal.htmlcss.StyleListener;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * @author mengbo
- */
-public class DocumentEditPart extends NodeEditPart implements StyleListener,
- ICSSStyleListener {
- boolean _refreshing = false;
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.AbstractEditPart#getModelChildren()
- */
- protected List getModelChildren() {
- List list = new ArrayList();
- Node model = (Node) getModel();
- if (model == null) {
- return list;
- }
-
- NodeList children1 = model.getChildNodes();
- for (int i = 0, n = children1.getLength(); i < n; i++) {
- Node node = children1.item(i);
- if (node.getNodeType() != Node.TEXT_NODE
- && node.getNodeType() != Node.ELEMENT_NODE) {
- continue;
- }
- list.add(node);
- }
- return list;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
- */
- protected IFigure createFigure() {
- FlowPage f = new FlowPage();
- return f;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.internal.provisional.INodeAdapter#notifyChanged(org.eclipse.wst.sse.core.internal.provisional.INodeNotifier,
- * int, java.lang.Object, java.lang.Object, java.lang.Object, int)
- */
- public void notifyChanged(INodeNotifier notifier, int eventType,
- Object changedFeature, Object oldValue, Object newValue, int pos) {
- refresh();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#refresh()
- */
- public void refresh() {
- if (_refreshing) {
- return;
- }
- _refreshing = true;
- try {
- super.refresh();
- } finally {
- _refreshing = false;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.AbstractEditPart#refreshChildren()
- */
- protected void refreshChildren() {
- super.refreshChildren();
- List children1 = getChildren();
- for (int i = 0, size = children1.size(); i < size; i++) {
- ((EditPart) children1.get(i)).refresh();
- }
- }
-
- // protected void removeChildVisual(EditPart childEditPart)
- // {
- // if (childEditPart instanceof SubNodeEditPart)
- // {
- // Node node = ((SubNodeEditPart) childEditPart).getNodeForFigure();
- // if (node != null)
- // {
- // getDestDocumentForDesign().removeChild(node);
- // }
- // }
- // super.removeChildVisual(childEditPart);
- // }
- //
- // protected void addChildVisual(EditPart childEditPart, int index)
- // {
- // if (childEditPart instanceof SubNodeEditPart)
- // {
- // Node node = ((SubNodeEditPart) childEditPart).getNodeForFigure();
- // if (node != null)
- // {
- // NodeList nodeList = getDestDocumentForDesign().getChildNodes();
- // if (nodeList.getLength() > index)
- // {
- // getDestDocumentForDesign().insertBefore(node, nodeList.item(index));
- // }
- // else
- // {
- // getDestDocumentForDesign().appendChild(node);
- // }
- // }
- // }
- // super.addChildVisual(childEditPart, index);
- // }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.html.core.internal.htmlcss.StyleListener#styleChanged()
- */
- public void styleChanged() {
- // refresh the whole document when style change (<style> or <link>)
- this.refreshStyle();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.css.core.internal.event.ICSSStyleListener#styleChanged(org.eclipse.wst.css.core.internal.provisional.document.ICSSModel,
- * org.eclipse.wst.css.core.document.ICSSSelector[],
- * org.eclipse.wst.css.core.document.ICSSSelector[], java.lang.String)
- */
- public void styleChanged(ICSSModel srcModel, ICSSSelector[] removed,
- ICSSSelector[] added, String media) {
- if ((removed != null && removed.length > 0) || added != null
- && added.length > 0) {
- this.refreshStyle();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.css.core.internal.event.ICSSStyleListener#styleUpdate(org.eclipse.wst.css.core.internal.provisional.document.ICSSModel)
- */
- public void styleUpdate(ICSSModel srcModel) {
- this.refreshStyle();
- }
-
- /**
- *
- */
- private void refreshStyle() {
- List childParts = this.getChildren();
- for (Iterator iter = childParts.iterator(); iter.hasNext();) {
- EditPart part = (EditPart) iter.next();
- if (part instanceof ElementEditPart) {
- IDOMNode node = (IDOMNode) ((ElementEditPart) part)
- .getNodeForFigure();
- if (node != null) {
- refreshChildStyles(node);
- }
- }
- }
- getFigure().revalidate();
- // getFigure().repaint();
- }
-
- /**
- * @param node
- */
- private void refreshChildStyles(IDOMNode node) {
- NodeList childNodes = node.getChildNodes();
- for (int i = 0, size = childNodes.getLength(); i < size; i++) {
- refreshChildStyles((IDOMNode) childNodes.item(i));
- }
- if (node instanceof IDOMElement) {
- // only refresh style on element.
- ICSSStyle a = (ICSSStyle) node.getAdapterFor(ICSSStyle.class);
- if (a != null) {
- a.reset();
- }
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/parts/EditProxyAdapter.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/parts/EditProxyAdapter.java
deleted file mode 100644
index cac1252..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/parts/EditProxyAdapter.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.parts;
-
-import org.eclipse.jst.pagedesigner.css2.style.IRangeSelectionProxy;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-
-/**
- * EditProxyAdapter is used to provide additional information to the underlying
- * figures. As when we doing the "convert", we are creating new nodes and
- * generate figure using those new nodes. This class is used to adapt to those
- * new nodes, and providing additional information to them.
- *
- * @author mengbo
- * @version 1.5
- */
-public class EditProxyAdapter implements INodeAdapter, IRangeSelectionProxy {
- ElementEditPart _part;
-
- /**
- * @param part
- */
- public EditProxyAdapter(ElementEditPart part) {
- _part = part;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.internal.provisional.INodeAdapter#isAdapterForType(java.lang.Object)
- */
- public boolean isAdapterForType(Object type) {
- if (type == IRangeSelectionProxy.class) {
- return true;
- } else if (type == EditProxyAdapter.class) {
- return true;
- }
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.internal.provisional.INodeAdapter#notifyChanged(org.eclipse.wst.sse.core.internal.provisional.INodeNotifier,
- * int, java.lang.Object, java.lang.Object, java.lang.Object, int)
- */
- public void notifyChanged(INodeNotifier notifier, int eventType,
- Object changedFeature, Object oldValue, Object newValue, int pos) {
- // do nothing?
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.css2.style.IRangeSelectionProxy#isRangeSelected()
- */
- public boolean isRangeSelected() {
- return _part.isRangeSelected();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/parts/ElementEditPart.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/parts/ElementEditPart.java
deleted file mode 100644
index 408d1d6..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/parts/ElementEditPart.java
+++ /dev/null
@@ -1,638 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.parts;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.DragTracker;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.LocationRequest;
-import org.eclipse.gef.tools.DragEditPartsTracker;
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.jsf.core.internal.tld.CMUtil;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.converter.ConvertPosition;
-import org.eclipse.jst.pagedesigner.converter.IConverterFactory;
-import org.eclipse.jst.pagedesigner.converter.ITagConverter;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.layout.CSSFigure;
-import org.eclipse.jst.pagedesigner.css2.layout.CSSWidgetLayout;
-import org.eclipse.jst.pagedesigner.css2.style.AbstractStyle;
-import org.eclipse.jst.pagedesigner.css2.widget.HiddenProvider;
-import org.eclipse.jst.pagedesigner.dtmanager.DTManager;
-import org.eclipse.jst.pagedesigner.editpolicies.ElementMenuBar;
-import org.eclipse.jst.pagedesigner.editpolicies.ElementResizableEditPolicy;
-import org.eclipse.jst.pagedesigner.editpolicies.IEnhancedSelectionEditPolicy;
-import org.eclipse.jst.pagedesigner.elementedit.ElementEditFactoryRegistry;
-import org.eclipse.jst.pagedesigner.elementedit.IElementEdit;
-import org.eclipse.jst.pagedesigner.figurehandler.FigureFactory;
-import org.eclipse.jst.pagedesigner.figurehandler.IFigureHandler;
-import org.eclipse.jst.pagedesigner.jsp.core.IJSPCoreConstants;
-import org.eclipse.jst.pagedesigner.range.RangeUtil;
-import org.eclipse.jst.pagedesigner.requests.PageDesignerRequestConstants;
-import org.eclipse.jst.pagedesigner.viewer.DesignRange;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class ElementEditPart extends SubNodeEditPart {
- private static Logger _log = PDPlugin.getLogger(ElementEditPart.class);
-
- private Element _elementNode;
-
- private ITagConverter _tagConverter;
-
- private ElementMenuBar _nonVisualElementBar;
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.EditPart#setModel(java.lang.Object)
- */
- public void setModel(Object model) {
- super.setModel(model);
- _elementNode = (Element) model;
- _tagConverter = getTagConverter(_elementNode);
- _tagConverter.convertRefresh(null);
- adaptEditProxy();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.parts.NodeEditPart#getDragTracker(org.eclipse.gef.Request)
- */
- public DragTracker getDragTracker(Request request)
- {
- EditPolicy policy = this
- .getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
-
- if (PageDesignerRequestConstants.REQ_SELECTION_TRACKER.equals(request.getType())
- || org.eclipse.gef.RequestConstants.REQ_SELECTION.equals(request.getType()))
- {
- if (policy instanceof IEnhancedSelectionEditPolicy
- && request instanceof LocationRequest)
- {
- return ((IEnhancedSelectionEditPolicy)policy).getSelectionDragTracker((LocationRequest)request);
- }
-
- return null;
- }
-
- // should not happen
- return new DragEditPartsTracker(this);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.parts.NodeEditPart#createEditPolicies()
- */
- protected void createEditPolicies() {
- super.createEditPolicies();
- IElementEdit support = getElementEdit();
- if (support != null) {
- support.createEditPolicies(this);
- }
-
- // if ElementEdit didn't install special SELECTION_FEEDBACK_ROLE policy,
- // then default
- if (this.getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE) == null) {
- this.installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE,
- new ElementResizableEditPolicy());
- }
- }
-
- /**
- * @return the associated element edit
- */
- public IElementEdit getElementEdit() {
- // XXX: should we cache it?
- return ElementEditFactoryRegistry.getInstance().createElementEdit(
- _elementNode);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.parts.NodeEditPart#addNotify()
- */
- public void addNotify() {
- if (_tagConverter == null) {
- _tagConverter = getTagConverter(_elementNode);
- _tagConverter.convertRefresh(null);
- adaptEditProxy();
- }
- super.addNotify();
- }
-
- /**
- * @param node
- * @return
- */
- private ITagConverter getTagConverter(Element node) {
- return DTManager.getInstance().getTagConverter(node,
- IConverterFactory.MODE_DESIGNER,
- this.getDestDocumentForDesign());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#removeNotify()
- */
- public void removeNotify() {
- super.removeNotify();
- // if (_tagConverter != null)
- // {
- // _tagConverter.dispose();
- // _tagConverter = null;
- // }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.AbstractEditPart#getModelChildren()
- */
- protected List getModelChildren() {
- List children_ = new ArrayList(_tagConverter.getChildModeList());
-
- for (Iterator it = _tagConverter.getNonVisualChildren().iterator(); it.hasNext();)
- {
- Element nonVisualChild = (Element) it.next();
- children_.add(DTManager.getInstance().getTagConverter(nonVisualChild,
- IConverterFactory.MODE_DESIGNER,
- this.getDestDocumentForDesign()));
- }
- return children_;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
- */
- protected IFigure createFigure() {
- // if (_tagConverter.isVisualByHTML())
- // {
- // Element result = _tagConverter.getResultElement();
- // return FigureFactory.createFigure(result,
- // true);//_tagConverter.isMultiLevel());
- // }
- // else
- // {
- // CSSWidgetFigure figure = new CSSWidgetFigure(this._elementNode,
- // createHiddenProvider());
- // return figure;
- // }
- return new CSSFigure();
- }
-
- /**
- * @return
- */
- private HiddenProvider createHiddenProvider() {
- Element result = _tagConverter.getHostElement();
- String localName = result.getLocalName();
- String appendString = localName;
- if (localName.equalsIgnoreCase(IJSPCoreConstants.TAG_DIRECTIVE_TAGLIB)) {
- appendString = ((IDOMElement) result)
- .getAttribute(IJSPCoreConstants.ATTR_URI);
- if (appendString == null) {
- appendString = "";
- }
- }
- Image image = _tagConverter.getVisualImage();
- HiddenProvider provider = new HiddenProvider(image, this);
- ((CSSFigure) getFigure()).setCSSStyle(provider.getCSSStyle());
- provider.setLabel(appendString);
- return provider;
- }
-
- /**
- * called by the
- * @param recursive
- *
- */
- public void refreshModelChange(boolean recursive) {
- IElementEdit support = getElementEdit();
- if (support == null
- || !support.handleModelChange(_elementNode, this, recursive)) {
- this.refresh(recursive);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#refresh()
- */
- public void refresh() {
- refresh(false);
- }
-
- /**
- * @param recursive
- */
- public void refresh(boolean recursive) {
- if (!_tagConverter.isVisualByHTML()) {
- _tagConverter.convertRefresh(null);
- ((CSSFigure) getFigure())
- .setFixedLayoutManager(new CSSWidgetLayout(
- (CSSFigure) getFigure(), createHiddenProvider()));
- // nothing to refresh
- // ((CSSWidgetFigure)
- // getFigure()).setProvider(createHiddenProvider());
- return;
- }
- EditPart editPart;
- Object model;
-
- Map modelToEditPart = new HashMap();
- List children1 = getChildren();
-
- for (int i = 0, n = children1.size(); i < n; i++) {
- editPart = (EditPart) children1.get(i);
- modelToEditPart.put(editPart.getModel(), editPart);
- // remove child visual, since we may reconstruct the figure
- // structure of this edit part
- removeChildVisual(editPart);
- }
-
- Element oldEle = _tagConverter.getResultElement();
-
- // link parent node.
- Node parent = oldEle.getParentNode();
- _tagConverter.convertRefresh(null);
- if (parent != null) {
- // a new element is generated. replace the old one.
- parent.replaceChild(_tagConverter.getResultElement(), oldEle);
- }
-
- adaptEditProxy();
-
- // XXX: comment out the if-else for always deep update.
- // this is for the case when a empty container generate child
- // text node, and then when user input data into the container,
- // the node change from "multiLevel" state to "non-multilevel"
- // state. We don't handle this very well yet, so always to deep
- // update for now. (lium)
- // if (_tagConverter.isMultiLevel())
- // {
- FigureFactory.updateDeepFigure(_tagConverter.getResultElement(),
- oldEle, (CSSFigure) this.getFigure());
- // }
- // else
- // {
- // FigureFactory.updateNonDeepFigure(_tagConverter.getResultElement(),
- // this.getFigure());
- // }
-
- List modelObjects = getModelChildren();
- if (!recursive) {
- for (int i = 0, n = modelObjects.size(); i < n; i++) {
- model = modelObjects.get(i);
-
- // Look to see if the EditPart is already around but in the
- // wrong location
- editPart = (EditPart) modelToEditPart.remove(model);
-
- if (editPart != null) {
- addChildVisual(editPart, i);
- } else {
- // An editpart for this model doesn't exist yet. Create and
- // insert one.
- editPart = createChild(model);
- addChild(editPart, i);
- }
- }
- for (Iterator iter = modelToEditPart.values().iterator(); iter
- .hasNext();) {
- EditPart part = (EditPart) iter.next();
- removeChild(part);
- }
- } else {
- // remove all child, and recreate them.
- for (Iterator iter = modelToEditPart.values().iterator(); iter
- .hasNext();) {
- EditPart part = (EditPart) iter.next();
- removeChild(part);
- }
- for (int i = 0, n = modelObjects.size(); i < n; i++) {
- model = modelObjects.get(i);
-
- // Look to see if the EditPart is already around but in the
- // wrong location
- // An editpart for this model doesn't exist yet. Create and
- // insert one.
- editPart = createChild(model);
- addChild(editPart, i);
- }
- }
- }
-
- /**
- *
- */
- private void adaptEditProxy() {
- Element resultEle = _tagConverter.getResultElement();
- if (resultEle instanceof IDOMElement) {
- INodeAdapter adapter = ((IDOMElement) resultEle)
- .getAdapterFor(EditProxyAdapter.class);
- if (adapter != null) {
- ((IDOMElement) resultEle).removeAdapter(adapter);
- }
- ((IDOMElement) resultEle).addAdapter(new EditProxyAdapter(this));
- }
- }
-
- /**
- * @return true if we are in range mode and this is in
- * the selection range
- */
- public boolean isRangeSelected() {
- IHTMLGraphicalViewer viewer = (IHTMLGraphicalViewer) this.getViewer();
- if (viewer == null || !viewer.isInRangeMode()) {
- return false;
- }
- DesignRange range = viewer.getRangeSelection();
- if (range == null || !range.isValid()) {
- return false;
- }
- return RangeUtil.intersect(range, this);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.parts.NodeEditPart#isWidget()
- */
- public boolean isWidget() {
- return _tagConverter.isWidget();
- }
-
- /**
- * @return true if our model node can have direct text children
- */
- public boolean canHaveDirectTextChild() {
- return CMUtil.canHaveDirectTextChild(this._elementNode);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.parts.NodeEditPart#isResizable()
- */
- public boolean isResizable() {
- if (!_tagConverter.isVisualByHTML()) {
- return false;
- }
- IElementEdit edit = this.getElementEdit();
- if (edit != null) {
- return edit.isResizable(this._elementNode);
- }
- CMElementDeclaration decl = CMUtil
- .getElementDeclaration(this._elementNode);
- if (decl != null) {
- // XXX: default implementation, if this element support "style"
- // attribute,
- // then we think it support resize.
- return decl.getAttributes().getNamedItem("style") != null;
- }
- return true;
- }
-
- /**
- * @param parent
- * @return
- */
- private IFigure getFigure(Node parent) {
- if (parent instanceof INodeNotifier) {
- IFigureHandler handler = (IFigureHandler) ((INodeNotifier) parent)
- .getAdapterFor(IFigureHandler.class);
- if (handler != null) {
- return handler.getFigure();
- }
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#addChildVisual(org.eclipse.gef.EditPart,
- * int)
- */
- protected void addChildVisual(EditPart childEditPart, int index) {
-
- boolean figureAdded = false;
-
- if (childEditPart instanceof NonVisualComponentEditPart)
- {
- getNonVisualElementBar().addNonVisualChild(((NonVisualComponentEditPart) childEditPart));
- figureAdded = true;
- //TODO: need better flow of control.
- return;
- }
-
- Node childNode = (Node) childEditPart.getModel();
- IFigure childFigure = ((GraphicalEditPart) childEditPart).getFigure();
- ConvertPosition position = _tagConverter
- .getChildVisualPosition(childNode);
- if (position != null) {
- Node parent = position.getParentNode();
- // link up figure.
- IFigure parentFigure = getFigure(parent);
- if (parentFigure != null) {
- parentFigure.add(childFigure, position.getIndex());
- figureAdded = true;
- }
- // link up style
- if (parent instanceof INodeNotifier) {
- ICSSStyle parentStyle = (ICSSStyle) ((INodeNotifier) parent)
- .getAdapterFor(ICSSStyle.class);
- if (parentStyle != null) {
- ICSSStyle childStyle = (ICSSStyle) ((INodeNotifier) childNode)
- .getAdapterFor(ICSSStyle.class);
- if (childStyle instanceof AbstractStyle) {
- ((AbstractStyle) childStyle)
- .setParentStyle(parentStyle);
- }
- }
- }
- // link up the nodeForFigure
- if (childEditPart instanceof SubNodeEditPart) {
- Node nodeForFigure = ((SubNodeEditPart) childEditPart)
- .getNodeForFigure();
- if (nodeForFigure != null /*
- * && !(nodeForFigure instanceof
- * PseudoElement)
- */) {
- parent.appendChild(nodeForFigure);
- }
- }
- } else {
- _log.error("getChildVisualPosition() return null");
- }
-
- if (!figureAdded) {
- super.addChildVisual(childEditPart, index);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#removeChildVisual(org.eclipse.gef.EditPart)
- */
- protected void removeChildVisual(EditPart childEditPart) {
- // remove figure
- IFigure childFigure = ((GraphicalEditPart) childEditPart).getFigure();
- IFigure parent = childFigure.getParent();
-
- if (parent != null) {
- parent.remove(childFigure);
- }
-
- if (childEditPart instanceof NonVisualComponentEditPart)
- {
- _nonVisualElementBar.removeNonVisualChild((NonVisualComponentEditPart) childEditPart);
- }
- // this only applies to visual edit parts
- else
- {
- // de-link style
- Node childNode = (Node) childEditPart.getModel();
- ICSSStyle childStyle = (ICSSStyle) ((INodeNotifier) childNode)
- .getAdapterFor(ICSSStyle.class);
- if (childStyle instanceof AbstractStyle) {
- ((AbstractStyle) childStyle).setParentStyle(null);
- }
- // de-link nodeForFigure
- if (childEditPart instanceof SubNodeEditPart) {
- Node nodeForFigure = ((SubNodeEditPart) childEditPart)
- .getNodeForFigure();
- if (nodeForFigure != null && nodeForFigure.getParentNode() != null) {
- nodeForFigure.getParentNode().removeChild(nodeForFigure);
- }
- }
- }
- }
-
- /**
- * @return the associated tag converter
- */
- public ITagConverter getTagConvert() {
- return _tagConverter;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.internal.provisional.INodeAdapter#notifyChanged(org.eclipse.wst.sse.core.internal.provisional.INodeNotifier,
- * int, java.lang.Object, java.lang.Object, java.lang.Object, int)
- */
- public void notifyChanged(INodeNotifier notifier, int eventType,
- Object changedFeature, Object oldValue, Object newValue, int pos) {
- // XXX: this can cause multiple refreshes on the same edit part for the
- // same change. I can also cause incorrect child refreshes...
- refresh();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.parts.SubNodeEditPart#getNodeForFigure()
- */
- public Node getNodeForFigure() {
- return _tagConverter.getResultElement();
- }
-
- /**
- * @return true this part's node has non whitespace child nodes
- */
- public boolean haveNonWhitespaceTextChild() {
- List children1 = this.getChildren();
- for (int i = 0, size = children1.size(); i < size; i++) {
- if (children1.get(i) instanceof TextEditPart) {
- IDOMText xmltext = (IDOMText) ((TextEditPart) children1.get(i))
- .getIDOMNode();
- if (!xmltext.isElementContentWhitespace()) {
- return true;
- }
- }
- }
- return false;
- }
-
- private ElementMenuBar getNonVisualElementBar()
- {
- if (_nonVisualElementBar == null)
- {
- _nonVisualElementBar = new ElementMenuBar(this);
- }
- return _nonVisualElementBar;
- }
-
- /**
- * @return the element menu bar for this element
- */
- public ElementMenuBar getElementMenuBar() {
- return getNonVisualElementBar();
- }
-
- public void deactivate() {
- super.deactivate();
- if (_nonVisualElementBar != null)
- {
- _nonVisualElementBar.dispose();
- _nonVisualElementBar = null;
- }
- if (_tagConverter != null) {
- _tagConverter.dispose();
- }
- }
-
- public Cursor getCursor(Point mouseLocation) {
- // let the selection edit policy dictate
- EditPolicy editPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
-
- if (editPolicy instanceof IEnhancedSelectionEditPolicy)
- {
- return ((IEnhancedSelectionEditPolicy)editPolicy).getSelectionToolCursor(mouseLocation);
- }
- return super.getCursor(mouseLocation);
- }
-
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/parts/HTMLEditPartsFactory.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/parts/HTMLEditPartsFactory.java
deleted file mode 100644
index 66dd085..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/parts/HTMLEditPartsFactory.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.parts;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.jst.pagedesigner.converter.ITagConverter;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.w3c.dom.Node;
-
-/**
- * The model here can only be Document/Element/Text.
- *
- * @author mengbo
- */
-public class HTMLEditPartsFactory implements EditPartFactory {
- private IDOMDocument _destDocument;
-
- /**
- * @param destDoc
- */
- public HTMLEditPartsFactory(IDOMDocument destDoc) {
- this._destDocument = destDoc;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.EditPartFactory#createEditPart(org.eclipse.gef.EditPart,
- * java.lang.Object)
- */
- public EditPart createEditPart(EditPart context, Object model) {
- NodeEditPart part = null;
-
- if (model instanceof Node)
- {
- Node node = (Node) model;
- if (node.getNodeType() == Node.DOCUMENT_NODE) {
- part = new DocumentEditPart();
- } else if (node.getNodeType() == Node.ELEMENT_NODE) {
- // String tag = ((Element)node).getTagName();
- // if ("TABLE".equalsIgnoreCase(tag))
- // part = new HTMLTableEditPart();
- // else
- part = new ElementEditPart();
- } else if (node.getNodeType() == Node.TEXT_NODE
- || node.getNodeType() == Node.CDATA_SECTION_NODE) {
- part = new TextEditPart();
- }
- }
- // XXX: we need to create wrapper that allows us to know when
- // a model object represents a non-visual decorator
- else if (model instanceof ITagConverter)
- {
- part = new NonVisualComponentEditPart();
- }
-
- if (part != null) {
- part.setDestDocumentForDesign(this._destDocument);
- part.setModel(model);
- }
- return part;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/parts/NodeEditPart.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/parts/NodeEditPart.java
deleted file mode 100644
index 653ba15..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/parts/NodeEditPart.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.parts;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.DragTracker;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.gef.requests.LocationRequest;
-import org.eclipse.jst.jsf.common.dom.TagIdentifier;
-import org.eclipse.jst.jsf.core.internal.tld.TagIdentifierFactory;
-import org.eclipse.jst.pagedesigner.dnd.LocalDropRequest;
-import org.eclipse.jst.pagedesigner.dnd.internal.LocalDropEditPolicy;
-import org.eclipse.jst.pagedesigner.editpolicies.DragMoveEditPolicy;
-import org.eclipse.jst.pagedesigner.itemcreation.ItemCreationEditPolicy;
-import org.eclipse.jst.pagedesigner.itemcreation.ItemCreationRequest;
-import org.eclipse.jst.pagedesigner.tools.RangeDragTracker;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- */
-public abstract class NodeEditPart extends AbstractGraphicalEditPart implements
- INodeAdapter {
-
- private IDOMDocument _destDocument;
- private boolean _isDragActive;
-
- /**
- * this method is called from the HTMLEditPartsFactory directly after the
- * part's creation.
- *
- * @param doc
- */
- public void setDestDocumentForDesign(IDOMDocument doc) {
- this._destDocument = doc;
- }
-
- /**
- * @return to owner document of this part's model node
- */
- public IDOMDocument getDestDocumentForDesign() {
- if (this._destDocument == null) {
- return (IDOMDocument) this.getIDOMNode().getOwnerDocument();
- }
- return this._destDocument;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.AbstractEditPart#createEditPolicies()
- */
- protected void createEditPolicies() {
- installEditPolicy(EditPolicy.NODE_ROLE, null);
- installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, null);
- installEditPolicy(LocalDropRequest.REQ_LOCAL_DROP,
- new LocalDropEditPolicy());
- installEditPolicy(ItemCreationRequest.REQ_ITEM_CREATION,
- new ItemCreationEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE,
- new DragMoveEditPolicy());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.INodeAdapter#isAdapterForType(java.lang.Object)
- */
- public boolean isAdapterForType(Object type) {
- return type == EditPart.class;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#addNotify()
- */
- public void addNotify() {
- Object obj = getModel();
- if (obj instanceof INodeNotifier) {
- ((INodeNotifier) obj).addAdapter(this);
- }
- super.addNotify();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#removeNotify()
- */
- public void removeNotify() {
- super.removeNotify();
- Object obj = getModel();
- if (obj instanceof INodeNotifier) {
- ((INodeNotifier) obj).removeAdapter(this);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.EditPart#deactivate()
- */
- public void deactivate() {
- LocationRequest hoverRequest = new LocationRequest();
- hoverRequest.setType(RequestConstants.REQ_SELECTION_HOVER);
- this.eraseTargetFeedback(hoverRequest);
- super.deactivate();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class key) {
- Object obj = getModel();
- if (key == IPropertySource.class) {
- if (obj instanceof INodeNotifier) {
- return ((INodeNotifier) obj)
- .getAdapterFor(IPropertySource.class);
- }
- }
-
- if (obj instanceof IAdaptable) {
- Object ret = ((IAdaptable) obj).getAdapter(key);
- if (ret != null)
- return ret;
- }
- return super.getAdapter(key);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#getDragTracker(org.eclipse.gef.Request)
- */
- public DragTracker getDragTracker(Request request) {
- return new RangeDragTracker(this);
- }
-
- /**
- * @return the model node as an IDOMNode
- */
- public IDOMNode getIDOMNode() {
- return ((IDOMNode) getModel());
- }
-
- /**
- * @return the model node as a node
- */
- public Node getDOMNode()
- {
- return ((Node)getModel());
- }
-
- /**
- * @return if this edit part's model is an Element, then returns
- * the tag identifier. Otherwise, null.
- */
- public TagIdentifier getTagIdentifier()
- {
- Node node = getDOMNode();
-
- if (node instanceof Element)
- {
- return TagIdentifierFactory.createDocumentTagWrapper(((Element)node));
- }
-
- return null;
- }
-
- /**
- * if a EditPart don't support caret inside it, and don't can't have child
- * edit part, then we call it as a widget.
- *
- * @return true if this part represents a widget
- */
- public boolean isWidget() {
- return false; // child class must override.
- }
-
- /**
- * whether this EditPart allow the selection range to have one edge in the
- * edit part and one edge outside the edit part.
- *
- * @return true if selection range across is allowed
- */
- public boolean allowSelectionRangeAcross() {
- return true;
- }
-
- /**
- * @return true if this part is resizable
- */
- public boolean isResizable() {
- return false;
- }
-
- /**
- * @return true if drag is active on this part
- */
- public boolean isDragActive() {
- return _isDragActive;
- }
-
- /**
- * @param newValue
- */
- public void setDragActive(boolean newValue)
- {
- _isDragActive = newValue;
- }
-
- /**
- * @param mouseLocation
- * @return this edit part's cursor or null if this edit part
- * does not wish to specify a specific cursor (the default
- * should be used).
- * Note that this is only called when no drag tracker is active,
- * when the mouse enters the edit part with the RangeSelectionTool
- * and the current state is INITIAL. This allows the editpart to
- * specify a custom mouse-over tool cursor
- * TODO: perhaps getCursor is not a specific enough a name
- */
- public Cursor getCursor(Point mouseLocation)
- {
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/parts/NonVisualComponentEditPart.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/parts/NonVisualComponentEditPart.java
deleted file mode 100644
index 08b76d1..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/parts/NonVisualComponentEditPart.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.parts;
-
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.ImageFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.jst.pagedesigner.converter.ITagConverter;
-import org.eclipse.jst.pagedesigner.editpolicies.NonVisualChildGraphicalEditPolicy;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * Represents a node that is non-visual in the runtime rendering
- * but which may wish to have a meta-representation on the design canvas.
- *
- */
-public class NonVisualComponentEditPart extends NodeEditPart
-{
- protected IFigure createFigure()
- {
- IFigure figure_ = new ImageFigure(getTagConverter().getVisualImage())
- {
-
- protected void paintFigure(Graphics graphics) {
- super.paintFigure(graphics);
-
- if (getImage() == null)
- return;
-
- Rectangle srcRect = new Rectangle(getImage().getBounds());
- graphics.drawImage(getImage(), srcRect, getClientArea());
- }
-
- };
-
- figure_.setMinimumSize(new Dimension(0,0));
- return figure_;
- }
-
- public void notifyChanged(INodeNotifier notifier, int eventType,
- Object changedFeature, Object oldValue, Object newValue, int pos) {
- // for now, do nothing
- }
-
- protected void createEditPolicies() {
- super.createEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE
- , new NonVisualChildGraphicalEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE,
- null);
- }
-
- @Override
- public void deactivate()
- {
- ITagConverter tagConverter = (ITagConverter) getModel();
- if (tagConverter != null)
- {
- tagConverter.dispose();
- }
-
- // always do super stuff
- super.deactivate();
- }
-
- /**
- * @return the tag converter
- */
- protected ITagConverter getTagConverter()
- {
- ITagConverter tagConverter = (ITagConverter)getModel();
- //need to call convertRefresh to get image (if any) from metadata
- if (tagConverter != null) {
- tagConverter.convertRefresh(null);
- }
- return tagConverter;
- }
-
- /**
- * @return the host element for this edit part
- */
- protected Element getModelElement()
- {
- return getTagConverter().getHostElement();
- }
-
- public IDOMNode getIDOMNode()
- {
- return (IDOMNode) getModelElement();
- }
-
- public Node getDOMNode() {
- return getModelElement();
- }
-
-// public DragTracker getDragTracker(Request request) {
-// // TODO: need to define drag semantics for these
-// // Also, right now edit part dragging causes bad behaviour
-// // in the non-visual decorator
-// return null;//new ObjectModeDragTracker(this);
-// }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/parts/Refresher.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/parts/Refresher.java
deleted file mode 100644
index 67e62f2..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/parts/Refresher.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.parts;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class Refresher implements INodeAdapter {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.internal.provisional.INodeAdapter#isAdapterForType(java.lang.Object)
- */
- public boolean isAdapterForType(Object type) {
- return (type == Refresher.class);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.internal.provisional.INodeAdapter#notifyChanged(org.eclipse.wst.sse.core.internal.provisional.INodeNotifier,
- * int, java.lang.Object, java.lang.Object, java.lang.Object, int)
- */
- public void notifyChanged(INodeNotifier notifier, int eventType,
- Object changedFeature, Object oldValue, Object newValue, int pos) {
- if (eventType == INodeNotifier.ADD || eventType == INodeNotifier.REMOVE) {
- // for ADD and REMOVE, system will fire CHANGE event, so we ignore
- // the ADD/REMOVE
- // event here.
- return;
- }
- if (notifier instanceof IDOMNode) {
- IDOMNode node = (IDOMNode) notifier;
- // we need to refresh all CSS style adapter of node and its
- // children.
- EditPart part = (EditPart) node.getAdapterFor(EditPart.class);
- if (part instanceof SubNodeEditPart) {
- Node nodeForFigure = ((SubNodeEditPart) part)
- .getNodeForFigure();
- if (nodeForFigure instanceof IDOMNode) {
- refreshChildStyles((IDOMNode) nodeForFigure);
- }
- }
-
- // we need also find the nearest parent node that has editpart, and
- // refresh it.
- refreshContainingPart(node,
- eventType == INodeNotifier.STRUCTURE_CHANGED);
-
- part = (EditPart) node.getAdapterFor(EditPart.class);
- if (part != null) {
- ((IHTMLGraphicalViewer) part.getViewer()).clearSelectionRange();
- }
- }
- }
-
- /**
- * @param node
- */
- private void refreshContainingPart(IDOMNode node, boolean recursive) {
- if (node.getOwnerDocument() == node) {
- EditPart part = (EditPart) node.getAdapterFor(EditPart.class);
- if (part != null) {
- part.refresh();
- }
- } else {
- while (node != null) {
- EditPart part = (EditPart) node.getAdapterFor(EditPart.class);
- if (part != null) {
- if (part instanceof ElementEditPart) {
- ((ElementEditPart) part).refreshModelChange(recursive);
- } else {
- part.refresh();
- }
- return;
- }
- node = (IDOMNode) node.getParentNode();
- }
- }
- }
-
- /**
- * @param node
- */
- private void refreshChildStyles(IDOMNode node) {
- NodeList childNodes = node.getChildNodes();
- for (int i = 0, size = childNodes.getLength(); i < size; i++) {
- refreshChildStyles((IDOMNode) childNodes.item(i));
- }
- if (node instanceof IDOMElement) {
- // only refresh style on element.
- ICSSStyle a = (ICSSStyle) node.getAdapterFor(ICSSStyle.class);
- if (a != null) {
- a.reset();
- }
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/parts/RefresherFactory.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/parts/RefresherFactory.java
deleted file mode 100644
index bb9c599..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/parts/RefresherFactory.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.parts;
-
-import org.eclipse.wst.sse.core.internal.provisional.AbstractAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class RefresherFactory extends AbstractAdapterFactory {
- private final Refresher refresher = new Refresher();
-
- RefresherFactory() {
- super(Refresher.class, true);
- }
-
- /*
- * (non-Javadoc)
- * @seeorg.eclipse.wst.sse.core.internal.provisional.AbstractAdapterFactory#createAdapter(org.eclipse.wst.sse.core.internal.provisional.INodeNotifier)
- */
- protected INodeAdapter createAdapter(INodeNotifier target) {
- return refresher;
- }
-
- static RefresherFactory _instance = new RefresherFactory();
-
- /**
- * @return the factory singleton
- */
- public static RefresherFactory getInstance() {
- return _instance;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/parts/SubNodeEditPart.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/parts/SubNodeEditPart.java
deleted file mode 100644
index 8056dd9..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/parts/SubNodeEditPart.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.parts;
-
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public abstract class SubNodeEditPart extends NodeEditPart {
- /**
- *
- * @return could be null
- */
- public abstract Node getNodeForFigure();
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/parts/TextEditPart.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/parts/TextEditPart.java
deleted file mode 100644
index 60377b5..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/parts/TextEditPart.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.parts;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.SharedCursors;
-import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
-import org.eclipse.jst.pagedesigner.css2.layout.CSSTextFigure;
-import org.eclipse.jst.pagedesigner.css2.layout.ICSSFigure;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.jst.pagedesigner.css2.provider.ICSSTextProvider;
-import org.eclipse.jst.pagedesigner.css2.style.DefaultStyle;
-import org.eclipse.jst.pagedesigner.editpolicies.LinkEditPolicy;
-import org.eclipse.jst.pagedesigner.range.RangeUtil;
-import org.eclipse.jst.pagedesigner.utils.HTMLUtil;
-import org.eclipse.jst.pagedesigner.viewer.DesignRange;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-/**
- * @author mengbo
- */
-public class TextEditPart extends SubNodeEditPart implements ICSSTextProvider {
- private String _cachedData;
-
- private Text _textNode;
-
- private Text _textNodeForFigure;
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.EditPart#setModel(java.lang.Object)
- */
- public void setModel(Object model) {
- super.setModel(model);
- _textNode = (Text) model;
- _cachedData = _textNode.getData();
- _textNodeForFigure = getDestDocumentForDesign().createTextNode(
- _cachedData);
- }
-
- protected IFigure createFigure() {
- // XXX: currently creating of CSSTextFigure is distributed both here
- // and FigureFactory. We may want to unify them later.
- return new CSSTextFigure(this);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.AbstractEditPart#createEditPolicies()
- */
- protected void createEditPolicies() {
- super.createEditPolicies();
- this.installEditPolicy("link editpolicy", new LinkEditPolicy());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.parts.SubNodeEditPart#getNodeForFigure()
- */
- public Node getNodeForFigure() {
- return _textNodeForFigure;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.INodeAdapter#notifyChanged(com.ibm.sse.model.INodeNotifier,
- * int, java.lang.Object, java.lang.Object, java.lang.Object, int)
- */
- public void notifyChanged(INodeNotifier notifier, int eventType,
- Object changedFeature, Object oldValue, Object newValue, int pos) {
- _cachedData = _textNode.getData();
- _textNodeForFigure.setData(_cachedData);
- if (eventType == INodeNotifier.CHANGE) {
- getFigure().revalidate();
- } else {
- // XXX: been removed? parent EditPart should have handled it.
- }
- }
-
-
- /**
- * @return the associated css style for this text node
- */
- public ICSSStyle getCSSStyle() {
- IFigure figure1 = this.getFigure();
- if (figure1 instanceof ICSSFigure) {
- ICSSStyle style = ((ICSSFigure) figure1).getCSSStyle();
- if (style != null) {
- return style;
- }
- }
- return DefaultStyle.getInstance();
- }
-
- /**
- * As when text are displayed in HTML, they are "normalized". For example,
- * leading whitespace may be removed dure to previous node as trailing
- * whitespace. Entity reference may have be resolved. Sequence whitespace
- * been merged.
- *
- * It is also possible that the text node is in "PRE" mode, in that case the
- * above things are not done.
- *
- * This method return the really value that is going to be presented to
- * user. EditPartPosition's offset is referencing this value.
- *
- * @return the text data
- * @see org.eclipse.jst.pagedesigner.viewer.DesignPosition
- */
- public String getTextData() {
- ICSSStyle style = getCSSStyle();
- String data = _cachedData;
- if (style.getStyleProperty(ICSSPropertyID.ATTR_WHITESPACE) != ICSSPropertyID.VAL_PRE) {
- return HTMLUtil.compactWhitespaces(_textNode, data);
- }
- return data;
- }
-
- /**
- * check what part of this text node is in the range selection.
- *
- * @return text node ranges
- */
- public int[] getSelectedRange() {
- IHTMLGraphicalViewer viewer = (IHTMLGraphicalViewer) this.getViewer();
- if (viewer == null || !viewer.isInRangeMode()) {
- return null;
- }
- DesignRange range = viewer.getRangeSelection();
- if (range == null || !range.isValid()) {
- return null;
- }
- if (!RangeUtil.intersect(range, this)) {
- return null;
- }
- // ok, we intersect with the range.
- range = RangeUtil.normalize(range);
- EditPart startContainer = range.getStartPosition().getContainerPart();
- EditPart endContainer = range.getEndPosition().getContainerPart();
- int[] ret = new int[2];
- if (startContainer != this) {
- ret[0] = 0;
- } else {
- ret[0] = range.getStartPosition().getOffset();
- }
- if (endContainer != this) {
- ret[1] = this.getTextData().length();
- } else {
- {
- ret[1] = range.getEndPosition().getOffset();
- }
- }
- return ret;
- }
-
- public boolean isSelectable() {
- // controls, amongst other things, whether or not a standard
- // hit test in SelectionTool for mouse over will find this edit part
- return true;
- }
-
- public Cursor getCursor(Point mouseLocation) {
- return SharedCursors.IBEAM;
- }
-
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/preview/PageExpressionContext.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/preview/PageExpressionContext.java
deleted file mode 100644
index 83d190d..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/preview/PageExpressionContext.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.preview;
-
-import java.io.BufferedInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.servlet.jsp.el.ELException;
-import javax.servlet.jsp.el.FunctionMapper;
-import javax.servlet.jsp.el.VariableResolver;
-
-import org.apache.commons.el.ExpressionEvaluatorImpl;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IStorage;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.jsf.common.ui.internal.utils.ResourceUtils;
-import org.eclipse.jst.jsf.core.internal.tld.LoadBundleUtil;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.jsp.core.el.JSFELParserHelper;
-import org.eclipse.jst.pagedesigner.jsp.core.pagevar.IPageVariablesProvider;
-import org.eclipse.jst.pagedesigner.jsp.core.pagevar.IVariableInfo;
-
-/**
- * This is a static class. But it has "session" concept in it. To make it static
- * is only to simplify its use.
- *
- * This class currently is only used by TagConverter, when calculating the
- * displayed string for resource bundle items.
- *
- * XXX: in the future, if we want to this to be non-static, we may incorportate
- * it into the context of the tag converter.
- *
- * @author mengbo
- * @version 1.5
- */
-// TODO: we may consider support cache the properties.
-public class PageExpressionContext {
- private static final Logger _log = PDPlugin
- .getLogger(PageExpressionContext.class);
-
- static PageExpressionContext _current;
-
- List _pageVarProviders = new ArrayList();
-
- VariableResolver resolver = new SimpleVariableResolver();
-
- private IProject _prj;
-
- /**
- * @param prj
- */
- public PageExpressionContext(IProject prj) {
- _prj = prj;
- }
-
- /**
- * reset the context.
- */
- public static void reset() {
- _current = null;
- }
-
- /**
- * Initialize the current context
- * @param prj
- */
- public static void initialize(IProject prj) {
- _current = new PageExpressionContext(prj);
- }
-
- /**
- * @return the current context
- */
- public static PageExpressionContext getCurrent() {
- return _current;
- }
-
- /**
- * @param provider
- */
- public void pushPageVarProvider(IPageVariablesProvider provider) {
- _pageVarProviders.add(provider);
- }
-
- /**
- * @param provider
- */
- public void popPageVarProvider(IPageVariablesProvider provider) {
- try {
- _pageVarProviders.remove(_pageVarProviders.size() - 1);
- } catch (Exception ex) {
- // "Error"
- _log.info("PageExpressionContext.Info.0", ex); //$NON-NLS-1$
- }
- }
-
- /**
- * this method is for design time expression evaluation. Currently it only
- * handles
- *
- * @param expression
- * @param expectedClass
- * @param options
- * XXX: not used today. In the future, we may support things like
- * locale in options
- * @return the result of evaluating the expression
- * @throws ELException
- */
- public Object evaluateExpression(String expression, Class expectedClass,
- Map options) throws ELException {
- expression = JSFELParserHelper.toJspElExpression(expression);
- ExpressionEvaluatorImpl evaluator = new ExpressionEvaluatorImpl();
- FunctionMapper mapper = new EmptyFunctionMapper();
-
- return evaluator.evaluate(expression, expectedClass, resolver, mapper);
- }
-
- class SimpleVariableResolver implements VariableResolver {
- /*
- * (non-Javadoc)
- *
- * @see javax.servlet.jsp.el.VariableResolver#resolveVariable(java.lang.String)
- */
- public Object resolveVariable(String varName) throws ELException {
- // reverse order.
- for (int k = _pageVarProviders.size() - 1; k >= 0; k--) {
- IPageVariablesProvider _pageVars = (IPageVariablesProvider) _pageVarProviders
- .get(k);
- if (_pageVars != null) {
- IVariableInfo[] vars = _pageVars.getBeanInfos();
- if (vars != null) {
- for (int i = 0; i < vars.length; i++) {
- if (varName.equals(vars[i].getName())) {
- // ok we found.
- if (vars[i].getMode() == IVariableInfo.RESOURCEBUNDLE) {
- String resourceName = vars[i]
- .getTypeInfoString();
- IStorage s = null;
- try {
- s = LoadBundleUtil
- .getLoadBundleResource(_prj,
- resourceName);
- } catch (CoreException ex) {
- // "Error"
- _log
- .info(
- "PageExpressionContext.Info.0", ex); //$NON-NLS-1$
- }
- if (s == null) {
- throw new ELException();
- }
- InputStream input = null;
- try {
- input = new BufferedInputStream(s
- .getContents());
- Properties p = new Properties();
- p.load(input);
- return p;
- } catch (CoreException e) {
- throw new ELException(e);
- } catch (IOException e) {
- throw new ELException(e);
- } finally {
- ResourceUtils.ensureClosed(input);
- }
- }
- }
- }
- }
- }
- }
- throw new ELException("Can't find: " + varName); //$NON-NLS-1$
- }
-
- }
-
- static class EmptyFunctionMapper implements FunctionMapper {
-
- /*
- * (non-Javadoc)
- *
- * @see javax.servlet.jsp.el.FunctionMapper#resolveFunction(java.lang.String,
- * java.lang.String)
- */
- public Method resolveFunction(String arg0, String arg1) {
- return null;
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/preview/PreviewConvertContext.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/preview/PreviewConvertContext.java
deleted file mode 100644
index 4c0b2f7..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/preview/PreviewConvertContext.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.preview;
-
-import java.util.List;
-
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.converter.ConvertPosition;
-import org.eclipse.jst.pagedesigner.converter.IConverterFactory;
-import org.eclipse.jst.pagedesigner.converter.ITagConverter;
-import org.eclipse.jst.pagedesigner.dtmanager.DTManager;
-import org.eclipse.wst.xml.core.internal.document.InvalidCharacterException;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class PreviewConvertContext {
- private Logger _log = PDPlugin.getLogger(PreviewConvertContext.class);
-
- private IDOMDocument _destDocument;
-
- /**
- * Instantiates an instance for the specified IDOMDocument.
- *
- * @param destDocument IDOMDocument instance.
- */
- public PreviewConvertContext(IDOMDocument destDocument) {
- this._destDocument = destDocument;
- }
-
- /**
- * Converts specified Node for preview.
- *
- * @param ele Node instance to convert.
- * @return Converted Node instance.
- */
- public Node previewConvert(Node ele) {
- if (ele instanceof Element) {
- return previewConvertElement((Element) ele);
- } else if (ele instanceof Text) {
- return createText((Text) ele);
- } else {
- // XXX: we'll support other node like doctype etc in the future.
- // so they should also be rendered into preview.
-
- return null;
- }
- }
-
- /**
- * @param text
- * @return
- */
- private Node createText(Text text) {
- Text previewText = this._destDocument.createTextNode(text.getData());
- try {
- ((IDOMText) previewText).setSource(((IDOMText) text).getSource());
- } catch (InvalidCharacterException e) {
- // "Error"
- _log.info("PreviewConvertContext.Error.0", e); //$NON-NLS-1$
- }
- return previewText;
- }
-
- /**
- * Converts specified Element instance for preview.
- *
- * @param ele Element instance to be converted.
- * @return Converted Node instance.
- */
- protected Node previewConvertElement(Element ele) {
- ITagConverter converter = createTagConverter(ele);
- if (!converter.isVisualByHTML()) {
- return null;
- }
- converter.convertRefresh(null);
- Element result = converter.getResultElement();
- List children = converter.getChildModeList();
- if (children != null) {
- for (int i = 0, size = children.size(); i < size; i++) {
- Node child = (Node) children.get(i);
- if (child != null) {
- Node childPreview = previewConvert(child);
- if (childPreview != null) {
- ConvertPosition position = converter
- .getChildVisualPosition(child);
- if (position != null) {
- /* FIX for bug #179403
- // FIXME: not using index here, need fix.
- position.getParentNode().appendChild(childPreview);
- */
- NodeList childNodes = position.getParentNode().getChildNodes();
- if (childNodes.getLength() > position.getIndex()) {
- Node item = childNodes.item(position.getIndex());
- position.getParentNode().insertBefore(childPreview, item);
- } else {
- position.getParentNode().appendChild(childPreview);
- }
- }
- }
- }
- }
- }
- return result;
- }
-
- /**
- * @param ele
- * @return
- */
- private ITagConverter createTagConverter(Element ele) {
- return DTManager.getInstance().getTagConverter(ele,
- IConverterFactory.MODE_PREVIEW, _destDocument);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/preview/PreviewHandlerNew.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/preview/PreviewHandlerNew.java
deleted file mode 100644
index 16c5a34..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/preview/PreviewHandlerNew.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.preview;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.pagedesigner.jsp.core.pagevar.IPageVariablesProvider;
-import org.eclipse.jst.pagedesigner.jsp.core.pagevar.adapter.IDocumentPageVariableAdapter;
-import org.eclipse.jst.pagedesigner.parts.DocumentEditPart;
-import org.eclipse.jst.pagedesigner.parts.NodeEditPart;
-import org.eclipse.jst.pagedesigner.utils.PreviewUtil;
-import org.eclipse.jst.pagedesigner.utils.StructuredModelUtil;
-import org.eclipse.wst.html.core.internal.provisional.contenttype.ContentTypeIdForHTML;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.document.XMLGeneratorImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.ISourceGenerator;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class PreviewHandlerNew {
- //private static Logger _log = PDPlugin.getLogger(PreviewHandlerNew.class);
-
- /**
- * @param part
- * @param result
- */
- public static void generatePreview(DocumentEditPart part,
- StringBuffer result) {
- try {
- IProject prj = StructuredModelUtil.getProjectFor(part.getIDOMNode()
- .getModel());
- PageExpressionContext.initialize(prj);
-
- IDOMDocument doc = (IDOMDocument) part.getIDOMNode();
- Object obj = doc.getAdapterFor(IDocumentPageVariableAdapter.class);
- if (obj instanceof IPageVariablesProvider) {
- ((IPageVariablesProvider) obj).refresh();
- PageExpressionContext.getCurrent().pushPageVarProvider(
- (IPageVariablesProvider) obj);
- } else {
- PageExpressionContext.getCurrent().pushPageVarProvider(null);
- }
-
- // IDOMModel previewModel =
- // (IDOMModel)StructuredModelManager.getModelManager().createNewInstance(doc.getModel());
- // IDOMDocument previewDoc = previewModel.getDocument();
-
- // CR400625: creating XML model here instead of HTML model. Since
- // for HTML model, there are checking enforced
- // by WTP to make sure the HTML content model is not invalidated.
- // And sometimes, the converted HTML may not fully
- // comply with HTML content model.
- // Use XML instead to workaround the content model validation.
-
- // CR403449: But if we use XML, then system can't recogonize special
- // tag such as "script", "style", they
- // support <!-- --> in them.
- // So we are still using HTML model, but in TagConverter, we are
- // always caling DOMUtil.cloneNodeDeepIgnoreError
- // to try to skip the errors.
- // Hopefully in later version of SSE, the famous "br" problem is
- // fixed, and we won't met error when doing
- // deep clone.
- // IStructuredModel sModel =
- // StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(IContentTypeIdentifier.ContentTypeID_XML);
- // FIXME: if is not jsp, should use original contentType, if is jsp,
- // should use the corresponding
- // content type
- IStructuredModel sModel = StructuredModelManager.getModelManager()
- .createUnManagedStructuredModelFor(
- ContentTypeIdForHTML.ContentTypeID_HTML);
-
- IDOMDocument previewDoc = ((IDOMModel) sModel).getDocument();
- PreviewConvertContext context = new PreviewConvertContext(
- previewDoc);
-
- ISourceGenerator generator = XMLGeneratorImpl.getInstance();
- List subeditparts = part.getChildren();
- for (int i = 0, size = subeditparts.size(); i < size; i++) {
- NodeEditPart subpart = (NodeEditPart) subeditparts.get(i);
- Node node = context.previewConvert(subpart.getIDOMNode());
-
- PreviewUtil.previewNode(node);
-
- if (node != null) {
- result.append(generator.generateSource(node));
- }
-
- }
- sModel.releaseFromEdit();
- } finally {
- PageExpressionContext.reset();
- }
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/preview/PreviewResources.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/preview/PreviewResources.java
deleted file mode 100644
index bae36d9..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/preview/PreviewResources.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.preview;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.jsf.common.ui.internal.utils.ResourceUtils;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-
-/**
- * @author mengbo
- */
-public class PreviewResources extends ResourceUtils {
- /** Create the logger for this class */
- private static Logger _log = PDPlugin.getLogger(PreviewResources.class);
-
- private static PreviewResources _resource; // singleton
-
- private static final String BUNDLE = "org.eclipse.jst.pagedesigner.preview.PreviewResources";
-
- /**
- * Empty Constructor.
- *
- * @return WizardsResources
- */
-
- public static PreviewResources getInstance() {
- if (_resource == null) {
- _resource = new PreviewResources();
- }
- return _resource;
- }
-
- /**
- * The constructor create a resource bundle
- */
- protected PreviewResources() {
- try {
- _resources = ResourceBundle.getBundle(BUNDLE);
- // NOTE: this throws a runtime "MissingResourceException".
- } catch (MissingResourceException ee) {
- _log
- .error(
- "Log.Error.PreviewResources.ResouceNotFound", BUNDLE, ee); //$NON-NLS-1$
- }
- setBundle(_resources, BUNDLE);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/preview/PreviewResources.properties b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/preview/PreviewResources.properties
deleted file mode 100644
index 1e42ee3..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/preview/PreviewResources.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2007 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are 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:
-# Oracle Corporation - initial API and implementation
-###############################################################################
-####################################################
-# Resource message for RenderingTraverser
-####################################################
-RenderingTraverser.Error.FileNotFound = File not found.
-RenderingTraverser.Error.UnsupportedEncoding = Unsupport encoding.
-RenderingTraverser.Error.IO = IO exception.
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/preview/WindowsIEBrowser.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/preview/WindowsIEBrowser.java
deleted file mode 100644
index 2901f70..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/preview/WindowsIEBrowser.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.preview;
-
-import java.io.File;
-
-import org.eclipse.swt.browser.Browser;
-import org.eclipse.swt.browser.ProgressEvent;
-import org.eclipse.swt.browser.ProgressListener;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Models the windows IE browser for preview
- *
- */
-public class WindowsIEBrowser implements ProgressListener {
- private Browser _browser;
-
- /**
- * @param composite
- * @param i
- */
- public void create(Composite composite, int i) {
- _browser = new Browser(composite, i);
- _browser.addProgressListener(this);
- }
-
- /**
- * @param file
- */
- public synchronized void loadFile(File file) {
- if (_browser == null) {
- return;
- }
- String s = "file:" + file.getAbsolutePath();
- _browser.setUrl(s);
- return;
- }
-
- /**
- * dispose the instance
- */
- public void dispose() {
- if (_browser == null) {
- return;
- }
- _browser.dispose();
- _browser = null;
- return;
- }
-
- public void changed(ProgressEvent progressevent) {
- // do nothing
- }
-
- public void completed(ProgressEvent progressevent) {
- // do nothing
- }
-
- /**
- * @return the underlying swt Browser instance
- */
- public Browser getBrowser() {
- return _browser;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/AllPropertySection.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/AllPropertySection.java
deleted file mode 100644
index 3c40094..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/AllPropertySection.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.views.properties.IPropertySourceProvider;
-import org.eclipse.ui.views.properties.tabbed.AbstractPropertySection;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- * Mainly copied from AdvancedPropertySection. But extend it to allow setting
- * PropertySourceProvider.
- *
- * @author mengbo
- */
-public class AllPropertySection extends AbstractPropertySection {
- // FIXME: workaround the eclipse properties view limitation of sorting
- // category.
- private AttributePropertySheetPage page;
-
- /**
- * IPropertySourceProvider for this section
- */
- protected IPropertySourceProvider _provider;
-
- /**
- * selected tag IDOMElement
- */
- protected IDOMElement _element;
-
- /**
- * The INodeAdapter to use for notification of model change
- */
- protected INodeAdapter _adapter = new INodeAdapter() {
- public boolean isAdapterForType(Object type) {
- return false;
- }
-
- public void notifyChanged(INodeNotifier notifier, int eventType,
- Object changedFeature, Object oldValue, Object newValue, int pos) {
- refresh();
- }
- };
-
- /**
- * Constructor
- */
- public AllPropertySection() {
- this.setPropertySourceProvider(new AttributePropertySourceProvider());
- }
-
- @Override
- public void createControls(Composite parent,
- TabbedPropertySheetPage tabbedPropertySheetPage) {
- super.createControls(parent, tabbedPropertySheetPage);
-
-
- Composite composite = getWidgetFactory()
- .createFlatFormComposite(parent);
- page = new AttributePropertySheetPage();
- page.init(tabbedPropertySheetPage.getSite());
-
- if (_provider != null) {
- page.setPropertySourceProvider(_provider);
- }
-
- page.createControl(composite);
- FormData data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(0, 0);
- data.bottom = new FormAttachment(100, 0);
- data.height = 100;
- data.width = 100;
- page.getControl().setLayoutData(data);
- }
-
- @Override
- public void setInput(IWorkbenchPart part, ISelection selection) {
- IDOMElement newEle = (IDOMElement) DesignerPropertyTool.getElement(
- part, selection);
-
- if (_element != newEle && page != null) {
- super.setInput(part, selection);
- page.selectionChanged(part, selection);
- if (_element != null) {
- _element.removeAdapter(_adapter);
- }
- _element = newEle;
- if (_element != null) {
- _element.addAdapter(_adapter);
- }
- }
- }
-
- @Override
- public void dispose() {
- super.dispose();
-
- if (_element != null) {
- _element.removeAdapter(_adapter);
- }
- if (page != null) {
- page.dispose();
- page = null;
- }
- }
-
- @Override
- public void refresh() {
- if (page != null)
- page.refresh();
- }
-
- @Override
- public boolean shouldUseExtraSpace() {
- return true;
- }
-
- /**
- * Set provider into tabbedPropertiesPage
- * @param provider
- */
- public void setPropertySourceProvider(IPropertySourceProvider provider) {
- _provider = provider;
- if (page != null){
- page.setPropertySourceProvider(_provider);
-
- }
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/AttributePropertySheetPage.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/AttributePropertySheetPage.java
deleted file mode 100644
index 9b236f9..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/AttributePropertySheetPage.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties;
-
-import org.eclipse.jst.pagedesigner.meta.internal.CategoryNameComparator;
-import org.eclipse.ui.views.properties.PropertySheetPage;
-import org.eclipse.ui.views.properties.PropertySheetSorter;
-
-/**
- * In PropertySheetPage, the <code>setSorter</code> is protected. Creating
- * this class to make setSorter accessible to us.
- *
- * @author mengbo
- * @version 1.5
- */
-public class AttributePropertySheetPage extends PropertySheetPage {
-// TODO: add actions
-// public void makeContributions(IMenuManager menuManager,
-// IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
-// super.makeContributions(menuManager, toolBarManager, statusLineManager);
-// //add actions here
-// hide/show all categories
-// collapse
-// remove
-// }
-
- /**
- * Use my sorter to sort the category name. Only override the
- * compareCategories method.
- *
- * @author mengbo
- * @version 1.5
- */
- private static class MySorter extends PropertySheetSorter {
- public int compareCategories(String categoryA, String categoryB) {
- return CategoryNameComparator.getInstance().compare(categoryA,
- categoryB);
- }
- }
-
- /**
- * Constructor
- */
- public AttributePropertySheetPage() {
- super();
- setSorter(new MySorter());
- }
-
-// public void createControl(Composite parent) {
-// super.createControl(parent);
-//// PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(),
-//// PDPlugin.getResourceString("MyPropertySheetPage.help.id"));
-// }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/AttributePropertySource.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/AttributePropertySource.java
deleted file mode 100644
index 2f128d1..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/AttributePropertySource.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.query.ITaglibDomainMetaDataModelContext;
-import org.eclipse.jst.jsf.common.metadata.query.TaglibDomainMetaDataQueryHelper;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.ITaglibContextResolver;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IWorkspaceContextResolver;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContextFactory;
-import org.eclipse.jst.jsf.metadataprocessors.MetaDataEnabledProcessingFactory;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.commands.single.ChangeAttributeCommand;
-import org.eclipse.jst.pagedesigner.editors.properties.IPropertyPageDescriptor;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.w3c.dom.Element;
-
-/**
- *
- * @author mengbo
- */
-public class AttributePropertySource implements IPropertySource {
- private IDOMElement _element;
-
- private IPropertySource _innerSource;
-
- private Entity _tagEntity;
-
- private IStructuredDocumentContext _context;
-
- private IPropertyDescriptor[] _descriptors;
-
- /**
- * Constructor
- * @param ele
- * @param source
- */
- public AttributePropertySource(Element ele, IPropertySource source) {
- _element = (IDOMElement) ele;
- _innerSource = source;
- _tagEntity = getTagEntity();
- }
-
- private Entity getTagEntity() {
- _context =
- IStructuredDocumentContextFactory.INSTANCE.getContext(_element.getStructuredDocument(), _element);
- if (_context == null)
- return null;
-
- IWorkspaceContextResolver wsresolver =
- IStructuredDocumentContextResolverFactory.INSTANCE.getWorkspaceContextResolver(_context);
- if (wsresolver == null)
- return null;
-
- ITaglibContextResolver resolver =
- IStructuredDocumentContextResolverFactory.INSTANCE.getTaglibContextResolver(_context);
- if (resolver == null) return null;
-
- String uri = resolver.getTagURIForNodeName(_element);
-
- //TODO: make below better
- if (uri == null){
- if (_element.getNamespaceURI() != null && _element.getNamespaceURI().equals("http://java.sun.com/JSP/Page")) //$NON-NLS-1$
- uri = "JSP11"; //$NON-NLS-1$
- else
- uri = "HTML"; //$NON-NLS-1$
- }
- ITaglibDomainMetaDataModelContext domainContext =
- TaglibDomainMetaDataQueryHelper.createMetaDataModelContext(wsresolver.getProject(), uri);
- return TaglibDomainMetaDataQueryHelper.getEntity(domainContext, _element.getLocalName());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
- */
- public Object getEditableValue() {
- return _innerSource.getEditableValue();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
- */
- public Object getPropertyValue(Object id) {
- // CR377844: when the attribute in source is "a>b", we would like to
- // display
- // "a>b" in cell editor. But _innerSource.getPropertyValue(id) will
- // return the source
- // of the attribute, so can't use that here.
- // read QTS log for detail.
- // return _innerSource.getPropertyValue(id);
- if (id == null) {
- return null;
- }
- String name = id.toString();
- String value = _element.getAttribute(name);
- if (value == null) {
- value = ""; //$NON-NLS-1$
- }
- return value;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
- */
- public boolean isPropertySet(Object id) {
- return _innerSource.isPropertySet(id);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
- */
- public void resetPropertyValue(Object id) {
- _innerSource.resetPropertyValue(id);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object,
- * java.lang.Object)
- */
- public void setPropertyValue(final Object id, final Object value) {
- Object oldValue = getPropertyValue(id);
- if (oldValue == value || (oldValue != null && oldValue.equals(value))) {
- return;
- }
- Command c = new ChangeAttributeCommand(
- PDPlugin
- .getResourceString("AttributePropertySource.CommandLabel.ChangeAttribute"), _element, (String) id, (String) value); //$NON-NLS-1$
- c.execute();
- }
-
- /**
- * the major job of this wrapper is to provide
- */
- public IPropertyDescriptor[] getPropertyDescriptors() {
- if (_descriptors == null) {
- List result = new ArrayList();
-
- IPropertyDescriptor[] descs = _innerSource.getPropertyDescriptors();
- if (descs != null) {
- for (int i = 0; i < descs.length; i++) {
- IPropertyDescriptor pd = getAttrPropertyDescriptor((String)descs[i].getId());
- if (pd != null)
- result.add(new PropertyDescriptorWrapper(
- _element,
- pd));//,
- //getStatusLineManager()));
- else {
- if (descs[i] instanceof PropertyDescriptor)
- ((PropertyDescriptor)descs[i]).setCategory(ITabbedPropertiesConstants.OTHER_CATEGORY);
- result.add(new PropertyDescriptorWrapper(
- _element,
- descs[i]));//,
- //getStatusLineManager()));
- }
-
- }
- }
-
- _descriptors = new IPropertyDescriptor[result.size()];
- result.toArray(_descriptors);
-
- }
- return _descriptors;
- }
-
-// private IAttributeDescriptor findReferencedAttribute(
-// IElementDescriptor elementDescriptor, IPropertyDescriptor desc) {
-// return null;
-// }
-
-// private IElementDescriptor getElementDescriptor() {
-// ICMRegistry registry = CMRegistry.getInstance();
-// String uri = CMUtil.getElementNamespaceURI(_element);
-// return registry.getElementDescriptor(uri, _element.getLocalName());
-// }
-
- private IPropertyDescriptor getAttrPropertyDescriptor(String attrName){
- Entity attrEntity = TaglibDomainMetaDataQueryHelper.getEntity(_tagEntity, attrName);
- List ppds = MetaDataEnabledProcessingFactory.getInstance().getAttributeValueRuntimeTypeFeatureProcessors(IPropertyPageDescriptor.class, _context, attrEntity);
- if (ppds.size() > 0)
- return (IPropertyDescriptor)((IPropertyPageDescriptor)ppds.get(0)).getAdapter(IPropertyDescriptor.class);
-
- return null;
-
- }
-
-// private IStatusLineManager getStatusLineManager() {
-// _page.getSite().getActionBars().getStatusLineManager();
-// }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/AttributePropertySourceProvider.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/AttributePropertySourceProvider.java
deleted file mode 100644
index 086072b..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/AttributePropertySourceProvider.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties;
-
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.IPropertySourceProvider;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.ui.internal.properties.XMLPropertySource;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- */
-public class AttributePropertySourceProvider implements IPropertySourceProvider {
-
- /**
- * Constructor
- */
- public AttributePropertySourceProvider() {
- //
- }
-
- public IPropertySource getPropertySource(Object object) {
- Element model = null;
- IPropertySource source = null;
-
- if ((model = DesignerPropertyTool.getElementNode(object)) != null) {
- source = (IPropertySource) ((INodeNotifier) (model))
- .getAdapterFor(IPropertySource.class);
- if (source == null) {
- source = new XMLPropertySource((INodeNotifier) model);
- }
- }
- if (source != null) {
- return new AttributePropertySource( model, source);
- }
- return source;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/BaseCustomSection.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/BaseCustomSection.java
deleted file mode 100644
index db8742d..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/BaseCustomSection.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.StatusUtil;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.views.properties.tabbed.AbstractPropertySection;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- */
-public abstract class BaseCustomSection extends AbstractPropertySection {
-
- /**
- * Status that all is OK
- */
- protected static final Status OKSTATUS = new Status(IStatus.OK, PDPlugin
- .getPluginId(), 0, "", null); //$NON-NLS-1$
-
- private WPETabbedPropertySheetPage _propertySheetPage;
-
- private boolean _visible = false;
-
- /**
- * the tag IDOMElement
- */
- protected IDOMElement _element;
-
- /**
- * the INodeAdapter used to receive notifications of model updates
- */
- protected INodeAdapter _adapter = new INodeAdapter() {
- public boolean isAdapterForType(Object type) {
- return false;
- }
-
- public void notifyChanged(INodeNotifier notifier, int eventType,
- Object changedFeature, Object oldValue, Object newValue, int pos) {
- BaseCustomSection.this.notifyChanged(notifier, eventType,
- changedFeature, oldValue, newValue, pos);
- }
- };
-
- public void setInput(IWorkbenchPart part, ISelection selection) {
- super.setInput(part, selection);
- IDOMElement newEle = (IDOMElement) DesignerPropertyTool.getElement(
- part, selection);
- if (_element != newEle) {
- if (_element != null) {
- _element.removeAdapter(_adapter);
- }
- _element = newEle;
- if (_element != null) {
- _element.addAdapter(_adapter);
- }
- }
- }
-
- /**
- * Method adapter will call when element has changed
- *
- * @param notifier
- * @param eventType
- * @param changedFeature
- * @param oldValue
- * @param newValue
- * @param pos
- */
- protected abstract void notifyChanged(INodeNotifier notifier,
- int eventType, Object changedFeature, Object oldValue,
- Object newValue, int pos);
-
- public void createControls(Composite parent,
- TabbedPropertySheetPage aTabbedPropertySheetPage) {
- super.createControls(parent, aTabbedPropertySheetPage);
- _propertySheetPage = (WPETabbedPropertySheetPage) aTabbedPropertySheetPage;
- }
-
- /**
- * for certain action performed in the section, may result big change in the
- * model. e.g: change tag name will result in editpart recreate. In this
- * case, we need do a total refresh.
- *
- */
- protected void refreshPropertySheetPage() {
- if (_propertySheetPage != null) {
- IWorkbenchPart part = getPart();
- if (part != null) {
- ISelection sel = part.getSite().getSelectionProvider()
- .getSelection();
- _propertySheetPage.selectionChanged(part, sel);
- } else {
- // XXX: will else happen?
- System.out.println("AbstractCustomSection --> What to do?"); //$NON-NLS-1$
- }
- }
- }
-
- /**
- * Change selection
- * @param node
- */
- protected void gotoNode(Node node) {
- _propertySheetPage.internalChangeSelection(node, node);
- }
-
- /**
- * @return IStatusLineManager to use for the property sheet page
- */
- protected IStatusLineManager getStatusLineManager() {
- if (_propertySheetPage != null) {
- IActionBars bar = _propertySheetPage.getSite().getActionBars();
- if (bar != null) {
- return bar.getStatusLineManager();
- }
- }
- return null;
- }
-
- /**
- * @param status to display on status line
- */
- protected void applyStatus(IStatus[] status) {
- if (!_visible) {
- return;
- }
-
- IStatusLineManager statusLine = getStatusLineManager();
- if (statusLine == null) {
- return;
- }
-
- IStatus s;
- if (status == null || status.length == 0) {
- s = null;
- } else {
- s = StatusUtil.getMostSevere(status);
- }
-
- if (s == null || s.getSeverity() != IStatus.ERROR) {
- statusLine.setErrorMessage(null);
- } else {
- statusLine.setErrorMessage(s.getMessage());
- }
- }
-
- /**
- * @param message
- */
- protected void setErrorMessage(String message) {
- IStatusLineManager s = getStatusLineManager();
- if (s != null) {
- s.setErrorMessage(message);
- }
- }
-
- /**
- * @param message
- * @return Status
- */
- protected Status createErrorStatus(String message) {
- return new Status(IStatus.ERROR, PDPlugin.getPluginId(), 0, message,
- null);
- }
-
- public void aboutToBeHidden() {
- applyStatus(null);
- _visible = false;
-// IDOMElement newEle = (IDOMElement) DesignerPropertyTool.getElement(
-// part, selection);
-// if (_element != newEle) {
- if (_element != null) {
- _element.removeAdapter(_adapter);
- }
-// _element = newEle;
-// if (_element != null) {
-// _element.addAdapter(_adapter);
-// }
-// }
- super.aboutToBeHidden();
- }
-
- public void aboutToBeShown() {
- super.aboutToBeShown();
-// IDOMElement newEle = (IDOMElement) DesignerPropertyTool.getElement(
-// part, selection);
-// if (_element != newEle) {
-// if (_element != null) {
-// _element.removeAdapter(_adapter);
-// }
-// _element = newEle;
- if (_element != null) {
- _element.addAdapter(_adapter);
- }
-// }
- _visible = true;
- }
-
- /**
- * @return IProject for the WPE editing instance
- */
- protected IProject getProject() {
- if (_propertySheetPage != null) {
- IEditorInput input = _propertySheetPage.getEditor()
- .getEditorInput();
- if (input instanceof IFileEditorInput) {
- return ((IFileEditorInput) input).getFile().getProject();
- }
- }
- return null;
- }
-
- public void dispose() {
- super.dispose();
- if (_element != null) {
- _element.removeAdapter(_adapter);
- }
- }
-
- /**
- * @return IFile for WPE editing instance
- */
- protected IFile getFile() {
- if (_propertySheetPage != null) {
- IEditorInput input = _propertySheetPage.getEditor()
- .getEditorInput();
- if (input instanceof IFileEditorInput) {
- return ((IFileEditorInput) input).getFile();
- }
- }
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/DesignerPropertyTool.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/DesignerPropertyTool.java
deleted file mode 100644
index d32d534..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/DesignerPropertyTool.java
+++ /dev/null
@@ -1,356 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectNature;
-import org.eclipse.gef.editparts.AbstractEditPart;
-import org.eclipse.gef.ui.parts.GraphicalEditor;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.jst.pagedesigner.dom.DOMUtil;
-import org.eclipse.jst.pagedesigner.editors.HTMLEditor;
-import org.eclipse.jst.pagedesigner.utils.SelectionHelper;
-import org.eclipse.jst.pagedesigner.viewer.DesignRange;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.editors.text.TextEditor;
-import org.eclipse.ui.views.contentoutline.ContentOutline;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Attr;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-/**
- * This is util class most used by Property related operation.
- *
- * @author mengbo
- */
-public class DesignerPropertyTool {
-
- /**
- * @param fNode
- * @param attributeDesc
- * @return attribute value
- */
- public static String getAttributeValue(Element fNode, CMNode attributeDesc) {
- if (attributeDesc == null) {
- return ""; //$NON-NLS-1$
- }
- String returnedValue = ""; //$NON-NLS-1$
- NamedNodeMap attrMap = fNode.getAttributes();
- if (attrMap != null) {
- Node attribute = attrMap.getNamedItem(attributeDesc.getNodeName());
- if (attribute != null) {
- if (attribute instanceof IDOMNode) {
- returnedValue = ((IDOMNode) attribute).getValueSource();
- } else {
- returnedValue = attribute.getNodeValue();
- }
- }
- }
- return returnedValue;
- }
-
-// /**
-// * @param fNode
-// * @param filter
-// * @return array of attributes as objects
-// * (unused)
-// */
-// public static Object[] getElementReferedAttributes(Element fNode,
-// String[] filter) {
-// List result = new ArrayList();
-// CMNamedNodeMap cmnnm = getElementDeclaredAttributes(fNode);
-// for (int i = 0, n = cmnnm.getLength(); i < n; i++) {
-// String name = cmnnm.item(i).getNodeName();
-// if (Arrays.asList(filter).contains(name)) {
-// result.add(cmnnm.item(i));
-// }
-// }
-// return result.toArray(new CMNode[result.size()]);
-// }
-
- /**
- * @param fNode
- * @return CMNamedNodeMap
- */
- public static CMNamedNodeMap getElementDeclaredAttributes(Node fNode) {
- IStructuredModel structModel = null;
- if (fNode instanceof IDOMNode) {
- structModel = ((IDOMNode) fNode).getModel();
- }
- if (null == structModel) {
- return null;
- }
- CMElementDeclaration cmde = null;
- CMNamedNodeMap cmnnm = null;
- if (fNode == null || fNode.getNodeType() != Node.ELEMENT_NODE) {
- cmde = null;
- }
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(fNode
- .getOwnerDocument());
- if (modelQuery != null) {
- cmde = modelQuery.getCMElementDeclaration((Element) fNode);
- }
- if (cmde != null) {
- cmnnm = cmde.getAttributes();
- }
- return cmnnm;
- }
-
- /**
- * the selection could be different kinds of selection, including: 1.
- * ITextSelection 2. IStructuredSelection (Node) 3. IStructuredSelection
- * (EditPart) 4. DesignRange we want to normalize it to only #2. If the node
- * is ATTR or TEXT/CDATA_SECTION, will use it's parent node.
- *
- * @param selectingPart
- * @param selection
- * @param htmlEditor
- * @return null if can't normalize.
- */
- public static Node normalizeSelectionToElement(
- IWorkbenchPart selectingPart, ISelection selection,
- HTMLEditor htmlEditor) {
-
- Node node = null;
- if (selectingPart instanceof HTMLEditor) {
- IEditorPart part = ((HTMLEditor) selectingPart).getActiveEditor();
- if (part instanceof TextEditor) {
- if (selection instanceof ITextSelection) {
- IStructuredModel model = ((HTMLEditor) selectingPart)
- .getModel();
- node = SelectionHelper.toNode(model,
- (ITextSelection) selection);
- }
- } else if (part instanceof GraphicalEditor) {
- if (selection instanceof IStructuredSelection) {
- node = SelectionHelper
- .toNode((IStructuredSelection) selection);
- } else if (selection instanceof DesignRange) {
- node = SelectionHelper.toNode((DesignRange) selection);
- }
- }
- if (node instanceof Attr) {
- node = ((Attr) node).getOwnerElement();
- } else if (node instanceof Text || node instanceof CDATASection) {
- node = node.getParentNode();
- }
- } else if (selectingPart instanceof ContentOutline) {
- if (selection instanceof IStructuredSelection
- && ((ContentOutline) selectingPart).getCurrentPage() != null
- && ((ContentOutline) selectingPart).getCurrentPage()
- .getControl().isFocusControl()) {
- node = SelectionHelper.toNode((IStructuredSelection) selection);
- if (node == null) {
- node = htmlEditor.getDOMDocument();
- }
- }
- }
-
- return node;
- }
-
- /**
- * @param node as Object
- * @return element
- */
- public static Element getElementNode(Object node) {
- Object model;
- Element element = null;
- if (node == null) {
- return null;
- }
-
- if (node instanceof Element) {
- element = (Element) node;
- } else if (node instanceof AbstractEditPart) {
- model = ((AbstractEditPart) node).getModel();
- if (model instanceof Element) {
- element = (Element) model;
- }
- } else if (node instanceof ISelection) {
- element = getElement(null, (ISelection) node);
- }
- return element;
- }
-
- /**
- * @param element
- * @param filter
- * @return list of attribute names
- */
- public static List getNameList(Element element, String[] filter) {
- List result = new ArrayList();
- CMNamedNodeMap attributes = getElementDeclaredAttributes(element);
- if (attributes != null) {
- for (int i = 0, n = attributes.getLength(); i < n; i++) {
- String name = attributes.item(i).getNodeName();
- if (Arrays.asList(filter).contains(name))
- result.add(name);
- }
- }
- return result;
- }
-
- /**
- * @param selection
- * should be a normalized selection
- * @return node
- */
- public static Node getCommonParent(ISelection selection) {
- if (selection instanceof IStructuredSelection) {
- Object obj = ((IStructuredSelection) selection).getFirstElement();
- return (Node) obj;
- } else if (selection instanceof DesignRange) {
- DesignRange range = (DesignRange) selection;
- Node node1 = range.getStartPosition().getContainerNode();
- Node node2 = range.getEndPosition().getContainerNode();
- return DOMUtil.findCommonAncester(node1, node2);
- } else {
- // should not happen
- return null;
- }
- }
-
- /**
- * The passed in selection should be normalized selection.
- *
- * @param selectingPart
- * @param selection
- * @return element
- */
- public static Element getElement(IWorkbenchPart selectingPart,
- ISelection selection) {
- Node node = getCommonParent(selection);
- if (node instanceof Element) {
- return (Element) node;
- } else if (node != null) {
- node = node.getParentNode();
- if (node instanceof Element) {
- return (Element) node;
- }
- }
- return null;
- }
-
- // reserved for future native use.
- // public static void dumpChildren(Element element)
- // {
- // // In this function we are using logger to dump message out.
- // Logger logger = PDPlugin.getLogger(DesignerPropertyTool.class);
- // if (element == null || !DEBUG)
- // return;
- // NodeList nl = element.getChildNodes();
- // // It's our pattern for dumping message
- // logger.debug("\n----------------------------"); //$NON-NLS-1$
- // logger.debug("Element:" + element.getNodeName()); //$NON-NLS-1$
- // for (int i = 0; i < nl.getLength(); i++)
- // {
- // Node node = nl.item(i);
- // logger.debug("child[" + i + "]:" + node.getNodeName()); //$NON-NLS-1$
- // //$NON-NLS-2$
- // }
- // logger.debug("----------------------------\n"); //$NON-NLS-1$
- // }
-
- /**
- * @param element
- * @return bool
- * (unused)
- */
- public static boolean isMultiSelection(Element element) {
- if (element.getNodeName().equalsIgnoreCase(IHTMLConstants.TAG_OPTION)) {
- return element.getAttribute(ICSSPropertyID.ATTR_MULTIPLE) != null;
- }
- return false;
- }
-
-// /**
-// * @param element
-// * @return if elementImpl, return source, else null
-// * (unused)
-// */
-// public static String getElementTextSource(Element element) {
-// if (element == null) {
-// return null;
-// }
-// if (element instanceof ElementImpl) {
-// return ((ElementImpl) element).getSource();
-// }
-// return null;
-// }
-
- /**
- * @param project
- * @return IJavaProject
- */
- public static IJavaProject getJavaProject(Object project) {
- if (project == null) {
- return null;
- }
- if (project instanceof IJavaProject) {
- return (IJavaProject) project;
- } else if (project instanceof IProject) {
- try {
- IProjectNature nature = ((IProject) project)
- .getNature(JavaCore.NATURE_ID);
- if (nature == null) {
- return null;
- }
- return (IJavaProject) nature;
- } catch (Exception e) {
- // Error.DesignerPropertyTool.NatureQuerying = Error in project
- // java nature querying
- PDPlugin.getLogger(DesignerPropertyTool.class).error(
- "Error.DesignerPropertyTool.NatureQuerying", e); //$NON-NLS-1$
- // Should be error tolerable?
- return null;
- }
- }
- return null;
- }
-//
-// /**
-// * @param project as Object
-// * @return IProject or null
-// */
-// public static IProject getProject(Object project) {
-// if (project instanceof IProject) {
-// return (IProject) project;
-// } else if (project instanceof IJavaProject) {
-// return ((IJavaProject) project).getProject();
-// }
-// return null;
-// }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/ISectionFilter.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/ISectionFilter.java
deleted file mode 100644
index 95591e8..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/ISectionFilter.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties;
-
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- * @version 1.5
- * @deprecated unused
- */
-public interface ISectionFilter {
-
- /**
- * @param node
- * @return true if node applies
- */
- boolean appliesTo(Element node);
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/ITabbedPropertiesConstants.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/ITabbedPropertiesConstants.java
deleted file mode 100644
index 233923a..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/ITabbedPropertiesConstants.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public interface ITabbedPropertiesConstants {
-
- // FIXME: when return null, will in fact using "Misc". This may not guarantee
- // it be the
- // last category, since is sorted by string order.
- /**
- * the other category
- */
- static final String OTHER_CATEGORY = Messages.ITabbedPropertiesConstants_other_category;
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/Messages.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/Messages.java
deleted file mode 100644
index a99a43c..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/Messages.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Externalized Strings
- *
- */
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.jst.pagedesigner.properties.messages"; //$NON-NLS-1$
- /**
- *
- */
- public static String ITabbedPropertiesConstants_other_category;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- //
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/NavigationHiearchyAction.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/NavigationHiearchyAction.java
deleted file mode 100644
index 262b43b..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/NavigationHiearchyAction.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class NavigationHiearchyAction extends Action {
- private Menu _hiearchyMenu;
-
- private Node _startNode;
-
- private Node _currentNode;
-
- private WPETabbedPropertySheetPage _propertyPage;
-
- private class MenuCreator implements IMenuCreator {
- public void dispose() {
- if (_hiearchyMenu != null) {
- for (int i = 0, n = _hiearchyMenu.getItemCount(); i < n; i++) {
- MenuItem menuItem = _hiearchyMenu.getItem(i);
- menuItem.setData(null);
- }
- _hiearchyMenu.dispose();
- _hiearchyMenu = null;
- }
- }
-
- public Menu getMenu(Menu parent) {
- return null;
- }
-
- public Menu getMenu(Control parent) {
- dispose();
- _hiearchyMenu = new Menu(parent);
-
- // next we need to add the list of parents node into the menu.
- Node node = _startNode;
- List list = new ArrayList();
- while (node != null && !(node instanceof Document)
- && !(node instanceof DocumentFragment)) {
- list.add(node);
- node = node.getParentNode();
- }
-
- // adding ancesters reverse order.
- for (int i = list.size() - 1; i >= 0; i--) {
- Node thenode = (Node) list.get(i);
- MenuItem item = new MenuItem(_hiearchyMenu, SWT.CHECK);
- item.setSelection(thenode == _currentNode ? true : false);
- String text = thenode.getNodeName();
- item.setText(text);
- item.setData(thenode);
- item.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- Node selectedNode = (Node) e.widget.getData();
- _propertyPage.internalChangeSelection(selectedNode,
- _startNode);
- }
- });
- }
-
- return _hiearchyMenu;
- }
- }
-
- /**
- * @param propertyPage
- */
- public NavigationHiearchyAction(WPETabbedPropertySheetPage propertyPage) {
- super(""); //$NON-NLS-1$
- setEnabled(true);
- setMenuCreator(new MenuCreator());
- this._propertyPage = propertyPage;
- }
-
- /**
- * @param selectedNode
- * @param startNode
- */
- protected void changeSelection(Node selectedNode, Node startNode) {
- this._propertyPage.internalChangeSelection(selectedNode, startNode);
- this._currentNode = selectedNode;
- this._startNode = startNode;
- this.setText(this._currentNode.getNodeName());
- }
-
- /**
- * @param currentNode
- * @param startNode
- */
- protected void refresh(Node currentNode, Node startNode) {
- this._currentNode = currentNode;
- this._startNode = startNode;
- if (!(_currentNode instanceof Text)
- && !(_currentNode instanceof Element)) {
- this.setText("---"); //$NON-NLS-1$
- this.setEnabled(false);
- } else {
- this.setText(_currentNode.getNodeName());
- this.setEnabled(true);
- }
- }
-
- @Override
- public void run() {
- this._propertyPage.internalChangeSelection(_currentNode, _startNode);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/OLDAttributePropertyDescriptor.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/OLDAttributePropertyDescriptor.java
deleted file mode 100644
index 75f7ec6..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/OLDAttributePropertyDescriptor.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties;
-
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.jst.pagedesigner.meta.IAttributeDescriptor;
-import org.eclipse.jst.pagedesigner.meta.XXXEditorCreator;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.w3c.dom.Element;
-
-/**
- * This is the PropertyDescriptor for an attribute. Getting information from a
- * IAttributeDescriptor and an IPropertyDescriptor.
- *
- * @author mengbo
- * @deprecated
- */
-public class OLDAttributePropertyDescriptor implements IPropertyDescriptor {
- private IAttributeDescriptor _attr;
-
- private IPropertyDescriptor _inner; // this could be null
-
- private Element _element;
-
- /**
- * @param element
- * the owner of the attribute.
- * @param descriptor
- * can't be null
- * @param desc
- * could be null
- */
- public OLDAttributePropertyDescriptor(Element element,
- IAttributeDescriptor descriptor, IPropertyDescriptor desc) {
- _element = element;
- _attr = descriptor;
- _inner = desc;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.views.properties.IPropertyDescriptor#createPropertyEditor(org.eclipse.swt.widgets.Composite)
- */
- public CellEditor createPropertyEditor(Composite parent) {
- CellEditor editor;
- editor = XXXEditorCreator.getInstance().createCellEditorWithWrapper(
- parent, _attr, (IDOMElement) _element, null);
-
- if (editor != null) {
- return editor;
- }
- XXXEditorCreator.CellEditorHolder holder = new XXXEditorCreator.CellEditorHolder() {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.meta.EditorCreator.CellEditorHolder#createCellEditor(org.eclipse.swt.widgets.Composite)
- */
- public CellEditor createCellEditor(Composite parent1) {
- if (_inner != null) {
- return _inner.createPropertyEditor(parent1);
- }
- return new TextCellEditor(parent1);
- }
- };
- return XXXEditorCreator.getInstance().createCellEditorWithWrapper(
- parent, _attr, holder, (IDOMElement) _element, null);
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.views.properties.IPropertyDescriptor#getCategory()
- */
- public String getCategory() {
- String cat = _attr.getCategory();
- if (cat != null) {
- return cat;
- }
- return ITabbedPropertiesConstants.OTHER_CATEGORY;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.views.properties.IPropertyDescriptor#getDescription()
- */
- public String getDescription() {
- String s = _attr.getDescription();
- if (s == null && _inner != null) {
- return _inner.getDescription();
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.views.properties.IPropertyDescriptor#getDisplayName()
- */
- public String getDisplayName() {
- return _attr.getAttributeName();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.views.properties.IPropertyDescriptor#getFilterFlags()
- */
- public String[] getFilterFlags() {
- if (_inner != null) {
- return _inner.getFilterFlags();
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.views.properties.IPropertyDescriptor#getHelpContextIds()
- */
- public Object getHelpContextIds() {
- if (_inner != null) {
- return _inner.getHelpContextIds();
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.views.properties.IPropertyDescriptor#getId()
- */
- public Object getId() {
- return _attr.getAttributeName();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.views.properties.IPropertyDescriptor#getLabelProvider()
- */
- public ILabelProvider getLabelProvider() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.views.properties.IPropertyDescriptor#isCompatibleWith(org.eclipse.ui.views.properties.IPropertyDescriptor)
- */
- public boolean isCompatibleWith(IPropertyDescriptor anotherProperty) {
- return false;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/PropertyDescriptorWrapper.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/PropertyDescriptorWrapper.java
deleted file mode 100644
index 6503bf1..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/PropertyDescriptorWrapper.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties;
-
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ICellEditorListener;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.jst.pagedesigner.meta.EditorCreator;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- * This is a simple PropertyDescriptor wrapper. It simply changed the category
- * name. This is because the default category name is "Attributes", which will
- * make them appear before other things, and that is not what we want.
- *
- * @author mengbo
- */
-public class PropertyDescriptorWrapper implements IPropertyDescriptor {
-
- private IPropertyDescriptor _inner;
-
- private IDOMElement _element;
-
- private IStatusLineManager _statusLineManager;
-
-// /**
-// * Constructor
-// * @param element
-// * @param innerDescriptor
-// * @param statusLineManager
-// *
-// */
-// public PropertyDescriptorWrapper(IDOMElement element,
-// IPropertyDescriptor innerDescriptor, IStatusLineManager statusLineManager) {
-// this._element = element;
-// this._inner = innerDescriptor;
-// this._statusLineManager = statusLineManager;
-// }
-
- /**
- * Constructor
- * @param element
- * @param innerDescriptor
- */
- public PropertyDescriptorWrapper(IDOMElement element,
- IPropertyDescriptor innerDescriptor) {
- this._element = element;
- this._inner = innerDescriptor;
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.views.properties.IPropertyDescriptor#createPropertyEditor(org.eclipse.swt.widgets.Composite)
- */
- public CellEditor createPropertyEditor(Composite parent) {
- EditorCreator.CellEditorHolder holder = new EditorCreator.CellEditorHolder() {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.meta.EditorCreator.CellEditorHolder#createCellEditor(org.eclipse.swt.widgets.Composite)
- */
- public CellEditor createCellEditor(Composite parent1) {
- CellEditor ed = null;
- if (_inner != null)
- ed = _inner.createPropertyEditor(parent1);
- else
- ed = new TextCellEditor(parent1);
-
- if (_statusLineManager != null)
- ed.addListener(new StatusBarUpdater(ed));
- return ed;
- }
- };
- return EditorCreator.getInstance().createCellEditorWithWrapper(parent,
- null, holder, _element, null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.views.properties.IPropertyDescriptor#getCategory()
- */
- public String getCategory() {
- String cat = _inner.getCategory();
- return cat != null ? cat : ITabbedPropertiesConstants.OTHER_CATEGORY;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.views.properties.IPropertyDescriptor#getDescription()
- */
- public String getDescription() {
- return _inner.getDescription();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.views.properties.IPropertyDescriptor#getDisplayName()
- */
- public String getDisplayName() {
- return _inner.getDisplayName();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.views.properties.IPropertyDescriptor#getFilterFlags()
- */
- public String[] getFilterFlags() {
- return _inner.getFilterFlags();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.views.properties.IPropertyDescriptor#getHelpContextIds()
- */
- public Object getHelpContextIds() {
- return _inner.getHelpContextIds();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.views.properties.IPropertyDescriptor#getId()
- */
- public Object getId() {
- return _inner.getId();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.views.properties.IPropertyDescriptor#getLabelProvider()
- */
- public ILabelProvider getLabelProvider() {
- return _inner.getLabelProvider();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.views.properties.IPropertyDescriptor#isCompatibleWith(org.eclipse.ui.views.properties.IPropertyDescriptor)
- */
- public boolean isCompatibleWith(IPropertyDescriptor anotherProperty) {
- if (anotherProperty instanceof PropertyDescriptorWrapper) {
- return _inner
- .isCompatibleWith(((PropertyDescriptorWrapper) anotherProperty)
- .getInner());
- }
- return _inner.isCompatibleWith(anotherProperty);
- }
-
- /**
- * @return IPropertyDescriptor
- */
- public IPropertyDescriptor getInner() {
- return _inner;
- }
-
- private class StatusBarUpdater implements ICellEditorListener {
- private CellEditor ed;
-
- StatusBarUpdater(CellEditor ed) {
- this.ed = ed;
- }
- public void applyEditorValue() {//
- }
- public void cancelEditor() {//
- }
-
- public void editorValueChanged(boolean oldValidState,
- boolean newValidState) {
- if (!newValidState)
- _statusLineManager.setErrorMessage(ed.getErrorMessage());
- else
- _statusLineManager.setErrorMessage(null);
-
- }
-
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/WPETabbedPropertySheetPage.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/WPETabbedPropertySheetPage.java
deleted file mode 100644
index 6883987..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/WPETabbedPropertySheetPage.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties;
-
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.editors.HTMLEditor;
-import org.eclipse.jst.pagedesigner.properties.internal.QuickEditTabManager;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.ISelectionListener;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.EditorPart;
-import org.eclipse.ui.part.IPageSite;
-import org.eclipse.ui.views.contentoutline.ContentOutline;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- */
-public class WPETabbedPropertySheetPage extends TabbedPropertySheetPage {
-
- // TODO: when we want to extend this page, HTMLEditor would not be the sole
- // type of editor part.
- private HTMLEditor _htmlEditor;
-
- private NavigationHiearchyAction _hiearchAction = new NavigationHiearchyAction(
- this);
-
- private QuickEditTabManager manager;
-
- private ISelectionListener _selListener;
-
- /**
- * Constructor
- * @param tabbedPropertySheetPageContributor
- * @param editor
- */
- public WPETabbedPropertySheetPage(
- ITabbedPropertySheetPageContributor tabbedPropertySheetPageContributor,
- HTMLEditor editor) {
- super(tabbedPropertySheetPageContributor);
- _htmlEditor = editor;
- }
-
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
- if (part == null) {
- part = _htmlEditor;
- }
- if (part instanceof HTMLEditor || part instanceof ContentOutline) {
- Node node = DesignerPropertyTool.normalizeSelectionToElement(part,
- selection, _htmlEditor);
- if (node != null) {
- try {
- _hiearchAction.refresh(node, node);
- this.getSite().getActionBars().getToolBarManager().update(
- true);
- //setInput(part, node);
- super.selectionChanged(part, new StructuredSelection(node));
- } catch (Exception e) {
- // Some synchronization would cause this, it does not damage
- // the data.
- }
- }
- }
- }
-
- /**
- * This method should be called from internal of the property page. Normally
- * means user did some action inside the property sheet to change current
- * selection.
- *
- * @param selectedNode
- * @param innerNode
- */
- public void internalChangeSelection(Node selectedNode, Node innerNode) {
- getEditor().setFocus();
- _hiearchAction.refresh(selectedNode, innerNode);
- this.getSite().getActionBars().getToolBarManager().update(true);
- super.selectionChanged(null, new StructuredSelection(selectedNode));
- }
-
- /**
- * @return EditorPart instance that this property sheet is for. Will return instance of WPE (htmlEditor)
- */
- public EditorPart getEditor() {
- return this._htmlEditor;
- }
-
- public void init(IPageSite pageSite) {
- super.init(pageSite);
- setSelectionProvider();
- setSelectionListener();
- IToolBarManager toolbar = pageSite.getActionBars().getToolBarManager();
- toolbar.add(_hiearchAction);
- _hiearchAction.refresh(null, null);
- }
-
- private void setSelectionListener() {
- this.getSite().getWorkbenchWindow().getSelectionService()
- .addPostSelectionListener(getSelectionListener());
- }
-
- private ISelectionListener getSelectionListener() {
- if (_selListener == null){
- _selListener = new ISelectionListener() {
- public void selectionChanged(IWorkbenchPart part,
- ISelection selection) {
- if (getEditor() == part)//only fire if the selection applies to this tabbed prop sheet instance
- WPETabbedPropertySheetPage.this.selectionChanged(
- part, selection);
- }
- };
- }
- return _selListener;
- }
-
- private void setSelectionProvider() {
- this.getSite().setSelectionProvider(new ISelectionProvider() {
- private ISelection _selection;
-
- public void addSelectionChangedListener(
- ISelectionChangedListener listener) {
- // do nothing
- }
-
- /**
- * Returns the current selection for this provider.
- *
- * @return the current selection
- */
- public ISelection getSelection() {
- return _selection;
- }
-
- /**
- * Removes the given selection change listener from this selection
- * provider. Has no affect if an identical listener is not
- * registered.
- *
- * @param listener
- * a selection changed listener
- */
- public void removeSelectionChangedListener(
- ISelectionChangedListener listener) {
- // do nothing
- }
-
- /**
- * Sets the current selection for this selection provider.
- *
- * @param selection
- * the new selection
- */
- public void setSelection(ISelection selection) {
- _selection = selection;
- }
- });
-
- }
-
- public void createControl(Composite parent) {
- super.createControl(parent);
- PlatformUI
- .getWorkbench()
- .getHelpSystem()
- .setHelp(
- getControl(),
- PDPlugin
- .getResourceString("WPETabbedPropertySheetPage.help.id")); //$NON-NLS-1$
- }
-
- /**
- * @return acquires an instance of QuickEditTabManager
- */
- public QuickEditTabManager getTabManager() {
- if (manager == null) {
- manager = QuickEditTabManager.acquireInstance(this);
- }
- return manager;
- }
-
- @Override
- public void dispose() {
- this.getSite().getWorkbenchWindow().getSelectionService().removePostSelectionListener(getSelectionListener());
- this.getSite().setSelectionProvider(null);
- manager.releaseInstance();
- manager.dispose();
- manager = null;
- _selListener = null;
- _htmlEditor = null;
- super.dispose();
- }
-
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/attrgroup/AttributeGroupMessages.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/attrgroup/AttributeGroupMessages.java
deleted file mode 100644
index 2daa303..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/attrgroup/AttributeGroupMessages.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties.attrgroup;
-
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class AttributeGroupMessages {
- private static final String BUNDLE_NAME = "org.eclipse.jst.pagedesigner.properties.attrgroup.messages"; //$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
- .getBundle(BUNDLE_NAME);
-
- private AttributeGroupMessages() {
- // no external instantiation
- }
-
- /**
- * @param key
- * @return the value for key or !!key!! if not found
- */
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-
- /**
- * Build a formated string from the resource bundle.
- *
- * @param key
- * the key into the resource bundle that has the formated string.
- * @param arg0
- * the first argument.
- * @return the formated string with the argument inline.
- */
- public static String getString(String key, Object arg0) {
- Object[] args = new Object[1];
- args[0] = arg0;
-
- MessageFormat formatter = new MessageFormat(getString(key));
- return formatter.format(args);
- }
-
- /**
- * Build a formated string from the resource bundle.
- *
- * @param key
- * the key into the resource bundle that has the formated string.
- * @param arg0
- * the first argument.
- * @param arg1
- * the second argument.
- * @return the formated string with the argument inline.
- */
- public static String getString(String key, Object arg0, Object arg1) {
- Object[] args = new Object[2];
- args[0] = arg0;
- args[1] = arg1;
-
- MessageFormat formatter = new MessageFormat(getString(key));
- return formatter.format(args);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/attrgroup/DialogUtil.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/attrgroup/DialogUtil.java
deleted file mode 100644
index 8288c89..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/attrgroup/DialogUtil.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties.attrgroup;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogField;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogFieldGroupPage;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.ISupportTextValue;
-import org.eclipse.jst.jsf.common.ui.internal.dialogs.CommonWizardDialog;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.commands.single.AddSubNodeCommand;
-import org.eclipse.jst.pagedesigner.editors.properties.IPropertyPageDescriptor;
-import org.eclipse.jst.pagedesigner.properties.internal.AttributeGroup;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class DialogUtil {
- /**
- * Utility method, this method will popup a dialog for user to input
- * attributes for initialize a sub element. In this method will create a
- * command and execute it.
- *
- * @param shell
- * parent shell for dialog
- * @param parent
- * the parent element
- * @param group
- * the AttributeGroup
- * @return true if success, false if user canceled.
- */
- public static boolean createSubElement(Shell shell,
- final IDOMElement parent, final AttributeGroup group) {
- group.setElementContext(parent, parent);//2ndParam seems to need to be parent most of the time... don't know why it WAS null... changed 12/19/07
-
- if (group.getDialogFields().length == 0){
- //don't show dialog
- createSubNode(group, parent, Collections.EMPTY_MAP);
- return true;
- }
-
- final DialogFieldGroupPage page = new DialogFieldGroupPage("", group); //$NON-NLS-1$
- page.setTitle(AttributeGroupMessages.getString(
- "DialogUtil.createTitle", group.getTagName())); //$NON-NLS-1$
- page
- .setDescription(AttributeGroupMessages
- .getString(
- "DialogUtil.createDescription", group.getTagName(), parent.getTagName())); //$NON-NLS-1$
-
- Wizard wizard = new Wizard() {
- public void addPages() {
- super.addPage(page);
- }
-
- public boolean performFinish() {
- DialogField[] fields = group.getDialogFields();
- Map map = new HashMap();
- for (int i = 0; i < fields.length; i++) {
- IPropertyPageDescriptor desc = group
- .getPropertyDescriptor(fields[i]);
- if (desc != null && fields[i] instanceof ISupportTextValue) {
- String value = ((ISupportTextValue) fields[i])
- .getText();
- if (value != null && value.length() > 0) {
- map.put(desc.getAttributeName(), value);
- }
- }
- }
- createSubNode(group, parent, map);
- return true;
- }
- };
- wizard.setWindowTitle(AttributeGroupMessages.getString(
- "DialogUtil.createTitle", group.getTagName())); //$NON-NLS-1$
- wizard.setDefaultPageImageDescriptor(PDPlugin.getDefault()
- .getImageDescriptor("newsuade_wiz.gif")); //$NON-NLS-1$
- CommonWizardDialog dialog = new CommonWizardDialog(shell, wizard);
-
- return dialog.open() == Window.OK;
- }
-
- private static void createSubNode(final AttributeGroup group, final IDOMElement parent, final Map mapOfAttributeValues) {
- AddSubNodeCommand addSubCommand = new AddSubNodeCommand(
- AttributeGroupMessages
- .getString(
- "DialogUtil.createCommandLabel", group.getTagName()), parent, group.getTagName(), group.getURI(), mapOfAttributeValues); //$NON-NLS-1$
- addSubCommand.execute();
-
- }
-
- /**
- * Utility method, this method will popup a dialog for user to input
- * attributes for initialize a sub element. In this method will create a
- * command and execute it.
- *
- * @param shell
- * parent shell for dialog
- * @param parent
- * parent element
- * @param uri
- * new ele's uri
- * @param tagName
- * new ele's tag name
- * @param attributes
- * an array of attribute names. The dialog will create a
- * dialogfield for each of them to allow user to input initial
- * value. If null, the system will try to use all attribute of
- * the element.
- * @return true if success, false if user canceled.
- */
- public static boolean createSubElement(Shell shell,
- final IDOMElement parent, final String uri, final String tagName,
- final String[] attributes) {
-
- final AttributeGroup group = new AttributeGroup(uri, tagName,
- attributes);
-
- return createSubElement(shell, parent, group);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/attrgroup/IElementContextable.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/attrgroup/IElementContextable.java
deleted file mode 100644
index bb90d80..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/attrgroup/IElementContextable.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties.attrgroup;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-
-/**
- * This is a special interface for those special dialog field that need context
- * information.
- *
- * @author mengbo
- * @version 1.5
- */
-public interface IElementContextable {
- /**
- *
- * @param ancester
- * an non null element, could be the element being edited, or an
- * ancester element when we are creating new element.
- * @param element
- * if not null, then is the element being edited, could be used
- * to retrive initial data.
- *
- */
- public void setElementContext(IDOMNode ancester, IDOMElement element);
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/attrgroup/OLDAttributeGroup.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/attrgroup/OLDAttributeGroup.java
deleted file mode 100644
index 8322e1f..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/attrgroup/OLDAttributeGroup.java
+++ /dev/null
@@ -1,359 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties.attrgroup;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogField;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogFieldGroup;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.IDialogFieldApplyListener;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.IDialogFieldChangeListener;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.ISupportTextValue;
-import org.eclipse.jst.pagedesigner.meta.AttributeDescriptor;
-import org.eclipse.jst.pagedesigner.meta.IAttributeDescriptor;
-import org.eclipse.jst.pagedesigner.meta.IElementDescriptor;
-import org.eclipse.jst.pagedesigner.meta.XXXEditorCreator;
-import org.eclipse.jst.pagedesigner.meta.internal.CMRegistry;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-
-/**
- * @author mengbo
- * @version 1.5
- *
- * TODO: no longer used????
- * @deprecated
- *
- */
-public class OLDAttributeGroup extends DialogFieldGroup {
- private static final Object KEY_ATTR = "KEY_ATTR"; //$NON-NLS-1$
-
- private String _uri;
-
- private String _tagName;
-
- private IAttributeDescriptor[] _attrs;
-
- private String _helpContextId;
-
- private List _dialogFields = null;
-
- private IDOMElement _ownerElement;
-
- /**
- * @param uri
- * @param tagName
- * @param attrNames
- */
- public OLDAttributeGroup(String uri, String tagName, String[] attrNames) {
- this._uri = uri;
- this._tagName = tagName;
- this._attrs = prepareAttributeDescriptors(uri, tagName, attrNames);
- }
-
- /**
- * @return the tag name
- */
- public String getTagName() {
- return this._tagName;
- }
-
- /**
- * @return the uri
- */
- public String getURI() {
- return this._uri;
- }
-
- /**
- * @param uri
- * @param tagName
- * @param attrNames
- */
- private IAttributeDescriptor[] prepareAttributeDescriptors(String uri,
- String tagName, String[] attrNames) {
- IAttributeDescriptor[] attrs;
- IElementDescriptor eleDesc = CMRegistry.getInstance()
- .getElementDescriptor(uri, tagName);
- if (eleDesc != null) {
- _helpContextId = eleDesc.getHelpContextID();
- if (attrNames == null) {
- attrs = eleDesc.getAttributeDescriptors();
- } else {
- attrs = new IAttributeDescriptor[attrNames.length];
- for (int i = 0; i < attrs.length; i++) {
- attrs[i] = eleDesc.getAttributeDescriptor(attrNames[i]);
- if (attrs[i] == null) {
- attrs[i] = new AttributeDescriptor(attrNames[i]);
- }
- }
- }
- } else {
- if (attrNames == null) {
- attrs = new IAttributeDescriptor[0];
- } else {
- attrs = new IAttributeDescriptor[attrNames.length];
- for (int i = 0; i < attrs.length; i++) {
- attrs[i] = new AttributeDescriptor(attrNames[i]);
- }
- }
- }
- return attrs;
- }
-
- /**
- * @param field
- * @return the descriptor
- */
- public IAttributeDescriptor getAttributeDescriptor(DialogField field) {
- Object obj = field.getAttachedData(KEY_ATTR);
- if (obj instanceof IAttributeDescriptor) {
- return (IAttributeDescriptor) obj;
- }
- return null;
- }
-
- /**
- * Child class could override this method to create customized dialogField.
- * Otherwise, system will use meta data to create default dailog field.
- *
- * @param uri
- * @param tag
- * @param attr
- * @return if null, system will create default dialog field.
- */
- protected DialogField createDialogField(String uri, String tag,
- IAttributeDescriptor attr) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogFieldGroup#initialize()
- */
- public void initialize() {
- if (_dialogFields == null) {
- _dialogFields = new ArrayList();
-
- IAttributeDescriptor[] descriptors = _attrs;
-
- for (int i = 0; i < descriptors.length; i++) {
- DialogField field;
- field = createDialogField(this._uri, this._tagName,
- descriptors[i]);
- if (field == null) {
- XXXEditorCreator creator = XXXEditorCreator.getInstance();
- field = creator.createDialogFieldWithWrapper(this._uri,
- this._tagName, descriptors[i], null);
- }
-
- field.putAttachedData(KEY_ATTR, descriptors[i]);
-
- IDialogFieldApplyListener applyListener = getDialogFieldApplyListener(
- this._uri, this._tagName, descriptors[i]);
- if (applyListener == null) {
- applyListener = getDefaultApplyListener();
- }
- field.setDialogFieldApplyListener(applyListener);
-
- IDialogFieldChangeListener changeListener = getDialogFieldChangeListener(
- this._uri, this._tagName, descriptors[i]);
- if (changeListener == null) {
- changeListener = getDefaultChangeListener();
- }
- field.setDialogFieldChangeListener(changeListener);
- _dialogFields.add(field);
- }
- }
- }
-
- /**
- * Child class can override the method to provide listener implementation
- *
- * @param uri
- * @param tag
- * @param attr
- * @return the listener
- */
- public IDialogFieldApplyListener getDialogFieldApplyListener(String uri,
- String tag, IAttributeDescriptor attr) {
- return null;
- }
-
- /**
- * Child class can override the method to provide listener implementation
- *
- * @param uri
- * @param tag
- * @param attr
- * @return the listener
- */
- public IDialogFieldChangeListener getDialogFieldChangeListener(String uri,
- String tag, IAttributeDescriptor attr) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogFieldGroup#refreshData()
- */
- public void refreshData() {
- if (_ownerElement == null) {
- return;
- }
- initialize();
- for (int i = 0, size = _dialogFields.size(); i < size; i++) {
- DialogField field = (DialogField) _dialogFields.get(i);
-
- ISupportTextValue textValue = (ISupportTextValue) field;
- IAttributeDescriptor attr = (IAttributeDescriptor) field
- .getAttachedData(KEY_ATTR);
- String attrName = attr.getAttributeName();
- String attrValue = _ownerElement.getAttribute(attrName);
- textValue.setTextWithoutUpdate(attrValue);
- }
- }
-
- /**
- * @return the element
- */
- public IDOMElement getElement() {
- return _ownerElement;
- }
-
- /**
- * @param context
- * @param owner
- */
- public void setElementContext(IDOMNode context, IDOMElement owner) {
- initialize();
- this._ownerElement = owner;
- if (context != null) {
- for (int i = 0, size = _dialogFields.size(); i < size; i++) {
- DialogField field = (DialogField) _dialogFields.get(i);
- if (field instanceof IElementContextable) {
- ((IElementContextable) field).setElementContext(context,
- owner);
- }
- }
- }
- refreshData();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogFieldGroup#layoutDialogFields(org.eclipse.ui.forms.widgets.FormToolkit,
- * org.eclipse.swt.widgets.Composite)
- */
- public void layoutDialogFields(FormToolkit toolkit, Composite parent) {
- Composite top;
- if (toolkit == null) {
- top = new Composite(parent, SWT.NONE);
- } else {
- top = toolkit.createComposite(parent);
- }
-// FillLayout fillLayout = new FillLayout(SWT.VERTICAL);
-// parent.setLayout(fillLayout);
-
- if (this._helpContextId != null && this._helpContextId.length() > 0) {
- PlatformUI.getWorkbench().getHelpSystem().setHelp(top,
- _helpContextId);
- }
-
- GridLayout layout = new GridLayout();
- int numColumns = getNumColumns();
- layout.numColumns = numColumns;
- top.setLayout(layout);
-
- initialize();
- for (int i = 0, size = _dialogFields.size(); i < size; i++) {
- DialogField field = (DialogField) _dialogFields.get(i);
- field.doFillIntoGrid(toolkit, top, numColumns);
- }
-
- DialogField maxColumnField = null;
- int maxColumn = 0;
- for (int i = 0, size = _dialogFields.size(); i < size; i++) {
- DialogField field = (DialogField) _dialogFields.get(i);
- int c = field.getNumberOfControls();
- if (c > maxColumn) {
- maxColumn = c;
- maxColumnField = field;
- }
- }
- if (maxColumnField != null) {
- maxColumnField.handleGrabHorizontal();
- }
- }
-
- /**
- * @return the number of columns
- */
- public int getNumColumns() {
- int columns = 1;
- initialize();
- for (int i = 0, size = _dialogFields.size(); i < size; i++) {
- DialogField field = (DialogField) _dialogFields.get(i);
- columns = Math.max(columns, field.getNumberOfControls());
- }
- return columns;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogFieldGroup#validateDialogFields()
- */
- public IStatus[] validateDialogFields() {
- return null;
- }
-
- /**
- * @return the dialog fields
- */
- public DialogField[] getDialogFields() {
- initialize();
- DialogField[] ret = new DialogField[_dialogFields.size()];
- _dialogFields.toArray(ret);
- return ret;
- }
-
- /**
- * get the dialogfield for the corresponding attribute.
- *
- * @param attrName
- * case sensitive attribute name.
- * @return null if fail to find.
- */
- public DialogField getDialogField(String attrName) {
- initialize();
- for (int i = 0, size = _dialogFields.size(); i < size; i++) {
- DialogField field = (DialogField) _dialogFields.get(i);
- IAttributeDescriptor attr = this.getAttributeDescriptor(field);
- if (attr != null && attr.getAttributeName().equals(attrName)) {
- return field;
- }
- }
- return null;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/attrgroup/OLDAttributeGroupSection.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/attrgroup/OLDAttributeGroupSection.java
deleted file mode 100644
index b41a1ed..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/attrgroup/OLDAttributeGroupSection.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties.attrgroup;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogField;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.IDialogFieldApplyListener;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.ISupportTextValue;
-import org.eclipse.jst.pagedesigner.commands.single.ChangeAttributeCommand;
-import org.eclipse.jst.pagedesigner.meta.IAttributeDescriptor;
-import org.eclipse.jst.pagedesigner.properties.BaseCustomSection;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-
-/**
- * This is a section for a list of attribute dialog fields.
- *
- * @author mengbo
- * @version 1.5
- * @deprecated
- *
- */
-public class OLDAttributeGroupSection extends BaseCustomSection {
- private static final Object KEY_ATTR = "KEY_ATTR"; //$NON-NLS-1$
-
- private IDialogFieldApplyListener _fieldApplyListener = new IDialogFieldApplyListener() {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.jsf.common.ui.internal.dialogfield.IDialogFieldApplyListener#dialogFieldApplied(org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogField)
- */
- public void dialogFieldApplied(DialogField field) {
- Object attr = field.getAttachedData(KEY_ATTR);
- if (attr instanceof IAttributeDescriptor && _element != null) {
- ISupportTextValue textValue = (ISupportTextValue) field;
- ChangeAttributeCommand c = new ChangeAttributeCommand(
- AttributeGroupMessages
- .getString("OLDAttributeGroupSection.changeAttribute"), _element, ((IAttributeDescriptor) attr).getAttributeName(), textValue.getText()); //$NON-NLS-1$
- c.execute();
- }
- }
- };
-
- /**
- * the attribute group
- */
- protected OLDAttributeGroup _group;
-
- /**
- * create the section with a default AttributeGroup. In default
- * AttributeGroup, there is no relationship between fields.
- *
- * @param uri
- * @param tagName
- * @param attrNames
- */
- public OLDAttributeGroupSection(String uri, String tagName, String[] attrNames) {
- this(new OLDAttributeGroup(uri, tagName, attrNames));
- }
-
- /**
- * In case the group is not a default group (e.g. you may add some
- * customized relationship between the fields).
- *
- * @param group
- */
- public OLDAttributeGroupSection(OLDAttributeGroup group) {
- _group = group;
- _group.setDefaultApplyListener(_fieldApplyListener);
- _group.initialize();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.AbstractPropertySection#setInput(org.eclipse.ui.IWorkbenchPart,
- * org.eclipse.jface.viewers.ISelection)
- */
- public void setInput(IWorkbenchPart part, ISelection selection) {
- super.setInput(part, selection);
- _group.setElementContext(_element, _element);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.integration.properties.section.AbstractCustomSection#createControls(org.eclipse.swt.widgets.Composite,
- * org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetPage)
- */
- public void createControls(Composite parent,
- TabbedPropertySheetPage aTabbedPropertySheetPage) {
- super.createControls(parent, aTabbedPropertySheetPage);
- TabbedPropertySheetWidgetFactory factory = aTabbedPropertySheetPage
- .getWidgetFactory();
- _group.layoutDialogFields(factory, parent);
- }
-
- protected void notifyChanged(INodeNotifier notifier, int eventType,
- Object changedFeature, Object oldValue, Object newValue, int pos) {
- if (_group != null) {
- _group.refreshData();
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/attrgroup/messages.properties b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/attrgroup/messages.properties
deleted file mode 100644
index dd21120..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/attrgroup/messages.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2007 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are 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:
-# Oracle Corporation - initial API and implementation
-###############################################################################
-DialogUtil.createTitle=Create {0}
-DialogUtil.createDescription=Create subelement "{0}" under "{1}"
-DialogUtil.createCommandLabel=Create {0}
-AttributeGroupSection.changeAttribute=Change Attribute
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/celleditors/CSSDialogCellEditor.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/celleditors/CSSDialogCellEditor.java
deleted file mode 100644
index b43bcc3..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/celleditors/CSSDialogCellEditor.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties.celleditors;
-
-import org.eclipse.jface.preference.PreferenceManager;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jst.jsf.core.internal.tld.IJSFConstants;
-import org.eclipse.jst.pagedesigner.commands.single.ChangeStyleCommand;
-import org.eclipse.jst.pagedesigner.ui.dialogs.StyleDialog;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclaration;
-import org.eclipse.wst.css.core.internal.util.declaration.CSSPropertyContext;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.w3c.dom.css.ElementCSSInlineStyle;
-
-/**
- * A css dialog cell editor
- *
- */
-public class CSSDialogCellEditor extends EditableDialogCellEditor {
- private IDOMElement _element;
-
- /**
- * @param parent
- * @param element
- */
- public CSSDialogCellEditor(Composite parent, IDOMElement element) {
- super(parent);
- _element = element;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.DialogCellEditor#openDialogBox(org.eclipse.swt.widgets.Control)
- */
- protected Object openDialogBox(Control cellEditorWindow) {
- ICSSStyleDeclaration styleDeclaration = (ICSSStyleDeclaration) ((ElementCSSInlineStyle) _element)
- .getStyle();
-
- PreferenceManager manager = new PreferenceManager();
- Shell shell = cellEditorWindow.getShell();
-
- final CSSPropertyContext context = new CSSPropertyContext(styleDeclaration);
- StyleDialog dialog = new StyleDialog(shell, manager, _element, context);
- if (dialog.open() == Window.OK) {
- if (context.isModified()) {
- PlatformUI.getWorkbench().getDisplay().asyncExec(
- new Runnable()
- {
- public void run()
- {
- ChangeStyleCommand c = new ChangeStyleCommand(_element, context);
- c.execute();
- }
- });
- }
- }
-
- String style = (_element == null ? null : _element
- .getAttribute(IJSFConstants.ATTR_STYLE));
- return style == null ? "" : style; //$NON-NLS-1$
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/celleditors/CellEditorFactory.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/celleditors/CellEditorFactory.java
deleted file mode 100644
index de79670..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/celleditors/CellEditorFactory.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.pagedesigner.properties.celleditors;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.internal.TraitValueHelper;
-import org.eclipse.jst.jsf.common.metadata.query.TaglibDomainMetaDataQueryHelper;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogField;
-import org.eclipse.jst.jsf.metadataprocessors.features.IDefaultValue;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.pagedesigner.editors.properties.IPropertyPageDescriptor;
-import org.eclipse.jst.pagedesigner.jsp.core.IJSPCoreConstants;
-import org.eclipse.jst.pagedesigner.meta.ITagAttributeCellEditorFactory;
-import org.eclipse.jst.pagedesigner.meta.IAttributeRuntimeValueType;
-import org.eclipse.jst.pagedesigner.properties.dialogfields.MDEnabledComboDialogField;
-import org.eclipse.jst.pagedesigner.ui.dialogfields.ClasspathResourceButtonDialogField;
-import org.eclipse.jst.pagedesigner.ui.dialogfields.ContextableResourceButtonDialogField;
-import org.eclipse.jst.pagedesigner.ui.dialogfields.StyleButtonDialogField;
-import org.eclipse.jst.pagedesigner.utils.StructuredModelUtil;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Element;
-
-/**
- *
- * @author mengbo
- */
-public class CellEditorFactory implements ITagAttributeCellEditorFactory {
- public CellEditor createCellEditor(Composite parent,
- IPropertyPageDescriptor attr, Element element) {
-
- String type = attr.getValueType();
-
- IPossibleValues pvs = (IPossibleValues)attr.getAdapter(IPossibleValues.class);
- IDefaultValue defaultValue = (IDefaultValue)attr.getAdapter(IDefaultValue.class);
-// ICellEditorValidator validator = (ICellEditorValidator)attr.getAdapter(ICellEditorValidator.class);
- CellEditor ed = null;
- if (IAttributeRuntimeValueType.RELATIVEPATH.equalsIgnoreCase(type)|| IAttributeRuntimeValueType.WEBPATH.equalsIgnoreCase(type)) {
- IProject project = getProject(element);
- if (project != null) {
-// String typeParam = TraitValueHelper.getValueAsString(TaglibDomainMetaDataQueryHelper.getTrait(attr.getMetaDataContext().getEntity(),"type-param"));
- ResourceDialogCellEditor cellEditor = new ResourceDialogCellEditor(
- parent);
- Trait fileExt = TaglibDomainMetaDataQueryHelper.getTrait(attr.getMetaDataContext().getEntity(), "file-extensions"); //$NON-NLS-1$
- Trait separator = TaglibDomainMetaDataQueryHelper.getTrait(attr.getMetaDataContext().getEntity(), "separator"); //$NON-NLS-1$
- String[] fileExts = null;
- if (fileExt != null){
- List exts = TraitValueHelper.getValueAsListOfStrings(fileExt);
- fileExts = (String[])exts.toArray(new String[exts.size()]);
- }
-
- String sep = null;
- if (separator != null)
- sep = TraitValueHelper.getValueAsString(separator);
-
- if (fileExts != null)
- cellEditor.setSuffixs(fileExts);
- if (sep != null)
- cellEditor.setSeparator(sep);
-
- cellEditor.setProject(project);
- cellEditor.setReferredFile(getFile(element));
-
- if (IAttributeRuntimeValueType.WEBPATH.equalsIgnoreCase(type)) {
- cellEditor.setWebPath(true);
- }
-
- if (IJSPCoreConstants.TAG_DIRECTIVE_INCLUDE.equals(element
- .getLocalName())
- || IJSPCoreConstants.TAG_INCLUDE.equals(element
- .getLocalName())) {
- cellEditor.setTransformJSPURL(false);
- }
- ed = cellEditor;
- }
- }
- else if (IAttributeRuntimeValueType.RESOURCEBUNDLE.equals(type)) {
- ed = new LoadbundleSelectionCellEditor(parent,
- getProject(element));
- }
- else if (IAttributeRuntimeValueType.CSSSTYLE.equalsIgnoreCase(type)) {
-// String param = getParamterValue(attr, "style");
-//// .getParameterByName(IAttributeDescriptor.PARAMETER_STYLE);
-// if (!param.equalsIgnoreCase("STYLE")) {
-// return null;
-// }
- CSSDialogCellEditor cellEditor = new CSSDialogCellEditor(parent,
- (IDOMElement) element);
- ed = cellEditor;
- }
- else if (pvs != null && pvs.getPossibleValues().size() > 0) {
-// if (validator != null)
-// ed = LabeledStyleComboCellEditor.newInstance(parent, pvs,
-// defaultValue, SWT.DROP_DOWN | SWT.READ_ONLY);
-// else
- ed = LabeledStyleComboCellEditor.newInstance(parent, pvs,
- defaultValue, SWT.NONE);
-
- }
-
-// } else if (IAttributeRuntimeValueType.CSSID.equalsIgnoreCase(type)) {
-// // TODO: missing case?
-
- else {
- ed = new TextCellEditor(parent);
- }
-// if (validator != null){
-// ed.setValidator(validator);
-// }
-
- return ed;
- }
-
-
-// private String getParamterValue(IPropertyPageDescriptor attr, String traitKey) {
-// Trait trait = TaglibDomainMetaDataQueryHelper.getTrait(attr.getMetaDataContext().getEntity(), traitKey);
-// if (trait != null){
-// return TraitValueHelper.getValueAsString(trait);
-// }
-// return null;
-// }
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.meta.NEWMDIAttributeCellEditorFactory#createDialogField(org.eclipse.jst.pagedesigner.meta.IAttributeDescriptor,
- * org.w3c.dom.Element, org.w3c.dom.Element)
- */
- public DialogField createDialogField(IPropertyPageDescriptor attr) {
-
- String type = attr.getValueType();
-
- IPossibleValues pvs = (IPossibleValues)attr.getAdapter(IPossibleValues.class);
-// IDefaultValue defaultValue = (IDefaultValue)attr.getAdapter(IDefaultValue.class);
-// ICellEditorValidator validator = (ICellEditorValidator)attr.getAdapter(ICellEditorValidator.class);
-
-
-
- if (IAttributeRuntimeValueType.RELATIVEPATH.equals(type) ||
- IAttributeRuntimeValueType.WEBPATH.equals(type)) {
- Trait fileExt = TaglibDomainMetaDataQueryHelper.getTrait(attr.getMetaDataContext().getEntity(), "file-extensions"); //$NON-NLS-1$
- Trait seperator = TaglibDomainMetaDataQueryHelper.getTrait(attr.getMetaDataContext().getEntity(), "separator"); //$NON-NLS-1$
-
- String[] fileExts = null;
- if (fileExt != null){
- List exts = TraitValueHelper.getValueAsListOfStrings(fileExt);
- fileExts = (String[])exts.toArray(new String[exts.size()]);
- }
-
- String sep = null;
- if (seperator != null)
- sep = TraitValueHelper.getValueAsString(seperator);
-
- ContextableResourceButtonDialogField field = new ContextableResourceButtonDialogField();
- field.setLabelText(attr.getLabel());
- if (fileExts != null) {
- field.setSuffixs(fileExts);
- }
-
- if (sep != null) {
- field.setSeparator(sep);
- }
-
- if ("".equalsIgnoreCase(field.getSeparator())) { //$NON-NLS-1$
- field.setResourceDescription(ResourceBoundle
- .getString("FileCellEditor.Msg")); //$NON-NLS-1$
- } else {
- field.setResourceDescription(ResourceBoundle
- .getString("FileCellEditor.Msg1")); //$NON-NLS-1$
- }
- field.setWebPath(IAttributeRuntimeValueType.WEBPATH.equals(type));
- field.setRequired(attr.isRequired());
- field.setToolTip(attr.getDescription());
- return field;
-
- } else if (IAttributeRuntimeValueType.CLASSPATH_RESOURCE.equals(type) ||
- IAttributeRuntimeValueType.RESOURCEBUNDLE.equals(type)) {
- ClasspathResourceButtonDialogField field = new ClasspathResourceButtonDialogField();
- field.setRequired(attr.isRequired());
- field.setToolTip(attr.getDescription());
- field.setLabelText(attr.getLabel());
- return field;
- } else if (IAttributeRuntimeValueType.CSSSTYLE.equalsIgnoreCase(type)) {
-// String param = getParamterValue(attr, "style");
-// if (!"STYLE".equalsIgnoreCase(param)) {
-// return null;
-// }
- StyleButtonDialogField field = new StyleButtonDialogField();
- field.setRequired(attr.isRequired());
- field.setToolTip(attr.getDescription());
- field.setLabelText(attr.getLabel());
- return field;
-
-// // if there is no type or type unknown, then we just return null. and
-// // system will
-// // create default (text cell editor).
- } else if (pvs != null && pvs.getPossibleValues().size() > 0) {
- MDEnabledComboDialogField field = new MDEnabledComboDialogField(SWT.None);
- field.setLabelText(attr.getLabel());
- field.setToolTip(attr.getDescription());
- field.setRequired(attr.isRequired());
- return field;
- }
- return null;
- }
-
- private IProject getProject(Element element) {
- if (element instanceof IDOMElement) {
- IDOMModel model = ((IDOMElement) element).getModel();
- IFile file = StructuredModelUtil.getFileFor(model);
- if (file != null) {
- return file.getProject();
- }
- }
- return null;
- }
-
- public String[] getSupportedValueTypes() {
- return null;//default - all!
- }
-
- private IFile getFile(Element element) {
- if (element instanceof IDOMElement) {
- IDOMModel model = ((IDOMElement) element).getModel();
- IFile file = StructuredModelUtil.getFileFor(model);
- return file;
- }
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/celleditors/CellEditorWrapper.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/celleditors/CellEditorWrapper.java
deleted file mode 100644
index 011ff99..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/celleditors/CellEditorWrapper.java
+++ /dev/null
@@ -1,359 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties.celleditors;
-
-import java.text.MessageFormat;
-
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ICellEditorListener;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-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.Layout;
-import org.eclipse.swt.widgets.Listener;
-
-/**
- * CellEditorWrapper is a special cell editor, that wraps an existing cell
- * editor by adding a small clickable button to end of it.
- *
- * Due to limitation of the CellEditor framework, this wrapping technology may
- * resulting in some small inconvenience when change focus from the "wrapped"
- * cell editor to the "added" button.
- *
- * This is an abstract class. Child class need override some methods.
- *
- * @author mengbo
- */
-public abstract class CellEditorWrapper extends CellEditor {
- /**
- * The editor control.
- */
- private Composite _editor;
-
- /**
- * the wrapped cell editor
- */
- private CellEditor _wrapped;
-
- /**
- * The button.
- */
- private Button _button;
-
- /**
- * Internal class for laying out the dialog.
- */
- private class DialogCellLayout extends Layout {
- public void layout(Composite editor, boolean force) {
- Rectangle bounds = editor.getClientArea();
- Point size = _button.computeSize(SWT.DEFAULT, SWT.DEFAULT, force);
- // if (_wrapped != null)
- _wrapped.getControl().setBounds(0, 0, bounds.width - size.x,
- bounds.height);
- _button.setBounds(bounds.width - size.x, 0, size.x, bounds.height);
- }
-
- public Point computeSize(Composite editor, int wHint, int hHint,
- boolean force) {
- if (wHint != SWT.DEFAULT && hHint != SWT.DEFAULT)
- return new Point(wHint, hHint);
- Point contentsSize = _wrapped.getControl().computeSize(SWT.DEFAULT,
- SWT.DEFAULT, force);
- Point buttonSize = _button.computeSize(SWT.DEFAULT, SWT.DEFAULT,
- force);
- // Just return the button width to ensure the button is not clipped
- // if the label is long.
- // The label will just use whatever extra width there is
- Point result = new Point(buttonSize.x, Math.max(contentsSize.y,
- buttonSize.y));
- return result;
- }
- }
-
- /**
- * Default DialogCellEditor style
- */
- private static final int defaultStyle = SWT.NONE;
-
- /**
- * Creates a new dialog cell editor with no control
- *
- * @since 2.1
- */
- public CellEditorWrapper() {
- setStyle(defaultStyle);
- }
-
- /**
- * Creates a new dialog cell editor parented under the given control. The
- * cell editor value is <code>null</code> initially, and has no validator.
- *
- * @param parent
- * the parent control
- */
- protected CellEditorWrapper(Composite parent) {
- this(parent, defaultStyle);
- }
-
- /**
- * Creates a new dialog cell editor parented under the given control. The
- * cell editor value is <code>null</code> initially, and has no validator.
- *
- * @param parent
- * the parent control
- * @param style
- * the style bits
- * @since 2.1
- */
- protected CellEditorWrapper(Composite parent, int style) {
- super(parent, style);
- }
-
- /**
- * Creates the button for this cell editor under the given parent control.
- * <p>
- * The default implementation of this framework method creates the button
- * display on the right hand side of the dialog cell editor. Subclasses may
- * extend or reimplement.
- * </p>
- *
- * @param parent
- * the parent control
- * @return the new button control
- */
- protected Button createButton(Composite parent) {
- Button result = new Button(parent, SWT.DOWN);
- result.setImage(getBindingImage());
- // result.setText("..."); //$NON-NLS-1$
- return result;
- }
-
- /**
- * Since createButton is called from constructor, so we could only let child
- * class override this method to provide image. Rather than setting as
- * property.
- *
- * @return image
- */
- protected abstract Image getBindingImage();
-
- /**
- * Creates the controls used to show the value of this cell editor.
- * <p>
- * The default implementation of this framework method creates a label
- * widget, using the same font and background color as the parent control.
- * </p>
- * <p>
- * Subclasses may re-implement. If you re-implement this method, you should
- * also re-implement <code>updateContents</code>.
- * </p>
- *
- * @param cell
- * the control for this cell editor
- * @return control
- */
- protected Control createContents(Composite cell) {
- _wrapped = createWrappedCellEditor(cell);
- if (_wrapped == null) {
- _wrapped = new TextCellEditor(cell);
- }
- _wrapped.addListener(new ICellEditorListener() {
- public void applyEditorValue() {
- fireApplyEditorValue();
- }
-
- public void cancelEditor() {
- fireCancelEditor();
- }
-
- public void editorValueChanged(boolean oldValidState,
- boolean newValidState) {
- fireEditorValueChanged(oldValidState, newValidState);
- }
- });
- _wrapped.addPropertyChangeListener(new IPropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent event) {
- // FIXME:
- }
- });
-
- _wrapped.getControl().setVisible(true);
- _wrapped.getControl().addListener(SWT.Hide, new Listener() {
- public void handleEvent(Event event) {
- Display.getCurrent().asyncExec(new Runnable() {
- public void run() {
- if (_wrapped != null && _wrapped.getControl() != null
- && !_wrapped.getControl().isDisposed()) {
- _wrapped.getControl().setVisible(true);
- } else {
- deactivate();
- }
- }
- });
-
- }
- });
- return _wrapped.getControl();
- }
-
- /**
- * @param cell
- * @return CellEditor
- */
- protected abstract CellEditor createWrappedCellEditor(Composite cell);
-
- /*
- * (non-Javadoc) Method declared on CellEditor.
- */
- protected Control createControl(Composite parent) {
- Font font = parent.getFont();
- Color bg = parent.getBackground();
-
- _editor = new Composite(parent, getStyle());
- _editor.setFont(font);
- _editor.setBackground(bg);
- _editor.setLayout(new DialogCellLayout());
-
- createContents(_editor);
- // updateContents(value);
-
- _button = createButton(_editor);
- _button.setFont(font);
-
- _button.addKeyListener(new KeyAdapter() {
- public void keyReleased(KeyEvent e) {
- if (e.character == '\u001b') { // Escape
- fireCancelEditor();
- }
- }
- });
-
- _button.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- Object newValue = openDialogBox(_editor);
- if (newValue != null) {
- boolean newValidState = isCorrect(newValue);
- if (newValidState) {
- markDirty();
- doSetValue(newValue);
- } else {
- // try to insert the current value into the error
- // message.
- setErrorMessage(MessageFormat.format(getErrorMessage(),
- new Object[] { newValue.toString() }));
- }
- fireApplyEditorValue();
- }
- }
- });
-
- setValueValid(true);
-
- return _editor;
- }
-
- /*
- * (non-Javadoc) Method declared on CellEditor. The focus is set to the cell
- * editor's button.
- */
- protected void doSetFocus() {
- if (_wrapped != null && _wrapped.getControl() != null
- && !_wrapped.getControl().isDisposed()) {
- _wrapped.setFocus();
- } else {
- _button.setFocus();
- }
- }
-
- /*
- * (non-Javadoc) Method declared on CellEditor.
- */
- protected Object doGetValue() {
- return _wrapped.getValue();
- }
-
- /*
- * (non-Javadoc) Method declared on CellEditor.
- */
- protected void doSetValue(Object value) {
- if (_wrapped != null) {
- _wrapped.setValue(value);
- }
- }
-
- /**
- * Opens a dialog box under the given parent control and returns the
- * dialog's value when it closes, or <code>null</code> if the dialog was
- * cancelled or no selection was made in the dialog.
- * <p>
- * This framework method must be implemented by concrete subclasses. It is
- * called when the user has pressed the button and the dialog box must pop
- * up.
- * </p>
- *
- * @param cellEditorWindow
- * the parent control cell editor's window so that a subclass can
- * adjust the dialog box accordingly
- * @return the selected value, or <code>null</code> if the dialog was
- * cancelled or no selection was made in the dialog
- */
- protected abstract Object openDialogBox(Control cellEditorWindow);
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.CellEditor#activate()
- */
- public void activate() {
- super.activate();
- _wrapped.activate();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.CellEditor#deactivate()
- */
- public void deactivate() {
- super.deactivate();
- // if (_wrapped != null)
- // {
- // _wrapped.deactivate();
- // }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.CellEditor#dispose()
- */
- public void dispose() {
- _wrapped.dispose();
- super.dispose();
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/celleditors/EditableDialogCellEditor.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/celleditors/EditableDialogCellEditor.java
deleted file mode 100644
index 9a9c385..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/celleditors/EditableDialogCellEditor.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties.celleditors;
-
-import java.text.MessageFormat;
-
-import org.eclipse.jface.viewers.DialogCellEditor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.FocusAdapter;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * @author mengbo
- */
-public abstract class EditableDialogCellEditor extends DialogCellEditor {
- private Text _text;
-
- /**
- *
- */
- public EditableDialogCellEditor() {
- super();
- }
-
- /**
- * @param parent
- */
- public EditableDialogCellEditor(Composite parent) {
- super(parent);
- }
-
- /**
- * @param parent
- * @param style
- */
- public EditableDialogCellEditor(Composite parent, int style) {
- super(parent, style);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.DialogCellEditor#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite cell) {
- _text = new Text(cell, SWT.LEFT);
- _text.setFont(cell.getFont());
- _text.setBackground(cell.getBackground());
- _text.addKeyListener(new KeyAdapter() {
- // hook key pressed - see PR 14201
- public void keyPressed(KeyEvent e) {
- keyReleaseOccured(e);
- // disposed this cell editor
- if ((getControl() == null) || getControl().isDisposed()) {
- return;
- }
- }
- });
- // when the text control has focus, the cellEditor will deactive even
- // when you press the button.
- // Add the follow codes enable switch to the button control.
- _text.addFocusListener(new FocusAdapter() {
- public void focusLost(FocusEvent e) {
- boolean newValidState = isCorrect(_text.getText());
- if (newValidState) {
- markDirty();
- doSetValue(_text.getText());
- } else {
- // try to insert the current value into the error message.
- setErrorMessage(MessageFormat.format(getErrorMessage(),
- new Object[] { _text.getText().toString() }));
- }
- }
- });
-
- return _text;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.CellEditor#doSetFocus()
- */
- protected void doSetFocus() {
- _text.setFocus();
- _text.selectAll();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.DialogCellEditor#updateContents(java.lang.Object)
- */
- protected void updateContents(Object value) {
- if (_text == null || _text.isDisposed()) {
- return;
- }
-
- String text = "";//$NON-NLS-1$
- if (value != null) {
- text = value.toString();
- }
- _text.setText(text);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.CellEditor#keyReleaseOccured(org.eclipse.swt.events.KeyEvent)
- */
- protected void keyReleaseOccured(KeyEvent keyEvent) {
- if (keyEvent.character == '\r') {
- boolean newValidState = isCorrect(_text.getText());
- if (newValidState) {
- markDirty();
- doSetValue(_text.getText());
- } else {
- // try to insert the current value into the error message.
- setErrorMessage(MessageFormat.format(getErrorMessage(),
- new Object[] { _text.getText().toString() }));
- }
- fireApplyEditorValue();
- }
- super.keyReleaseOccured(keyEvent);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/celleditors/LabeledComboBoxCellEditor.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/celleditors/LabeledComboBoxCellEditor.java
deleted file mode 100644
index efd1df0..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/celleditors/LabeledComboBoxCellEditor.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties.celleditors;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.jface.viewers.ComboBoxCellEditor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.sse.ui.internal.Logger;
-
-/**
- * A simple ComboBoxCellEditor, which allow value and display string to be
- * different.
- *
- * @author mengbo
- */
-public class LabeledComboBoxCellEditor extends ComboBoxCellEditor {
- private boolean _fSettingValue = false;
-
- private Object[] _values;
-
- /**
- * Create LabeledComboBoxCellEditor
- * @param parent
- * @param valueLabelMap
- * @param style
- * @return LabeledComboBoxCellEditor
- */
- public static LabeledComboBoxCellEditor newInstance(Composite parent,
- Map valueLabelMap, int style) {
- // we'll sort according to label. since that is what being show to user.
- List list = new ArrayList();
- for (Iterator iter = valueLabelMap.keySet().iterator(); iter.hasNext();) {
- Object key = iter.next();
- String label = (String) valueLabelMap.get(key);
- list.add(new Object[] { key, label });
- }
- // sort by label
- Collections.sort(list, new Comparator() {
- public int compare(Object o1, Object o2) {
- String label1 = (String) ((Object[]) o1)[1];
- String label2 = (String) ((Object[]) o2)[1];
- return label1.compareTo(label2);
- }
- });
- Object[] values = new Object[list.size()];
- String[] labels = new String[list.size()];
- for (int i = 0, n = list.size(); i < n; i++) {
- values[i] = ((Object[]) list.get(i))[0];
- labels[i] = (String) ((Object[]) list.get(i))[1];
- }
- return new LabeledComboBoxCellEditor(parent, values, labels, style);
- }
-
- /**
- * Constructor
- *
- * @param parent
- * @param values
- * @param labels
- */
- public LabeledComboBoxCellEditor(Composite parent, Object[] values,
- String[] labels) {
- this(parent, values, labels, SWT.NONE);
- }
-
- /**
- * Constructor
- *
- * @param parent
- * @param values
- * @param labels
- * @param style
- */
- public LabeledComboBoxCellEditor(Composite parent, Object[] values,
- String[] labels, int style) {
- super(parent, labels, style);
- _values = values;
- }
-
- protected Object doGetValue() {
- // otherwise limits to set of valid values
- Object index = super.doGetValue();
- int selection = -1;
- if (index instanceof Integer) {
- selection = ((Integer) index).intValue();
- }
- if (selection >= 0) {
- return _values[selection];
- } else if (getControl() instanceof CCombo) {
- // retrieve the actual text as the list of valid items doesn't
- // contain the value
- return ((CCombo) getControl()).getText();
- }
- return null;
- }
-
- protected void doSetValue(Object value) {
- if (_fSettingValue) {
- return;
- }
- _fSettingValue = true;
- if (value instanceof Integer) {
- super.doSetValue(value);
- } else {
- String stringValue = value.toString();
- int selection = -1;
- for (int i = 0; i < _values.length; i++) {
- if (_values[i].equals(stringValue)) {
- selection = i;
- }
- }
- if (selection >= 0) {
- super.doSetValue(new Integer(selection));
- } else {
- super.doSetValue(new Integer(-1));
- if (getControl() instanceof CCombo
- && !stringValue.equals(((CCombo) getControl())
- .getText())) {
- // update the Text widget
- ((CCombo) getControl()).setText(stringValue);
- }
- }
- }
- _fSettingValue = false;
- }
-
- public void setItems(String[] newItems) {
- if (getControl() == null || getControl().isDisposed()) {
- Logger.log(Logger.ERROR,
- "Attempted to update item list for disposed cell editor"); //$NON-NLS-1$
- return;
- }
-
- // keep selection if possible
- Object previousSelectedValue = getValue();
- super.setItems(newItems);
- if (previousSelectedValue != null && getControl() instanceof CCombo) {
- for (int i = 0; i < newItems.length; i++) {
- if (newItems[i].equals(previousSelectedValue)) {
- setValue(previousSelectedValue);
- }
- }
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/celleditors/LabeledStyleComboCellEditor.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/celleditors/LabeledStyleComboCellEditor.java
deleted file mode 100644
index e8a47d5..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/celleditors/LabeledStyleComboCellEditor.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties.celleditors;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jst.jsf.common.ui.internal.utils.StyleCombo;
-import org.eclipse.jst.jsf.metadataprocessors.features.IDefaultValue;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValue;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.sse.ui.internal.Logger;
-
-/**
- * A combo cell editor
- *
- */
-public class LabeledStyleComboCellEditor extends StyleComboCellEditor {
- private boolean _fSettingValue = false;
-
- private Object[] _values;
-
- /**
- * @param parent
- * @param valueLabelMap
- * @param defaultValue
- * @param style
- * @return the new instance
- */
- public static LabeledStyleComboCellEditor newInstance(Composite parent,
- Map valueLabelMap, String defaultValue, int style) {
- // we'll sort according to label. since that is what being show to user.
- List list = new ArrayList();
- for (Iterator iter = valueLabelMap.keySet().iterator(); iter.hasNext();) {
- Object key = iter.next();
- String label = (String) valueLabelMap.get(key);
- list.add(new Object[] { key, label });
- }
- // sort by label
- Collections.sort(list, new Comparator() {
- public int compare(Object o1, Object o2) {
- String label1 = (String) ((Object[]) o1)[1];
- String label2 = (String) ((Object[]) o2)[1];
- return label1.compareTo(label2);
- }
- });
- Object[] values = new Object[list.size()];
- String[] labels = new String[list.size()];
- for (int i = 0, n = list.size(); i < n; i++) {
- values[i] = ((Object[]) list.get(i))[0];
- labels[i] = (String) ((Object[]) list.get(i))[1];
- }
- return new LabeledStyleComboCellEditor(parent, values, labels,
- defaultValue, style);
- }
-
- /**
- * Constructor
- *
- * @param parent
- * @param values
- * @param labels
- * @param defaultValue
- * @param style
- */
- public LabeledStyleComboCellEditor(Composite parent, Object[] values,
- String[] labels, String defaultValue, int style) {
- super(parent, labels, style);
- StyleCombo combo = (StyleCombo) getControl();
- if (defaultValue != null)
- combo.setDefaultValue(defaultValue);
- _values = values;
- }
-
- protected Object doGetValue() {
- // otherwise limits to set of valid values
- Object index = super.doGetValue();
- int selection1 = -1;
- if (index instanceof Integer) {
- selection1 = ((Integer) index).intValue();
- }
- if (selection1 >= 0) {
- return _values[selection1];
- } else if (getControl() instanceof StyleCombo) {
- // retrieve the actual text as the list of valid items doesn't
- // contain the value
- return ((StyleCombo) getControl()).getText();
- }
- return null;
- }
-
- protected void doSetValue(Object value) {
- if (_fSettingValue) {
- return;
- }
- _fSettingValue = true;
- if (value instanceof Integer) {
- super.doSetValue(value);
- } else {
- String stringValue = value.toString();
- int selection1 = -1;
- for (int i = 0; i < _values.length; i++) {
- if (_values[i].equals(stringValue)) {
- selection1 = i;
- }
- }
- if (selection1 >= 0) {
- super.doSetValue(new Integer(selection1));
- } else {
- super.doSetValue(new Integer(-1));
- if (getControl() instanceof StyleCombo
- && !stringValue.equals(((StyleCombo) getControl())
- .getText())) {
- // update the Text widget
- ((StyleCombo) getControl()).setText(stringValue);
- }
- }
- }
- _fSettingValue = false;
- }
-
- public void setItems(String[] newItems) {
- if (getControl() == null || getControl().isDisposed()) {
- Logger.log(Logger.ERROR,
- "Attempted to update item list for disposed cell editor"); //$NON-NLS-1$
- return;
- }
-
- // keep selection if possible
- Object previousSelectedValue = getValue();
- super.setItems(newItems);
- if (previousSelectedValue != null && getControl() instanceof StyleCombo) {
- for (int i = 0; i < newItems.length; i++) {
- if (newItems[i].equals(previousSelectedValue)) {
- setValue(previousSelectedValue);
- }
- }
- }
- }
-
- /**
- * Create CellEditor
- * @param parent
- * @param pvs
- * @param defaultValue
- * @param style
- * @return CellEditor
- */
- public static CellEditor newInstance(Composite parent, IPossibleValues pvs,
- IDefaultValue defaultValue, int style) {
-
- CellEditor ed = null;
- if (pvs != null) {
- Map map = getPossibleValueMap(pvs);
- ed = newInstance(parent, map, defaultValue != null ? defaultValue.getDefaultValue() : null, style);
- }
-
- return ed;
- }
-
- private static Map getPossibleValueMap(IPossibleValues pvs) {
- Map<String, String> map = new HashMap<String, String>(pvs.getPossibleValues().size());
- for (Iterator it = pvs.getPossibleValues().iterator();it.hasNext();){
- IPossibleValue pv = (IPossibleValue)it.next();
- map.put(pv.getValue(), pv.getDisplayValue());
- }
- return map;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/celleditors/LoadbundleSelectionCellEditor.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/celleditors/LoadbundleSelectionCellEditor.java
deleted file mode 100644
index 1465478..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/celleditors/LoadbundleSelectionCellEditor.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties.celleditors;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.jsf.common.ui.IFileFolderConstants;
-import org.eclipse.jst.jsf.common.ui.internal.dialogs.ResourceOnClasspathDialog;
-import org.eclipse.jst.pagedesigner.properties.DesignerPropertyTool;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-/**
- * @author mengbo
- */
-public class LoadbundleSelectionCellEditor extends EditableDialogCellEditor {
- private static final String[] PROPERTIES_FILES_SUFFIXS = new String[] { IFileFolderConstants.EXT_PROPERTIES };
-
- private String _value;
-
- private IProject _project;
-
- /**
- * @param parent
- * @param project
- */
- public LoadbundleSelectionCellEditor(Composite parent, IProject project) {
- super(parent);
- _project = project;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.DialogCellEditor#openDialogBox(org.eclipse.swt.widgets.Control)
- */
- protected Object openDialogBox(Control cellEditorWindow) {
- ResourceOnClasspathDialog dialog = new ResourceOnClasspathDialog(
- cellEditorWindow.getShell(), DesignerPropertyTool
- .getJavaProject(_project));
- dialog.setTitle(ResourceBoundle.getString("FileCellEditor.Title")); //$NON-NLS-1$
- dialog.setSuffixs(PROPERTIES_FILES_SUFFIXS);
- dialog.open();
- if (dialog.getResult() != null) {
- _value = (String) dialog.getResult()[0];
- }
- return _value;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/celleditors/NamedBooleanCellEditor.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/celleditors/NamedBooleanCellEditor.java
deleted file mode 100644
index 929fe36..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/celleditors/NamedBooleanCellEditor.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties.celleditors;
-
-import org.eclipse.jst.pagedesigner.meta.IAttributeDescriptor;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- * @author mengbo
- * @version 1.5
- * Unused???
- */
-public class NamedBooleanCellEditor extends LabeledComboBoxCellEditor {
- /**
- * @param parent
- * @param items
- * @param style
- */
- private NamedBooleanCellEditor(Composite parent, Object[] values,
- String[] labels, int style) {
- super(parent, values, labels, style);
- }
-
- /**
- * @param parent
- * @param style
- * @param element
- * @param attribute
- * @return the new instance
- */
- public static NamedBooleanCellEditor newInstance(Composite parent,
- int style, IDOMElement element, IAttributeDescriptor attribute) {
- String[] values = new String[] { "", attribute.getAttributeName() }; //$NON-NLS-1$
- return new NamedBooleanCellEditor(parent, values, values, style);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/celleditors/OLDCellEditorFactory.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/celleditors/OLDCellEditorFactory.java
deleted file mode 100644
index bc74e9c..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/celleditors/OLDCellEditorFactory.java
+++ /dev/null
@@ -1,483 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties.celleditors;
-
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Map;
-import java.util.TimeZone;
-import java.util.TreeMap;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.ComboDialogField;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogField;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.StyleComboDialogField;
-import org.eclipse.jst.pagedesigner.css2.CSSUtil;
-import org.eclipse.jst.pagedesigner.jsp.core.IJSPCoreConstants;
-import org.eclipse.jst.pagedesigner.meta.IAttributeCellEditorFactory;
-import org.eclipse.jst.pagedesigner.meta.IAttributeDescriptor;
-import org.eclipse.jst.pagedesigner.meta.OLDIValueType;
-import org.eclipse.jst.pagedesigner.ui.dialogfields.ClasspathResourceButtonDialogField;
-import org.eclipse.jst.pagedesigner.ui.dialogfields.ContextableResourceButtonDialogField;
-import org.eclipse.jst.pagedesigner.ui.dialogfields.StyleButtonDialogField;
-import org.eclipse.jst.pagedesigner.utils.StructuredModelUtil;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Element;
-
-/**
- *
- * @author mengbo
- * @deprecated
- */
-public class OLDCellEditorFactory implements IAttributeCellEditorFactory {
- private static String[] CURRENCYCODES = { "AED", // United Arab Emirates, //$NON-NLS-1$
- // Dirhams //$NON-NLS-1$
- "AFA", // Afghanistan, Afghanis //$NON-NLS-1$
- "ALL", // Albania, Leke //$NON-NLS-1$
- "AMD", // Armenia, Drams //$NON-NLS-1$
- "ANG", // Netherlands Antilles, Guilders (also called Florins)//$NON-NLS-1$
- "AOA", // Angola, Kwanza //$NON-NLS-1$
- "ARS", // Argentina, Pesos //$NON-NLS-1$
- "AUD", // Australia, Dollars //$NON-NLS-1$
- "AWG", // Aruba, Guilders (also called Florins) //$NON-NLS-1$
- "AZM", // Azerbaijan, Manats //$NON-NLS-1$
- "BAM", // Bosnia and Herzegovina, Convertible Marka //$NON-NLS-1$
- "BBD", // Barbados, Dollars //$NON-NLS-1$
- "BDT", // Bangladesh, Taka //$NON-NLS-1$
- "BGN", // Bulgaria, Leva //$NON-NLS-1$
- "BHD", // Bahrain, Dinars //$NON-NLS-1$
- "BIF", // Burundi, Francs //$NON-NLS-1$
- "BMD", // Bermuda, Dollars //$NON-NLS-1$
- "BND", // Brunei Darussalam, Dollars //$NON-NLS-1$
- "BOB", // Bolivia, Bolivianos //$NON-NLS-1$
- "BRL", // Brazil, Brazil Real //$NON-NLS-1$
- "BSD", // Bahamas, Dollars //$NON-NLS-1$
- "BTN", // Bhutan, Ngultrum //$NON-NLS-1$
- "BWP", // Botswana, Pulas //$NON-NLS-1$
- "BYR", // Belarus, Rubles //$NON-NLS-1$
- "BZD", // Belize, Dollars //$NON-NLS-1$
- "CAD", // Canada, Dollars //$NON-NLS-1$
- "CDF", // Congo/Kinshasa, Congolese Francs //$NON-NLS-1$
- "CHF", // Switzerland, Francs //$NON-NLS-1$
- "CLP", // Chile, Pesos //$NON-NLS-1$
- "CNY", // China, Yuan Renminbi //$NON-NLS-1$
- "COP", // Colombia, Pesos //$NON-NLS-1$
- "CRC", // Costa Rica, Colones //$NON-NLS-1$
- "CSD", // Serbia, Dinars //$NON-NLS-1$
- "CUP", // Cuba, Pesos //$NON-NLS-1$
- "CVE", // Cape Verde, Escudos //$NON-NLS-1$
- "CYP", // Cyprus, Pounds //$NON-NLS-1$
- "CZK", // Czech Republic, Koruny //$NON-NLS-1$
- "DJF", // Djibouti, Francs //$NON-NLS-1$
- "DKK", // Denmark, Kroner //$NON-NLS-1$
- "DOP", // Dominican Republic, Pesos //$NON-NLS-1$
- "DZD", // Algeria, Algeria Dinars //$NON-NLS-1$
- "EEK", // Estonia, Krooni //$NON-NLS-1$
- "EGP", // Egypt, Pounds //$NON-NLS-1$
- "ERN", // Eritrea, Nakfa //$NON-NLS-1$
- "ETB", // Ethiopia, Birr //$NON-NLS-1$
- "EUR", // Euro Member Countries, Euro //$NON-NLS-1$
- "FJD", // Fiji, Dollars //$NON-NLS-1$
- "FKP", // Falkland Islands (Malvinas), Pounds //$NON-NLS-1$
- "GBP", // United Kingdom, Pounds //$NON-NLS-1$
- "GEL", // Georgia, Lari //$NON-NLS-1$
- "GGP", // Guernsey, Pounds //$NON-NLS-1$
- "GHC", // Ghana, Cedis //$NON-NLS-1$
- "GIP", // Gibraltar, Pounds //$NON-NLS-1$
- "GMD", // Gambia, Dalasi //$NON-NLS-1$
- "GNF", // Guinea, Francs //$NON-NLS-1$
- "GTQ", // Guatemala, Quetzales //$NON-NLS-1$
- "GYD", // Guyana, Dollars //$NON-NLS-1$
- "HKD", // Hong Kong, Dollars //$NON-NLS-1$
- "HNL", // Honduras, Lempiras //$NON-NLS-1$
- "HRK", // Croatia, Kuna //$NON-NLS-1$
- "HTG", // Haiti, Gourdes //$NON-NLS-1$
- "HUF", // Hungary, Forint //$NON-NLS-1$
- "IDR", // Indonesia, Rupiahs //$NON-NLS-1$
- "ILS", // Israel, New Shekels //$NON-NLS-1$
- "IMP", // Isle of Man, Pounds //$NON-NLS-1$
- "INR", // India, Rupees //$NON-NLS-1$
- "IQD", // Iraq, Dinars //$NON-NLS-1$
- "IRR", // Iran, Rials //$NON-NLS-1$
- "ISK", // Iceland, Kronur //$NON-NLS-1$
- "JEP", // Jersey, Pounds //$NON-NLS-1$
- "JMD", // Jamaica, Dollars //$NON-NLS-1$
- "JOD", // Jordan, Dinars //$NON-NLS-1$
- "JPY", // Japan, Yen //$NON-NLS-1$
- "KES", // Kenya, Shillings //$NON-NLS-1$
- "KGS", // Kyrgyzstan, Soms //$NON-NLS-1$
- "KHR", // Cambodia, Riels //$NON-NLS-1$
- "KMF", // Comoros, Francs //$NON-NLS-1$
- "KPW", // Korea (North), Won //$NON-NLS-1$
- "KRW", // Korea (South), Won //$NON-NLS-1$
- "KWD", // Kuwait, Dinars //$NON-NLS-1$
- "KYD", // Cayman Islands, Dollars //$NON-NLS-1$
- "KZT", // Kazakhstan, Tenge //$NON-NLS-1$
- "LAK", // Laos, Kips //$NON-NLS-1$
- "LBP", // Lebanon, Pounds //$NON-NLS-1$
- "LKR", // Sri Lanka, Rupees //$NON-NLS-1$
- "LRD", // Liberia, Dollars //$NON-NLS-1$
- "LSL", // Lesotho, Maloti //$NON-NLS-1$
- "LTL", // Lithuania, Litai //$NON-NLS-1$
- "LVL", // Latvia, Lati //$NON-NLS-1$
- "LYD", // Libya, Dinars //$NON-NLS-1$
- "MAD", // Morocco, Dirhams //$NON-NLS-1$
- "MDL", // Moldova, Lei //$NON-NLS-1$
- "MGA", // Madagascar, Ariary //$NON-NLS-1$
- "MKD", // Macedonia, Denars //$NON-NLS-1$
- "MMK", // Myanmar (Burma), Kyats //$NON-NLS-1$
- "MNT", // Mongolia, Tugriks //$NON-NLS-1$
- "MOP", // Macau, Patacas //$NON-NLS-1$
- "MRO", // Mauritania, Ouguiyas //$NON-NLS-1$
- "MTL", // Malta, Liri //$NON-NLS-1$
- "MUR", // Mauritius, Rupees //$NON-NLS-1$
- "MVR", // Maldives (Maldive Islands), Rufiyaa //$NON-NLS-1$
- "MWK", // Malawi, Kwachas //$NON-NLS-1$
- "MXN", // Mexico, Pesos //$NON-NLS-1$
- "MYR", // Malaysia, Ringgits //$NON-NLS-1$
- "MZM", // Mozambique, Meticais //$NON-NLS-1$
- "NAD", // Namibia, Dollars //$NON-NLS-1$
- "NGN", // Nigeria, Nairas //$NON-NLS-1$
- "NIO", // Nicaragua, Cordobas //$NON-NLS-1$
- "NOK", // Norway, Krone //$NON-NLS-1$
- "NPR", // Nepal, Nepal Rupees //$NON-NLS-1$
- "NZD", // New Zealand, Dollars //$NON-NLS-1$
- "OMR", // Oman, Rials //$NON-NLS-1$
- "PAB", // Panama, Balboa //$NON-NLS-1$
- "PEN", // Peru, Nuevos Soles //$NON-NLS-1$
- "PGK", // Papua New Guinea, Kina //$NON-NLS-1$
- "PHP", // Philippines, Pesos //$NON-NLS-1$
- "PKR", // Pakistan, Rupees //$NON-NLS-1$
- "PLN", // Poland, Zlotych //$NON-NLS-1$
- "PYG", // Paraguay, Guarani //$NON-NLS-1$
- "QAR", // Qatar, Rials //$NON-NLS-1$
- "ROL", // Romania, Lei //$NON-NLS-1$
- "RUB", // Russia, Rubles //$NON-NLS-1$
- "RWF", // Rwanda, Rwanda Francs //$NON-NLS-1$
- "SAR", // Saudi Arabia, Riyals //$NON-NLS-1$
- "SBD", // Solomon Islands, Dollars //$NON-NLS-1$
- "SCR", // Seychelles, Rupees //$NON-NLS-1$
- "SDD", // Sudan, Dinars //$NON-NLS-1$
- "SEK", // Sweden, Kronor //$NON-NLS-1$
- "SGD", // Singapore, Dollars //$NON-NLS-1$
- "SHP", // Saint Helena, Pounds //$NON-NLS-1$
- "SIT", // Slovenia, Tolars //$NON-NLS-1$
- "SKK", // Slovakia, Koruny //$NON-NLS-1$
- "SLL", // Sierra Leone, Leones //$NON-NLS-1$
- "SOS", // Somalia, Shillings //$NON-NLS-1$
- "SPL", // Seborga, Luigini //$NON-NLS-1$
- "SRD", // Suriname, Dollars //$NON-NLS-1$
- "STD", // S?o Tome and Principe, Dobras //$NON-NLS-1$
- "SVC", // El Salvador, Colones //$NON-NLS-1$
- "SYP", // Syria, Pounds //$NON-NLS-1$
- "SZL", // Swaziland, Emalangeni //$NON-NLS-1$
- "THB", // Thailand, Baht //$NON-NLS-1$
- "TJS", // Tajikistan, Somoni //$NON-NLS-1$
- "TMM", // Turkmenistan, Manats //$NON-NLS-1$
- "TND", // Tunisia, Dinars //$NON-NLS-1$
- "TOP", // Tonga, Pa'anga //$NON-NLS-1$
- "TRL", // Turkey, Liras [being phased out] //$NON-NLS-1$
- "TRY", // Turkey, New Lira //$NON-NLS-1$
- "TTD", // Trinidad and Tobago, Dollars //$NON-NLS-1$
- "TVD", // Tuvalu, Tuvalu Dollars //$NON-NLS-1$
- "TWD", // Taiwan, New Dollars //$NON-NLS-1$
- "TZS", // Tanzania, Shillings //$NON-NLS-1$
- "UAH", // Ukraine, Hryvnia //$NON-NLS-1$
- "UGX", // Uganda, Shillings //$NON-NLS-1$
- "USD", // United States of America, Dollars //$NON-NLS-1$
- "UYU", // Uruguay, Pesos //$NON-NLS-1$
- "UZS", // Uzbekistan, Sums //$NON-NLS-1$
- "VEB", // Venezuela, Bolivares //$NON-NLS-1$
- "VND", // Viet Nam, Dong //$NON-NLS-1$
- "VUV", // Vanuatu, Vatu //$NON-NLS-1$
- "WST", // Samoa, Tala //$NON-NLS-1$
- "XAF", // Communaut�� Financi��re Africaine BEAC, Francs //$NON-NLS-1$
- // //$NON-NLS-1$
- "XAG", // Silver, Ounces //$NON-NLS-1$
- "XAU", // Gold, Ounces //$NON-NLS-1$
- "XCD", // East Caribbean Dollars //$NON-NLS-1$
- "XDR", // International Monetary Fund (IMF) Special Drawing Rights //$NON-NLS-1$
- // //$NON-NLS-1$
- "XOF", // Communaut�� Financi��re Africaine BCEAO, Francs //$NON-NLS-1$
- // //$NON-NLS-1$
- "XPD", // Palladium Ounces //$NON-NLS-1$
- "XPF", // Comptoirs Fran?ais du Pacifique Francs //$NON-NLS-1$
- "XPT", // Platinum, Ounces //$NON-NLS-1$
- "YER", // Yemen, Rials //$NON-NLS-1$
- "ZAR", // South Africa, Rand //$NON-NLS-1$
- "ZMK", // Zambia, Kwacha //$NON-NLS-1$
- "ZWD" // Zimbabwe, Zimbabwe Dollars //$NON-NLS-1$
- };
-
- public CellEditor createCellEditor(Composite parent,
- IAttributeDescriptor attr, Element element) {
- String type = attr.getValueType();
-
- if (OLDIValueType.ENUMERATED.equalsIgnoreCase(type)) {
- Map map = new HashMap(attr.getOptions());
- String defaultValue = attr.getDefaultValue();
- if (defaultValue == null) {
- return LabeledComboBoxCellEditor.newInstance(parent, map,
- SWT.NONE);
- }
- return LabeledStyleComboCellEditor.newInstance(parent, map,
- defaultValue, SWT.NONE);
- } else if (OLDIValueType.LOCALE.equalsIgnoreCase(type)) {
- Map map = new HashMap();
- Locale[] locales = Locale.getAvailableLocales();
- for (int i = 0, size = locales.length; i < size; i++) {
- map.put(locales[i].toString(), locales[i].toString());
- }
- return LabeledComboBoxCellEditor.newInstance(parent, map, SWT.NONE);
- } else if (OLDIValueType.TIMEZONE.equalsIgnoreCase(type)) {
- Map map = new HashMap();
- String[] ids = TimeZone.getAvailableIDs();
- for (int i = 0, size = ids.length; i < size; i++) {
- map.put(ids[i], ids[i]);
- }
- return LabeledComboBoxCellEditor.newInstance(parent, map, SWT.NONE);
- } else if (OLDIValueType.RELATIVEPATH.equalsIgnoreCase(type)
- || OLDIValueType.WEBPATH.equalsIgnoreCase(type)) {
- IProject project = getProject(element);
- if (project != null) {
- ResourceDialogCellEditor cellEditor = new ResourceDialogCellEditor(
- parent);
- cellEditor.setSuffixs(attr.getParameterByName(
- IAttributeDescriptor.PARAMETER_SUFFIX).split(";")); //$NON-NLS-1$
- cellEditor
- .setSeparator(attr
- .getParameterByName(IAttributeDescriptor.PARAMETER_SEPARATOR));
- cellEditor.setProject(project);
- cellEditor.setReferredFile(getFile(element));
- if ("".equalsIgnoreCase(cellEditor.getSeparator())) { //$NON-NLS-1$
- cellEditor.setResourceDescription(ResourceBoundle
- .getString("FileCellEditor.Msg")); //$NON-NLS-1$
- } else {
- cellEditor.setResourceDescription(ResourceBoundle
- .getString("FileCellEditor.Msg1")); //$NON-NLS-1$
- }
- if (OLDIValueType.WEBPATH.equalsIgnoreCase(type)) {
- cellEditor.setWebPath(true);
- }
-
- if (IJSPCoreConstants.TAG_DIRECTIVE_INCLUDE.equals(element
- .getLocalName())
- || IJSPCoreConstants.TAG_INCLUDE.equals(element
- .getLocalName())) {
- cellEditor.setTransformJSPURL(false);
- }
- return cellEditor;
- }
- } else if (OLDIValueType.CLASSPATH_RESOURCE.equalsIgnoreCase(type)) {
- return new LoadbundleSelectionCellEditor(parent,
- getProject(element));
- } else if (OLDIValueType.CSSID.equalsIgnoreCase(type)) {
- // TODO: missing case?
- } else if (OLDIValueType.CSSCLASS.equalsIgnoreCase(type)) {
- String cssclasses[] = CSSUtil.getCSSClasses(element
- .getOwnerDocument());
- Map map = new HashMap();
- if (cssclasses != null) {
- for (int i = 0; i < cssclasses.length; i++) {
- map.put(cssclasses[i], cssclasses[i]);
- }
- }
- return LabeledComboBoxCellEditor.newInstance(parent, map, SWT.NONE);
- } else if (OLDIValueType.BOOLEAN.equalsIgnoreCase(type)) {
- String defaultValue = attr
- .getParameterByName(IAttributeDescriptor.PARAMETER_DEFAULT);
- Map booleanMap = new HashMap();
- booleanMap.put(Boolean.TRUE.toString(), Boolean.TRUE.toString());
- booleanMap.put(Boolean.FALSE.toString(), Boolean.FALSE.toString());
- if (defaultValue == null) {
- return LabeledComboBoxCellEditor.newInstance(parent,
- booleanMap, SWT.NONE);
- }
- return LabeledStyleComboCellEditor.newInstance(parent,
- booleanMap, defaultValue, SWT.NONE);
- } else if (OLDIValueType.CSSSTYLE.equalsIgnoreCase(type)) {
- String param = attr
- .getParameterByName(IAttributeDescriptor.PARAMETER_STYLE);
- if (!param.equalsIgnoreCase("STYLE")) { //$NON-NLS-1$
- return null;
- }
- CSSDialogCellEditor cellEditor = new CSSDialogCellEditor(parent,
- (IDOMElement) element);
- return cellEditor;
- } else if (OLDIValueType.NAMED_BOOLEAN.equalsIgnoreCase(type)) {
- return NamedBooleanCellEditor.newInstance(parent, SWT.NONE,
- (IDOMElement) element, attr);
- } else if (OLDIValueType.CURRENCYCODE.equalsIgnoreCase(type)) {
- Map map = new HashMap();
- for (int i = 0, n = CURRENCYCODES.length; i < n; i++) {
- map.put(CURRENCYCODES[i], CURRENCYCODES[i]);
- }
-
- return LabeledComboBoxCellEditor.newInstance(parent, map, SWT.NONE);
- }
-
- // if there is no type or type unknonw, then we just return null. and
- // system will
- // create default (text cell editor).
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.meta.IAttributeCellEditorFactory#createDialogField(org.eclipse.jst.pagedesigner.meta.IAttributeDescriptor,
- * org.w3c.dom.Element, org.w3c.dom.Element)
- */
- public DialogField createDialogField(IAttributeDescriptor attr) {
- String type = attr.getValueType();
-
- if (OLDIValueType.ENUMERATED.equalsIgnoreCase(type)
- || OLDIValueType.LOCALE.equalsIgnoreCase(type)
- || OLDIValueType.TIMEZONE.equalsIgnoreCase(type)) {
- Map map = new HashMap();
- if (OLDIValueType.ENUMERATED.equalsIgnoreCase(type)) {
- map = attr.getOptions();
- } else if (OLDIValueType.LOCALE.equalsIgnoreCase(type)) {
- Locale[] locales = Locale.getAvailableLocales();
- for (int i = 0, size = locales.length; i < size; i++) {
- map.put(locales[i].toString(), locales[i].toString());
- }
- } else {
- String[] ids = TimeZone.getAvailableIDs();
- for (int i = 0, size = ids.length; i < size; i++) {
- map.put(ids[i], ids[i]);
- }
- }
- if (map != null && !map.isEmpty()) {
- String defaultValue = attr.getDefaultValue();
- if (defaultValue == null || "".equals(defaultValue)) { //$NON-NLS-1$
- attr
- .getParameterByName(IAttributeDescriptor.PARAMETER_DEFAULT);
- }
- StyleComboDialogField field = new StyleComboDialogField(
- SWT.NONE);
- field.setDefaultValue(defaultValue);
- field.setLabelText(attr.getLabelString());
- field.setEntryMap(new TreeMap(map));
- field.setRequired(attr.isRequired());
- field.setToolTip(attr.getDescription());
- return field;
- }
- // eles the config is incorrect. fall through, will return null.
- } else if (OLDIValueType.RELATIVEPATH.equalsIgnoreCase(type)) {
- String param = attr.getTypeParameter();
- ContextableResourceButtonDialogField field = new ContextableResourceButtonDialogField();
- field.setLabelText(attr.getLabelString());
- if (param != null) {
- field.setSuffixs(attr.getParameterByName(
- IAttributeDescriptor.PARAMETER_SUFFIX).split(";")); //$NON-NLS-1$
- }
- field.setResourceDescription(ResourceBoundle
- .getString("FileCellEditor.Msg")); //$NON-NLS-1$
- field.setRequired(attr.isRequired());
- field.setToolTip(attr.getDescription());
- return field;
- } else if (OLDIValueType.WEBPATH.equalsIgnoreCase(type)) {
- String param = attr.getTypeParameter();
- ContextableResourceButtonDialogField field = new ContextableResourceButtonDialogField();
- field.setLabelText(attr.getLabelString());
- if (param != null) {
- field.setSuffixs(attr.getParameterByName(
- IAttributeDescriptor.PARAMETER_SUFFIX).split(";")); //$NON-NLS-1$
- field
- .setSeparator(attr
- .getParameterByName(IAttributeDescriptor.PARAMETER_SEPARATOR));
- }
- if ("".equalsIgnoreCase(field.getSeparator())) { //$NON-NLS-1$
- field.setResourceDescription(ResourceBoundle
- .getString("FileCellEditor.Msg")); //$NON-NLS-1$
- } else {
- field.setResourceDescription(ResourceBoundle
- .getString("FileCellEditor.Msg1")); //$NON-NLS-1$
- }
- field.setWebPath(true);
- field.setRequired(attr.isRequired());
- field.setToolTip(attr.getDescription());
- return field;
- } else if (OLDIValueType.CLASSPATH_RESOURCE.equals(type)) {
- ClasspathResourceButtonDialogField field = new ClasspathResourceButtonDialogField();
- field.setRequired(attr.isRequired());
- field.setToolTip(attr.getDescription());
- return field;
- } else if (OLDIValueType.BOOLEAN.equalsIgnoreCase(type)) {
- String defaultValue = attr
- .getParameterByName(IAttributeDescriptor.PARAMETER_DEFAULT);
- StyleComboDialogField field = new StyleComboDialogField(SWT.NONE);
- TreeMap map = new TreeMap();
- map.put("", ""); //$NON-NLS-1$ //$NON-NLS-2$
- map.put(Boolean.FALSE.toString(), Boolean.FALSE.toString());
- map.put(Boolean.TRUE.toString(), Boolean.TRUE.toString());
- field.setEntryMap(map);
- field.setDefaultValue(defaultValue);
- field.setLabelText(attr.getLabelString());
- field.setRequired(attr.isRequired());
- field.setToolTip(attr.getDescription());
- return field;
- } else if (OLDIValueType.CSSSTYLE.equalsIgnoreCase(type)) {
- String param = attr
- .getParameterByName(IAttributeDescriptor.PARAMETER_STYLE);
- if (!"STYLE".equalsIgnoreCase(param)) { //$NON-NLS-1$
- return null;
- }
- StyleButtonDialogField field = new StyleButtonDialogField();
- field.setRequired(attr.isRequired());
- field.setToolTip(attr.getDescription());
- return field;
- } else if (OLDIValueType.CURRENCYCODE.equalsIgnoreCase(type)) {
- ComboDialogField field = new ComboDialogField(SWT.NONE);
- field.setLabelText(attr.getLabelString());
- field.setItems(CURRENCYCODES);
- field.setRequired(attr.isRequired());
- field.setToolTip(attr.getDescription());
- return field;
- }
-
- // if there is no type or type unknonw, then we just return null. and
- // system will
- // create default (text cell editor).
- return null;
- }
-
- private IProject getProject(Element element) {
- if (element instanceof IDOMElement) {
- IDOMModel model = ((IDOMElement) element).getModel();
- IFile file = StructuredModelUtil.getFileFor(model);
- if (file != null) {
- return file.getProject();
- }
- }
- return null;
- }
-
- public String[] getSupportedValueTypes() {
- return null;
- }
-
- private IFile getFile(Element element) {
- if (element instanceof IDOMElement) {
- IDOMModel model = ((IDOMElement) element).getModel();
- IFile file = StructuredModelUtil.getFileFor(model);
- return file;
- }
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/celleditors/ResourceBoundle.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/celleditors/ResourceBoundle.java
deleted file mode 100644
index b3eeac5..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/celleditors/ResourceBoundle.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties.celleditors;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class ResourceBoundle {
- private static final String BUNDLE_NAME = "org.eclipse.jst.pagedesigner.properties.celleditors.messages"; //$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
- .getBundle(BUNDLE_NAME);
-
- private ResourceBoundle() {
- // no external instantiation
- }
-
- /**
- * @param key
- * @return the value for the key or !!key!!
- */
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/celleditors/ResourceDialogCellEditor.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/celleditors/ResourceDialogCellEditor.java
deleted file mode 100644
index 0eced33..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/celleditors/ResourceDialogCellEditor.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties.celleditors;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jst.jsf.common.ui.internal.dialogs.CommonResourceDialog;
-import org.eclipse.jst.jsf.common.ui.internal.utils.PathUtil;
-import org.eclipse.jst.jsf.common.ui.internal.utils.WebrootUtil;
-import org.eclipse.jst.pagedesigner.utils.WebAppUtil;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * @author mengbo
- */
-public class ResourceDialogCellEditor extends EditableDialogCellEditor {
- private IProject _project;
-
- private String[] _suffixs;
-
- private String _resourceDescription;
-
- private IFile _referredFile;
-
- private boolean _isWebPath = false;
-
- private boolean _needTransformJSPURL = true;
-
- private String _separator = ""; //$NON-NLS-1$
-
-
- /**
- * Constructor
- */
- public ResourceDialogCellEditor() {
- super();
- }
-
- /**
- * Constructor
- * @param parent
- */
- public ResourceDialogCellEditor(Composite parent) {
- super(parent);
- }
-
- /**
- * Constructor
- * @param parent
- * @param style
- */
- public ResourceDialogCellEditor(Composite parent, int style) {
- super(parent, style);
- }
-
- protected Object openDialogBox(Control cellEditorWindow) {
- Shell shell = cellEditorWindow.getShell();
- int style = "".equals(_separator) ? SWT.NONE : SWT.MULTI | SWT.H_SCROLL //$NON-NLS-1$
- | SWT.V_SCROLL;
- CommonResourceDialog dialog = new CommonResourceDialog(shell, _project,
- style);
- dialog.setTitle(ResourceBoundle.getString("FileCellEditor.Title")); //$NON-NLS-1$
- dialog.setSuffixs(_suffixs);
- dialog.setResourceDescription(_resourceDescription);
- if (dialog.open() == Window.OK) {
- Object[] result = dialog.getResult();
- StringBuffer buffer = new StringBuffer();
- for (int i = 0; i < result.length; i++) {
- IPath path = ((IFile) result[i]).getLocation();
-
- IPath referredPath = null;
- if (_referredFile != null) {
- referredPath = _referredFile.getLocation();
- } else {
- referredPath = _project.getLocation();
- }
-
- String newValue = null;
- if (this._isWebPath) {
- IFile selectedFile = ((IFile) result[i]);
- newValue = WebrootUtil.getWebPath(selectedFile
- .getFullPath());
- } else {
- newValue = PathUtil.convertToRelativePath(path.toString(),
- referredPath.toString());
- }
- if (this._needTransformJSPURL) {
- newValue = WebAppUtil.transformJSPURL(newValue,
- this._referredFile);
- }
- buffer.append(newValue);
- buffer.append(_separator);
- }
- if (buffer.length() > 0) {
- return buffer.substring(0, buffer.length()
- - _separator.length());
- }
- }
- return null;
- }
-
- /**
- * @param project
- */
- public void setProject(IProject project) {
- this._project = project;
- }
-
- /**
- * @return Returns the project.
- */
- public IProject getProject() {
- return _project;
- }
-
- /**
- * @return Returns the referredFile.
- */
- public IFile getReferredFile() {
- return _referredFile;
- }
-
- /**
- * @param referredFile
- * The referredFile to set.
- */
- public void setReferredFile(IFile referredFile) {
- this._referredFile = referredFile;
- }
-
- /**
- * @return Returns the resourceDescription.
- */
- public String getResourceDescription() {
- if (_resourceDescription == null) {
- if ("".equalsIgnoreCase(getSeparator())) { //$NON-NLS-1$
- _resourceDescription = ResourceBoundle
- .getString("FileCellEditor.Msg"); //$NON-NLS-1$
- } else {
- _resourceDescription = ResourceBoundle
- .getString("FileCellEditor.Msg1"); //$NON-NLS-1$
- }
- }
- return _resourceDescription;
- }
-
- /**
- * @param resourceDescription
- * The resourceDescription to set.
- */
- public void setResourceDescription(String resourceDescription) {
- this._resourceDescription = resourceDescription;
- }
-
- /**
- * @return Returns the suffixes.
- */
- public String[] getSuffixs() {
- return _suffixs;
- }
-
- /**
- * @param suffixs
- * The suffixes to set.
- */
- public void setSuffixs(String[] suffixs) {
- this._suffixs = suffixs;
- }
-
- /**
- * set some special path to web path instead of relative path
- *
- * @param isWebPath
- */
- public void setWebPath(boolean isWebPath) {
- this._isWebPath = isWebPath;
- }
-
- /**
- * @param needTransform
- */
- public void setTransformJSPURL(boolean needTransform) {
- this._needTransformJSPURL = needTransform;
- }
-
- /**
- * @return separator to use for between values
- */
- public String getSeparator() {
- return _separator;
- }
-
- /**
- * @param separator to use for between values
- */
- public void setSeparator(String separator) {
- this._separator = separator;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/celleditors/StyleComboCellEditor.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/celleditors/StyleComboCellEditor.java
deleted file mode 100644
index dba336d..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/celleditors/StyleComboCellEditor.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties.celleditors;
-
-import java.text.MessageFormat;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jst.jsf.common.ui.internal.utils.StyleCombo;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.FocusAdapter;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.TraverseEvent;
-import org.eclipse.swt.events.TraverseListener;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-/**
- * Combo cell editor
- *
- */
-public class StyleComboCellEditor extends CellEditor {
- /**
- * The list of items to present in the combo box.
- */
- private String[] items;
-
- /**
- * The zero-based index of the selected item.
- */
- int selection;
-
- /**
- * The custom combo box control.
- */
- StyleCombo comboBox;
-
- /**
- * Default ComboBoxCellEditor style
- */
- private static final int defaultStyle = SWT.NONE;
-
- /**
- * Default constructor
- */
- public StyleComboCellEditor() {
- setStyle(defaultStyle);
- }
-
- /**
- * @param parent
- * @param items
- */
- public StyleComboCellEditor(Composite parent, String[] items) {
- this(parent, items, defaultStyle);
- }
-
- /**
- * @param parent
- * @param items
- * @param style
- */
- public StyleComboCellEditor(Composite parent, String[] items, int style) {
- super(parent, style);
- setItems(items);
- }
-
- /**
- * Returns the list of choices for the combo box
- *
- * @return the list of choices for the combo box
- */
- public String[] getItems() {
- return this.items;
- }
-
- /**
- * Sets the list of choices for the combo box
- *
- * @param items
- * the list of choices for the combo box
- */
- public void setItems(String[] items) {
- Assert.isNotNull(items);
- this.items = items;
- populateComboBoxItems();
- }
-
- /*
- * (non-Javadoc) Method declared on CellEditor.
- */
- protected Control createControl(Composite parent) {
-
- comboBox = new StyleCombo(parent, getStyle());
- comboBox.setFont(parent.getFont());
-
- comboBox.addKeyListener(new KeyAdapter() {
- // hook key pressed - see PR 14201
- public void keyPressed(KeyEvent e) {
- keyReleaseOccured(e);
- }
- });
-
- comboBox.addSelectionListener(new SelectionAdapter() {
- public void widgetDefaultSelected(SelectionEvent event) {
- applyEditorValueAndDeactivate();
- }
-
- public void widgetSelected(SelectionEvent event) {
- selection = comboBox.getSelectionIndex();
- }
- });
-
- comboBox.addTraverseListener(new TraverseListener() {
- public void keyTraversed(TraverseEvent e) {
- if (e.detail == SWT.TRAVERSE_ESCAPE
- || e.detail == SWT.TRAVERSE_RETURN) {
- e.doit = false;
- }
- }
- });
-
- comboBox.addFocusListener(new FocusAdapter() {
- public void focusLost(FocusEvent e) {
- StyleComboCellEditor.this.focusLost();
- }
- });
- return comboBox;
- }
-
- /**
- * The <code>ComboBoxCellEditor</code> implementation of this
- * <code>CellEditor</code> framework method returns the zero-based index
- * of the current selection.
- *
- * @return the zero-based index of the current selection wrapped as an
- * <code>Integer</code>
- */
- protected Object doGetValue() {
- return new Integer(selection);
- }
-
- /*
- * (non-Javadoc) Method declared on CellEditor.
- */
- protected void doSetFocus() {
- comboBox.setFocus();
- }
-
- /**
- * The <code>ComboBoxCellEditor</code> implementation of this
- * <code>CellEditor</code> framework method sets the minimum width of the
- * cell. The minimum width is 10 characters if <code>comboBox</code> is
- * not <code>null</code> or <code>disposed</code> eles it is 60 pixels
- * to make sure the arrow button and some text is visible. The list of
- * CCombo will be wide enough to show its longest item.
- */
- public LayoutData getLayoutData() {
- LayoutData layoutData = super.getLayoutData();
- if ((comboBox == null) || comboBox.isDisposed())
- layoutData.minimumWidth = 60;
- else {
- // make the comboBox 10 characters wide
- GC gc = new GC(comboBox);
- layoutData.minimumWidth = (gc.getFontMetrics()
- .getAverageCharWidth() * 10) + 10;
- gc.dispose();
- }
- return layoutData;
- }
-
- /**
- * The <code>ComboBoxCellEditor</code> implementation of this
- * <code>CellEditor</code> framework method accepts a zero-based index of
- * a selection.
- *
- * @param value
- * the zero-based index of the selection wrapped as an
- * <code>Integer</code>
- */
- protected void doSetValue(Object value) {
- Assert.isTrue(comboBox != null && (value instanceof Integer));
- selection = ((Integer) value).intValue();
- comboBox.select(selection);
- }
-
- /**
- * Updates the list of choices for the combo box for the current control.
- */
- private void populateComboBoxItems() {
- if (comboBox != null && items != null) {
- comboBox.removeAll();
- for (int i = 0; i < items.length; i++)
- comboBox.add(items[i], i);
-
- setValueValid(true);
- selection = 0;
- }
- }
-
- /**
- * Applies the currently selected value and deactiavates the cell editor
- */
- void applyEditorValueAndDeactivate() {
- // must set the selection before getting value
- selection = comboBox.getSelectionIndex();
- Object newValue = doGetValue();
- markDirty();
- boolean isValid = isCorrect(newValue);
- setValueValid(isValid);
- if (!isValid) {
- // try to insert the current value into the error message.
- setErrorMessage(MessageFormat.format(getErrorMessage(),
- new Object[] { items[selection] }));
- }
- fireApplyEditorValue();
- deactivate();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.CellEditor#focusLost()
- */
- protected void focusLost() {
- if (isActivated()) {
- applyEditorValueAndDeactivate();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.CellEditor#keyReleaseOccured(org.eclipse.swt.events.KeyEvent)
- */
- protected void keyReleaseOccured(KeyEvent keyEvent) {
- if (keyEvent.character == '\u001b') { // Escape character
- fireCancelEditor();
- } else if (keyEvent.character == '\t') { // tab key
- applyEditorValueAndDeactivate();
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/celleditors/messages.properties b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/celleditors/messages.properties
deleted file mode 100644
index aa55e43..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/celleditors/messages.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2007 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are 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:
-# Oracle Corporation - initial API and implementation
-###############################################################################
-FileCellEditor.Title=Select File
-FileCellEditor.Msg=Select a file
-FileCellEditor.Msg1=Select one or more files
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/dialogfields/MDEnabledComboDialogField.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/dialogfields/MDEnabledComboDialogField.java
deleted file mode 100644
index e63245f..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/dialogfields/MDEnabledComboDialogField.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.pagedesigner.properties.dialogfields;
-
-import java.util.Iterator;
-import java.util.Map;
-import java.util.TreeMap;
-
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.StyleComboDialogField;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContextFactory;
-import org.eclipse.jst.jsf.metadataprocessors.features.IDefaultValue;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValue;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.pagedesigner.editors.properties.IPropertyPageDescriptor;
-import org.eclipse.jst.pagedesigner.properties.attrgroup.IElementContextable;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-
-/**
- * This combo dialog field defers loading the combos until the element context has been set
- *
- */
-public class MDEnabledComboDialogField extends StyleComboDialogField implements IElementContextable {
-
- /**
- * Constructor
- * @param flags
- */
- public MDEnabledComboDialogField(int flags) {
- super(flags);
- }
-
- public void setElementContext(IDOMNode ancester, IDOMElement element) {
- IStructuredDocumentContext sdContext =IStructuredDocumentContextFactory.INSTANCE.getContext(element.getStructuredDocument(), element);
- IPropertyPageDescriptor ppd = (IPropertyPageDescriptor)getAttachedData("KEY_ATTR");//FIXME use constant //$NON-NLS-1$
- ppd.setStructuredDocumentContext(sdContext);
- IPossibleValues pvs = (IPossibleValues)ppd.getAdapter(IPossibleValues.class);
- IDefaultValue def = (IDefaultValue)ppd.getAdapter(IDefaultValue.class);
- if (def != null)
- setDefaultValue(def.getDefaultValue());
- if (pvs.getPossibleValues() != null)
- setEntryMap(getMapOfPossibleValues(pvs));
- }
-
- private Map getMapOfPossibleValues(IPossibleValues pvs) {
- Map map = new TreeMap<String, String>();
- for (Iterator<IPossibleValue> it=pvs.getPossibleValues().iterator();it.hasNext();){
- IPossibleValue pv = it.next();
- map.put(pv.getValue(), pv.getDisplayValue());
- }
- return map;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/AllPropertySectionDescriptor.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/AllPropertySectionDescriptor.java
deleted file mode 100644
index 8c5de9b..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/AllPropertySectionDescriptor.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties.internal;
-
-import org.eclipse.jst.pagedesigner.properties.AllPropertySection;
-import org.eclipse.ui.views.properties.tabbed.AbstractSectionDescriptor;
-import org.eclipse.ui.views.properties.tabbed.ISection;
-
-/**
- * SectionDescriptor for the WPE Attributes tab
- */
-public class AllPropertySectionDescriptor extends AbstractSectionDescriptor {
- /**
- * Id for the WPE AllPropertySectionDescriptor
- */
- public static final String ID = "AllPropertySectionDescriptor"; //$NON-NLS-1$
-
- private ISection section;
-
- public String getId() {
- return ID;
- }
-
- public ISection getSectionClass() {
- if (section == null){
- section = new AllPropertySection();
- }
- return section;
- }
-
- public String getTargetTab() {
- return AttributesTabDescriptor.TAB_ID;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/AttributeGroup.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/AttributeGroup.java
deleted file mode 100644
index 585cd4e..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/AttributeGroup.java
+++ /dev/null
@@ -1,441 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties.internal;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.query.TaglibDomainMetaDataQueryHelper;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogField;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogFieldGroup;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.IDialogFieldApplyListener;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.IDialogFieldChangeListener;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.ISupportTextValue;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContextFactory;
-import org.eclipse.jst.jsf.metadataprocessors.MetaDataEnabledProcessingFactory;
-import org.eclipse.jst.pagedesigner.editors.HTMLEditor;
-import org.eclipse.jst.pagedesigner.editors.properties.IPropertyPageDescriptor;
-import org.eclipse.jst.pagedesigner.properties.attrgroup.IElementContextable;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-
-/**
- * @author mengbo
- * @version 1.5
- *
- * TODO: cleanup up constructors
- */
-public class AttributeGroup extends DialogFieldGroup {
- private static final Object KEY_ATTR = "KEY_ATTR"; //$NON-NLS-1$
-
-// private String _helpContextId;
-
- private List<DialogField> _dialogFields = null; //consider using Map
- private IDOMElement _ownerElement;
- private Entity _tagEntity;
- private List<String> _attrNames;
- private List<IPropertyPageDescriptor> _attrPDs;
- private IStructuredDocumentContext _sdContext;
-
- private String _uri;
- private String _tagName;
-
- /**
- * Constructor
- * @param tagEntity - may not be null
- * @param attrNames - may not be null. Attribute names must be valid for the tag, and have attribute-value-runtime-type trait info
- */
- public AttributeGroup(Entity tagEntity, List<String> attrNames) {
- _tagEntity = tagEntity;
- _attrNames = attrNames;
- }
-
- /**
- * Constructor where tagEntity is determined later or set later
- * @param uri - may be null
- * @param tagName - may be null
- * @param attributeNames - may not be null. Attribute names must be valid for the tag, and have attribute-value-runtime-type trait info
- */
- public AttributeGroup(String uri,
- String tagName, String[] attributeNames) {
- _uri = uri;
- _tagName = tagName;
- if (attributeNames != null)
- _attrNames = Arrays.asList(attributeNames);
- else
- _attrNames = new ArrayList();
- }
-
- private List<IPropertyPageDescriptor> prepareDescriptors(Entity tagEntity,
- List<String> names) {
-
- List pds = new ArrayList();
- for (String attrName : names) {
- IPropertyPageDescriptor pd = getPD(tagEntity, attrName);
- if (pd != null)
- pds.add(pd);
- }
- return pds;
- }
-
- private IPropertyPageDescriptor getPD(Entity tagEntity, String attrName) {
- IPropertyPageDescriptor pd = null;
- Entity attrEntity = TaglibDomainMetaDataQueryHelper.getEntity(tagEntity, attrName);
- if (attrEntity != null){
- List pds = MetaDataEnabledProcessingFactory.getInstance().getAttributeValueRuntimeTypeFeatureProcessors(
- IPropertyPageDescriptor.class, getStructuredDocumentContext(), attrEntity);
- if (pds != null && !pds.isEmpty())
- pd = (IPropertyPageDescriptor)pds.get(0);
- else
- pd = new DefaultPropertyPageDescriptor(tagEntity, attrEntity);
- }
- return pd;
- }
-
-
- private void resetStructuredDocumentContext() {
- _sdContext = null;
- getStructuredDocumentContext();
- }
-
- private IStructuredDocumentContext getStructuredDocumentContext() {
- if (_sdContext == null) {
- if (_ownerElement != null) {
- _sdContext = IStructuredDocumentContextFactory.INSTANCE.getContext(_ownerElement.getStructuredDocument(), _ownerElement);
-
- } else {
- IEditorPart edPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- if (edPart != null && edPart instanceof HTMLEditor) {//edPart will always be the WPE, but checking just to be safe
- _sdContext = IStructuredDocumentContextFactory.INSTANCE.getContext(((HTMLEditor)edPart).getDocument(), 0);
- }
- }
- }
- return _sdContext;
- }
-
- /**
- * @return tag entity for this attribute group
- */
- protected Entity getTagEntity() {
- if (_tagEntity == null) {
- if (_ownerElement != null){
- IStructuredDocumentContext context = IStructuredDocumentContextFactory.INSTANCE.getContext(_ownerElement.getStructuredDocument(), 0);
- if (context != null){
- String uri = _uri != null ? _uri : IStructuredDocumentContextResolverFactory.INSTANCE.getDOMContextResolver(context).getNode().getBaseURI();
- String tagName = _tagName != null ? _tagName : IStructuredDocumentContextResolverFactory.INSTANCE.getDOMContextResolver(context).getNode().getNodeName();
- if (uri != null){
- IProject project = IStructuredDocumentContextResolverFactory.INSTANCE.getWorkspaceContextResolver(context).getProject();
- _tagEntity = TaglibDomainMetaDataQueryHelper.getEntity(TaglibDomainMetaDataQueryHelper.createMetaDataModelContext(project, uri), tagName);
- }
- }
- }
- }
- return _tagEntity;
- }
- /**
- * @return tag name
- */
- public String getTagName() {
- if (getTagEntity() == null)
- return _tagName;
- return getTagEntity().getId();
- }
-
- /**
- * @return tag URI
- */
- public String getURI() {
- if (getTagEntity() == null)
- return _uri;
- return getTagEntity().getModel().getCurrentModelContext().getUri();
- }
-
-
- /**
- * Empty implementation. Subclasses should override to override default dialogField creation
- * @param ppd
- * @return DialogField
- */
- protected DialogField createDialogField(IPropertyPageDescriptor ppd) {
- return null;
- }
-
-// protected DialogField createDialogField(String uri, String tag,
-// String attr) {
-//
-// return null;
-// }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogFieldGroup#initialize()
- */
- public void initialize() {
- if (_dialogFields == null) {
- _dialogFields = new ArrayList();
-
- for (IPropertyPageDescriptor pd : getAttributePDs()) {
- DialogField field;
- field = createDialogField(pd);
-
- if (field == null) {
- field = pd.getDialogFieldEditor();
- }
-
- field.putAttachedData(KEY_ATTR, pd);//descriptors[i]);
-
- IDialogFieldApplyListener applyListener = getDialogFieldApplyListener(pd);
-// getURI(), getTagName(), pd.getAttributeName());//descriptors[i]);
- if (applyListener == null) {
- applyListener = getDefaultApplyListener();
- }
- field.setDialogFieldApplyListener(applyListener);
-
- IDialogFieldChangeListener changeListener = getDialogFieldChangeListener(pd);
-// getURI(), getTagName(), pd.getAttributeName());//descriptors[i]);
- if (changeListener == null) {
- changeListener = getDefaultChangeListener();
- }
- field.setDialogFieldChangeListener(changeListener);
- _dialogFields.add(field);
- }
- }
- }
-
- private List<IPropertyPageDescriptor> getAttributePDs() {
- if (_attrPDs == null){
- _attrPDs = prepareDescriptors(getTagEntity(), _attrNames);
- }
- return _attrPDs;
- }
-
- /**
- * Child class can override the method to provide listener implementation
- *
- * @param ppd
- * @return IDialogFieldApplyListener
- */
- protected IDialogFieldApplyListener getDialogFieldApplyListener(IPropertyPageDescriptor ppd) {
- return null;
- }
-
- /**
- * Child class can override the method to provide listener implementation
- *
- * @param ppd
- * @return IDialogFieldChangeListener
- */
- protected IDialogFieldChangeListener getDialogFieldChangeListener(IPropertyPageDescriptor ppd){
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogFieldGroup#refreshData()
- */
- public void refreshData() {
- if (_ownerElement == null) {
- return;
- }
- initialize();
- for (int i = 0, size = _dialogFields.size(); i < size; i++) {
- DialogField field = _dialogFields.get(i);
-
- ISupportTextValue textValue = (ISupportTextValue) field;
- IPropertyPageDescriptor attr = (IPropertyPageDescriptor) field
- .getAttachedData(KEY_ATTR);
- String attrName = attr.getAttributeName();
- String attrValue = _ownerElement.getAttribute(attrName);
- textValue.setTextWithoutUpdate(attrValue);
- }
- }
-
- /**
- * @return IDOMElement
- */
- public IDOMElement getElement() {
- return _ownerElement;
- }
-
- /**
- * Sets the context in each of the dialogFields in the Group
- * @param context
- * @param owner
- */
- public void setElementContext(IDOMNode context, IDOMElement owner) {
- this._ownerElement = owner;
- resetStructuredDocumentContext();
- initialize();
- if (context != null) {
- for (int i = 0, size = _dialogFields.size(); i < size; i++) {
- DialogField field = _dialogFields.get(i);
- if (field instanceof IElementContextable) {
- ((IElementContextable) field).setElementContext(context,
- owner);
- }
- }
- }
- refreshData();
- }
-
- public void layoutDialogFields(FormToolkit toolkit, Composite parent) {
- Composite top;
- if (toolkit == null) {//when being displayed by DialogFieldGroupPage (wizard)
- top = new Composite(parent, SWT.NONE);
- FillLayout fillLayout = new FillLayout(SWT.VERTICAL);
- parent.setLayout(fillLayout);
- } else {
- top = toolkit.createComposite(parent, SWT.NONE);
- }
-// FillLayout fillLayout = new FillLayout(SWT.VERTICAL);
-// parent.setLayout(fillLayout);
-
-// if (this._helpContextId != null && this._helpContextId.length() > 0) {
-// PlatformUI.getWorkbench().getHelpSystem().setHelp(top,
-// _helpContextId);
-// }
-
- GridLayout layout = new GridLayout();
- int numColumns = getNumColumns();
- layout.numColumns = numColumns;
- top.setLayout(layout);
-// top.setLayoutData(new RowData());
-
- initialize();
- for (int i = 0, size = _dialogFields.size(); i < size; i++) {
- DialogField field = _dialogFields.get(i);
- field.doFillIntoGrid(toolkit, top, numColumns);
- }
-
- DialogField maxColumnField = null;
- int maxColumn = 0;
- for (int i = 0, size = _dialogFields.size(); i < size; i++) {
- DialogField field = _dialogFields.get(i);
- int c = field.getNumberOfControls();
- if (c > maxColumn) {
- maxColumn = c;
- maxColumnField = field;
- }
- }
- if (maxColumnField != null) {
- maxColumnField.handleGrabHorizontal();
- }
- }
-
- /**
- * @return number of columns in for composite grid layout
- */
- public int getNumColumns() {
- int columns = 1;
- initialize();
- for (int i = 0, size = _dialogFields.size(); i < size; i++) {
- DialogField field = _dialogFields.get(i);
- columns = Math.max(columns, field.getNumberOfControls());
- }
- return columns;
- }
-
- @Override
- public IStatus[] validateDialogFields() {
- return null;
- }
-
- /**
- * @return DialogField[]
- */
- public DialogField[] getDialogFields() {
- initialize();
- DialogField[] ret = new DialogField[_dialogFields.size()];
- _dialogFields.toArray(ret);
- return ret;
- }
-
- /**
- * get the dialogfield for the corresponding attribute.
- *
- * @param attrName
- * case sensitive attribute name.
- * @return null if fail to find.
- */
- public DialogField getDialogField(String attrName) {
- initialize();
- for (int i = 0, size = _dialogFields.size(); i < size; i++) {
- DialogField field = _dialogFields.get(i);
- IPropertyPageDescriptor attr = this.getPropertyDescriptor(field);
- if (attr != null && attr.getAttributeName().equals(attrName)) {
- return field;
- }
- }
- return null;
- }
-
- /**
- * @param field
- * @return IPropertyPageDescriptor
- */
- public IPropertyPageDescriptor getPropertyDescriptor(DialogField field) {
- Object obj = field.getAttachedData(KEY_ATTR);
- if (obj instanceof IPropertyPageDescriptor) {
- return (IPropertyPageDescriptor) obj;
- }
- return null;
- }
-
- @Override
- public void reset(){
- if (_dialogFields != null){
- for (DialogField field : _dialogFields){
- field.setDialogFieldApplyListener(null);
- field.setDialogFieldChangeListener(null);
- }
- _dialogFields = null;
- }
- }
-
- /**
- * Set the tag entity
- * @param tagEntity
- */
- /*package*/ void setTagEntity(Entity tagEntity) {
- _tagEntity = tagEntity;
- }
-
- public String toString(){
- StringBuffer buf = new StringBuffer("AttributeGroup: uri="); //$NON-NLS-1$
- buf.append("\r\r").append(getURI()).append("\r\rtag=").append(getTagName()); //$NON-NLS-1$ //$NON-NLS-2$
- buf.append("\r\rAttrs: "); //$NON-NLS-1$
- for (int i=0;i<_attrNames.size();i++) {
- String attr = _attrNames.get(i);
- buf.append(attr);
- if (i<_attrNames.size())
- buf.append(", "); //$NON-NLS-1$
- }
- return buf.toString();
- }
-
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/AttributeGroupSection.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/AttributeGroupSection.java
deleted file mode 100644
index 49a49e4..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/AttributeGroupSection.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties.internal;
-
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogField;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.IDialogFieldApplyListener;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.ISupportTextValue;
-import org.eclipse.jst.pagedesigner.commands.single.ChangeAttributeCommand;
-import org.eclipse.jst.pagedesigner.editors.properties.IPropertyPageDescriptor;
-import org.eclipse.jst.pagedesigner.properties.BaseCustomSection;
-import org.eclipse.jst.pagedesigner.properties.attrgroup.AttributeGroupMessages;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-
-/**
- * This is a section for a list of attribute dialog fields.
- *
- * @author mengbo
- * @version 1.5
- */
-public class AttributeGroupSection extends BaseCustomSection {
- private static final Object KEY_ATTR = "KEY_ATTR"; //$NON-NLS-1$
- private IDialogFieldApplyListener _fieldApplyListener = new IDialogFieldApplyListener() {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.jsf.common.ui.internal.dialogfield.IDialogFieldApplyListener#dialogFieldApplied(org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogField)
- */
- public void dialogFieldApplied(DialogField field) {
- Object attr = field.getAttachedData(KEY_ATTR);
- if (attr instanceof IPropertyPageDescriptor && _element != null) {
- ISupportTextValue textValue = (ISupportTextValue) field;
- ChangeAttributeCommand c = new ChangeAttributeCommand(
- AttributeGroupMessages
- .getString("AttributeGroupSection.changeAttribute"), _element, ((IPropertyPageDescriptor) attr).getAttributeName(), textValue.getText()); //$NON-NLS-1$
- c.execute();
- }
- }
- };
-
- private AttributeGroup _group;
-
- /**
- * Constructor. Create the section with a default AttributeGroup. In default
- * AttributeGroup, there is no relationship between fields.
- *
- * @param tagEntity
- * @param attrNames
- */
- public AttributeGroupSection(Entity tagEntity, List<String> attrNames) {
- this(new AttributeGroup(tagEntity, attrNames));
- }
-
- /**
- * Constructor. In case the group is not a default group (e.g. you may add some
- * customized relationship between the fields).
- *
- * @param group
- */
- public AttributeGroupSection(AttributeGroup group) {
- _group = group;
- _group.setDefaultApplyListener(_fieldApplyListener);
-// _group.initialize();
- }
-
- public void setInput(IWorkbenchPart part, ISelection selection) {
- super.setInput(part, selection);
- _group.setElementContext(_element, _element);
- }
-
- public void createControls(Composite parent,
- TabbedPropertySheetPage aTabbedPropertySheetPage) {
- super.createControls(parent, aTabbedPropertySheetPage);
- TabbedPropertySheetWidgetFactory factory = aTabbedPropertySheetPage
- .getWidgetFactory();
- _group.layoutDialogFields(factory, parent);
- }
-
- protected void notifyChanged(INodeNotifier notifier, int eventType,
- Object changedFeature, Object oldValue, Object newValue, int pos) {
- if (_group != null) {
- _group.refreshData();
- }
- }
-
- @Override
- public void dispose() {
- super.dispose();
- _group.reset();
- }
-
- /**
- * NOT API - for JUnit testing only
- * @return @link{AttributeGroup}
- */
- public AttributeGroup getAttributeGroup() {
- return _group;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/AttributesTabDescriptor.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/AttributesTabDescriptor.java
deleted file mode 100644
index 4c00440..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/AttributesTabDescriptor.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties.internal;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.ui.views.properties.tabbed.AbstractTabDescriptor;
-import org.eclipse.ui.views.properties.tabbed.ISectionDescriptor;
-
-/**
- * Attributes tab descriptor
- *
- */
-public class AttributesTabDescriptor extends AbstractTabDescriptor {
-
- /**
- * Attributes tab id
- */
- public static final String TAB_ID = "jst.pagedesigner.tabbed.properties.attributes"; //$NON-NLS-1$
-
- private Vector<ISectionDescriptor> descriptors;
-
- /**
- * Constructor
- */
- public AttributesTabDescriptor(){
- super();
- descriptors = new Vector<ISectionDescriptor>(1);
- descriptors.add(new AllPropertySectionDescriptor());
- }
-
- @Override
- public List getSectionDescriptors() {
- return descriptors;
- }
-
- public String getCategory() {
- return "attributes"; //$NON-NLS-1$
- }
-
- public String getId() {
- return TAB_ID;
- }
-
- public String getLabel() {
- return Messages.AttributesTabDescriptor_label;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/DefaultPropertyPageDescriptor.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/DefaultPropertyPageDescriptor.java
deleted file mode 100644
index e22bf2e..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/DefaultPropertyPageDescriptor.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties.internal;
-
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogField;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.metadataprocessors.MetaDataContext;
-import org.eclipse.jst.pagedesigner.editors.properties.IPropertyPageDescriptor;
-import org.eclipse.jst.pagedesigner.meta.EditorCreator;
-import org.eclipse.jst.pagedesigner.meta.IAttributeRuntimeValueType;
-import org.eclipse.jst.pagedesigner.meta.internal.CellEditorFactoryRegistry;
-import org.eclipse.jst.pagedesigner.properties.ITabbedPropertiesConstants;
-import org.eclipse.swt.widgets.Composite;
-import org.w3c.dom.Element;
-
-/**
- * Property descriptor implementation for when meta data is available, but the
- * meta data type is not adaptable to a {@link IPropertyPageDescriptor}.
- *
- * It is assumed that the value type is
- * {@link org.eclipse.jst.jsf.taglibprocessing.attributevalues.StringType}.
- */
-public class DefaultPropertyPageDescriptor implements IPropertyPageDescriptor
-{
- private Entity _tagEntity;
- private Entity _attrEntity;
-
- private IStructuredDocumentContext _sdContext;
- private MetaDataContext _mdContext;
-
- /**
- * Constructor
- *
- * @param tagEntity
- * @param attrEntity
- */
- public DefaultPropertyPageDescriptor(Entity tagEntity, Entity attrEntity)
- {
- _tagEntity = tagEntity;
- _attrEntity = attrEntity;
- }
-
- public String getAttributeName()
- {
- return _attrEntity.getId();
- }
-
- public String getCategory()
- {
- return ITabbedPropertiesConstants.OTHER_CATEGORY;
- }
-
- public CellEditor getCellEditor(Composite parent)
- {
- Element element = (Element) IStructuredDocumentContextResolverFactory.INSTANCE
- .getDOMContextResolver(getStructuredDocumentContext())
- .getNode();
- return CellEditorFactoryRegistry.getInstance().createCellEditor(parent,
- this, element);
- }
-
- public String getDescription()
- {
- return null;
- }
-
- public DialogField getDialogFieldEditor()
- {
- EditorCreator creator = EditorCreator.getInstance();
- return creator.createDialogFieldWithWrapper(getUri(), getTagName(),
- this, null);
- }
-
- public String getLabel()
- {
- return getAttributeName() + ":";
- }
-
- public String getTagName()
- {
- return _tagEntity.getId();
- }
-
- public String getUri()
- {
- return _tagEntity.getModel().getCurrentModelContext().getUri();
- }
-
- public String getValueType()
- {
- return IAttributeRuntimeValueType.STRING;
- }
-
- public boolean isRequired()
- {
- return false;
- }
-
- public MetaDataContext getMetaDataContext()
- {
- return _mdContext;
- }
-
- public IStructuredDocumentContext getStructuredDocumentContext()
- {
- return _sdContext;
- }
-
- public void setMetaDataContext(MetaDataContext context)
- {
- _mdContext = context;
- }
-
- public void setStructuredDocumentContext(IStructuredDocumentContext context)
- {
- _sdContext = context;
- }
-
- public Object getAdapter(Class adapter)
- {
- return null;
- }
-
- public String toString()
- {
- return getUri()
- + "/" + getTagName() + "/" + getAttributeName() + " (Default Descriptor)"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/MDQuickEditTabSectionDescriptor.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/MDQuickEditTabSectionDescriptor.java
deleted file mode 100644
index e1628d4..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/MDQuickEditTabSectionDescriptor.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties.internal;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.views.properties.tabbed.AbstractSectionDescriptor;
-import org.eclipse.ui.views.properties.tabbed.ISection;
-
-/**
- * Quick Edit section descriptor that uses the quickEditSection trait meta data for the tag entity of the selection
- * to determine the sections to display
- *
- */
-public class MDQuickEditTabSectionDescriptor extends AbstractSectionDescriptor {
-
- /**
- * Default constructor
- */
- public MDQuickEditTabSectionDescriptor() {
- super();
- }
-
- @Override
- public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
- return true;// we will always display tab, but will show text that no quick edit properties are available when they aren't
- }
-
- public ISection getSectionClass() {
- return new QuickEditTabSection();
- }
-
- public String getTargetTab() {
- return QuickEditTabDescriptor.TAB_ID;
- }
-
- public String getId() {
- return "mdQuickEditTabSections"; //$NON-NLS-1$
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/Messages.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/Messages.java
deleted file mode 100644
index 275a500..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/Messages.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Externalized strings
- *
- */
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.jst.pagedesigner.properties.internal.messages"; //$NON-NLS-1$
- /**
- *
- */
- public static String AttributesTabDescriptor_label;
- /**
- *
- */
- public static String QuickEditTabDescriptor_label;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- //
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/NullQuickEditTabGroupDescriptor.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/NullQuickEditTabGroupDescriptor.java
deleted file mode 100644
index 893b6ab..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/NullQuickEditTabGroupDescriptor.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.ui.views.properties.tabbed.ISection;
-
-/**
- * QuickEdit Tab section when quick edit section info is not available.
- *
- * Ideally we should not be displaying the tab in the absence of MD, but due to current
- * issues with the tabbed-properties framework, it is easier to simply display a "null"
- * section.
- *
- */
-public class NullQuickEditTabGroupDescriptor extends
- QuickEditTabSectionsDescriptor {
-
- private List<ISection> nullQuickEditSection;
-
- /**
- * Constructor
- */
- public NullQuickEditTabGroupDescriptor() {
- super();
- }
-
- @Override
- public List<ISection> getSections() {
- return nullQuickEditSection;
- }
-
- @Override
- public void calculateSections() {
- nullQuickEditSection = new ArrayList<ISection>(1);
- nullQuickEditSection.add(new NullQuickEditTabSection());
- }
-
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/NullQuickEditTabSection.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/NullQuickEditTabSection.java
deleted file mode 100644
index 11712bf..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/NullQuickEditTabSection.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties.internal;
-
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.AbstractPropertySection;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-/**
- * Section that displays text that no quick edit properties are available for the input
- */
-public class NullQuickEditTabSection extends AbstractPropertySection {
-
- @Override
- public void createControls(Composite parent,
- TabbedPropertySheetPage tabbedPropertySheetPage) {
- super.createControls(parent, tabbedPropertySheetPage);
- TabbedPropertySheetWidgetFactory factory = tabbedPropertySheetPage.getWidgetFactory();
-
- Composite cont = factory.createComposite(parent, SWT.NO_FOCUS);
- GridLayout layout = new GridLayout(1, false);
- cont.setLayout(layout);
-
- CLabel lbl =
- factory.createCLabel(cont, PDPlugin.getResourceString("QuickEditTab.no_quick_edit_md"));//$NON-NLS-1$
- lbl.setLayoutData(new GridData());
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/QuickEditTabDescriptor.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/QuickEditTabDescriptor.java
deleted file mode 100644
index 5917065..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/QuickEditTabDescriptor.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties.internal;
-
-import org.eclipse.ui.views.properties.tabbed.AbstractTabDescriptor;
-
-/**
- * Quick Edit Tab Descriptor
- */
-public class QuickEditTabDescriptor extends AbstractTabDescriptor {
-
- /**
- * Quick Edit tab id
- */
- public static final String TAB_ID = "jst.pagedesigner.tabbed.properties.quickedit"; //$NON-NLS-1$
-
- /**
- * Constructor
- */
- public QuickEditTabDescriptor(){
- super();
- getSectionDescriptors().add(new MDQuickEditTabSectionDescriptor());
- }
-
- public String getCategory() {
- return "quickedit"; //$NON-NLS-1$
- }
-
- public String getId() {
- return TAB_ID;
- }
-
- public String getLabel() {
- return Messages.QuickEditTabDescriptor_label;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/QuickEditTabManager.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/QuickEditTabManager.java
deleted file mode 100644
index f14058a..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/QuickEditTabManager.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties.internal;
-
-import javax.xml.namespace.QName;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.query.ITaglibDomainMetaDataModelContext;
-import org.eclipse.jst.jsf.common.metadata.query.TaglibDomainMetaDataQueryHelper;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.ITaglibContextResolver;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContextFactory;
-import org.eclipse.jst.pagedesigner.editors.HTMLEditor;
-import org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.QuickEditTabSections;
-import org.eclipse.jst.pagedesigner.properties.DesignerPropertyTool;
-import org.eclipse.jst.pagedesigner.properties.WPETabbedPropertySheetPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.part.FileEditorInput;
-import org.w3c.dom.Element;
-
-/**
- * One-to-one with {@link WPETabbedPropertySheetPage} that manages the current sections for the current selection.
- * <p>
- * The QuickEditTabManager has a shared instance of a {@link QuickEditTabSectionsManager} for the project.
- * <p>
- * When a WPETabbedPropertySheetPage is created, it must acquire a QuickEditTabManager using the static acquireInstance method,
- * and then release the instance when it is disposed. This ensures that the QuickEditTabSectionsManager shared instance (per project) is released appropriately.
- * <p>
- * selectionChanged method must be called prior to calling createControls on the sections for this tab group call.
- */
-public class QuickEditTabManager {
- private QuickEditTabSectionsManager _groupsManager;
- private QuickEditTabSections _quickEditTabSections;
- private Entity _tagEntity;
- private QName _lastTagID;
- private QuickEditTabSectionsDescriptor _lastQuickEditTabGroup;
- private QuickEditTabSectionsDescriptor _nullQuickEditTabGroup;
- private Element _lastElement;
-
- private QuickEditTabSectionsManager getRegistry() {
- return _groupsManager;
- }
-
- /**
- * Must only be called once per tabbed property sheet as ref count is kept.
- * Callers must call releaseInstance when the page is disposed
- * @param page
- * @return instance for this property sheet
- */
- public static synchronized QuickEditTabManager acquireInstance(WPETabbedPropertySheetPage page) {
- IProject project = getProject(page);
- QuickEditTabManager instance = new QuickEditTabManager();
- instance._groupsManager = QuickEditTabSectionsManager.acquireInstance(project);
- return instance;
- }
-
- /**
- * Releases this instance, but does not dispose. Ensures that the {@link QuickEditTabSectionsManager} is released.
- */
- public synchronized void releaseInstance() {
- this._groupsManager.releaseInstance();
- }
-
- /**
- * Private constructor
- */
- private QuickEditTabManager(){
- //
- }
-
- private static IProject getProject(WPETabbedPropertySheetPage page) {
- IProject proj = null;
- IDocument doc = ((HTMLEditor)page.getEditor()).getDocument();
- IStructuredDocumentContext context = IStructuredDocumentContextFactory.INSTANCE.getContext(doc, 0);
- if (context != null){
- proj = IStructuredDocumentContextResolverFactory.INSTANCE.getWorkspaceContextResolver(context).getProject();
- }
- return proj;
-
- }
- /**
- * Must be called so that the sections for the input can be calculated.
- *
- * @param part
- * @param selection
- * @return true if current selection is different than during the last call
- */
- public boolean selectionChanged(IWorkbenchPart part, ISelection selection) {
- boolean hasChanged = false;
- QuickEditTabSections qets = getQuickTabSectionsMetaData(part, selection);
- if (qets == null) {//use null quick edit tab
- hasChanged = (_quickEditTabSections != null);
- _quickEditTabSections = qets;
- _lastQuickEditTabGroup = getNullQuickEditTab();
- _lastTagID = null;
- }
- else {
- QName tagId = getTagId();
- if (_lastTagID == null || !_lastTagID.equals(tagId)){
- _quickEditTabSections = qets;
- QuickEditTabSectionsDescriptor group = getRegistry().getQuickEditTabSectionsFor(tagId);
- if (group == null){
- group = createQuickEditTabGroup(tagId, _quickEditTabSections);
- if (group != null){
- group.calculateSections();
- getRegistry().addQuickEditTabGroupDescriptor(group);
- }
- }
- _lastQuickEditTabGroup = group;
- _lastTagID = tagId;
- }
- }
-
- return hasChanged;
- }
-
- /**
- * @return current QuickEditTabSectionsDescriptor
- */
- public QuickEditTabSectionsDescriptor getCurrentTabGroupDescriptor() {
- return _lastQuickEditTabGroup;
- }
-
- private QuickEditTabSections getQuickTabSectionsMetaData(IWorkbenchPart part,
- ISelection selection) {
-
- Element node = DesignerPropertyTool.getElement(part, selection);
- if (node == null) {
- return null;
- }
- if (_lastElement != node){
- _lastElement = node;
- _quickEditTabSections = null;
- _tagEntity = getTagEntity(part, selection, node);
- if (_tagEntity != null) {
- Trait pds = TaglibDomainMetaDataQueryHelper.getTrait(_tagEntity, QuickEditTabSections.TRAIT_ID);
- if (pds != null){
- _quickEditTabSections = (QuickEditTabSections)pds.getValue();
- }
- }
- }
- return _quickEditTabSections;
- }
-
- private QuickEditTabSectionsDescriptor createQuickEditTabGroup(QName tagId,
- QuickEditTabSections tabSections) {
- return new QuickEditTabSectionsDescriptor(_tagEntity, tagId, tabSections);
- }
-
- private QName getTagId() {
- return TaglibDomainMetaDataQueryHelper.getQNameForTagEntity(_tagEntity);
- }
-
- /**
- * Dispose
- */
- public void dispose() {
- _lastQuickEditTabGroup= null;
- _lastElement = null;
- _lastTagID = null;
- _nullQuickEditTabGroup = null;
- _quickEditTabSections = null;
- _groupsManager = null;
- }
-
- private Entity getTagEntity(IWorkbenchPart part, ISelection selection, Element node){
- HTMLEditor ed = null;
- if (part instanceof HTMLEditor)
- ed = (HTMLEditor)part;
- if (ed == null)
- return null;
-
- FileEditorInput input = (FileEditorInput)ed.getEditorInput();
- IStructuredDocumentContext context = IStructuredDocumentContextFactory.INSTANCE.getContext(ed.getDocument(), node);
- if (context != null){
- ITaglibContextResolver resolver = IStructuredDocumentContextResolverFactory.INSTANCE.getTaglibContextResolver(context);
- if (resolver != null){
- ITaglibDomainMetaDataModelContext mdContext = TaglibDomainMetaDataQueryHelper.createMetaDataModelContext(input.getFile().getProject(),resolver.getTagURIForNodeName(node));
- return TaglibDomainMetaDataQueryHelper.getEntity(mdContext, node.getLocalName());
- }
- }
- return null;
- }
-
- private QuickEditTabSectionsDescriptor getNullQuickEditTab() {
- if (_nullQuickEditTabGroup == null) {
- _nullQuickEditTabGroup = new NullQuickEditTabGroupDescriptor();
- _nullQuickEditTabGroup.calculateSections();
- }
- return _nullQuickEditTabGroup;
- }
-
- /**
- * NOT API - for JUnit testing only
- * @return {@link QuickEditTabSectionsManager}
- */
- public QuickEditTabSectionsManager getQuickEditTabSectionsManager() {
- return _groupsManager;
- }
-
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/QuickEditTabSection.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/QuickEditTabSection.java
deleted file mode 100644
index 172626c..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/QuickEditTabSection.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties.internal;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jst.pagedesigner.properties.WPETabbedPropertySheetPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Layout;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.views.properties.tabbed.AbstractPropertySection;
-import org.eclipse.ui.views.properties.tabbed.ISection;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
-
-/**
- * Using the tag entity's QuickEditTabSections meta-data, this section reacts to changes in selection,
- * and will dynamically create a QuickEditTabGroup. The QuickEditTabGroup is cached and reused.
- * <br><br>
- * This section delegates construction to the sections discovered thru meta data.
- * Because this section is not disposed of until the tab is disposed, this section will enforce the expected section lifecycle
- * on the sections loaded from meta data. This occurs during setInput. But will pass on all section lifecycle events as
- * this section receives them.
- * <br><br>
- * The lifecycle that this section enforces on it's child sections in the setInput call on this section are (in order):
- * <li>createControls
- * <li>setInput
- * <li>aboutToBeShown
- * <li>refresh
- *
- * When tab section lifecycle events occur to this section, they are passed on to all child sections also.
- *
- */
-public class QuickEditTabSection extends AbstractPropertySection {
-
- private QuickEditTabManager manager;
- private Composite _composite;
- private Composite _qeGroupComposite;
- private WPETabbedPropertySheetPage _tabbedPropertySheetPage;
-
- private QuickEditTabManager getTabManager() {
- if (manager == null) {
- manager = _tabbedPropertySheetPage.getTabManager();
- }
- return manager;
- }
-
- @Override
- public void createControls(Composite parent,
- TabbedPropertySheetPage tabbedPropertySheetPage) {
- super.createControls(parent, tabbedPropertySheetPage);
- _composite = parent;
- _tabbedPropertySheetPage = (WPETabbedPropertySheetPage)tabbedPropertySheetPage;
- }
-
- @Override
- public void setInput(IWorkbenchPart part, ISelection selection) {
- super.setInput(part, selection);
- if (getTabManager() != null){
- aboutToBeHidden();
- createOrResetQuickEditGroupComposite();//disposes of old and recreates new topComp
- getTabManager().selectionChanged(part, selection);
- for (ISection section : getSections()){
- section.createControls(_qeGroupComposite, _tabbedPropertySheetPage);
- section.setInput(part, selection);
- }
- _composite.getParent().layout(true, true);
-
- aboutToBeShown();
- refresh();
- }
- }
-
- @Override
- public void aboutToBeHidden() {
- super.aboutToBeHidden();
- for (ISection section : getSections()){
- section.aboutToBeHidden();
- }
- }
-
- @Override
- public void aboutToBeShown() {
- super.aboutToBeShown();
- for (ISection section : getSections()){
- section.aboutToBeShown();
- }
- }
-
- @Override
- public void refresh() {
- super.refresh();
- for (ISection section : getSections()){
- section.refresh();
- }
- }
-
- private void createOrResetQuickEditGroupComposite() {
- if (_qeGroupComposite != null && !_qeGroupComposite.isDisposed()){
- //dispose of current sections
- disposeCurrentQuickEditTabSections();
- _qeGroupComposite.dispose();
- }
-
- _qeGroupComposite = _tabbedPropertySheetPage.getWidgetFactory().createComposite(_composite, SWT.NO_FOCUS);
- QuickEditTabLayout layout = new QuickEditTabLayout();
- _qeGroupComposite.setLayout(layout);
-
- }
-
- private void disposeCurrentQuickEditTabSections() {
- for (ISection section : getSections()){
- section.dispose();
- }
- }
-
- private List<ISection> getSections(){
- if (getTabManager().getCurrentTabGroupDescriptor() != null)
- return getTabManager().getCurrentTabGroupDescriptor().getSections();
-
- return Collections.EMPTY_LIST;
- }
-
- public void dispose() {
- super.dispose();
- disposeCurrentQuickEditTabSections();
- manager.dispose();
- manager = null;
- _composite = null;
- _qeGroupComposite = null;
- _tabbedPropertySheetPage = null;
- }
-
- public boolean shouldUseExtraSpace() {
- return false;
- }
-
- private class QuickEditTabLayout extends Layout {
-
- // allow for adjustments
- private static final int MARGIN = 0;
- private static final int SPACING = 0;
-
- // cache
- Point[] sizes;
- int maxWidth, totalHeight;
-
- protected Point computeSize(Composite composite, int wHint, int hHint,
- boolean flushCache) {
-
- Control children[] = composite.getChildren();
- if (flushCache || sizes == null || sizes.length != children.length) {
- initialize(children);
- }
-
- int width = wHint, height = hHint;
- if (wHint == SWT.DEFAULT)
- width = maxWidth;
-
- if (hHint == SWT.DEFAULT)
- height = totalHeight;
-
- return new Point(width + 2 * MARGIN, height + 2 * MARGIN);
- }
-
- protected void layout(Composite composite, boolean flushCache) {
- Control children[] = composite.getChildren();
- if (flushCache || sizes == null || sizes.length != children.length) {
- initialize(children);
- }
- Rectangle rect = composite.getClientArea();
- int x = MARGIN, y = MARGIN;
- int width = Math.max(rect.width - 2 * MARGIN, maxWidth);
-// System.out.println("--- Comp id: "+composite.toString()+ "[#Children: "+ composite.getChildren().length +"] -------");
- for (int i = 0; i < children.length; i++) {
- int height = sizes[i].y;
- children[i].setBounds(x, y, width, height);
- y += height + SPACING;
-// System.out.println("h="+height+", y="+y);
- }
- composite.setRedraw(true);
- }
-
- void initialize(Control children[]) {
- maxWidth = 0;
- totalHeight = 0;
- sizes = new Point[children.length];
- for (int i = 0; i < children.length; i++) {
- sizes[i] = children[i].computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
- maxWidth = Math.max(maxWidth, sizes[i].x);
- totalHeight += sizes[i].y;
- }
- totalHeight += (children.length - 1) * SPACING;
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/QuickEditTabSectionDescriptor.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/QuickEditTabSectionDescriptor.java
deleted file mode 100644
index 18fddd4..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/QuickEditTabSectionDescriptor.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties.internal;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.properties.DesignerPropertyTool;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.internal.views.properties.tabbed.view.SectionDescriptor;
-import org.eclipse.ui.views.properties.tabbed.ISection;
-import org.eclipse.ui.views.properties.tabbed.ITypeMapper;
-import org.w3c.dom.Element;
-
-/**
- * A SectionDescriptor from org.eclipse.ui.views.properties.tabbed.propertySections extension-point
- * for use by the QuickEdit tab in the Web Page Editor.
- */
-public class QuickEditTabSectionDescriptor extends SectionDescriptor {
-
- private static final String ATT_CLASS = "class"; //$NON-NLS-1$
- private IConfigurationElement _configurationElement;
- private Entity _tagEntity;
-
- /**
- * Constructor for the section descriptor.
- *
- * @param configurationElement
- * the configuration element for the section descriptor.
- * @param typeMapper
- */
- public QuickEditTabSectionDescriptor(IConfigurationElement configurationElement, ITypeMapper typeMapper) {
- super(configurationElement, typeMapper);
- _configurationElement = configurationElement;
- }
-
- @Override
- public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
- Element node = DesignerPropertyTool.getElement(part, selection);
- if (node == null) {
- return false;
- }
- return true;
- }
-
- @Override
- public ISection getSectionClass() {
- ISection section = null;
- try {
- Object secOrGroup = _configurationElement
- .createExecutableExtension(ATT_CLASS);
- if (secOrGroup instanceof ISection) {
- section = (ISection) secOrGroup;
- } else if (secOrGroup instanceof AttributeGroup) {
- ((AttributeGroup) secOrGroup).setTagEntity(_tagEntity);
- section = new AttributeGroupSection((AttributeGroup) secOrGroup);
- }
- } catch (CoreException exception) {
- handleSectionError(exception);
- }
- return section;
- }
-
- /**
- * Handle the section error when an issue is found loading from the
- * configuration element.
- *
- * @param _configurationElement
- * the configuration element
- * @param exception
- * an optional CoreException
- */
- private void handleSectionError(CoreException exception) {
- PDPlugin.getLogger(QuickEditTabSectionDescriptor.class).error("error", //$NON-NLS-1$
- exception);
- exception.printStackTrace();
- }
-
- /**
- * @param tagEntity
- * @return ISection for the tagEntity
- */
- /*package*/ ISection getSectionClass(Entity tagEntity) {
- _tagEntity = tagEntity;
- return getSectionClass();
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/QuickEditTabSectionsDescriptor.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/QuickEditTabSectionsDescriptor.java
deleted file mode 100644
index afba392..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/QuickEditTabSectionsDescriptor.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.QuickEditTabSections;
-import org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.SECTION_TYPE;
-import org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.SectionInfo;
-import org.eclipse.ui.views.properties.tabbed.ISection;
-
-/**
- * Represents all of the section classes that make up the Quick Edit tab for a given tag input.
- * Uses QuickEditTabSections meta data from tag entity
- */
-public class QuickEditTabSectionsDescriptor {
-
- private QuickEditTabSections _sections;
- private QName _tagId;
- private List<ISection> _sectionClasses;
- private Entity _tagEntity;
- private WPETabPropertySectionDescriptorProvider sectionProvider;
-
- /**
- * Constructor
- * @param tagEntity
- * @param tagId
- * @param sections
- */
- public QuickEditTabSectionsDescriptor (Entity tagEntity, QName tagId, QuickEditTabSections sections) {
- _tagEntity = tagEntity;
- _tagId = tagId;
- _sections = sections;
- }
-
- /*package*/ QuickEditTabSectionsDescriptor () {
- _tagEntity = null;
- _tagId = null;
- _sections = null;
- }
-
- /**
- * Determines section classes for the group from the available meta data
- */
- public void calculateSections() {
- if (_sectionClasses == null || _sectionClasses.isEmpty()) {
- _sectionClasses = new ArrayList();
- List<String> attrIds = new ArrayList();
- for (SectionInfo secInfo : _sections.getSections()) {
- if (secInfo.getType() == SECTION_TYPE.ATTRIBUTE){
- //collect attrSecs and process as a group so that layout will be best
- if (secInfo.getId() != null)
- attrIds.add(secInfo.getId());
- }
- else if (secInfo.getType() == SECTION_TYPE.SECTION) {
- //if there are any attribute sections not processed, do that now
- if (attrIds.size() > 0){
- createAttributeGroup(attrIds);
- attrIds = new ArrayList();
- }
- createSectionGroup(secInfo);
- }
- }
- if (attrIds.size() > 0){
- createAttributeGroup(attrIds);
- }
- }
- }
-
- private void createSectionGroup(SectionInfo secInfo) {
- QuickEditTabSectionDescriptor sd = getSectionProvider().getNamedSectionDescriptor(secInfo.getId());
- if (sd != null) {
- ISection section = sd.getSectionClass(_tagEntity);
- if (section != null){
- _sectionClasses.add(section);
- }
- }
-
- }
-
- private void createAttributeGroup(List<String> attrNames) {
- ISection section = new AttributeGroupSection(_tagEntity, attrNames);
- if (section != null){
- _sectionClasses.add(section);
- }
- }
-
- /**
- * @return QName of tag that this tab descriptor is for
- */
- public QName getTagId() {
- return _tagId;
- }
-
- /**
- * @return List of current ISection classes set after calculateSections() has been called
- */
- public List<ISection> getSections() {
- return _sectionClasses;
- }
-
- private WPETabPropertySectionDescriptorProvider getSectionProvider() {
- if (sectionProvider == null){
- sectionProvider = new WPETabPropertySectionDescriptorProvider();
- }
- return sectionProvider;
- }
-
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/QuickEditTabSectionsManager.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/QuickEditTabSectionsManager.java
deleted file mode 100644
index 17bbc45..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/QuickEditTabSectionsManager.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties.internal;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.eclipse.core.resources.IProject;
-
-/**
- * Cache of quickEditTabGroupDescriptors keyed by tagID as QName.
- */
-public class QuickEditTabSectionsManager {
-
- private static QuickEditTabSectionsManagerMgr _mgrInstance = new QuickEditTabSectionsManagerMgr();
- private Map<QName, QuickEditTabSectionsDescriptor> map = new HashMap<QName, QuickEditTabSectionsDescriptor>(5);
- private IProject _project;
- private int clientCount = 0;
-
- /**
- * Returns instance of QuickEditTabSectionsManager for the given project. Caller must release the instance when caller is being disposed.
- * @param project
- * @return instance of QuickEditTabSectionsManager
- */
- public static synchronized QuickEditTabSectionsManager acquireInstance(IProject project){
- QuickEditTabSectionsManager instance = _mgrInstance.getSectionsManager(project);
- instance.clientCount++;
- return instance;
- }
-
- /**
- * Releases instance of QuickEditTabSectionsManager and removes from the QuickEditSectionGroupsManagerMgr if it is the last reference
- */
- public synchronized void releaseInstance(){
- int refCount = --clientCount;
- if (refCount == 0){
- _mgrInstance.removeSectionsManager(_project);
- }
- }
-
- /**
- * private constructor
- */
- private QuickEditTabSectionsManager(){
- //
- }
-
- /**
- * @return IProject that this section manager applies to
- */
- public IProject getProject(){
- return _project;
- }
-
- /**
- * Get QuickEditTabSectionsDescriptor for passed tag
- *
- * @param tagId
- * @return QuickEditTabSectionsDescriptor
- */
- public QuickEditTabSectionsDescriptor getQuickEditTabSectionsFor(QName tagId) {
- return map.get(tagId);
- }
-
- /**
- * Adds QuickEditTabSectionsDescriptor to managed registry keyed by the tagId
- * QName
- *
- * @param group
- */
- public void addQuickEditTabGroupDescriptor(QuickEditTabSectionsDescriptor group) {
- map.put(group.getTagId(), group);
- }
-
- /**
- * Removes and disposes a cached {@link QuickEditTabSectionsDescriptor}
- *
- * @param tagId
- */
- public void removeQuickEditTabGroup(QName tagId) {
- QuickEditTabSectionsDescriptor grp = map.get(tagId);
- if (grp != null) {
- map.remove(tagId);
- }
- }
-
- /**
- * Manages the QuickEditTabSectionsManager instances. Ensures one per project.
- */
- private static class QuickEditTabSectionsManagerMgr {
- private Map <IProject,QuickEditTabSectionsManager>_map = new HashMap<IProject,QuickEditTabSectionsManager>();
- /**
- * @param project - may be null
- * @return QuickEditTabManager for project
- */
- public QuickEditTabSectionsManager getSectionsManager(IProject project){
- if (_map.containsKey(project))
- return _map.get(project);
-
- QuickEditTabSectionsManager instance = new QuickEditTabSectionsManager();
- instance._project = project;
- _map.put(project, instance);
- return instance;
- }
-
- /**
- * Removes QuickEditTabManager from mgr for given project
- * @param project
- */
- public void removeSectionsManager(IProject project){
- if (_map.containsKey(project))
- _map.remove(project);
- }
-
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/WPETabDescriptorProvider.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/WPETabDescriptorProvider.java
deleted file mode 100644
index 5003d40..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/WPETabDescriptorProvider.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties.internal;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.views.properties.tabbed.ITabDescriptor;
-import org.eclipse.ui.views.properties.tabbed.ITabDescriptorProvider;
-
-/**
- * Class that provides the default tabs for the Web Page Editor
- */
-public class WPETabDescriptorProvider implements ITabDescriptorProvider {
-
- private AttributesTabDescriptor _attributesTabDescriptor;
- private QuickEditTabDescriptor _quickTabDescriptor;
-
- /**
- * Constructor
- */
- public WPETabDescriptorProvider() {
- _quickTabDescriptor = new QuickEditTabDescriptor();
- _attributesTabDescriptor = new AttributesTabDescriptor();
- }
-
- /**
- * Provides a QuickTabDescriptor and the AttributesTabDescriptor
- */
- public ITabDescriptor[] getTabDescriptors(IWorkbenchPart part,
- ISelection selection) {
-
- return new ITabDescriptor[]{_quickTabDescriptor,
- _attributesTabDescriptor};
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/WPETabPropertySectionDescriptorProvider.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/WPETabPropertySectionDescriptorProvider.java
deleted file mode 100644
index 4e2530d..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/WPETabPropertySectionDescriptorProvider.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.properties.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jst.pagedesigner.editors.HTMLEditor;
-import org.eclipse.ui.views.properties.tabbed.ISectionDescriptor;
-import org.eclipse.ui.views.properties.tabbed.ISectionDescriptorProvider;
-
-/**
- * Provides sections registered for the Web Page Editor whose contributor ID is,
- * "org.eclipse.jst.pagedesigner.tabPropertyContributor" using the
- * org.eclipse.ui.views.properties.tabbed.propertyTabs extension-points.
- *
- * The sections declared using the org.eclipse.ui.views.properties.tabbed.propertySections extension-point
- * for the WPE will only be displayed by the Quick Edit tab is the selected tag has metadata to choose
- * the section. TypeMappers/filters, etc. are ignored by this sectionDescriptorProvider.
- *
- * See jsf_html.xml in the org.eclipse.jst.jsf.standard.tagsupport plugin for examples on how to use.
- */
-public class WPETabPropertySectionDescriptorProvider implements
- ISectionDescriptorProvider {
-
- private static final String EXTPT_SECTIONS = "propertySections"; //$NON-NLS-1$
- private static final String ELEMENT_SECTION = "propertySection"; //$NON-NLS-1$
- private ISectionDescriptor[] _descriptors = null;
-
- /**
- * Constructor
- */
- public WPETabPropertySectionDescriptorProvider() {
- super();
- }
-
- public ISectionDescriptor[] getSectionDescriptors() {
- if (_descriptors == null) {
- List result = new ArrayList();
- List contributedSections = readSectionDescriptors();
- result.addAll(contributedSections);
-
-// if (1 == 0){ //disabled for now... do we want to allow other mechanisms to add sections?
-// List providers = readAdditionalSectionDescriptorProviders();
-// for (int i = 0, size = providers.size(); i < size; i++) {
-// try {
-// ISectionDescriptorProvider provider = (ISectionDescriptorProvider) providers
-// .get(i);
-// ISectionDescriptor[] sections = provider
-// .getSectionDescriptors();
-// if (sections != null) {
-// result.addAll(Arrays.asList(sections));
-// }
-// } catch (Exception ex) {
-// // ignore
-// ex.printStackTrace();
-// }
-// }
-// }
- _descriptors = new ISectionDescriptor[result.size()];
- result.toArray(_descriptors);
- }
- return _descriptors;
- }
-
- /**
- * @return registered section descriptors for the WPE QuickEdit tab
- */
- protected List<QuickEditTabSectionDescriptor> readSectionDescriptors() {
- List result = new ArrayList();
-
- IConfigurationElement[] extensions = getConfigurationElements(EXTPT_SECTIONS);
- for (int i = 0; i < extensions.length; i++) {
- IConfigurationElement extension = extensions[i];
- if (extension.getAttribute("contributorId").equals(HTMLEditor.TABBED_PROPERTIES_CONTRIBUTOR_ID)){ //$NON-NLS-1$
- IConfigurationElement[] sections = extension
- .getChildren(ELEMENT_SECTION);
- for (int j = 0; j < sections.length; j++) {
- IConfigurationElement section = sections[j];
- ISectionDescriptor descriptor = new QuickEditTabSectionDescriptor(
- section, null);//ITypeMapper set to null
- result.add(descriptor);
- }
- }
- }
- return result;
- }
-
- /**
- * @param extensionPointId
- * @return IConfigurationElement[]
- */
- private static IConfigurationElement[] getConfigurationElements(
- String extensionPointId) {
- IExtensionPoint extensionPoint = Platform.getExtensionRegistry()
- .getExtensionPoint("org.eclipse.ui.views.properties.tabbed", extensionPointId); //$NON-NLS-1$
- if (extensionPoint == null) {
- return null;
- }
- return extensionPoint.getConfigurationElements();
- }
-
- /**
- * @param name of section
- * @return {@link QuickEditTabSectionDescriptor} or null if not located
- */
- public QuickEditTabSectionDescriptor getNamedSectionDescriptor(String name) {
- for (int i=0;i<getSectionDescriptors().length;i++){
- QuickEditTabSectionDescriptor sd = (QuickEditTabSectionDescriptor)getSectionDescriptors()[i];
- if (name.equals(sd.getId()))
- return sd;
- }
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/messages.properties b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/messages.properties
deleted file mode 100644
index 57b015f..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/internal/messages.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2007 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are 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:
-# Oracle Corporation - initial API and implementation
-###############################################################################
-AttributesTabDescriptor_label=Attributes
-QuickEditTabDescriptor_label=Quick Edit
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/messages.properties b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/messages.properties
deleted file mode 100644
index b0d48c1..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/properties/messages.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2007 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are 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:
-# Oracle Corporation - initial API and implementation
-###############################################################################
-ITabbedPropertiesConstants_other_category=Attributes
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/range/RangeUtil.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/range/RangeUtil.java
deleted file mode 100644
index 1d85654..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/range/RangeUtil.java
+++ /dev/null
@@ -1,378 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.range;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.jst.pagedesigner.parts.DocumentEditPart;
-import org.eclipse.jst.pagedesigner.viewer.DesignPosition;
-import org.eclipse.jst.pagedesigner.viewer.DesignRange;
-
-/**
- * @author mengbo
- */
-public class RangeUtil {
- /**
- * append the child after the reference node as next sibling.
- *
- * @param child
- * can't be null
- * @param reference
- * can't be null
- * @return ??
- */
- //TODO: dead
-// private static Node appendAfter(Node child, Node reference) {
-// Node next = reference.getNextSibling();
-// if (next == null)
-// {
-// return reference.getParentNode().appendChild(child);
-// }
-// return reference.getParentNode().insertBefore(child, next);
-// }
-
- /**
- * @param child
- * @param reference
- * @return ??
- */
- // TODO: dead
-// private static Node insertBefore(Node child, Node reference) {
-// return reference.getParentNode().insertBefore(child, reference);
-// }
-
- /**
- * Insert a node into the specified position. The node can be an element or
- * DocumentFragment.
- *
- * @param node
- * @param position
- */
- // TODO: dead
-// private static Node insertElement(DesignPosition position, Element node) {
-// EditPart containerEditPart = position.getContainerPart();
-// int offset = position.getOffset();
-//
-// if (containerEditPart instanceof TextEditPart) {
-// TextEditPart textPart = (TextEditPart) containerEditPart;
-// String textData = textPart.getTextData();
-// Node textNode = (Node) textPart.getModel();
-// if (offset == 0)
-// return insertBefore(node, textNode);
-// else if (offset == textData.length())
-// return appendAfter(node, textNode);
-// else {
-// // inserting the element in the middle of text.
-// String before = textData.substring(0, offset);
-// String after = textData.substring(offset);
-//
-// // XXX: don't know whether setNodeValue() will do all those
-// // escape or not.
-// textNode.setNodeValue(after);
-// Node newnode = insertBefore(node, textNode);
-//
-// // XXX: don't know whether createTextNode() will do all those
-// // escape or not
-// Text t = textNode.getOwnerDocument().createTextNode(before);
-//
-// insertBefore(t, newnode);
-// return newnode;
-// }
-// }
-// return insertIntoEditPart(containerEditPart, node, offset);
-// }
-
- /**
- * @param containerEditPart
- * @param node
- * @param offset
- * @return
- */
- // TODO: dead
-// private static Node insertIntoEditPart(EditPart containerEditPart,
-// Node node, int offset) {
-// Node parent = (Node) containerEditPart.getModel();
-// List childParts = containerEditPart.getChildren();
-// if (offset >= childParts.size()) {
-// // to the end of parent
-// return parent.appendChild(node);
-// }
-// Node child = (Node) ((EditPart) childParts.get(offset)).getModel();
-// return insertBefore(node, child);
-// }
-
- // TODO: dead
-// private static TextPosition insertText(DesignPosition position, String data) {
-// // TODO: never read EditPart containerEditPart = position.getContainerPart();
-//
-// position = moveIntoText(position);
-// int offset = position.getOffset();
-//
-// if (position.getContainerPart() instanceof TextEditPart) {
-// // it is guaranteeed that now the containing edit part is text node.
-// TextEditPart textPart = (TextEditPart) position.getContainerPart();
-// String textData = textPart.getTextData();
-// String before = textData.substring(0, offset);
-// String after = textData.substring(offset);
-// if (data.startsWith(" ") && before.endsWith(" ")) {
-// before = before.substring(0, before.length() - 1) + " ";
-// }
-// if (after.startsWith(" ") && data.endsWith(" ")) {
-// data = data.substring(0, data.length() - 1) + (char) 160;
-// }
-// String nextData = before + data + after;
-// IDOMText text = (IDOMText) textPart.getModel();
-// text.setData(nextData);
-// return new TextPosition(text, offset + data.length());
-// }
-// // can't merge into a neighboring text node. So create a text node
-// // of it's own
-// EditPart part = position.getContainerPart();
-// Node parent = (Node) part.getModel();
-// Text text = parent.getOwnerDocument().createTextNode(data);
-// insertIntoEditPart(part, text, offset);
-// return new TextPosition((IDOMText) text, offset);
-// }
-
- /**
- * Try to make the position move into a text node.
- *
- * @param position
- * @return
- */
- // TODO: dead
-// private static DesignPosition moveIntoText(DesignPosition position) {
-// EditPart container = position.getContainerPart();
-// if (container instanceof TextEditPart)
-// return position;
-// if (position.getOffset() > 0) {
-// EditPart pre = (EditPart) container.getChildren().get(
-// position.getOffset() - 1);
-// if (pre instanceof TextEditPart) {
-// return new DesignPosition(pre, ((TextEditPart) pre)
-// .getTextData().length());
-// }
-// }
-// if (position.getOffset() < container.getChildren().size()) {
-// EditPart next = (EditPart) container.getChildren().get(
-// position.getOffset());
-// if (next instanceof TextEditPart) {
-// return new DesignPosition(next, 0);
-// }
-// }
-// return position;
-// }
-
- /**
- * try to move the position up to not inside a text. if the position is at 0
- * index or last index of a text node, then try to move it up.
- *
- * @param position
- * @return
- */
- // TODO: dead
-// private static DesignPosition moveOutFromText(DesignPosition position) {
-// EditPart container = position.getContainerPart();
-// if (container instanceof TextEditPart) {
-// int offset = position.getOffset();
-// String text = ((TextEditPart) container).getTextData();
-// if (offset == 0) {
-// return new DesignPosition(container.getParent(), container
-// .getParent().getChildren().indexOf(container));
-// } else if (offset == text.length()) {
-// return new DesignPosition(container.getParent(), container
-// .getParent().getChildren().indexOf(container) + 1);
-// }
-// }
-// return position;
-// }
-
-// private static void insertDocumentFragment(DesignPosition position,
-// DocumentFragment fragment) {
-// // FIXME: NOT DONE.
-// }
-
- /**
- * Test whether the range intersect with the part.
- *
- * @param range
- * @param part
- * @return true if thereis an intersection
- */
- public static boolean intersect(DesignRange range, EditPart part) {
- if (range == null || !range.isValid())
- return false;
- range = normalize(range);
- if (part instanceof DocumentEditPart)
- return true;
- EditPart parent = part.getParent();
- int index = parent.getChildren().indexOf(part);
- DesignPosition left = new DesignPosition(parent, index);
- DesignPosition right = new DesignPosition(parent, index + 1);
- int compare = compareDesignPosition(left, range.getEndPosition());
- if (compare == 1 || compare == 0 || compare == Integer.MIN_VALUE)
- return false;
-
- compare = compareDesignPosition(right, range.getStartPosition());
- if (compare == -1 || compare == 0 || compare == Integer.MIN_VALUE)
- return false;
-
- return true;
- }
-
- /**
- * make sure the start position is before end position. If the original
- * range is already normalized, then the original range will be returned
- * without constructing a new one.
- *
- * @param range
- * @return the normalized range
- */
- public static DesignRange normalize(DesignRange range) {
- if (range == null || !range.isValid()) {
- return range;
- }
- int result = compareDesignPosition(range.getStartPosition(), range
- .getEndPosition());
- if (result == 1)
- {
- return new DesignRange(range.getEndPosition(), range
- .getStartPosition());
- }
- return range;
- }
-
- /**
- *
- * @param p1
- * @param p2
- * @return 0 means equal. 1 Means p1 is after p2. -1 means p1 is before p2.
- * Integer.MIN_VALUE means some error and can't compare.
- */
- private static int compareDesignPosition(DesignPosition p1, DesignPosition p2) {
- if (!p1.isValid() || !p2.isValid())
- return Integer.MIN_VALUE;
- if (p1.equals(p2))
- return 0;
- int offset1 = p1.getOffset();
- int offset2 = p2.getOffset();
- List a1 = getAncesters(p1.getContainerPart());
- List a2 = getAncesters(p2.getContainerPart());
- if (a1 == null || a2 == null)
- return Integer.MIN_VALUE;
- if (a1.get(0) != a2.get(0))
- return Integer.MIN_VALUE; // not same DocumentEditPart
- for (int i = 1;; i++) {
- EditPart p1a = (EditPart) a1.get(i);
- EditPart p2a = (EditPart) a2.get(i);
- if (p1a == p2a) {
- if (p1a != null)
- {
- continue; // same ancester
- }
- // both are null. just compare the offset.
- return offset1 < offset2 ? -1
- : (offset1 == offset2 ? 0 : 1);
- }
- // p1a != p2a. now we can just compare p1a and p2a to decide the
- // order.
- if (p1a != null)
- offset1 = p1a.getParent().getChildren().indexOf(p1a);
- if (p2a != null)
- offset2 = p2a.getParent().getChildren().indexOf(p2a);
- if ((p1a == null && p2a == null) || (p1a != null && p2a != null)) {
- return offset1 < offset2 ? -1 : (offset1 == offset2 ? 0 : 1);
- } else if (p1a == null) {
- return offset1 <= offset2 ? -1 : 1;
- } else {
- return offset1 >= offset2 ? 1 : -1;
- }
- }
- }
-
- /**
- * Get a list of ancester nodes starting from the DocumentEditPart till the
- * node.
- *
- * @param part
- * @return
- */
- private static List getAncesters(EditPart part) {
- List list = new ArrayList();
- while (part != null) {
- list.add(part);
- if (part instanceof DocumentEditPart)
- {
- break;
- }
- part = part.getParent();
- }
- if (part == null) {
- // if part ==null, means we didn't find a DocumentEditPart,
- // something must be wrong.
- return null;
- }
- // reverse to make it starting from the docuemnteditpart node.
- Collections.reverse(list);
- list.add(null); // add an null terminator.
- return list;
- }
-
- /**
- * find the smallest common ancester of two edit part.
- *
- * @param part1
- * @param part2
- * @return
- */
- private static EditPart findCommonAncester(EditPart part1, EditPart part2) {
- if (part1 == part2) {
- return part1;
- }
- List list1 = getAncesters(part1);
- if (list1 == null)
- return null;
- List list2 = getAncesters(part2);
- if (list2 == null)
- return null;
- if (list1.get(0) != list2.get(0))
- return null;
- EditPart common = (EditPart) list1.get(0);
- for (int i = 1;; i++) {
- EditPart p1 = (EditPart) list1.get(i);
- EditPart p2 = (EditPart) list2.get(i);
- if (p1 == null || p2 == null)
- return common;
- if (p1 != p2)
- return common;
- common = p1;
- }
-
- }
-
- /**
- * @param range
- * @return the common ancestor
- */
- public static EditPart findCommonAncestor(DesignRange range) {
- if (!range.isValid()) {
- return null;
- }
- DesignPosition startPosition = range.getStartPosition();
- DesignPosition endPosition = range.getEndPosition();
- return findCommonAncester(startPosition.getContainerPart(), endPosition
- .getContainerPart());
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/requests/LocationModifierRequest.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/requests/LocationModifierRequest.java
deleted file mode 100644
index 176710b..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/requests/LocationModifierRequest.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.requests;
-
-import org.eclipse.gef.requests.LocationRequest;
-
-/**
- * This is a LocationRequest plus keyboard modified support.
- *
- * @author mengbo
- * @version 1.5
- */
-public class LocationModifierRequest extends LocationRequest {
-
- private boolean _controlKeyDown;
-
- /**
- *
- */
- public LocationModifierRequest() {
- super();
- }
-
- /**
- * @param type
- */
- public LocationModifierRequest(Object type) {
- super(type);
- }
-
- /**
- * @return true if the control key was pressed
- */
- public boolean isControlKeyPressed() {
- return _controlKeyDown;
- }
-
- /**
- * @param b
- */
- public void setControlKeyPressed(boolean b) {
- this._controlKeyDown = b;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/requests/NodeCreationFactory.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/requests/NodeCreationFactory.java
deleted file mode 100644
index 7c54de0..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/requests/NodeCreationFactory.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.requests;
-
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.gef.requests.CreationFactory;
-import org.eclipse.jst.jsf.core.internal.tld.ITLDConstants;
-import org.eclipse.jst.pagedesigner.editors.HTMLEditor;
-import org.eclipse.jst.pagedesigner.utils.JSPUtil;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- */
-public class NodeCreationFactory implements CreationFactory {
- private final String _tagName;
-
- private final String _uri;
-
- private final String _suggestedPrefix;
-
- private final Map _attributes;
-
- /**
- * @param uri
- * @param tagname
- * @param suggestedPrefix
- * @param attributes
- */
- public NodeCreationFactory(String uri, String tagname,
- String suggestedPrefix, Map attributes) {
- _tagName = tagname;
- _uri = uri;
- _suggestedPrefix = suggestedPrefix;
- _attributes = attributes;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.requests.CreationFactory#getNewObject()
- */
- public Object getNewObject() {
- Document ownerdoc = getOwnerDocument();
- if (ownerdoc == null)
- return null;
-
- Element ele = ownerdoc.createElement(_tagName);
- if (ele instanceof IDOMNode) {
- String prefix = getPrefix(_uri, ((IDOMDocument) ownerdoc)
- .getModel(), _suggestedPrefix);
- if (prefix != null) {
- ele.setPrefix(prefix);
- }
- }
- if (_attributes != null) {
- for (Iterator iter = _attributes.keySet().iterator(); iter
- .hasNext();) {
- String key = (String) iter.next();
- String value = (String) _attributes.get(key);
- ele.setAttribute(key, value);
- }
- }
- return ele;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.requests.CreationFactory#getObjectType()
- */
- public Object getObjectType() {
- return _tagName;
- }
-
- /**
- * XXX: need some better way for owner document. Maybe pass in from
- * constructor
- *
- * @return the owner document
- */
- protected Document getOwnerDocument() {
- IWorkbenchWindow active = PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow();
- if (active == null)
- return null;
- IWorkbenchPage page = active.getActivePage();
- if (page == null)
- return null;
- IEditorPart editor = page.getActiveEditor();
- if (editor instanceof HTMLEditor) {
- return ((HTMLEditor) editor).getDOMDocument();
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.requests.NodeCreationFactory#getPrefix(int)
- */
- private String getPrefix(String uri, IDOMModel model, String suggested) {
- if (ITLDConstants.URI_HTML.equals(uri)
- || ITLDConstants.URI_JSP.equals(uri))
- return null;
-
- // now handles custom tag lib
- return JSPUtil.getOrCreatePrefix(model, uri, suggested);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/requests/PageDesignerRequestConstants.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/requests/PageDesignerRequestConstants.java
deleted file mode 100644
index 74e1797..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/requests/PageDesignerRequestConstants.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.requests;
-
-/**
- * Page designer constants
- *
- */
-public final class PageDesignerRequestConstants
-{
- /**
- * sent to an edit part to request a selection drag tracker
- */
- public final static String REQ_SELECTION_TRACKER = "selection.tracker.request";
-
- private PageDesignerRequestConstants()
- {
- // no instantiation
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/ColumnHandle.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/ColumnHandle.java
deleted file mode 100644
index 97a1c1a..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/ColumnHandle.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.tableedit;
-
-import org.eclipse.gef.GraphicalEditPart;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class ColumnHandle extends TableSideItemHandle {
-
- /**
- * @param owner
- * @param index
- */
- public ColumnHandle(GraphicalEditPart owner, int index) {
- super(owner, false, index);
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/ColumnResizeHandle.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/ColumnResizeHandle.java
deleted file mode 100644
index e6446a1..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/ColumnResizeHandle.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.tableedit;
-
-import org.eclipse.gef.GraphicalEditPart;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class ColumnResizeHandle extends TableSideResizeHandle {
- // 0 means before first column
- int _columnIndex;
-
- /**
- * @param owner
- * @param index
- *
- */
- public ColumnResizeHandle(GraphicalEditPart owner, int index) {
- super(owner, false, index);
- _columnIndex = index;
- }
-
- /**
- * @return the column index
- */
- public int getColumnIndex() {
- return _columnIndex;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/DeleteHeaderFooterAction.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/DeleteHeaderFooterAction.java
deleted file mode 100644
index 02a8e5c..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/DeleteHeaderFooterAction.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.tableedit;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.action.Action;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class DeleteHeaderFooterAction extends Action {
- private Command _command;
-
- /**
- * @param text
- * @param editPart
- * @param isHeader
- */
- public DeleteHeaderFooterAction(String text, EditPart editPart,
- boolean isHeader) {
- super(text);
- DeleteHeaderFooterRequest req = new DeleteHeaderFooterRequest(text,
- isHeader);
- this._command = editPart.getCommand(req);
- this.setEnabled(this._command != null && this._command.canExecute());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run() {
- _command.execute();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/DeleteHeaderFooterRequest.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/DeleteHeaderFooterRequest.java
deleted file mode 100644
index ebd315d..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/DeleteHeaderFooterRequest.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.tableedit;
-
-import org.eclipse.gef.Request;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class DeleteHeaderFooterRequest extends Request {
- private boolean _isHeader;
-
- /**
- * @param type
- * @param isHeader
- */
- public DeleteHeaderFooterRequest(String type, boolean isHeader) {
- super(type);
- this._isHeader = isHeader;
- }
-
- /**
- * @return Returns the _isHeader.
- */
- public boolean isHeader() {
- return _isHeader;
- }
-
- /**
- * @param header
- * The _isHeader to set.
- */
- public void setHeader(boolean header) {
- _isHeader = header;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/DeleteRowColumnAction.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/DeleteRowColumnAction.java
deleted file mode 100644
index 0f68bd1..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/DeleteRowColumnAction.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.tableedit;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.action.Action;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class DeleteRowColumnAction extends Action {
- private Command _command;
-
- /**
- * @param text
- * @param tablePart
- * @param index
- * @param isrow
- */
- public DeleteRowColumnAction(String text, EditPart tablePart, int index,
- boolean isrow) {
- super(text);
-
- TableRowColumnDeleteRequest req = new TableRowColumnDeleteRequest(
- isrow, index);
- this._command = tablePart.getCommand(req);
- this.setEnabled(this._command != null && this._command.canExecute());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run() {
- _command.execute();
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/EmptyLocator.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/EmptyLocator.java
deleted file mode 100644
index d69fc73..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/EmptyLocator.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.tableedit;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Locator;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class EmptyLocator implements Locator {
- /**
- *
- */
- public EmptyLocator() {
- super();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.draw2d.Locator#relocate(org.eclipse.draw2d.IFigure)
- */
- public void relocate(IFigure target) {
- // do nothing; this is a noop locator
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/InsertHeaderFooterAction.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/InsertHeaderFooterAction.java
deleted file mode 100644
index 4009220..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/InsertHeaderFooterAction.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.tableedit;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.action.Action;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class InsertHeaderFooterAction extends Action {
- private Command _command;
-
- /**
- * @param text
- * @param editPart
- * @param isHeader
- */
- public InsertHeaderFooterAction(String text, EditPart editPart,
- boolean isHeader) {
- super(text);
-
- InsertHeaderFooterRequest req = new InsertHeaderFooterRequest(text,
- isHeader);
- this._command = editPart.getCommand(req);
- this.setEnabled(this._command != null && this._command.canExecute());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run() {
- _command.execute();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/InsertHeaderFooterRequest.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/InsertHeaderFooterRequest.java
deleted file mode 100644
index 845d48a..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/InsertHeaderFooterRequest.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.tableedit;
-
-import org.eclipse.gef.Request;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class InsertHeaderFooterRequest extends Request {
- private boolean _isHeader;
-
- /**
- * @param type
- * @param isHeader
- */
- public InsertHeaderFooterRequest(String type, boolean isHeader) {
- super(type);
- this._isHeader = isHeader;
- }
-
- /**
- * @return Returns the _isHeader.
- */
- public boolean isHeader() {
- return _isHeader;
- }
-
- /**
- * @param header
- * The _isHeader to set.
- */
- public void setHeader(boolean header) {
- _isHeader = header;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/InsertRowColumnAction.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/InsertRowColumnAction.java
deleted file mode 100644
index 6eedf0a..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/InsertRowColumnAction.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.tableedit;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.action.Action;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class InsertRowColumnAction extends Action {
- private Command _command;
-
- /**
- * @param text
- * @param tablePart
- * @param index
- * @param isrow
- * @param isbefore
- */
- public InsertRowColumnAction(String text, EditPart tablePart, int index,
- boolean isrow, boolean isbefore) {
- super(text);
-
- TableInsertRequest req = new TableInsertRequest(isrow, index, isbefore);
- this._command = tablePart.getCommand(req);
- this.setEnabled(this._command != null && this._command.canExecute());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run() {
- _command.execute();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/MarqueeRectangleFigure.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/MarqueeRectangleFigure.java
deleted file mode 100644
index c65e771..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/MarqueeRectangleFigure.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.tableedit;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * This class is copied from MarqueeSelectionTool, since it is private there.
- *
- * @author mengbo
- * @version 1.5
- */
-class MarqueeRectangleFigure extends Figure {
-
- private int offset = 0;
-
- private boolean schedulePaint = true;
-
- private static final int DELAY = 110; // animation delay in millisecond
-
- /**
- * @see org.eclipse.draw2d.Figure#paintFigure(org.eclipse.draw2d.Graphics)
- */
- protected void paintFigure(Graphics graphics) {
- Rectangle bounds1 = getBounds().getCopy();
- graphics.translate(getLocation());
-
- graphics.setXORMode(true);
- graphics.setForegroundColor(ColorConstants.white);
- graphics.setBackgroundColor(ColorConstants.black);
-
- graphics.setLineStyle(Graphics.LINE_DOT);
-
- int[] points = new int[6];
-
- points[0] = 0 + offset;
- points[1] = 0;
- points[2] = bounds1.width - 1;
- points[3] = 0;
- points[4] = bounds1.width - 1;
- points[5] = bounds1.height - 1;
-
- graphics.drawPolyline(points);
-
- points[0] = 0;
- points[1] = 0 + offset;
- points[2] = 0;
- points[3] = bounds1.height - 1;
- points[4] = bounds1.width - 1;
- points[5] = bounds1.height - 1;
-
- graphics.drawPolyline(points);
-
- graphics.translate(getLocation().getNegated());
-
- if (schedulePaint) {
- Display.getCurrent().timerExec(DELAY, new Runnable() {
- public void run() {
- offset++;
- if (offset > 5)
- offset = 0;
-
- schedulePaint = true;
- repaint();
- }
- });
- }
-
- schedulePaint = false;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/RowHandle.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/RowHandle.java
deleted file mode 100644
index 5ebd6d9..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/RowHandle.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.tableedit;
-
-import org.eclipse.gef.GraphicalEditPart;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class RowHandle extends TableSideItemHandle {
-
- /**
- * @param owner
- * @param index
- */
- public RowHandle(GraphicalEditPart owner, int index) {
- super(owner, true, index);
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/RowResizeHandle.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/RowResizeHandle.java
deleted file mode 100644
index 8efbcc3..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/RowResizeHandle.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.tableedit;
-
-import org.eclipse.gef.GraphicalEditPart;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class RowResizeHandle extends TableSideResizeHandle {
- // 0 means before first row
- int _rowIndex;
-
- /**
- * @param owner
- * @param index
- */
- public RowResizeHandle(GraphicalEditPart owner, int index) {
- super(owner, true, index);
-
- _rowIndex = index;
- }
-
- /**
- * @return the row index
- */
- public int getRowIndex() {
- return _rowIndex;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableColumnHandle.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableColumnHandle.java
deleted file mode 100644
index 466159b..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableColumnHandle.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.tableedit;
-
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.jst.pagedesigner.editpolicies.ITableEditAdapter;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class TableColumnHandle extends TableSideHandle {
- /**
- * @param tableHost
- */
- public TableColumnHandle(GraphicalEditPart tableHost) {
- super(tableHost, new TableColumnHandleLocator(tableHost));
- }
-
- /**
- *
- *
- */
- public void setupColumns() {
- ITableEditAdapter tableAdapter = getTableEditAdapter();
- if (tableAdapter == null) {
- return;
- }
- int numColumns = tableAdapter.getColumnCount();
- for (int i = 0; i < numColumns; i++) {
- ColumnHandle columnHandle = createColumnHandle(i);
- add(columnHandle);
- ColumnResizeHandle columnResizeHandle = createColumnResizeHandle(i);
- add(columnResizeHandle);
- }
- ColumnResizeHandle lastResize = createColumnResizeHandle(numColumns);
- add(lastResize);
- }
-
- /**
- * @param numColumns
- * @return
- */
- private ColumnResizeHandle createColumnResizeHandle(int numColumns) {
- return new ColumnResizeHandle(getOwner(), numColumns);
- }
-
- /**
- * @param i
- * @return
- */
- private ColumnHandle createColumnHandle(int i) {
- return new ColumnHandle(getOwner(), i);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableColumnHandleLocator.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableColumnHandleLocator.java
deleted file mode 100644
index 37bb7e2..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableColumnHandleLocator.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.tableedit;
-
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.handles.HandleBounds;
-import org.eclipse.gef.handles.MoveHandleLocator;
-import org.eclipse.jst.pagedesigner.editpolicies.ITableEditAdapter;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class TableColumnHandleLocator extends MoveHandleLocator {
-
- GraphicalEditPart _tablePart;
-
- /**
- * @param tablePart
- */
- public TableColumnHandleLocator(GraphicalEditPart tablePart) {
- super(tablePart.getFigure());
- _tablePart = tablePart;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.handles.MoveHandleLocator#relocate(org.eclipse.draw2d.IFigure)
- */
- public void relocate(IFigure target) {
- Rectangle bounds;
- if (getReference() instanceof HandleBounds) {
- bounds = ((HandleBounds) getReference()).getHandleBounds();
- } else {
- bounds = getReference().getBounds();
- }
- Insets referenceInsets = getReference().getInsets();
-
- Rectangle r = new Rectangle(bounds.x + referenceInsets.left, bounds.y
- + bounds.height, bounds.width - referenceInsets.getWidth(),
- TableEditConst.HEIGHT);
-
- getReference().translateToAbsolute(r);
- target.translateToRelative(r);
-
- target.setBounds(r);
- relocateChildren(target, getReference());
- }
-
- /**
- * @param target
- * @param reference
- */
- private void relocateChildren(IFigure target, IFigure reference) {
- // As user may removed columns/rows, so need to recalculate columns.
- TableColumnHandle tableColumnHandle = (TableColumnHandle) target;
- tableColumnHandle.removeAll();
- tableColumnHandle.setupColumns();
-
- // ---------------------------
- List children = target.getChildren();
-
- ITableEditAdapter tableAdapter = TableEditHelper
- .getTableEditAdapter(this._tablePart);
- if (tableAdapter == null) {
- // XXX: what should we do if we found it is no longer table?
- // here just skip
- return;
- }
- for (int i = 0, size = children.size(); i < size; i++) {
- Rectangle rect = null;
- IFigure child = (IFigure) children.get(i);
- if (child instanceof ColumnHandle) {
- ColumnHandle columnHandle = (ColumnHandle) child;
- int columnIndex = columnHandle.getIndex();
- rect = new Rectangle(tableAdapter.getColumnStart(columnIndex),
- 0, tableAdapter.getColumnWidth(columnIndex),
- TableEditConst.HEIGHT);
- } else if (child instanceof ColumnResizeHandle) {
- ColumnResizeHandle resizeHandle = (ColumnResizeHandle) child;
- int columnIndex = resizeHandle.getColumnIndex();
- rect = new Rectangle(tableAdapter
- .getColumnResizeStart(columnIndex), 0, tableAdapter
- .getColumnResizeWidth(), TableEditConst.HEIGHT);
- } else {
- // should not happen.
- }
- if (rect != null) {
- child.setBounds(rect);
- }
- }
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableEditAdapter.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableEditAdapter.java
deleted file mode 100644
index 6689636..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableEditAdapter.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.tableedit;
-
-import org.eclipse.jst.pagedesigner.css2.layout.table.CSSTableLayout2;
-import org.eclipse.jst.pagedesigner.editpolicies.ITableEditAdapter;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class TableEditAdapter implements ITableEditAdapter {
- CSSTableLayout2 _tableLayout;
-
- /**
- * @param layout2
- */
- public TableEditAdapter(CSSTableLayout2 layout2) {
- this._tableLayout = layout2;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.editpolicies.ITableEditAdapter#getColumnCount()
- */
- public int getColumnCount() {
- return _tableLayout.getColumnWidths().length;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.editpolicies.ITableEditAdapter#getRowCount()
- */
- public int getRowCount() {
- return _tableLayout.getRowHeights().length;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.editpolicies.ITableEditAdapter#insertColumn(int)
- */
- public void insertColumn(int atPosition) {
- // do nothing
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.editpolicies.ITableEditAdapter#insertRow(int)
- */
- public void insertRow(int rowPosition) {
- // TODO Auto-generated method stub
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.editpolicies.ITableEditAdapter#getResizeStart(int)
- */
- public int getColumnResizeStart(int columnIndex) {
- int w = 0;
- int[] columnWidths = _tableLayout.getColumnWidths();
- for (int i = 0; i < columnIndex; i++) {
- w += columnWidths[i];
- }
- w += columnIndex * _tableLayout.getHSpacing();
- return w;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.editpolicies.ITableEditAdapter#getResizeWidth()
- */
- public int getColumnResizeWidth() {
- return _tableLayout.getHSpacing();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.editpolicies.ITableEditAdapter#getColumnStart(int)
- */
- public int getColumnStart(int columnIndex) {
- return getColumnResizeStart(columnIndex) + _tableLayout.getHSpacing();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.editpolicies.ITableEditAdapter#getColumnWidth(int)
- */
- public int getColumnWidth(int columnIndex) {
- return _tableLayout.getColumnWidths()[columnIndex];
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.editpolicies.ITableEditAdapter#getRowStart(int)
- */
- public int getRowStart(int rowIndex) {
- int start = getRowResizeStart(rowIndex) + _tableLayout.getVSpacing();
- if (_tableLayout.getCaptionInfo() != null
- && "top".equalsIgnoreCase(_tableLayout.getCaptionInfo().getAlign())) //$NON-NLS-1$
- {
- start += _tableLayout.getCaptionSize().height;
- }
- return start;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.editpolicies.ITableEditAdapter#getRowHeight(int)
- */
- public int getRowHeight(int rowIndex) {
- return _tableLayout.getRowHeights()[rowIndex];
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.editpolicies.ITableEditAdapter#getRowResizeStart(int)
- */
- public int getRowResizeStart(int rowIndex) {
- int w = 0;
- int[] rowHeights = _tableLayout.getRowHeights();
- for (int i = 0; i < rowIndex; i++) {
- w += rowHeights[i];
- }
- w += rowIndex * _tableLayout.getHSpacing();
- return w;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.editpolicies.ITableEditAdapter#getRowResizeWidth()
- */
- public int getRowResizeWidth() {
- return _tableLayout.getVSpacing();
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableEditConst.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableEditConst.java
deleted file mode 100644
index 40b1dee..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableEditConst.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.tableedit;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-/*package*/ interface TableEditConst {
- /**
- * height constant
- */
- public static final int HEIGHT = 10;
-
- /**
- * width constant
- */
- public static final int WIDTH = 10;
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableEditHelper.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableEditHelper.java
deleted file mode 100644
index 5614d81..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableEditHelper.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.tableedit;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.LayoutManager;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.jst.pagedesigner.css2.layout.table.CSSTableLayout2;
-import org.eclipse.jst.pagedesigner.editpolicies.ITableEditAdapter;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class TableEditHelper {
- /**
- * This method will return null if the editpart is not a table.
- *
- * @param tablePart
- * @return the adapter
- */
- public static ITableEditAdapter getTableEditAdapter(
- GraphicalEditPart tablePart) {
- IFigure figure = tablePart.getFigure();
- LayoutManager layout = figure.getLayoutManager();
- if (layout instanceof CSSTableLayout2) {
- return new TableEditAdapter((CSSTableLayout2) layout);
- }
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableHandleKit.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableHandleKit.java
deleted file mode 100644
index c8082e5..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableHandleKit.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.tableedit;
-
-import java.util.List;
-
-import org.eclipse.gef.GraphicalEditPart;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class TableHandleKit {
-
- /**
- * @param tableHost
- * @param handles
- */
- public static void addHandles(GraphicalEditPart tableHost, List handles) {
- addColumnHandles(tableHost, handles);
- addRowHandles(tableHost, handles);
- }
-
- /**
- * @param tableHost
- * @param handles
- */
- private static void addColumnHandles(GraphicalEditPart tableHost,
- List handles) {
- TableColumnHandle handle = new TableColumnHandle(tableHost);
- handles.add(handle);
-
- }
-
- /**
- * @param tableHost
- * @param handles
- */
- private static void addRowHandles(GraphicalEditPart tableHost, List handles) {
- TableRowHandle handle = new TableRowHandle(tableHost);
- handles.add(handle);
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableInsertRequest.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableInsertRequest.java
deleted file mode 100644
index 101d47c..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableInsertRequest.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.tableedit;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class TableInsertRequest extends TableRowColumnRequest {
- /**
- *
- */
- private static final String TABLE_INSERT_REQUEST = "Table Insert";
-
- boolean _before;
-
- /**
- * @param row
- * @param index
- * @param before
- *
- */
- public TableInsertRequest(boolean row, int index, boolean before) {
- super(TABLE_INSERT_REQUEST, row, index);
- this._before = before;
- }
-
- /**
- * @return true if is before
- */
- public boolean isBefore() {
- return _before;
- }
-
- /**
- * @param before
- */
- public void setBefore(boolean before) {
- this._before = before;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableResizableEditPolicy.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableResizableEditPolicy.java
deleted file mode 100644
index 87619c2..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableResizableEditPolicy.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.tableedit;
-
-import java.util.List;
-
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.jst.pagedesigner.editpolicies.ElementResizableEditPolicy;
-import org.eclipse.jst.pagedesigner.editpolicies.ITableEditAdapter;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class TableResizableEditPolicy extends ElementResizableEditPolicy {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editpolicies.ResizableEditPolicy#createSelectionHandles()
- */
- protected List createSelectionHandles() {
- List list = super.createSelectionHandles();
-
- // CR402770-1. Add a check whether it is table. If is not, will not
- // create the handles. Thus, the handles could assume
- // TableEditHelper.getTableEditAdatper()
- // will always return non null.
- ITableEditAdapter adapter = TableEditHelper
- .getTableEditAdapter((GraphicalEditPart) getHost());
- if (adapter != null) {
- TableHandleKit.addHandles((GraphicalEditPart) getHost(), list);
- }
- return list;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableResizeRequest.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableResizeRequest.java
deleted file mode 100644
index 5bca788..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableResizeRequest.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.tableedit;
-
-import org.eclipse.gef.Request;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class TableResizeRequest extends Request {
- private static final String TABLE_RESIZE_REQ = "Table Resize";
-
- private boolean _row;
-
- private int _index;
-
- private int _delta;
-
- /**
- * @param isrow
- * @param index
- */
- public TableResizeRequest(boolean isrow, int index) {
- super(TABLE_RESIZE_REQ);
- this._row = isrow;
- this._index = index;
- }
-
- /**
- * @return the index
- */
- public int getIndex() {
- return _index;
- }
-
- /**
- * @param index
- */
- public void setIndex(int index) {
- this._index = index;
- }
-
- /**
- * @return true if is row
- */
- public boolean isRow() {
- return _row;
- }
-
- /**
- * @param row
- */
- public void setRow(boolean row) {
- this._row = row;
- }
-
- /**
- * @return the delta
- */
- public int getDelta() {
- return _delta;
- }
-
- /**
- * @param delta
- */
- public void setDelta(int delta) {
- this._delta = delta;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableRowColumnDeleteRequest.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableRowColumnDeleteRequest.java
deleted file mode 100644
index 1e44f46..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableRowColumnDeleteRequest.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.tableedit;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class TableRowColumnDeleteRequest extends TableRowColumnRequest {
- private static final String TABLE_ROWCOLUMN_DELETE = "Table RowColumn Delete";
-
- /**
- * @param row
- * @param index
- */
- public TableRowColumnDeleteRequest(boolean row, int index) {
- super(TABLE_ROWCOLUMN_DELETE, row, index);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableRowColumnRequest.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableRowColumnRequest.java
deleted file mode 100644
index b7bc8cd..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableRowColumnRequest.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.tableedit;
-
-import org.eclipse.gef.Request;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class TableRowColumnRequest extends Request {
- int _index;
-
- boolean _row;
-
- /**
- * @param type
- * @param row
- * @param index
- */
- public TableRowColumnRequest(Object type, boolean row, int index) {
- super(type);
- this._row = row;
- this._index = index;
- }
-
- /**
- * @return the index
- */
- public int getIndex() {
- return _index;
- }
-
- /**
- * @param index
- */
- public void setIndex(int index) {
- this._index = index;
- }
-
- /**
- * @return true if is row
- */
- public boolean isRow() {
- return _row;
- }
-
- /**
- * @param row
- */
- public void setRow(boolean row) {
- this._row = row;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableRowHandle.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableRowHandle.java
deleted file mode 100644
index daca6e4..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableRowHandle.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.tableedit;
-
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.jst.pagedesigner.editpolicies.ITableEditAdapter;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class TableRowHandle extends TableSideHandle {
- /**
- * @param tableHost
- */
- public TableRowHandle(GraphicalEditPart tableHost) {
- super(tableHost, new TableRowHandleLocator(tableHost));
- // setupRows();
- }
-
- /**
- *
- *
- */
- public void setupRows() {
- ITableEditAdapter tableAdapter = getTableEditAdapter();
- if (tableAdapter == null) {
- return;
- }
- int numRows = tableAdapter.getRowCount();
- for (int i = 0; i < numRows; i++) {
- RowHandle rowHandle = createRowHandle(i);
- add(rowHandle);
- RowResizeHandle rowResizeHandle = createRowResizeHandle(i);
- add(rowResizeHandle);
- }
- RowResizeHandle lastResize = createRowResizeHandle(numRows);
- add(lastResize);
- }
-
- /**
- * @param rowIndex
- * @return
- */
- private RowResizeHandle createRowResizeHandle(int rowIndex) {
- return new RowResizeHandle(getOwner(), rowIndex);
- }
-
- /**
- * @param rowIndex
- * @return
- */
- private RowHandle createRowHandle(int rowIndex) {
- return new RowHandle(getOwner(), rowIndex);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableRowHandleLocator.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableRowHandleLocator.java
deleted file mode 100644
index 54ed350..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableRowHandleLocator.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.tableedit;
-
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.draw2d.geometry.PrecisionRectangle;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.handles.HandleBounds;
-import org.eclipse.gef.handles.MoveHandleLocator;
-import org.eclipse.jst.pagedesigner.editpolicies.ITableEditAdapter;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class TableRowHandleLocator extends MoveHandleLocator {
-
- GraphicalEditPart _tablePart;
-
- /**
- * @param tablePart
- */
- public TableRowHandleLocator(GraphicalEditPart tablePart) {
- super(tablePart.getFigure());
- _tablePart = tablePart;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.handles.MoveHandleLocator#relocate(org.eclipse.draw2d.IFigure)
- */
- public void relocate(IFigure target) {
- Rectangle bounds;
- if (getReference() instanceof HandleBounds) {
- bounds = ((HandleBounds) getReference()).getHandleBounds();
- } else {
- bounds = getReference().getBounds();
- }
- // bounds = new PrecisionRectangle(bounds.getResized(-1, -1));
- Insets referenceInsets = getReference().getInsets();
-
- Rectangle r = new Rectangle(bounds.x + bounds.width, bounds.y
- + referenceInsets.top, TableEditConst.WIDTH, bounds.height
- - referenceInsets.getHeight());
- bounds = new PrecisionRectangle(r);
-
- getReference().translateToAbsolute(bounds);
- target.translateToRelative(bounds);
-
- target.setBounds(bounds);
- relocateChildren(target, getReference());
- }
-
- /**
- * @param target
- * @param reference
- */
- private void relocateChildren(IFigure target, IFigure reference) {
- // As user may removed columns/rows, so need to recalculate columns.
- TableRowHandle tableRowHandle = (TableRowHandle) target;
- tableRowHandle.removeAll();
- tableRowHandle.setupRows();
- List children = target.getChildren();
-
- ITableEditAdapter tableAdapter = TableEditHelper
- .getTableEditAdapter(this._tablePart);
- if (tableAdapter == null) {
- return;
- }
- for (int i = 0, size = children.size(); i < size; i++) {
- Rectangle rect = null;
- IFigure child = (IFigure) children.get(i);
- if (child instanceof RowHandle) {
- RowHandle rowHandle = (RowHandle) child;
- int rowIndex = rowHandle.getIndex();
- rect = new Rectangle(0, tableAdapter.getRowStart(rowIndex),
- TableEditConst.WIDTH, tableAdapter
- .getRowHeight(rowIndex));
- } else if (child instanceof RowResizeHandle) {
- RowResizeHandle resizeHandle = (RowResizeHandle) child;
- int rowIndex = resizeHandle.getRowIndex();
- rect = new Rectangle(0, tableAdapter
- .getRowResizeStart(rowIndex), TableEditConst.WIDTH,
- tableAdapter.getRowResizeWidth());
- } else {
- // should not happen.
- }
- if (rect != null) {
- child.setBounds(rect);
- }
- }
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableSideHandle.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableSideHandle.java
deleted file mode 100644
index 753ad40..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableSideHandle.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.tableedit;
-
-import org.eclipse.draw2d.Locator;
-import org.eclipse.gef.DragTracker;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.handles.AbstractHandle;
-import org.eclipse.jst.pagedesigner.editpolicies.ITableEditAdapter;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class TableSideHandle extends AbstractHandle {
- /**
- * @param owner
- * @param loc
- */
- public TableSideHandle(GraphicalEditPart owner, Locator loc) {
- super(owner, loc);
- // TODO Auto-generated constructor stub
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.handles.AbstractHandle#createDragTracker()
- */
- protected DragTracker createDragTracker() {
- // TODO Auto-generated method stub
- return null;
- }
-
- /**
- * @return the edit part
- */
- public GraphicalEditPart getTableEditPart() {
- return this.getOwner();
- }
-
- /**
- * @return the adapter
- */
- public ITableEditAdapter getTableEditAdapter() {
- return TableEditHelper.getTableEditAdapter(getOwner());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.draw2d.Figure#useLocalCoordinates()
- */
- protected boolean useLocalCoordinates() {
- return true;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableSideItemDragTracker.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableSideItemDragTracker.java
deleted file mode 100644
index efedef5..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableSideItemDragTracker.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.tableedit;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.tools.DragEditPartsTracker;
-
-/**
- * This is the tracker for the TableSideItem. It will be responsible to track
- * the right mouse down event and popup a menu.
- *
- * @author mengbo
- * @version 1.5
- */
-public class TableSideItemDragTracker extends DragEditPartsTracker {
- // TODO: dead?
- // private boolean _isRow;
-//
-// private int _index;
-
- /**
- *
- * @param sourceEditPart
- * @param isrow
- * @param index
- */
- public TableSideItemDragTracker(EditPart sourceEditPart, boolean isrow,
- int index) {
- super(sourceEditPart);
- // TODO: dead?
-// this._isRow = isrow;
-// this._index = index;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.tools.DragEditPartsTracker#handleButtonUp(int)
- */
- protected boolean handleButtonUp(int button) {
- boolean result = super.handleButtonUp(button);
- //
- // if (button == 3)
- // {
- // MenuManager m = new MenuManager();
- // if (_isRow)
- // {
- // m.add(new InsertRowColumnAction("Insert row before",
- // getSourceEditPart(), _index, _isRow, true));
- // m.add(new InsertRowColumnAction("Insert row after",
- // getSourceEditPart(), _index, _isRow, false));
- // m.add(new DeleteRowColumnAction("Delete row", getSourceEditPart(),
- // _index, _isRow));
- // }
- // else
- // {
- // m.add(new InsertRowColumnAction("Insert column before",
- // getSourceEditPart(), _index, _isRow, true));
- // m.add(new InsertRowColumnAction("Insert column after",
- // getSourceEditPart(), _index, _isRow, false));
- // m.add(new DeleteRowColumnAction("Delete column", getSourceEditPart(),
- // _index, _isRow));
- // }
- // m.createContextMenu(this.getCurrentViewer().getControl()).setVisible(true);
- // }
- return result;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableSideItemHandle.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableSideItemHandle.java
deleted file mode 100644
index 9b833ab..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableSideItemHandle.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.tableedit;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Cursors;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.LineBorder;
-import org.eclipse.gef.DragTracker;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.handles.AbstractHandle;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public abstract class TableSideItemHandle extends AbstractHandle {
- private boolean _isRow;
-
- private int _index;
-
- /**
- * @param owner
- * @param isRow
- * @param index
- *
- */
- public TableSideItemHandle(GraphicalEditPart owner, boolean isRow, int index) {
- super(owner, new EmptyLocator());
- this._isRow = isRow;
- this._index = index;
- initialize();
- }
-
- /**
- *
- */
- private void initialize() {
- this.setOpaque(false);
- LineBorder border1 = new LineBorder(ColorConstants.green, 1);
- this.setBorder(border1);
- this.setCursor(Cursors.ARROW);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.draw2d.Figure#paintFigure(org.eclipse.draw2d.Graphics)
- */
- protected void paintFigure(Graphics graphics) {
- graphics.setXORMode(true);
- graphics.setBackgroundColor(ColorConstants.darkGray);
- graphics.fillRectangle(getBounds());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.handles.AbstractHandle#createDragTracker()
- */
- protected DragTracker createDragTracker() {
- return new TableSideItemDragTracker(getOwner(), _isRow, _index);
- }
-
- /**
- * @return the index
- */
- public int getIndex() {
- return _index;
- }
-
- /**
- * @return true if is row
- */
- public boolean isRow() {
- return _isRow;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableSideResizeDragTracker.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableSideResizeDragTracker.java
deleted file mode 100644
index ca0771f..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableSideResizeDragTracker.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.tableedit;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.tools.DragEditPartsTracker;
-import org.eclipse.jst.pagedesigner.editpolicies.ITableEditAdapter;
-
-/**
- * This is the drag tracker for the small resize item on the
- * TableSideResizeHandle. used to adjust a single column/row size.
- *
- * @author mengbo
- * @version 1.5
- */
-public class TableSideResizeDragTracker extends DragEditPartsTracker {
- private boolean _isrow;
-
- private int _index;
-
- private MarqueeRectangleFigure _marqueeFigure;
-
- /**
- * @param sourceEditPart
- * @param isrow
- * @param index
- */
- public TableSideResizeDragTracker(EditPart sourceEditPart, boolean isrow,
- int index) {
- super(sourceEditPart);
- this._isrow = isrow;
- this._index = index;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.tools.DragEditPartsTracker#showSourceFeedback()
- */
- protected void showSourceFeedback() {
- Rectangle rect = getFeedbackRect();
- if (rect != null) {
- rect = rect.getCopy();
- getMarqueeRectangleFigure().setBounds(rect);
- } else {
- // ignore.
- }
- }
-
- private int calculateDelta() {
- int delta;
- // FIXME: TODO: XXX: when delta is too small (<0) to make previous
- // column/row
- // to have negative size, then we need adjust delta.
- if (_isrow) {
- delta = getLocation().y - getStartLocation().y;
- } else {
- delta = getLocation().x - getStartLocation().x;
- }
- return delta;
- }
-
- /**
- * @return null if this is not a table.
- */
- private Rectangle getFeedbackRect() {
- ITableEditAdapter adapter = getTableEditAdapter();
- if (adapter == null) {
- return null;
- }
-
- IFigure figure = ((GraphicalEditPart) this.getSourceEditPart())
- .getFigure();
- Rectangle bounds = figure.getBounds();
- Insets insets = figure.getInsets();
- Rectangle rect;
- if (_isrow) {
- int delta = calculateDelta();
- rect = new Rectangle(0, adapter.getRowResizeStart(_index) + delta,
- bounds.width - insets.getWidth(), adapter
- .getRowResizeWidth());
- } else {
- int delta = calculateDelta();
- rect = new Rectangle(adapter.getColumnResizeStart(_index) + delta,
- 0, adapter.getColumnResizeWidth(), bounds.height
- - insets.getHeight());
- }
- rect.translate(bounds.x + insets.left, bounds.y + insets.top);
-
- figure.translateToAbsolute(rect);
- getMarqueeRectangleFigure().translateToRelative(rect);
- return rect;
- }
-
- /**
- *
- * @return null if this is not a table.
- */
- private ITableEditAdapter getTableEditAdapter() {
- return TableEditHelper.getTableEditAdapter((GraphicalEditPart) this
- .getSourceEditPart());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.tools.DragEditPartsTracker#eraseSourceFeedback()
- */
- protected void eraseSourceFeedback() {
- super.eraseSourceFeedback();
- if (_marqueeFigure != null) {
- removeFeedback(_marqueeFigure);
- _marqueeFigure = null;
- }
- }
-
- private MarqueeRectangleFigure getMarqueeRectangleFigure() {
- if (this._marqueeFigure == null) {
- this._marqueeFigure = new MarqueeRectangleFigure();
- addFeedback(this._marqueeFigure);
- }
- return this._marqueeFigure;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.tools.DragEditPartsTracker#createTargetRequest()
- */
- protected Request createTargetRequest() {
- return new TableResizeRequest(this._isrow, this._index);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.tools.DragEditPartsTracker#updateTargetRequest()
- */
- protected void updateTargetRequest() {
- TableResizeRequest req = (TableResizeRequest) getTargetRequest();
- req.setDelta(calculateDelta());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.tools.SelectEditPartTracker#handleButtonDown(int)
- */
- protected boolean handleButtonDown(int button) {
- lockTargetEditPart(getSourceEditPart());
- return super.handleButtonDown(button);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.tools.DragEditPartsTracker#getCommand()
- */
- protected Command getCommand() {
- return getTargetEditPart().getCommand(getTargetRequest());
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableSideResizeHandle.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableSideResizeHandle.java
deleted file mode 100644
index bfe6b22..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tableedit/TableSideResizeHandle.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.tableedit;
-
-import org.eclipse.draw2d.Cursors;
-import org.eclipse.gef.DragTracker;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.handles.AbstractHandle;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class TableSideResizeHandle extends AbstractHandle {
- private boolean _isRow;
-
- private int _index;
-
- /**
- * @param owner
- * @param isrow
- * @param index
- *
- */
- public TableSideResizeHandle(GraphicalEditPart owner, boolean isrow,
- int index) {
- super(owner, new EmptyLocator());
- this._isRow = isrow;
- this._index = index;
-
- this.setCursor(isrow ? Cursors.SIZEN : Cursors.SIZEE);
- // this.setBackgroundColor(ColorConstants.green);
- this.setOpaque(false);
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.handles.AbstractHandle#createDragTracker()
- */
- protected DragTracker createDragTracker() {
- return new TableSideResizeDragTracker(getOwner(), _isRow, _index);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tools/ExposeHelper.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tools/ExposeHelper.java
deleted file mode 100644
index 6828db1..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tools/ExposeHelper.java
+++ /dev/null
@@ -1,333 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.tools;
-
-import org.eclipse.draw2d.FigureCanvas;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Viewport;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.editpolicies.AbstractEditPolicy;
-import org.eclipse.gef.ui.parts.ScrollingGraphicalViewer;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.w3c.dom.Node;
-
-/**
- * This helper class expose an rectangle in design view, currentlly it is used
- * to help expose caret.
- *
- * @author mengbo
- */
-public class ExposeHelper {
- private static final int DEFAULT_OFFSET = 100;
-
- private static final int SCROLL_OFFSET = 8;
-
- IHTMLGraphicalViewer _viewer;
-
- /**
- * @param viewer
- */
- public ExposeHelper(IHTMLGraphicalViewer viewer) {
- _viewer = viewer;
- }
-
- /**
- * Expose rectangle. (non-Javadoc)
- * @param rect
- *
- * @see org.eclipse.gef.ExposeHelper#exposeDescendant(org.eclipse.gef.EditPart)
- */
- public void exposeArea(Rectangle rect) {
- if (_viewer == null) {
- return;
- }
- FigureCanvas canvas = (FigureCanvas) _viewer.getControl();
- Viewport port = _viewer.getViewport();
-
- if (port == null) {
- return;
- }
- Rectangle exposeRegion = rect.getCopy();
- Rectangle portBounds = port.getBounds().getCopy();
- Point viewLocation = port.getViewLocation();
- Dimension diff = calculateDiff(portBounds, exposeRegion);
- if (diff != null) {
- viewLocation.x -= diff.width;
- viewLocation.y -= diff.height;
- canvas.scrollSmoothTo(viewLocation.x, viewLocation.y);
- }
- }
-
- private void exposeVertical(int offset) {
- if (_viewer == null) {
- return;
- }
- FigureCanvas canvas = (FigureCanvas) _viewer.getControl();
- Viewport port = _viewer.getViewport();
-
- if (port == null) {
- return;
- }
- Point viewLocation = port.getViewLocation();
- viewLocation.y += offset;
- canvas.scrollSmoothTo(viewLocation.x, viewLocation.y);
- }
-
- private void exposeHorizontal(int offset) {
- if (_viewer == null) {
- return;
- }
- FigureCanvas canvas = (FigureCanvas) _viewer.getControl();
- Viewport port = _viewer.getViewport();
-
- if (port == null) {
- return;
- }
- Point viewLocation = port.getViewLocation();
- viewLocation.x += offset;
- canvas.scrollSmoothTo(viewLocation.x, viewLocation.y);
- }
-
- private int calculateX(Rectangle portBounds, Rectangle caretRect) {
- int result = 0;
- if (portBounds.x > caretRect.getRight().x) {
- result = portBounds.getLeft().getDifference(caretRect.getRight()).width;
- if (portBounds.width >= caretRect.width) {
- result = portBounds.getLeft()
- .getDifference(caretRect.getLeft()).width;
- }
- } else if (portBounds.getRight().x < caretRect.getLeft().x) {
- result = portBounds.getRight().getDifference(caretRect.getLeft()).width;
- if (portBounds.width >= caretRect.width) {
- result = portBounds.getRight().getDifference(
- caretRect.getRight()).width;
- }
- }
- return result;
- }
-
- private int calculateY(Rectangle portBounds, Rectangle caretRect) {
- int result = 0;
- if (portBounds.y > caretRect.getBottom().y) {
- result = portBounds.getTop().getDifference(caretRect.getBottom()).height;
- if (portBounds.height >= caretRect.height) {
- result = portBounds.getTop().getDifference(caretRect.getTop()).height;
- }
- } else if (portBounds.getBottom().y < caretRect.getTop().y) {
- result = portBounds.getBottom().getDifference(caretRect.getTop()).height;
- if (portBounds.height >= caretRect.height) {
- result = portBounds.getBottom().getDifference(
- caretRect.getBottom()).height;
- }
- } else if (portBounds.getBottom().y < caretRect.getBottom().y) {
- if (portBounds.height >= caretRect.height) {
- result = portBounds.getBottom().getDifference(
- caretRect.getBottom()).height;
- }
- } else if (portBounds.getTop().y > caretRect.getTop().y) {
- if (portBounds.height >= caretRect.height) {
- result = portBounds.getTop().getDifference(caretRect.getTop()).height;
- }
- }
- return result;
- }
-
- /**
- * Calculate caretPoint's offset to posrBounds at both x coordinate and y
- * coordinate.
- *
- * @param portBounds
- * @param exposeRegion
- * @param canvas
- * @param caretPoint
- */
- private Dimension calculateDiff(Rectangle portBounds, Rectangle caretRect) {
- Dimension diff = new Dimension(0, 0);
- diff.width = calculateX(portBounds, caretRect);
- diff.height = calculateY(portBounds, caretRect);
- return diff;
- }
-
- // /**
- // * Calculate caretPoint's offset to posrBounds at both x coordinate and y
- // coordinate.
- // *
- // * @param portBounds
- // * @param exposeRegion
- // * @param canvas
- // * @param caretPoint
- // */
- // private Dimension calculateDiff(Rectangle portBounds, Point caretPoint)
- // {
- // int position = portBounds.getPosition(caretPoint);
- // Dimension diff = null;
- // Point containerPos = null;
- // switch (position)
- // {
- // case PositionConstants.EAST:
- // containerPos = new Point(portBounds.getRight().x, caretPoint.y);
- // diff = containerPos.getDifference(caretPoint);
- // break;
- // case PositionConstants.NORTH_EAST:
- // diff = portBounds.getTopRight().getDifference(caretPoint);
- // break;
- // case PositionConstants.WEST:
- // containerPos = new Point(portBounds.getLeft().x, caretPoint.y);
- // diff = containerPos.getDifference(caretPoint);
- // break;
- // case PositionConstants.NORTH_WEST:
- // diff = portBounds.getTopLeft().getDifference(caretPoint);
- // break;
- // case PositionConstants.SOUTH_WEST:
- // diff = portBounds.getBottomLeft().getDifference(caretPoint);
- // break;
- // case PositionConstants.SOUTH_EAST:
- // diff = portBounds.getBottomRight().getDifference(caretPoint);
- // break;
- // case PositionConstants.NORTH:
- // containerPos = new Point(caretPoint.x, portBounds.getTop().y);
- // diff = containerPos.getDifference(caretPoint);
- // break;
- // case PositionConstants.SOUTH:
- // containerPos = new Point(caretPoint.x, portBounds.getBottom().y);
- // diff = containerPos.getDifference(caretPoint);
- // break;
- // }
- // return diff;
- // }
- //
- private static void expose(EditPart part, ScrollingGraphicalViewer viewer) {
- if (part != null && part.getModel() instanceof Node) {
- viewer.reveal(part);
- }
- }
-
- private static void expose(Node element, ScrollingGraphicalViewer viewer) {
- if (element instanceof INodeNotifier) {
- EditPart editPart = (EditPart) ((INodeNotifier) element)
- .getAdapterFor(EditPart.class);
- expose(editPart, viewer);
- }
- }
-
- /**
- * @param selection
- * @param viewer
- */
- public static void expose(ISelection selection,
- ScrollingGraphicalViewer viewer) {
- if (selection instanceof IStructuredSelection) {
- Object element = ((IStructuredSelection) selection)
- .getFirstElement();
- if (element instanceof Node) {
- expose((Node) element, viewer);
- } else if (element instanceof EditPart) {
- expose((EditPart) element, viewer);
- }
- }
- }
-
- /**
- * @param p
- */
- public void adjustVertical(Point p) {
- int offset = 0;
- if ((offset = getVerticalBoundsOffset(p, false)) < SCROLL_OFFSET) {
- exposeVertical(SCROLL_OFFSET - offset);
- } else if ((offset = getVerticalBoundsOffset(p, true)) < SCROLL_OFFSET) {
- exposeVertical(offset - SCROLL_OFFSET);
- }
- if ((offset = getHorizontalBoundsOffset(p, true)) < SCROLL_OFFSET) {
- exposeHorizontal(SCROLL_OFFSET - offset);
- } else if ((offset = getHorizontalBoundsOffset(p, false)) < SCROLL_OFFSET) {
- exposeHorizontal(offset - SCROLL_OFFSET);
- }
- }
-
- /**
- * @return the location of the view port
- */
- public Point getViewpostLocation() {
- if (_viewer != null) {
- Viewport port = _viewer.getViewport();
-
- if (port != null) {
- return port.getViewLocation();
- }
- }
- return null;
- }
-
- /**
- * @param figure
- * @param p
- * @return the translated point
- */
- public Point translateToViewport(IFigure figure, Point p) {
- Point vp = getViewpostLocation();
- return new Point(p.x - vp.x, p.y - vp.y);
- }
-
- private int getHorizontalBoundsOffset(Point p, boolean forward) {
- if (_viewer == null) {
- return DEFAULT_OFFSET;
- }
- Viewport port = _viewer.getViewport();
-
- if (port == null) {
- return DEFAULT_OFFSET;
- }
- if (forward) {
- Rectangle portBounds = port.getBounds().getCopy();
- return portBounds.getRight().x - p.x;
- }
- return p.x;
- }
-
- private int getVerticalBoundsOffset(Point p, boolean up) {
- if (_viewer == null) {
- return DEFAULT_OFFSET;
- }
- Viewport port = _viewer.getViewport();
-
- if (port == null) {
- return DEFAULT_OFFSET;
- }
- if (!up) {
- Rectangle portBounds = port.getBounds().getCopy();
- return portBounds.getBottom().y - p.y;
- }
- return p.y;
- }
-
- /**
- * @param rect
- * @param policy
- */
- void exposeBorder(Rectangle rect, AbstractEditPolicy policy) {
- Point p = rect.getTopLeft();
- p = translateToViewport(((GraphicalEditPart) policy.getHost())
- .getFigure(), p);
- adjustVertical(p);
- p = rect.getBottomRight();
- p = translateToViewport(((GraphicalEditPart) policy.getHost())
- .getFigure(), p);
- adjustVertical(p);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tools/ObjectModeDragTracker.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tools/ObjectModeDragTracker.java
deleted file mode 100644
index 15519bc..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tools/ObjectModeDragTracker.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.tools;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.tools.DragEditPartsTracker;
-import org.eclipse.jst.pagedesigner.range.RangeUtil;
-import org.eclipse.jst.pagedesigner.viewer.DesignRange;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-
-/**
- * When user press right mouse to do selection, if the selected node is inside
- * current range selection, then don't change selection. This is for better
- * context menu support.
- *
- * @author mengbo
- * @version 1.5
- */
-public class ObjectModeDragTracker extends DragEditPartsTracker {
- /**
- * @param sourceEditPart
- */
- public ObjectModeDragTracker(EditPart sourceEditPart) {
- super(sourceEditPart);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.tools.SelectEditPartTracker#handleButtonDown(int)
- */
- protected boolean handleButtonDown(int button) {
- if (button == 3 && isInState(STATE_INITIAL)) {
- EditPart sourcePart = this.getSourceEditPart();
- IHTMLGraphicalViewer viewer = (IHTMLGraphicalViewer) sourcePart
- .getViewer();
- if (viewer != null && viewer.isInRangeMode()) {
- DesignRange range = viewer.getRangeSelection();
- if (range != null && range.isValid()) {
- if (RangeUtil.intersect(range, sourcePart)) {
- return true;
- }
- }
- }
- }
- return super.handleButtonDown(button);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tools/RangeDragTracker.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tools/RangeDragTracker.java
deleted file mode 100644
index 03e690e..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tools/RangeDragTracker.java
+++ /dev/null
@@ -1,314 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.tools;
-
-import java.util.Collections;
-
-import org.eclipse.draw2d.Cursors;
-import org.eclipse.gef.DragTracker;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.requests.SelectionRequest;
-import org.eclipse.gef.tools.TargetingTool;
-import org.eclipse.jst.pagedesigner.parts.NodeEditPart;
-import org.eclipse.jst.pagedesigner.parts.TextEditPart;
-import org.eclipse.jst.pagedesigner.range.RangeUtil;
-import org.eclipse.jst.pagedesigner.validation.caret.ActionData;
-import org.eclipse.jst.pagedesigner.validation.caret.IPositionMediator;
-import org.eclipse.jst.pagedesigner.validation.caret.InlineEditingPositionMediator;
-import org.eclipse.jst.pagedesigner.validation.caret.Target;
-import org.eclipse.jst.pagedesigner.viewer.DesignPosition;
-import org.eclipse.jst.pagedesigner.viewer.DesignRange;
-import org.eclipse.jst.pagedesigner.viewer.EditPartPositionHelper;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.eclipse.swt.graphics.Cursor;
-
-/**
- * @author mengbo
- */
-public class RangeDragTracker extends TargetingTool implements DragTracker {
- /** Flag to indicate selection has been performed. */
- private static final int FLAG_SELECTION_PERFORMED = TargetingTool.MAX_FLAG << 1;
-
- private EditPart editpart;
-
- /**
- * Constructs a new SelectEditPartTracker with the given edit part as the
- * source.
- *
- * @param owner
- * the source edit part
- */
- public RangeDragTracker(EditPart owner) {
- setSourceEditPart(owner);
- }
-
- /**
- * @see org.eclipse.gef.tools.AbstractTool#calculateCursor()
- */
- protected Cursor calculateCursor() {
- return Cursors.IBEAM;
-// if (isInState(STATE_INITIAL))
-// {
-// return Cursors.IBEAM;
-// }
-// else if (isInState(STATE_DRAG | STATE_ACCESSIBLE_DRAG))
-// {
-// return getDefaultCursor();
-// }
-// return Cursors.IBEAM;
-// return super.calculateCursor();
- }
-
- /**
- * @see org.eclipse.gef.tools.AbstractTool#getCommandName()
- */
- protected String getCommandName() {
- return "Range Drag Tracker";//$NON-NLS-1$
- }
-
- /**
- * @see org.eclipse.gef.tools.AbstractTool#getDebugName()
- */
- protected String getDebugName() {
- return "Range Drag Tracker";//$NON-NLS-1$
- }
-
- /**
- * Returns the source edit part.
- *
- * @return the source edit part
- */
- protected EditPart getSourceEditPart() {
- return editpart;
- }
-
- /**
- * Performs a conditional selection if needed (if right or left mouse button
- * have been pressed) and goes into the drag state. If any other button has
- * been pressed, the tool goes into the invalid state.
- *
- * @see org.eclipse.gef.tools.AbstractTool#handleButtonDown(int)
- */
- protected boolean handleButtonDown(int button) {
- if (button == 3 && isInState(STATE_INITIAL)) {
- EditPart sourcePart = this.getSourceEditPart();
- IHTMLGraphicalViewer viewer = (IHTMLGraphicalViewer) sourcePart
- .getViewer();
- if (viewer != null && viewer.isInRangeMode()) {
- DesignRange range = viewer.getRangeSelection();
- if (range != null && range.isValid()) {
- if (RangeUtil.intersect(range, sourcePart)) {
- return true;
- }
- }
- }
- }
-
- if ((button == 1 || button == 3) && isInState(STATE_INITIAL)) {
- peroformSelectionBegin();
- }
-
- if (button != 1) {
- setState(STATE_INVALID);
- if (button == 3)
- setState(STATE_TERMINAL);
- handleInvalidInput();
- } else {
- stateTransition(STATE_INITIAL, STATE_DRAG);
- }
- return true;
- }
-
- /**
- * If the
- * source is selected and there are no modifier keys pressed (i.e. the user
- * isn't selecting multiple edit parts or deselecting edit parts), sets the
- * direct edit flag so that when the mouse is released, a direct edit will
- * be performed.
- */
- protected void peroformSelectionBegin() {
- // if (getCurrentInput().isControlKeyDown())
- // {
- // // when control key is down, switch to object selection mode.
- // getHTMLGraphicalViewer().ensureObjectSelectionMode();
- // setFlag(FLAG_SELECTION_PERFORMED, true);
- // EditPartViewer viewer = getCurrentViewer();
- // List selectedObjects = viewer.getSelectedEditParts();
- //
- // if (selectedObjects.contains(getSourceEditPart()))
- // viewer.deselect(getSourceEditPart());
- // else
- // viewer.appendSelection(getSourceEditPart());
- // }
- // else
- if (getCurrentInput().isShiftKeyDown()) {
- getHTMLGraphicalViewer().ensureRangeSelectionMode();
- rangeSelection(true);
- } else {
- if (shouldStartRangeSelection()) {
- rangeSelection(false);
- } else {
- getCurrentViewer().select(getSourceEditPart());
- }
- }
- }
-
- /**
- * If in the drag state, the tool selects the source edit part. If the
- * edit part is newly selected and not completely visible,
- * {@link org.eclipse.gef.EditPartViewer#reveal(EditPart)}is called to show the selected
- * edit part.
- *
- * @see org.eclipse.gef.tools.AbstractTool#handleButtonUp(int)
- */
- protected boolean handleButtonUp(int button) {
- if (isInState(STATE_DRAG)) {
- // XXX: commented the following two line (lium)
- // performSelection();
- // if (button == 1 && getSourceEditPart().getSelected() !=
- // EditPart.SELECTED_NONE)
- // getCurrentViewer().reveal(getSourceEditPart());
- setState(STATE_TERMINAL);
- return true;
- }
- return false;
- }
-
- /**
- * Calls {@link #performOpen()}if the double click was with mouse button 1.
- *
- * @see org.eclipse.gef.tools.AbstractTool#handleDoubleClick(int)
- */
- protected boolean handleDoubleClick(int button) {
- if (button == 1) {
- performOpen();
- }
- return true;
- }
-
- /**
- * @see org.eclipse.gef.tools.AbstractTool#handleDragStarted()
- */
- protected boolean handleDragStarted() {
- return stateTransition(STATE_DRAG, STATE_DRAG_IN_PROGRESS);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.tools.AbstractTool#handleDragInProgress()
- */
- protected boolean handleDragInProgress() {
- if (getHTMLGraphicalViewer().isInRangeMode()) {
- rangeSelection(true);
- return true;
- }
- return super.handleDragInProgress();
- }
-
- /**
- * Returns <code>true</code> if selection has already occured.
- *
- * @return <code>true</code> if selection has occured
- */
- protected boolean hasSelectionOccurred() {
- return getFlag(FLAG_SELECTION_PERFORMED);
- }
-
- /**
- * Creates a {@link SelectionRequest}and sends it to the source edit part
- * via {@link EditPart#performRequest(org.eclipse.gef.Request)}. Possible uses are to open
- * the selected item in another editor or replace the current editor's
- * contents based on the selected item.
- */
- protected void performOpen() {
- SelectionRequest request = new SelectionRequest();
- request.setLocation(getLocation());
- request.setType(RequestConstants.REQ_OPEN);
- getSourceEditPart().performRequest(request);
- }
-
- /**
- * @see org.eclipse.gef.tools.AbstractTool#resetFlags()
- */
- protected void resetFlags() {
- super.resetFlags();
- setFlag(FLAG_SELECTION_PERFORMED, false);
- }
-
- /**
- * Sets the source edit part.
- *
- * @param part
- * the source edit part
- */
- protected void setSourceEditPart(EditPart part) {
- this.editpart = part;
- }
-
- /**
- * @return the html graphical viewer
- */
- public IHTMLGraphicalViewer getHTMLGraphicalViewer() {
- return (IHTMLGraphicalViewer) getCurrentViewer();
- }
-
- /**
- * @return
- */
- private boolean shouldStartRangeSelection() {
- IPositionMediator positionMediator = new InlineEditingPositionMediator(
- new ActionData(ActionData.INLINE_EDIT, null));
- if (positionMediator.isEditable(new Target(getSourceEditPart()))) {
- return getSourceEditPart() instanceof TextEditPart
- || !(((NodeEditPart) getSourceEditPart()).isWidget());
- }
- return false;
- }
-
- /**
- * @param b
- * true means remain the old range start position.
- */
- private void rangeSelection(boolean b) {
- // XXX: not using updateTargetEditPartUnderMouse. Maybe should. Don't
- // want to
- // go through the request mechanism, so simple implementation for now.
-
- //to avoid 219038 and possibility of current viewer changing
- final EditPartViewer viewer = getCurrentViewer();
- final IHTMLGraphicalViewer graphicalViewer = (IHTMLGraphicalViewer)viewer;
- EditPart editPart = viewer.findObjectAtExcluding(
- getLocation(), Collections.EMPTY_LIST);
- IPositionMediator positionMediator = new InlineEditingPositionMediator(
- new ActionData(ActionData.INLINE_EDIT, null));
- ExposeHelper exposeHelper = new ExposeHelper(graphicalViewer);
- exposeHelper.adjustVertical(getCurrentInput().getMouseLocation());
- DesignPosition position = EditPartPositionHelper.findEditPartPosition(
- editPart, getCurrentInput().getMouseLocation(),
- positionMediator);
- if (b) {
- graphicalViewer.setRangeEndPosition(position);
- } else {
- graphicalViewer.setRange(position, position);
- }
- graphicalViewer.updateHorizontalPos();
- }
-
- protected boolean handleHover() {
- boolean retValue = super.handleHover();
- refreshCursor();
- return retValue;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tools/RangeSelectionTool.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tools/RangeSelectionTool.java
deleted file mode 100644
index be49075..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/tools/RangeSelectionTool.java
+++ /dev/null
@@ -1,319 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.tools;
-
-import org.eclipse.gef.DragTracker;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.requests.LocationRequest;
-import org.eclipse.gef.tools.SelectionTool;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jst.pagedesigner.commands.DeleteNodeCommand;
-import org.eclipse.jst.pagedesigner.commands.SwitchSelectionCommand;
-import org.eclipse.jst.pagedesigner.commands.nav.HorizontalMoveCommand;
-import org.eclipse.jst.pagedesigner.commands.nav.ICaretPositionMover;
-import org.eclipse.jst.pagedesigner.commands.nav.VerticalMoveCommand;
-import org.eclipse.jst.pagedesigner.commands.range.CopyCommand;
-import org.eclipse.jst.pagedesigner.commands.range.CutCommand;
-import org.eclipse.jst.pagedesigner.commands.range.DeleteCommand;
-import org.eclipse.jst.pagedesigner.commands.range.InsertCommand;
-import org.eclipse.jst.pagedesigner.commands.range.KeyboardData;
-import org.eclipse.jst.pagedesigner.commands.range.PasteCommand;
-import org.eclipse.jst.pagedesigner.commands.range.SelectAllCommand;
-import org.eclipse.jst.pagedesigner.editors.pagedesigner.PageDesignerResources;
-import org.eclipse.jst.pagedesigner.parts.DocumentEditPart;
-import org.eclipse.jst.pagedesigner.parts.NodeEditPart;
-import org.eclipse.jst.pagedesigner.requests.LocationModifierRequest;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.graphics.Cursor;
-
-/**
- * @author mengbo
- */
-public class RangeSelectionTool extends SelectionTool
-{
- private LocationRequest _hoverRequest;
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.tools.SelectionTool#handleKeyDown(org.eclipse.swt.events.KeyEvent)
- */
- protected boolean handleKeyDown(KeyEvent e) {
- // resetHover() is not visible.
- if (isHoverActive()) {
- handleHoverStop();
- }
- setHoverActive(false);
-
- if ((e.stateMask & SWT.ALT) != 0) {
- return false;
- }
- Command command = null;
- KeyboardData keyCode = null;
- switch (e.keyCode) {
- case SWT.F2:
- command = new SwitchSelectionCommand((IHTMLGraphicalViewer) this
- .getCurrentViewer());
-
- break;
- case SWT.ARROW_UP:
- command = new VerticalMoveCommand((IHTMLGraphicalViewer) this
- .getCurrentViewer(), true, (e.stateMask & SWT.SHIFT) != 0);
- break;
- case SWT.ARROW_DOWN:
- command = new VerticalMoveCommand((IHTMLGraphicalViewer) this
- .getCurrentViewer(), false, (e.stateMask & SWT.SHIFT) != 0);
- break;
- case SWT.ARROW_LEFT:
- command = new HorizontalMoveCommand((IHTMLGraphicalViewer) this
- .getCurrentViewer(), false, (e.stateMask & SWT.SHIFT) != 0);
- break;
- case SWT.ARROW_RIGHT:
- command = new HorizontalMoveCommand((IHTMLGraphicalViewer) this
- .getCurrentViewer(), true, (e.stateMask & SWT.SHIFT) != 0);
- break;
- case SWT.DEL:
- if ((e.stateMask & SWT.SHIFT) == 0) {
- if (getCurrentViewer().getSelection() != null) {
- ISelection selection = getCurrentViewer().getSelection();
- if (selection instanceof StructuredSelection) {
- Object object = ((StructuredSelection) selection)
- .getFirstElement();
- if (!(object instanceof DocumentEditPart)) {
- // "delete node"
- command = new DeleteNodeCommand(
- (IHTMLGraphicalViewer) getCurrentViewer());
- }
- }
- }
- if (command == null) {
- // "delete"
- command = new DeleteCommand(true,
- (IHTMLGraphicalViewer) this.getCurrentViewer()); //$NON-NLS-1$
- }
- } else {
- // "cut"
- command = new CutCommand((IHTMLGraphicalViewer) this
- .getCurrentViewer()); //$NON-NLS-1$
- e.doit = false;
- }
- break;
- case SWT.BS:
- // "delete"
- command = new DeleteCommand(false, (IHTMLGraphicalViewer) this
- .getCurrentViewer()); //$NON-NLS-1$
- e.doit = false;
- break;
- case SWT.INSERT:
- if ((e.stateMask & SWT.SHIFT) != 0) {
- // "paste"
- command = new PasteCommand((IHTMLGraphicalViewer) this
- .getCurrentViewer()); //$NON-NLS-1$
- e.doit = false;
- break;
- } else if ((e.stateMask & SWT.CONTROL) != 0) {
- // "copy"
- command = new CopyCommand((IHTMLGraphicalViewer) this
- .getCurrentViewer()); //$NON-NLS-1$
- e.doit = false;
- break;
- }
- break;
- case SWT.LF:
- case SWT.CR:
- // "insert"
- keyCode = new KeyboardData(e.character, e.stateMask,
- (IHTMLGraphicalViewer) getCurrentViewer());
- command = new InsertCommand(
- PageDesignerResources.getInstance().getString(
- "RangeSelectionTool.CommandLabel.Insert"), (IHTMLGraphicalViewer) this.getCurrentViewer(), keyCode); //$NON-NLS-1$
- e.doit = false;
- break;
- default:
- if (e.keyCode == 'a' && (e.stateMask & SWT.CTRL) != 0) {
- command = new SelectAllCommand("selectAll",
- (IHTMLGraphicalViewer) this.getCurrentViewer());
- e.doit = false;
- } else {
- if (getCurrentViewer() instanceof IHTMLGraphicalViewer
- && ((IHTMLGraphicalViewer) getCurrentViewer())
- .isInRangeMode()
- && (!Character.isIdentifierIgnorable(e.character) && !Character
- .isISOControl(e.character))
- || (e.character == '\r')) {
- keyCode = new KeyboardData(e.character, e.stateMask,
- (IHTMLGraphicalViewer) getCurrentViewer());
- // "insert"
- command = new InsertCommand(
- PageDesignerResources.getInstance().getString(
- "RangeSelectionTool.CommandLabel.Insert"), (IHTMLGraphicalViewer) this.getCurrentViewer(), keyCode); //$NON-NLS-1$
- e.doit = false;
- break;
- }
- return super.handleKeyDown(e);
- }
- }
- if (command != null) {
- command.execute();
- e.doit = false;
- if (command instanceof ICaretPositionMover) {
- if (getCurrentViewer() instanceof IHTMLGraphicalViewer) {
- ((IHTMLGraphicalViewer) getCurrentViewer())
- .updateHorizontalPos();
- }
- }
- return true;
- }
- return false;
- }
-
- // /**
- // * @param e
- // * @return
- // */
- // protected boolean handleRangeModeKeyDown(KeyEvent e)
- // {
- // if (e.keyCode == SWT.SHIFT || e.keyCode == SWT.CONTROL || e.keyCode ==
- // SWT.ALT)
- // {
- // return false;
- // }
- //
- // dumpKey(e);
- // Command command = null;
- // switch (e.keyCode)
- // {
- // case SWT.ARROW_LEFT:
- // command = new HorizontalMoveCommand((IHTMLGraphicalViewer)
- // this.getCurrentViewer(), false,
- // (e.stateMask & SWT.SHIFT) != 0);
- // break;
- // case SWT.ARROW_RIGHT:
- // command = new HorizontalMoveCommand((IHTMLGraphicalViewer)
- // this.getCurrentViewer(), true,
- // (e.stateMask & SWT.SHIFT) != 0);
- // break;
- //
- // }
- // if (command != null)
- // {
- // command.execute();
- // return true;
- // }
- //
- // char content = e.character;
- //
- // // when reach here, should be standard content keys.
- // return handleRangeModeContentChar(content);
- // }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.tools.SelectionTool#createHoverRequest()
- */
- protected void createHoverRequest() {
- this._hoverRequest = new LocationModifierRequest();
- _hoverRequest.setType(RequestConstants.REQ_SELECTION_HOVER);
- }
-
- protected Request getTargetHoverRequest() {
- if (_hoverRequest == null) {
- createHoverRequest();
- }
- return _hoverRequest;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.tools.SelectionTool#updateHoverRequest()
- */
- protected void updateHoverRequest() {
- LocationModifierRequest request = (LocationModifierRequest) getTargetHoverRequest();
- request.setLocation(getLocation());
- request.setControlKeyPressed(getCurrentInput().isControlKeyDown());
- }
-
- /*
- * If the target edit part is a NodeEditPart, then inform it if of the current
- * drag status before calling its hover feedback
- */
- protected void showHoverFeedback()
- {
- if (getTargetEditPart() instanceof NodeEditPart)
- {
- ((NodeEditPart)getTargetEditPart())
- .setDragActive(
- isInState(STATE_DRAG_IN_PROGRESS
- | STATE_ACCESSIBLE_DRAG_IN_PROGRESS
- | STATE_DRAG));
- }
- super.showHoverFeedback();
- }
-
- // TODO : this method is for debug purposes and should
- // be removed in production
-// protected boolean updateTargetUnderMouse() {
-// EditPart editPart = getTargetEditPart();
-// boolean retValue = super.updateTargetUnderMouse();
-// if (getTargetEditPart() != editPart)
-// {
-// System.out.println("New target editpart: "+getTargetEditPart()+" Old edit part: "+editPart);
-// }
-// return retValue;
-// }
-
- protected boolean handleMove() {
- boolean handled = super.handleMove();
- EditPart targetEditPart = getTargetEditPart();
-
- if (isInState(STATE_INITIAL)
- && targetEditPart instanceof NodeEditPart)
- {
- LocationRequest request = new LocationRequest(org.eclipse.jst.pagedesigner.requests.PageDesignerRequestConstants.REQ_SELECTION_TRACKER);
- request.setLocation(getLocation());
- DragTracker selectionTracker = targetEditPart.getDragTracker(request);
- setDragTracker(selectionTracker);
- }
-
- return handled;
- }
-
- protected Cursor calculateCursor() {
- EditPart targetEditPart = getTargetEditPart();
- if (isInState(STATE_INITIAL)
- && targetEditPart instanceof NodeEditPart)
- {
- final Cursor nodeCursor =
- ((NodeEditPart)targetEditPart).getCursor(getLocation());
-
- // if the edit part specified a custom cursor and there is no
- // active drag tracker (which would otherwise manage cursor)
- // then set the custom cursor
- // if we fall-through, the default behaviour will be used
- if (nodeCursor != null
- && getDragTracker() == null)
- {
- return nodeCursor;
- }
- }
- // otherwise, use super's defaults
- return super.calculateCursor();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/common/CommonResourceDialog.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/common/CommonResourceDialog.java
deleted file mode 100644
index c714b34..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/common/CommonResourceDialog.java
+++ /dev/null
@@ -1,403 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.ui.common;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-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.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jst.jsf.common.ui.IFileFolderConstants;
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.jsf.common.ui.internal.utils.WebrootUtil;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.editors.pagedesigner.PageDesignerResources;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-
-/**
- * This dialog shows IFile type resources within a IProject domain for
- * selection. The client can prvide the suffixs of files to filter when
- * candidates are shown on the tree,
- *
- * TODO: dead?
- *
- * @author mengbo
- */
-class CommonResourceDialog extends TreeViewerSelectionDialog {
- private static final int WEBROOT_FOLDER_DEPTH = 2;
-
- // CommonResourceDialog.statusMessage = Please select an image file
- private static final String STATUS_MESSAGE = PageDesignerResources
- .getInstance().getString("CommonResourceDialog.statusMessage"); //$NON-NLS-1$
-
- private String _suffixs[] = null;
-
- private CommonResourceFilter _filter;
-
- /** Create the logger for this class */
- private static Logger _log = PDPlugin.getLogger(CommonResourceDialog.class);
-
- // The content provider
- class ProjectFileDialogContentProvider implements ITreeContentProvider {
- /**
- * The visual part that is using this content provider is about to be
- * disposed. Deallocate all allocated SWT resources.
- */
- public void dispose() {
- // do nothing
- }
-
- /**
- * @see ITreeContentProvider#getChildren
- */
- public Object[] getChildren(Object element) {
- if (element instanceof IWorkspace) {
- IWorkspaceRoot root = ((IWorkspace) element).getRoot();
- IProject[] projects = root.getProjects();
- return projects;
- } else if (element instanceof IContainer) {
- if (element instanceof IProject) {
- IContainer container = (IContainer) element;
- if (container.isAccessible()) {
- try {
- IResource[] members = container.members();
- return members;
- } catch (CoreException e) {
- // "Error.CommonResourceDialog.0.1" = "Error in
- // project memeber querying"
- // "Error.CommonResourceDialog.0.2" = "Please refer
- // to the log for details"
- PDPlugin
- .getAlerts()
- .error(
- "Error.CommonResourceDialog.0.1", "Error.CommonResourceDialog.0.2"); //$NON-NLS-1$ //$NON-NLS-2$
- // Error.ProjectFileDialogContentProvider.0 = Core
- // error, you may need to restart the application
- _log
- .error(
- "Error.ProjectFileDialogContentProvider.0", e); //$NON-NLS-1$
- }
- }
- } else if (element instanceof IFolder) {
- // Process the folder container
- IContainer container = (IContainer) element;
- if (container.isAccessible()) {
- try {
- // Filter all the files under the project and only
- // show
- // the folder in the container selection dialog
- List children = new ArrayList();
- IResource[] members = container.members();
- for (int i = 0; i < members.length; i++) {
- if (!members[i].getName().equals(
- IFileFolderConstants.FOLDER_WEBINF)
- && !members[i]
- .getName()
- .equals(
- IFileFolderConstants.FOLDER_METAINF)) {
- children.add(members[i]);
- }
- }
- return children.toArray();
- } catch (CoreException e) {
- // "Error.CommonResourceDialog.0.1" = "Error in
- // project memeber querying"
- // "Error.CommonResourceDialog.0.2" = "Please refer
- // to the log for details"
- PDPlugin
- .getAlerts()
- .error(
- "Error.CommonResourceDialog.0.1", "Error.CommonResourceDialog.0.2"); //$NON-NLS-1$ //$NON-NLS-2$
- // Error.ProjectFileDialogContentProvider.0 = core
- // error, you may need to restart the application
- _log
- .error(
- "Error.ProjectFileDialogContentProvider.0", e); //$NON-NLS-1$
- }
- }
- }
- }
- return new Object[0];
- }
-
- /**
- * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements
- */
- public Object[] getElements(Object element) {
- return getChildren(element);
- }
-
- /**
- * @see ITreeContentProvider#getParent
- */
- public Object getParent(Object element) {
- if (element instanceof IResource) {
- return ((IResource) element).getParent();
- }
- return null;
- }
-
- /**
- * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren
- */
- public boolean hasChildren(Object element) {
- return getChildren(element).length > 0;
- }
-
- /**
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // do nothing
- }
-
- }
-
- // The default resource filter
- static class CommonResourceFilter extends ViewerFilter {
- private String _suffixs[] = { IFileFolderConstants.EXT_PROPERTIES };
-
- private Logger _mylog = PDPlugin.getLogger(CommonResourceFilter.class);
-
- private IProject _project;
-
- /**
- * @return Returns the _suffixs.
- */
- public String[] getSuffixs() {
- return _suffixs;
- }
-
- /**
- * @param _suffixs
- * The _suffixs to set.
- */
- public void setSuffixs(String[] _suffixs) {
- this._suffixs = _suffixs;
- }
-
- /**
- * @param project
- */
- public CommonResourceFilter(IProject project) {
- _project = project;
- }
-
- /**
- * @param project
- * The _project to set.
- */
- public void setProject(IProject project) {
- this._project = project;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer,
- * java.lang.Object, java.lang.Object)
- */
- public boolean select(Viewer viewer, Object parentElement,
- Object element) {
- // TODO: This logic can be improved by add caching mechanism
- if (element instanceof IWorkspace) {
- return true;
- } else if (element instanceof IFile) {
- if (Arrays.asList(_suffixs).contains(
- ((IFile) element).getFileExtension())) {
- return true;
- }
- } else if (element instanceof IContainer) {
- if (!((IContainer) element).isAccessible()) {
- return false;
- }
- if (element instanceof IProject) {
- IProject container = (IProject) element;
- if (isWebAppProject(container)
- && this.isSameProject(container, _project)) {
- return true;
- }
- return false;
- } else if (element instanceof IFolder) {
- IContainer container = (IContainer) element;
- try {
- if (container.getName().equals(
- IFileFolderConstants.FOLDER_WEBINF)
- || container.getName().equals(
- IFileFolderConstants.FOLDER_METAINF)) {
- return false;
- }
- IResource[] members = container.members();
- for (int i = 0; i < members.length; i++) {
- {
- if (select(viewer, members[i].getParent(),
- members[i])) {
- return true;
- }
- }
- }
- } catch (CoreException e) {
- // "Error.ImgFileFilter.0" = "Error in filtering the
- // tree", "Error.ImgFileFilter.2 = ""CoreException is
- // thrown, please refer to error log for details"
- // "Error.ProjectFileDialogContentProvider.0" = core
- // error, show alert dialog to user.
- PDPlugin
- .getAlerts()
- .detailError(
- "Error.ImgFileFilter.0", "Error.ImgFileFilter.2"); //$NON-NLS-2$
- _mylog.error(
- "Error.ProjectFileDialogContentProvider.0", e); //$NON-NLS-1$
- return false;
- }
- }
- }
- // we don't select any other types of resources.
- return false;
- }
-
- /**
- * Determines if a project is a Web Application project by the presence
- * of an associated Web Application Nature.
- *
- * @return boolean - True, when project is a Web Application project
- */
- private boolean isWebAppProject(IProject project) {
- return WebrootUtil.isValidWebProject(project);
- }
-
- private boolean isSameProject(IProject orig, IProject dst) {
- String currentProjectName = orig.getFullPath()
- .toString().trim();
- String projectName = dst.getFullPath().toString().trim();
- return projectName.equalsIgnoreCase(currentProjectName);
- }
- }
-
- /**
- * This is a dialog for common resource selection, the resouce supported
- * include IFolder, IProject, IFile, user can provide
- *
- * @param parentShell
- * @param project
- */
- public CommonResourceDialog(Shell parentShell, IProject project) {
- super(parentShell, STATUS_MESSAGE);
- setContentProvider(new ProjectFileDialogContentProvider());
- setLabelProvider(WorkbenchLabelProvider
- .getDecoratingWorkbenchLabelProvider());
- _filter = new CommonResourceFilter(project);
- setFilter(_filter);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.ui.common.SelectionTreeViewerDialog#findInputElement()
- */
- protected Object findInputElement() {
- return ResourcesPlugin.getWorkspace();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.ui.common.SelectionTreeViewerDialog#isValidSelection(java.lang.Object)
- */
- protected boolean isValidSelection(Object selection) {
- if (getContainerFullPath(selection) == null) {
- return false;
- }
- int depth = getContainerFullPath(selection).segmentCount();
- // The location is within WEBROOT PATH?
- if ((selection instanceof IFile) && depth >= WEBROOT_FOLDER_DEPTH) {
- // Null means no filter is set
- if (_suffixs == null) {
- return true;
- }
- // The extension is supported?
- else if (_suffixs != null
- && Arrays.asList(_suffixs).contains(
- ((IFile) selection).getFileExtension())) {
- return true;
- }
- }
- // None of above conditions, invalid.
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.dialogs.SelectionDialog#getResult()
- */
- public Object[] getResult() {
- Object[] objects = super.getResult();
- if (objects == null || objects.length == 0) {
- return null;
- }
- // Only one element is set by us.
- IPath returnValue = getWebRelatedPath(objects[0]);
- if (returnValue != null) {
- if (!(returnValue.toString().startsWith(
- IFileFolderConstants.PATH_SEPARATOR) || returnValue
- .toString().startsWith("\\"))) {
- Path tempPath = new Path(IFileFolderConstants.PATH_SEPARATOR
- + returnValue.toString());
- returnValue = tempPath;
- }
- }
- return new Object[] { returnValue };
- }
-
- private IPath getContainerFullPath(Object _selectedElement) {
- if (_selectedElement == null) {
- return null;
- } else if (_selectedElement instanceof IContainer) {
- return ((IContainer) _selectedElement).getFullPath();
- } else if (_selectedElement instanceof IFile) {
- return ((IFile) _selectedElement).getFullPath();
- }
- return null;
- }
-
- private IPath getWebRelatedPath(Object _selectedElement) {
- IPath result = null;
- if (_selectedElement == null) {
- return null;
- } else if (_selectedElement instanceof IContainer) {
- result = ((IContainer) _selectedElement).getFullPath();
- } else if (_selectedElement instanceof IFile) {
- result = ((IFile) _selectedElement).getFullPath();
- }
- if (result != null) {
- if (result.segmentCount() > 2) {
- result = result.removeFirstSegments(2);
- }
- }
- return result;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/common/PartActivationHandler.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/common/PartActivationHandler.java
deleted file mode 100644
index e6bc799..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/common/PartActivationHandler.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.ui.common;
-
-import org.eclipse.swt.events.ShellAdapter;
-import org.eclipse.swt.events.ShellEvent;
-import org.eclipse.ui.IPartListener;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * @author mengbo
- */
-public abstract class PartActivationHandler extends ShellAdapter implements
- IPartListener {
- private IWorkbenchPart _activePart;
-
- private boolean _isHandlingActivation = false;
-
- private IWorkbenchPart _trace;
-
- /**
- * @param part
- */
- public PartActivationHandler(IWorkbenchPart part) {
- _trace = part;
- }
-
- /**
- * this method is called when the specified part is activated.
- */
- public abstract void handleActivation();
-
- private void internalHandleActivation() {
-
- if (_isHandlingActivation)
- return;
-
- if (_activePart == _trace) {
- _isHandlingActivation = true;
- try {
- handleActivation();
- } finally {
- _isHandlingActivation = false;
- }
- }
- }
-
- /**
- * @see IPartListener#partActivated(IWorkbenchPart)
- */
- public void partActivated(IWorkbenchPart part) {
- _activePart = part;
- internalHandleActivation();
- }
-
- /**
- * @see IPartListener#partBroughtToTop(IWorkbenchPart)
- */
- public void partBroughtToTop(IWorkbenchPart part) {
- // do nothing
- }
-
- /**
- * @see IPartListener#partClosed(IWorkbenchPart)
- */
- public void partClosed(IWorkbenchPart part) {
- // do nothing
- }
-
- /**
- * @see IPartListener#partDeactivated(IWorkbenchPart)
- */
- public void partDeactivated(IWorkbenchPart part) {
- _activePart = null;
- }
-
- /**
- * @see IPartListener#partOpened(IWorkbenchPart)
- */
- public void partOpened(IWorkbenchPart part) {
- // do nothing
- }
-
- /*
- * @see ShellListener#shellActivated(ShellEvent)
- */
- public void shellActivated(ShellEvent e) {
- internalHandleActivation();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/common/ResourceOnClasspathDialog.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/common/ResourceOnClasspathDialog.java
deleted file mode 100644
index 6a53826..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/common/ResourceOnClasspathDialog.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.ui.common;
-
-import java.io.File;
-import java.util.Arrays;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.core.IJarEntryResource;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.ui.JavaElementLabelProvider;
-import org.eclipse.jdt.ui.StandardJavaElementContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jst.jsf.common.ui.IFileFolderConstants;
-import org.eclipse.jst.pagedesigner.editors.pagedesigner.PageDesignerResources;
-import org.eclipse.jst.pagedesigner.utils.JavaUtil;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * This dialog will let client to select resources that located on a
- * IJavaProject classpath, the client can provide a list of files suffixs to
- * filter.
- *
- * @author mengbo
- */
-// TODO: Since many jar files might do nothing to do with client's selection, we
-// may need to provides more filter choice
-// to clients to exclude unnecessary jar files, such as that are located in JDK
-// dir.
-public class ResourceOnClasspathDialog extends TreeViewerSelectionDialog {
- // ResourcesOnClasspathDialog.statusMessage = Please select a property file
- private static final String STATUS_MESSAGE = PageDesignerResources
- .getInstance()
- .getString("ResourcesOnClasspathDialog.statusMessage"); //$NON-NLS-1$
-
- private IJavaProject _javaProject;
-
- // the suffixs of files that can be selected
- private String _suffixs[]; // =
-
- // IJMTConstants.DEFAULT_SUFFIX;
-
- private ResourceOnClasspathFilter _filter;
-
- // Client doesn't need to know it.
- class ResourceOnClasspathFilter extends ViewerFilter {
- StandardJavaElementContentProvider _javaContentProvider;
-
- /**
- * @param contentProvider
- */
- public ResourceOnClasspathFilter(
- StandardJavaElementContentProvider contentProvider) {
- _javaContentProvider = contentProvider;
- }
-
- /**
- * Set the suffixs of files need to be selected.
- *
- * @param suffixs
- */
- public void setSuffixs(String suffixs[]) {
- _suffixs = suffixs;
- }
-
- /**
- * @param contentProvider
- * The _javaContentProvider to set.
- */
- public void setJavaContentProvider(
- StandardJavaElementContentProvider contentProvider) {
- _javaContentProvider = contentProvider;
- }
-
- /**
- * @param project
- * The _javaProject to set.
- */
- public void setJavaProject(IJavaProject project) {
- _javaProject = project;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer,
- * java.lang.Object, java.lang.Object)
- */
- public boolean select(Viewer viewer, Object parentElement,
- Object element) {
- // TODO: This logic can be improved by add caching mechanism
- if (element instanceof IJavaProject) {
- String currentProjectName = ((IJavaProject) element)
- .getProject().getFullPath().toString().trim();
- String projectName = _javaProject.getProject().getFullPath()
- .toString().trim();
- if (projectName.equalsIgnoreCase(currentProjectName)) {
- return true;
- }
- return false;
- } else if (element instanceof IResource) {
- if (((_javaProject != null) && !_javaProject
- .isOnClasspath((IResource) element))) {
- return false;
- }
- if (element instanceof IFile) {
- if (Arrays.asList(_suffixs).contains(
- ((IFile) element).getFileExtension())) {
- return true;
- }
- }
- return false;
- }
-
- if (element instanceof IJarEntryResource) {
- String ext = ((IJarEntryResource) element).getFullPath()
- .getFileExtension();
- if (ext != null && Arrays.asList(_suffixs).contains(ext)) {
- return true;
- }
- return false;
- }
- if (!(element instanceof IJavaElement)) {
- return false;
- }
- if (((_javaProject != null) && !_javaProject
- .isOnClasspath((IJavaElement) element))) {
- return false;
- }
- IJavaElement javaElement = (IJavaElement) element;
- Object[] children = null;
- switch (javaElement.getElementType()) {
- case IJavaElement.PACKAGE_FRAGMENT_ROOT:
- children = _javaContentProvider.getChildren(javaElement);
- break;
- case IJavaElement.IMPORT_CONTAINER:
- return true;
- case IJavaElement.PACKAGE_FRAGMENT:
- children = _javaContentProvider.getChildren(javaElement);
- break;
- case IJavaElement.CLASS_FILE:
- if (Arrays.asList(_suffixs).contains(
- IFileFolderConstants.EXT_CLASS)) {
- return true;
- }
- return false;
- case IJavaElement.COMPILATION_UNIT:
- String ext = javaElement.getPath().getFileExtension();
- if (ext != null && Arrays.asList(_suffixs).contains(ext)) {
- return true;
- }
- return false;
- default:
- return false;
- }
-
- for (int i = 0; i < children.length; i++) {
- if (select(viewer, javaElement, children[i])) {
- return true;
- }
- }
- // Either the resouce or its children are not for displaying.
- return false;
- }
- }
-
- /**
- * Set the suffixs of files need to be selected.
- *
- * @param suffixs
- */
- public void setSuffixs(String suffixs[]) {
- _suffixs = suffixs;
- _filter.setSuffixs(suffixs);
- }
-
- /**
- * @param parentShell
- * @param project
- */
- public ResourceOnClasspathDialog(Shell parentShell, IJavaProject project) {
- super(parentShell, STATUS_MESSAGE);
- // set provider and filter
- StandardJavaElementContentProvider contentProvider = new StandardJavaElementContentProvider();
- setContentProvider(contentProvider);
- setLabelProvider(new JavaElementLabelProvider());
- _filter = new ResourceOnClasspathFilter(contentProvider);
- setFilter(_filter);
- // store the project
- _javaProject = project;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.dialogs.SelectionDialog#getResult()
- */
- public Object[] getResult() {
- Object[] objects = super.getResult();
- if (objects == null || objects.length == 0) {
- return null;
- }
- IPath path = JavaUtil.getPathOnClasspath(_javaProject, objects[0]);
- String result = null;
- if (path.segmentCount() == 0) {
- return new Object[] { "" };
- }
- path = path.removeFileExtension();
- result = path.toOSString();
- result = result.replace(File.separatorChar, '.');
- return new Object[] { result };
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.ui.common.SelectionTreeViewerDialog#isValidSelection()
- */
- protected boolean isValidSelection(Object selection) {
- String extension = JavaUtil.getPathOnClasspath(_javaProject, selection)
- .getFileExtension();
- return (extension != null && Arrays.asList(_suffixs)
- .contains(extension));
- }
-
- protected Object findInputElement() {
- Object input = ResourcesPlugin.getWorkspace();
- if (input instanceof IWorkspace) {
- return JavaCore.create(((IWorkspace) input).getRoot());
- } else if (input instanceof IContainer) {
- IJavaElement element = JavaCore.create((IContainer) input);
- if (element != null && element.exists())
- return element;
- return input;
- }
- return JavaCore.create(ResourcesPlugin.getWorkspace().getRoot());
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/common/TreeViewerSelectionDialog.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/common/TreeViewerSelectionDialog.java
deleted file mode 100644
index 97aa367..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/common/TreeViewerSelectionDialog.java
+++ /dev/null
@@ -1,328 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.ui.common;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.resource.JFaceResources;
-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.ViewerFilter;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.jst.jsf.common.ui.internal.guiutils.SWTUtils;
-import org.eclipse.jst.pagedesigner.editors.pagedesigner.PageDesignerResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-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.ui.dialogs.SelectionDialog;
-import org.eclipse.ui.part.DrillDownComposite;
-
-/**
- * This is a base dialog that uses TreeViewer to show selections, subclass needs
- * to provide IContentProvider, ILabelProvider and ViewerFilter for the
- * TreeViewer. Subclass needs to implement isValidSelection(), which valids the
- * selection, and findInputElement() which provides the root element of the
- * tree. Besides, subclass might need to implement getResult() to return a
- * customized result.
- *
- * @author mengbo
- */
-abstract class TreeViewerSelectionDialog extends SelectionDialog {
- // = "Select a file"
- private static final String DEFAULT_TITLE = PageDesignerResources
- .getInstance().getString("TreeViewerSelectionDialog.Title"); //$NON-NLS-1$
-
- /** Used to tag the image type */
- static final int STYLE_NONE = 0;
-
- static final int STYLE_INFORMATION = 1;
-
- static final int STYLE_ERROR = 2;
-
- static final int STYLE_WARNING = 3;
-
- /** Sizi of the TreeViewer composite */
- private static final int SIZING_SELECTION_PANE_HEIGHT = 300;
-
- private static final int SIZING_SELECTION_PANE_WIDTH = 320;
-
- private String _title = DEFAULT_TITLE;
-
- // the seleciton on the treeviewer.
- private static Object _selection;
-
- // providers
- private ITreeContentProvider _contentProvider;
-
- private ILabelProvider _labelProvider;
-
- private ViewerFilter _filter;
-
- /** The validation image */
- private Label _statusImage;
-
- /** The validation message */
- private Label _statusLabel;
-
- private String _statusMessage;
-
- // private IJavaProject _project;
- /** The selection tree */
- private TreeViewer _treeViewer;
-
- /**
- * @param parentShell
- * @param statusMessage
- */
- public TreeViewerSelectionDialog(Shell parentShell, String statusMessage) {
- super(parentShell);
- _statusMessage = statusMessage;
- // ? need SWT.RESIZE
- setShellStyle(getShellStyle());
- }
-
- /**
- * Returns a new drill down viewer for this dialog.
- * @param parent
- *
- */
- protected void createTreeViewer(Composite parent) {
- // Create drill down
- DrillDownComposite drillDown = new DrillDownComposite(parent,
- SWT.BORDER);
- GridData spec = new GridData(GridData.VERTICAL_ALIGN_FILL
- | GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL
- | GridData.GRAB_VERTICAL);
- spec.widthHint = SIZING_SELECTION_PANE_WIDTH;
- spec.heightHint = SIZING_SELECTION_PANE_HEIGHT;
- drillDown.setLayoutData(spec);
- _treeViewer = new TreeViewer(drillDown, SWT.NONE);
- drillDown.setChildTree(_treeViewer);
- }
-
- private void setTreeViewerProviders() {
- _treeViewer.setContentProvider(_contentProvider);
- _treeViewer.setLabelProvider(_labelProvider);
- _treeViewer.setSorter(new ViewerSorter());
- _treeViewer
- .addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- _selection = getSelectedElement((IStructuredSelection) event
- .getSelection());
- updateStatus();
- }
- });
- _treeViewer.addDoubleClickListener(new IDoubleClickListener() {
- public void doubleClick(DoubleClickEvent event) {
- ISelection selection = event.getSelection();
- if (selection instanceof IStructuredSelection) {
- Object item = ((IStructuredSelection) selection)
- .getFirstElement();
- if (_treeViewer.getExpandedState(item)) {
- _treeViewer.collapseToLevel(item, 1);
- } else {
- _treeViewer.expandToLevel(item, 1);
- }
- }
- }
- });
- _treeViewer.setInput(findInputElement());
-
- if (_filter != null) {
- // Assert.isLegal(_contentProvider instanceof
- // StandardJavaElementContentProvider);
- _treeViewer.addFilter(_filter);
- }
-
- }
-
- /**
- * Creates the contents of the composite.
- * @param parent
- */
- public void createTreeViewerComposite(Composite parent) {
- Composite treeViewerComposite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- treeViewerComposite.setLayout(layout);
- GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
- gridData.horizontalSpan = 2;
- treeViewerComposite.setLayoutData(gridData);
- Label label = new Label(treeViewerComposite, SWT.WRAP);
- label.setText(_title);
- label.setFont(treeViewerComposite.getFont());
- createTreeViewer(treeViewerComposite);
- Dialog.applyDialogFont(treeViewerComposite);
- }
-
- /**
- * Sets the selected existing container.
- *
- * @param selection -
- * the current selected container.
- */
- public void setSelectedElement(Object selection) {
- // Expand to and select the specified container
- if (_selection != null) {
- _treeViewer.expandToLevel(_selection, 1);
- }
- List itemsToExpand = new ArrayList();
- Object parent = _contentProvider.getParent(selection);
- if (parent == null) {
- return;
- }
- while (parent != null) {
- itemsToExpand.add(0, parent);
- parent = _contentProvider.getParent(parent);
- }
- _treeViewer.setExpandedElements(itemsToExpand.toArray());
- _treeViewer.setSelection(new StructuredSelection(selection), true);
- }
-
- /*
- * (non-Javadoc) Method declared on Dialog.
- */
- protected Control createDialogArea(Composite parent) {
- Composite area = (Composite) super.createDialogArea(parent);
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 2;
- area.setLayout(gridLayout);
-
- // Container treeviewer composite
- createTreeViewerComposite(area);
-
- _statusImage = SWTUtils.createLabelImage(area,
- getMessageImage(STYLE_ERROR), 1, null);
- _statusLabel = SWTUtils.createLabel(area, "", 1);
- // Link to model
- setTreeViewerProviders();
-
- return dialogArea;
- }
-
- private Object getSelectedElement(IStructuredSelection selection) {
- return selection.getFirstElement();
- }
-
- /**
- * @param provider
- * The _contentProvider to set.
- */
- public void setContentProvider(ITreeContentProvider provider) {
- _contentProvider = provider;
- }
-
- /**
- * @param provider
- * The _labelProvider to set.
- */
- public void setLabelProvider(ILabelProvider provider) {
- _labelProvider = provider;
- }
-
- /**
- * @param filter
- * The _filter to set.
- */
- public void setFilter(ViewerFilter filter) {
- this._filter = filter;
- }
-
-
- /**
- * Update the status message
- */
- private void updateStatus() {
- if (isValidSelection(_selection)) {
- _statusImage.setImage(getMessageImage(STYLE_NONE));
- _statusLabel.setText("");
- getOkButton().setEnabled(true);
- } else {
- _statusImage.setImage(getMessageImage(STYLE_ERROR));
- _statusLabel.setText(_statusMessage);
- getOkButton().setEnabled(false);
- }
- }
-
- /**
- * Get the different message according the message type.
- *
- * @param imageType
- *
- * @return Image - the message image
- */
- protected Image getMessageImage(int imageType) {
- switch (imageType) {
- case STYLE_ERROR:
- return JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_ERROR);
- case STYLE_WARNING:
- return JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_WARNING);
- case STYLE_INFORMATION:
- return JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_INFO);
- default:
- return null;
- }
- }
-
- /**
- * The <code>ContainerSelectionDialog</code> implementation of this
- * <code>Dialog</code> method builds a list of the selected resource
- * containers for later retrieval by the client and closes this dialog.
- */
- protected void okPressed() {
- List chosenContainerPathList = new ArrayList();
- if (_selection != null) {
- chosenContainerPathList.add(_selection);
- }
- setResult(chosenContainerPathList);
- super.okPressed();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.window.Window#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent) {
- Control control = super.createContents(parent);
- if (_selection != null) {
- this.setSelectedElement(_selection);
- }
- return control;
- }
-
- /**
- * @param selection
- * @return true if the selection is valid
- */
- protected abstract boolean isValidSelection(Object selection);
-
- /**
- * @return the input element
- */
- protected abstract Object findInputElement();
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/common/sash/NestedEditorActionBarContributor.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/common/sash/NestedEditorActionBarContributor.java
deleted file mode 100644
index 2e0a2c0..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/common/sash/NestedEditorActionBarContributor.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.ui.common.sash;
-
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.part.MultiPageEditorActionBarContributor;
-
-/**
- * This contributor should be used when a SashEditor is inside a multipage
- * editor.
- *
- * @author mengbo
- * @version 1.5
- */
-public abstract class NestedEditorActionBarContributor extends
- MultiPageEditorActionBarContributor {
- /**
- * Child class should not override this method.
- */
- public final void setActivePage(IEditorPart activeEditor) {
- if (activeEditor instanceof SashEditorPart) {
- activeEditor = ((SashEditorPart) activeEditor).getActiveEditor();
- }
-
- setInnerActivePage(activeEditor);
- }
-
- /**
- * Child class should override this method
- *
- * @param activeEditor
- */
- public abstract void setInnerActivePage(IEditorPart activeEditor);
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/common/sash/SashEditorPart.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/common/sash/SashEditorPart.java
deleted file mode 100644
index ddaf592..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/common/sash/SashEditorPart.java
+++ /dev/null
@@ -1,531 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.ui.common.sash;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SafeRunner;
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.jface.util.SafeRunnable;
-import org.eclipse.jface.viewers.IPostSelectionProvider;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jst.jsf.common.ui.internal.guiutils.SWTUtils;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.ui.IEditorActionBarContributor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IKeyBindingService;
-import org.eclipse.ui.INestableKeyBindingService;
-import org.eclipse.ui.IPropertyListener;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.part.EditorPart;
-import org.eclipse.ui.part.MultiPageEditorActionBarContributor;
-import org.eclipse.ui.part.MultiPageEditorSite;
-
-/**
- * This class emulates the MultiPageEditorPart. But instead of using multipage,
- * it use SashForm to separate the editors.
- *
- * @author mengbo
- */
-public abstract class SashEditorPart extends EditorPart {
- private int _orientation = SWT.VERTICAL;
-
- private SashForm _sashForm;
-
- /**
- * List of nested editors. Element type: IEditorPart. Need to hang onto them
- * here, in addition to using get/setData on the items, because dispose()
- * needs to access them, but widgetry has already been disposed at that
- * point.
- */
- private ArrayList _nestedEditors = new ArrayList(3);
-
- private Map _editorToComposite = new HashMap();
-
- private IEditorPart _activeEditor = null;
-
- /**
- * Creates and adds a new page containing the given editor to this
- * multi-page editor. The page is added at the given index. This also hooks
- * a property change listener on the nested editor.
- *
- * @param editor
- * the nested editor
- * @param input
- * the input for the nested editor
- * @exception PartInitException
- * if a new page could not be created
- * @see org.eclipse.ui.part.MultiPageEditorPart#handlePropertyChange(int) the handler for
- * property change events from the nested editor
- */
- public void addPage(final IEditorPart editor, IEditorInput input)
- throws PartInitException {
- IEditorSite site = createSite(editor);
- // call init first so that if an exception is thrown, we have created no
- // new widgets
- editor.init(site, input);
- final Composite parent1 = new Composite(getContainer(), SWT.NONE);
- FillLayout fillLayout = new FillLayout();
- fillLayout.marginWidth = fillLayout.marginHeight = 1;
- parent1.setLayout(fillLayout);
-
- parent1.addListener(SWT.Activate, new Listener() {
- public void handleEvent(Event event) {
- if (event.type == SWT.Activate) {
- activeEditorChanged(editor);
- parent1.setBackground(ColorConstants.green);
- }
- }
- });
- parent1.addListener(SWT.Deactivate, new Listener() {
- public void handleEvent(Event event) {
- parent1.setBackground(ColorConstants.titleInactiveBackground);
- }
- });
- SWTUtils.workaroundResize(parent1);
- editor.createPartControl(parent1);
- editor.addPropertyListener(new IPropertyListener() {
- public void propertyChanged(Object source, int propertyId) {
- SashEditorPart.this.handlePropertyChange(propertyId);
- }
- });
-
- _nestedEditors.add(editor);
- _editorToComposite.put(editor, parent1);
-
- connectPage(editor);
- }
-
- /**
- * @param editor
- */
- protected void connectPage(IEditorPart editor) {
- ISelectionProvider editSelectionProvider = editor.getSite()
- .getSelectionProvider();
- if (editSelectionProvider instanceof IPostSelectionProvider) {
- ((IPostSelectionProvider) editSelectionProvider)
- .addPostSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- ((SashEditorSelectionProvider) getSite()
- .getSelectionProvider())
- .firePostSelectionChanged(event);
- }
- });
- } else {
- editSelectionProvider
- .addSelectionChangedListener(new ISelectionChangedListener() {
-
- public void selectionChanged(SelectionChangedEvent event) {
- ((SashEditorSelectionProvider) getSite()
- .getSelectionProvider())
- .fireSelectionChanged(event);
- }
- });
- }
- }
-
- /**
- * Creates an empty container. Creates a CTabFolder with no style bits set,
- * and hooks a selection listener which calls <code>pageChange()</code>
- * whenever the selected tab changes.
- *
- * @param parent
- * The composite in which the container tab folder should be
- * created; must not be <code>null</code>.
- * @return a new container
- */
- private SashForm createContainer(Composite parent) {
- // use SWT.FLAT style so that an extra 1 pixel border is not reserved
- // inside the folder
- SashForm newContainer = new SashForm(parent, SWT.NONE);
- SWTUtils.workaroundResize(newContainer);
- newContainer.setOrientation(_orientation);
- return newContainer;
- }
-
- /**
- * @throws PartInitException
- */
- abstract protected void createPages() throws PartInitException;
-
- /**
- * The <code>MultiPageEditor</code> implementation of this
- * <code>IWorkbenchPart</code> method creates the control for the
- * multi-page editor by calling <code>createContainer</code>, then
- * <code>createPages</code>. Subclasses should implement
- * <code>createPages</code> rather than overriding this method.
- *
- * @param parent
- * The parent in which the editor should be created; must not be
- * <code>null</code>.
- */
- public final void createPartControl(Composite parent) {
- this._sashForm = createContainer(parent);
-
- try {
- createPages();
- } catch (PartInitException ex) {
- ex.printStackTrace();
- }
- // set the active page (page 0 by default), unless it has already been
- // done
- if (getActiveEditor() == null) {
- if (!_nestedEditors.isEmpty()) {
- setActiveEditor((IEditorPart) _nestedEditors.get(0));
- }
- }
- }
-
- /**
- * Creates the site for the given nested editor. The
- * <code>MultiPageEditorPart</code> implementation of this method creates
- * an instance of <code>MultiPageEditorSite</code>. Subclasses may
- * reimplement to create more specialized sites.
- *
- * @param editor
- * the nested editor
- * @return the editor site
- */
- protected IEditorSite createSite(IEditorPart editor) {
- return new SashEditorSite(this, editor);
- }
-
- /**
- * The <code>MultiPageEditorPart</code> implementation of this
- * <code>IWorkbenchPart</code> method disposes all nested editors.
- * Subclasses may extend.
- */
- public void dispose() {
- _activeEditor = null;
- for (int i = 0; i < _nestedEditors.size(); ++i) {
- IEditorPart editor = (IEditorPart) _nestedEditors.get(i);
- disposePart(editor);
- }
- _nestedEditors.clear();
- _editorToComposite.clear();
- }
-
- /**
- * Returns the active nested editor if there is one.
- * <p>
- * Subclasses should not override this method
- * </p>
- *
- * @return the active nested editor, or <code>null</code> if none
- */
- public IEditorPart getActiveEditor() {
- return _activeEditor;
- }
-
- /**
- * Returns the composite control containing this multi-page editor's pages.
- * This should be used as the parent when creating controls for the
- * individual pages. That is, when calling <code>addPage(Control)</code>,
- * the passed control should be a child of this container.
- * <p>
- * Warning: Clients should not assume that the container is any particular
- * subclass of Composite. The actual class used may change in order to
- * improve the look and feel of multi-page editors. Any code making
- * assumptions on the particular subclass would thus be broken.
- * </p>
- * <p>
- * Subclasses should not override this method
- * </p>
- *
- * @return the composite, or <code>null</code> if
- * <code>createPartControl</code> has not been called yet
- */
- protected Composite getContainer() {
- return _sashForm;
- }
-
- /**
- * Returns the editor for the given page index. The page index must be
- * valid.
- *
- * @param pageIndex
- * the index of the page
- * @return the editor for the specified page, or <code>null</code> if the
- * specified page was not created with
- * <code>addPage(IEditorPart,IEditorInput)</code>
- */
- protected IEditorPart getEditor(int pageIndex) {
- return (IEditorPart) _nestedEditors.get(pageIndex);
- }
-
- /**
- * Handles a property change notification from a nested editor. The default
- * implementation simply forwards the change to listeners on this multi-page
- * editor by calling <code>firePropertyChange</code> with the same
- * property id. For example, if the dirty state of a nested editor changes
- * (property id <code>IEditorPart.PROP_DIRTY</code>), this method handles
- * it by firing a property change event for
- * <code>IEditorPart.PROP_DIRTY</code> to property listeners on this
- * multi-page editor.
- * <p>
- * Subclasses may extend or reimplement this method.
- * </p>
- *
- * @param propertyId
- * the id of the property that changed
- */
- protected void handlePropertyChange(int propertyId) {
- firePropertyChange(propertyId);
- }
-
- /**
- * The <code>MultiPageEditorPart</code> implementation of this
- * <code>IEditorPart</code> method sets its site to the given site, its
- * input to the given input, and the site's selection provider to a
- * <code>MultiPageSelectionProvider</code>. Subclasses may extend this
- * method.
- *
- * @param site
- * The site for which this part is being created; must not be
- * <code>null</code>.
- * @param input
- * The input on which this editor should be created; must not be
- * <code>null</code>.
- * @throws PartInitException
- * If the initialization of the part fails -- currently never.
- */
- public void init(IEditorSite site, IEditorInput input)
- throws PartInitException {
- setSite(site);
- setInput(input);
- site.setSelectionProvider(new SashEditorSelectionProvider(this));
- }
-
- /**
- * The <code>MultiPageEditorPart</code> implementation of this
- * <code>IEditorPart</code> method returns whether the contents of any of
- * this multi-page editor's nested editors have changed since the last save.
- * Pages created with <code>addPage(Control)</code> are ignored.
- * <p>
- * Subclasses may extend or reimplement this method.
- * </p>
- *
- * @return <code>true</code> if any of the nested editors are dirty;
- * <code>false</code> otherwise.
- */
- public boolean isDirty() {
- // use nestedEditors to avoid SWT requests; see bug 12996
- for (Iterator i = _nestedEditors.iterator(); i.hasNext();) {
- IEditorPart editor = (IEditorPart) i.next();
- if (editor.isDirty()) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Notifies this multi-page editor that the page with the given id has been
- * activated. This method is called when the user selects a different tab.
- * <p>
- * The <code>MultiPageEditorPart</code> implementation of this method sets
- * focus to the new page, and notifies the action bar contributor (if there
- * is one). This checks whether the action bar contributor is an instance of
- * <code>MultiPageEditorActionBarContributor</code>, and, if so, calls
- * <code>setActivePage</code> with the active nested editor. This also
- * fires a selection change event if required.
- * </p>
- * <p>
- * Subclasses may extend this method.
- * </p>
- * @param activeEditor
- *
- */
- protected void activeEditorChanged(IEditorPart activeEditor) {
- setActiveEditor(activeEditor);
- setFocus();
-
- IEditorSite site = getEditorSite();
- while (site != null) {
- IEditorActionBarContributor contributor = site
- .getActionBarContributor();
- if (contributor instanceof MultiPageEditorActionBarContributor) {
- ((MultiPageEditorActionBarContributor) contributor)
- .setActivePage(activeEditor);
- }
- if (site instanceof MultiPageEditorSite) {
- site = (IEditorSite) ((MultiPageEditorSite) site)
- .getMultiPageEditor().getSite();
- } else if (site instanceof SashEditorSite) {
- site = (IEditorSite) ((SashEditorSite) site).getSashEditor()
- .getSite();
- } else {
- site = null;
- }
- }
-
- if (activeEditor != null) {
- // Workaround for 1GAUS7C: ITPUI:ALL - Editor not activated when
- // restored from previous session
- // do not need second if once fixed
- ISelectionProvider selectionProvider = activeEditor.getSite()
- .getSelectionProvider();
- if (selectionProvider != null) {
- SelectionChangedEvent event = new SelectionChangedEvent(
- selectionProvider, selectionProvider.getSelection());
- ((SashEditorSelectionProvider) getSite().getSelectionProvider())
- .fireSelectionChanged(event);
- }
- }
- }
-
- /**
- * Disposes the given part and its site.
- *
- * @param part
- * The part to dispose; must not be <code>null</code>.
- */
- private void disposePart(final IWorkbenchPart part) {
- SafeRunner.run(new SafeRunnable() {
- public void run() {
- if (part.getSite() instanceof SashEditorSite) {
- SashEditorSite partSite = (SashEditorSite) part.getSite();
- partSite.dispose();
- }
- part.dispose();
- }
-
- public void handleException(Throwable e) {
- // Exception has already being logged by Core. Do nothing.
- }
- });
- }
-
- /**
- * Sets the currently active page.
- * @param part
- *
- */
- protected void setActiveEditor(IEditorPart part) {
- _activeEditor = part;
- }
-
- /**
- * The <code>MultiPageEditor</code> implementation of this
- * <code>IWorkbenchPart</code> method sets focus on the active nested
- * editor, if there is one.
- * <p>
- * Subclasses may extend or reimplement.
- * </p>
- */
- public void setFocus() {
- setFocus(getActiveEditor());
- }
-
- /**
- * Sets focus to the control for the given page. If the page has an editor,
- * this calls its <code>setFocus()</code> method. Otherwise, this calls
- * <code>setFocus</code> on the control for the page.
- *
- * @param pageIndex
- * the index of the page
- */
- private void setFocus(IEditorPart editor) {
- final IKeyBindingService service = getSite().getKeyBindingService();
-
- if (editor == null) {
- // There is no selected page, so deactivate the active service.
- if (service instanceof INestableKeyBindingService) {
- final INestableKeyBindingService nestableService = (INestableKeyBindingService) service;
- nestableService.activateKeyBindingService(null);
- } else {
- //WorkbenchPlugin
- PDPlugin
- .getLogger(getClass()).error("MultiPageEditorPart.setFocus() Parent key binding service was not an instance of INestableKeyBindingService. It was an instance of " + service.getClass().getName() + " instead."); //$NON-NLS-1$ //$NON-NLS-2$
- }
- return;
- }
- editor.setFocus();
- // There is no selected page, so deactivate the active service.
- if (service instanceof INestableKeyBindingService) {
- final INestableKeyBindingService nestableService = (INestableKeyBindingService) service;
- if (editor != null) {
- nestableService.activateKeyBindingService(editor
- .getEditorSite());
- } else {
- nestableService.activateKeyBindingService(null);
- }
- } else {
- PDPlugin
- .getLogger(getClass()).error("MultiPageEditorPart.setFocus() Parent key binding service was not an instance of INestableKeyBindingService. It was an instance of " + service.getClass().getName() + " instead."); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- public void doSave(IProgressMonitor monitor) {
- if (_activeEditor != null) {
- _activeEditor.doSave(monitor);
- }
- }
-
- public void doSaveAs() {
- if (_activeEditor != null) {
- _activeEditor.doSaveAs();
- }
-
- }
-
- public boolean isSaveAsAllowed() {
- if (_activeEditor != null)
- {
- return _activeEditor.isSaveAsAllowed();
- }
- return false;
- }
-
- /**
- * @param orientation
- */
- public void setOrientation(int orientation) {
- this._orientation = orientation;
- if (_sashForm != null && !_sashForm.isDisposed()) {
- _sashForm.setMaximizedControl(null);
- _sashForm.setOrientation(_orientation);
- }
- }
-
- /**
- * @param part
- */
- public void setMaximizedEditor(IEditorPart part) {
- if (part != null) {
- Composite c = (Composite) _editorToComposite.get(part);
- if (c != null && _sashForm != null && !_sashForm.isDisposed()) {
- _sashForm.setMaximizedControl(c);
- part.setFocus();
- }
- } else {
- if (_sashForm != null && !_sashForm.isDisposed()) {
- _sashForm.setMaximizedControl(null);
- }
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/common/sash/SashEditorSelectionProvider.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/common/sash/SashEditorSelectionProvider.java
deleted file mode 100644
index 2f47aaa..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/common/sash/SashEditorSelectionProvider.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.ui.common.sash;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.ListenerList;
-import org.eclipse.core.runtime.SafeRunner;
-import org.eclipse.jface.util.SafeRunnable;
-import org.eclipse.jface.viewers.IPostSelectionProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.ui.IEditorPart;
-
-/**
- * @author mengbo
- */
-public class SashEditorSelectionProvider implements IPostSelectionProvider {
-
- /**
- * Registered selection changed listeners (element type:
- * <code>ISelectionChangedListener</code>).
- */
- private ListenerList _listeners = new ListenerList(ListenerList.IDENTITY);
-
- private ListenerList _postSelectionChangedListeners = new ListenerList(ListenerList.IDENTITY);
-
- /**
- * The multi-page editor.
- */
- private SashEditorPart _sashEditor;
-
- /**
- * Creates a selection provider for the given multi-page editor.
- *
- * @param sashEditor
- * the multi-page editor
- */
- public SashEditorSelectionProvider(SashEditorPart sashEditor) {
- Assert.isNotNull(sashEditor);
- this._sashEditor = sashEditor;
- }
-
- /*
- * (non-Javadoc) Method declared on <code>ISelectionProvider</code>.
- */
- public void addSelectionChangedListener(ISelectionChangedListener listener) {
- _listeners.add(listener);
- }
-
- /**
- * Notifies all registered selection changed listeners that the editor's
- * selection has changed. Only listeners registered at the time this method
- * is called are notified.
- *
- * @param event
- * the selection changed event
- */
- public void fireSelectionChanged(final SelectionChangedEvent event) {
- Object[] listeners = this._listeners.getListeners();
- for (int i = 0; i < listeners.length; ++i) {
- final ISelectionChangedListener l = (ISelectionChangedListener) listeners[i];
- SafeRunner.run(new SafeRunnable() {
- public void run() {
- l.selectionChanged(event);
- }
- });
- }
- }
-
- /**
- * Returns the sash editor.
- * @return the sash editor part
- */
- public SashEditorPart getSashEditor() {
- return _sashEditor;
- }
-
- /*
- * (non-Javadoc) Method declared on <code>ISelectionProvider</code>.
- */
- public ISelection getSelection() {
- IEditorPart activeEditor = _sashEditor.getActiveEditor();
- if (activeEditor != null) {
- ISelectionProvider selectionProvider = activeEditor.getSite()
- .getSelectionProvider();
- if (selectionProvider != null)
- return selectionProvider.getSelection();
- }
- return null;
- }
-
- /*
- * (non-JavaDoc) Method declaed on <code>ISelectionProvider</code>.
- */
- public void removeSelectionChangedListener(
- ISelectionChangedListener listener) {
- _listeners.remove(listener);
- }
-
- /*
- * (non-Javadoc) Method declared on <code>ISelectionProvider</code>.
- */
- public void setSelection(ISelection selection) {
- IEditorPart activeEditor = _sashEditor.getActiveEditor();
- if (activeEditor != null) {
- ISelectionProvider selectionProvider = activeEditor.getSite()
- .getSelectionProvider();
- if (selectionProvider != null)
- selectionProvider.setSelection(selection);
- }
- }
-
- public void addPostSelectionChangedListener(
- ISelectionChangedListener listener) {
- _postSelectionChangedListeners.add(listener);
- }
-
- public void removePostSelectionChangedListener(
- ISelectionChangedListener listener) {
- _postSelectionChangedListeners.remove(listener);
- }
-
- /**
- * Notifies any post selection listeners that a post selection event has
- * been received. Only listeners registered at the time this method is
- * called are notified.
- *
- * @param event
- * a selection changed event
- *
- * @see #addPostSelectionChangedListener(ISelectionChangedListener)
- */
- public void firePostSelectionChanged(final SelectionChangedEvent event) {
- Object[] listeners = _postSelectionChangedListeners.getListeners();
- for (int i = 0; i < listeners.length; ++i) {
- final ISelectionChangedListener l = (ISelectionChangedListener) listeners[i];
- SafeRunnable.run(new SafeRunnable() {
- public void run() {
- l.selectionChanged(event);
- }
- });
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/common/sash/SashEditorSite.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/common/sash/SashEditorSite.java
deleted file mode 100644
index 4558404..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/common/sash/SashEditorSite.java
+++ /dev/null
@@ -1,435 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.ui.common.sash;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.viewers.ILabelDecorator;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorActionBarContributor;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IKeyBindingService;
-import org.eclipse.ui.INestableKeyBindingService;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-//import org.eclipse.ui.internal.PopupMenuExtender;
-
-/**
- * @author mengbo
- */
-public class SashEditorSite implements IEditorSite {
-
- /**
- * The nested editor.
- */
- private IEditorPart _editor;
-
- /**
- * The multi-page editor.
- */
- private SashEditorPart _sashEditor;
-
- /**
- * The selection provider; <code>null</code> if none.
- *
- * @see SashEditorSite#setSelectionProvider(ISelectionProvider)
- */
- private ISelectionProvider _selectionProvider = null;
-
- /**
- * The selection change listener, initialized lazily; <code>null</code> if
- * not yet created.
- */
- private ISelectionChangedListener _selectionChangedListener = null;
-
- /**
- * The cached copy of the key binding service specific to this sash editor
- * site. This value is <code>null</code> if it is not yet initialized.
- */
- private IKeyBindingService _service = null;
-
- /**
- * The list of popup menu extenders; <code>null</code> if none registered.
- */
- // TODO: dead? private ArrayList _menuExtenders;
-
- /**
- * Creates a site for the given editor nested within the given multi-page
- * editor.
- *
- * @param sashEditor
- * the multi-page editor
- * @param editor
- * the nested editor
- */
- public SashEditorSite(SashEditorPart sashEditor, IEditorPart editor) {
- Assert.isNotNull(sashEditor);
- Assert.isNotNull(editor);
- this._sashEditor = sashEditor;
- this._editor = editor;
- }
-
- /**
- * Dispose the contributions.
- */
- public void dispose() {
-// if (_menuExtenders != null) {
-// for (int i = 0, size = _menuExtenders.size(); i < size; i++) {
-// ((PopupMenuExtender) _menuExtenders.get(i)).dispose();
-// }
-// _menuExtenders = null;
-// }
-
- // Remove myself from the list of nested key binding services.
- if (_service != null) {
- IKeyBindingService parentService = getEditor().getSite()
- .getKeyBindingService();
- if (parentService instanceof INestableKeyBindingService) {
- INestableKeyBindingService nestableParent = (INestableKeyBindingService) parentService;
- nestableParent.removeKeyBindingService(this);
- }
- _service = null;
- }
- }
-
- /**
- * The <code>SashEditorSite</code> implementation of this
- * <code>IEditorSite</code> method returns <code>null</code>, since
- * nested editors do not have their own action bar contributor.
- *
- * @return <code>null</code>
- */
- public IEditorActionBarContributor getActionBarContributor() {
- return null;
- }
-
- /**
- * The <code>SashEditorSite</code> implementation of this
- * <code>IEditorSite</code> method forwards to the multi-page editor to
- * return the action bars.
- *
- * @return The action bars from the parent multi-page editor.
- */
- public IActionBars getActionBars() {
- return _sashEditor.getEditorSite().getActionBars();
- }
-
- /**
- * The <code>SashEditorSite</code> implementation of this
- * <code>IWorkbenchPartSite</code> method forwards to the multi-page
- * editor to return the decorator manager.
- *
- * @return The decorator from the workbench window.
- * @deprecated use IWorkbench.getDecoratorManager()
- */
- public ILabelDecorator getDecoratorManager() {
- return getWorkbenchWindow().getWorkbench().getDecoratorManager()
- .getLabelDecorator();
- }
-
- /**
- * Returns the nested editor.
- *
- * @return the nested editor
- */
- public IEditorPart getEditor() {
- return _editor;
- }
-
- /**
- * The <code>SashEditorSite</code> implementation of this
- * <code>IWorkbenchPartSite</code> method returns an empty string since
- * the nested editor is not created from the registry.
- *
- * @return An empty string.
- */
- public String getId() {
- return ""; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc) Method declared on IEditorSite.
- */
- public IKeyBindingService getKeyBindingService() {
- if (_service == null) {
- _service = getSashEditor().getEditorSite().getKeyBindingService();
- if (_service instanceof INestableKeyBindingService) {
- INestableKeyBindingService nestableService = (INestableKeyBindingService) _service;
- _service = nestableService.getKeyBindingService(this);
-
- } else {
- /*
- * This is an internal reference, and should not be copied by
- * client code. If you are thinking of copying this, DON'T DO
- * IT.
- */
- PDPlugin
- .getLogger(SashEditorSite.class)
- .info(
- "MultiPageEditorSite.getKeyBindingService() Parent key binding service was not an instance of INestableKeyBindingService. It was an instance of " + _service.getClass().getName() + " instead."); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- return _service;
- }
-
- /**
- * Returns the sash editor.
- *
- * @return the sash editor
- */
- public SashEditorPart getSashEditor() {
- return _sashEditor;
- }
-
- /**
- * The <code>SashEditorSite</code> implementation of this
- * <code>IWorkbenchPartSite</code> method forwards to the multi-page
- * editor to return the workbench page.
- *
- * @return The workbench page in which this editor site resides.
- */
- public IWorkbenchPage getPage() {
- return getSashEditor().getSite().getPage();
- }
-
- /**
- * The <code>SashEditorSite</code> implementation of this
- * <code>IWorkbenchPartSite</code> method returns an empty string since
- * the nested editor is not created from the registry.
- *
- * @return An empty string.
- */
- public String getPluginId() {
- return ""; //$NON-NLS-1$
- }
-
- /**
- * The <code>SashEditorSite</code> implementation of this
- * <code>IWorkbenchPartSite</code> method returns an empty string since
- * the nested editor is not created from the registry.
- *
- * @return An empty string.
- */
- public String getRegisteredName() {
- return ""; //$NON-NLS-1$
- }
-
- /**
- * Returns the selection changed listener which listens to the nested
- * editor's selection changes, and calls <code>handleSelectionChanged</code>.
- *
- * @return the selection changed listener
- */
- private ISelectionChangedListener getSelectionChangedListener() {
- if (_selectionChangedListener == null) {
- _selectionChangedListener = new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- SashEditorSite.this.handleSelectionChanged(event);
- }
- };
- }
- return _selectionChangedListener;
- }
-
- /**
- * The <code>SashEditorSite</code> implementation of this
- * <code>IWorkbenchPartSite</code> method returns the selection provider
- * set by <code>setSelectionProvider</code>.
- *
- * @return The current selection provider.
- */
- public ISelectionProvider getSelectionProvider() {
- return _selectionProvider;
- }
-
- /**
- * The <code>SashEditorSite</code> implementation of this
- * <code>IWorkbenchPartSite</code> method forwards to the multi-page
- * editor to return the shell.
- *
- * @return The shell in which this editor site resides.
- */
- public Shell getShell() {
- return getSashEditor().getSite().getShell();
- }
-
- /**
- * The <code>SashEditorSite</code> implementation of this
- * <code>IWorkbenchPartSite</code> method forwards to the multi-page
- * editor to return the workbench window.
- *
- * @return The workbench window in which this editor site resides.
- */
- public IWorkbenchWindow getWorkbenchWindow() {
- return getSashEditor().getSite().getWorkbenchWindow();
- }
-
- /**
- * Handles a selection changed event from the nested editor. The default
- * implementation gets the selection provider from the multi-page editor's
- * site, and calls <code>fireSelectionChanged</code> on it (only if it is
- * an instance of <code>SashSelectionProvider</code>), passing a new
- * event object.
- * <p>
- * Subclasses may extend or reimplement this method.
- * </p>
- *
- * @param event
- * the event
- */
- public void handleSelectionChanged(SelectionChangedEvent event) {
- // we'll only make the parent editor site fire the selection change
- // event
- // when we (the sasheditorsite) is the active editor in the parent site.
- if (getSashEditor().getActiveEditor() == this.getPart()) {
- ISelectionProvider parentProvider = getSashEditor().getSite()
- .getSelectionProvider();
- if (parentProvider instanceof SashEditorSelectionProvider) {
- SelectionChangedEvent newEvent = new SelectionChangedEvent(
- parentProvider, event.getSelection());
- ((SashEditorSelectionProvider) parentProvider)
- .fireSelectionChanged(newEvent);
- }
- }
- }
-
- /**
- * The <code>SashEditorSite</code> implementation of this
- * <code>IWorkbenchPartSite</code> method forwards to the multi-page
- * editor for registration.
- *
- * @param menuID
- * The identifier for the menu.
- * @param menuMgr
- * The menu manager
- * @param selProvider
- * The selection provider.
- */
- public void registerContextMenu(String menuID, MenuManager menuMgr,
- ISelectionProvider selProvider) {
-// if (_menuExtenders == null) {
-// _menuExtenders = new ArrayList(1);
-// }
- // cancel the registration of PopupMenuExtender since the
- // PopupMenuExtender's behavior
- // is different between eclipse 3.0 and eclipse 3.1,and we always have
- // one context
- // menu listener,no need add PopupMenuExtender as the second
- // listener(workaroud for bug 408295-1)
- // _menuExtenders.add(new PopupMenuExtender(menuID, menuMgr,
- // selProvider,
- // _editor));
- }
-
- /**
- * The <code>SashEditorSite</code> implementation of this
- * <code>IWorkbenchPartSite</code> method forwards to the multi-page
- * editor for registration.
- *
- * @param menuManager
- * The menu manager
- * @param selProvider
- * The selection provider.
- */
- public void registerContextMenu(MenuManager menuManager,
- ISelectionProvider selProvider) {
- getSashEditor().getSite().registerContextMenu(menuManager, selProvider);
- }
-
- /**
- * The <code>SashEditorSite</code> implementation of this
- * <code>IWorkbenchPartSite</code> method remembers the selection
- * provider, and also hooks a listener on it, which calls
- * <code>handleSelectionChanged</code> when a selection changed event
- * occurs.
- *
- * @param provider
- * The selection provider.
- * @see SashEditorSite#handleSelectionChanged(SelectionChangedEvent)
- */
- public void setSelectionProvider(ISelectionProvider provider) {
- ISelectionProvider oldSelectionProvider = _selectionProvider;
- _selectionProvider = provider;
- if (oldSelectionProvider != null) {
- oldSelectionProvider
- .removeSelectionChangedListener(getSelectionChangedListener());
- }
- if (_selectionProvider != null) {
- _selectionProvider
- .addSelectionChangedListener(getSelectionChangedListener());
- }
- }
-
- /**
- * @param job
- */
- public void progressEnd(Job job) {
- // Do nothing
- }
-
-
- /**
- * @param job
- */
- public void progressStart(Job job) {
- // Do nothing
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class adapter) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IWorkbenchPartSite#getPart()
- */
- public IWorkbenchPart getPart() {
- return _editor;
- }
-
- public void registerContextMenu(MenuManager menuManager,
- ISelectionProvider selectionProvider, boolean includeEditorInput) {
- // do nothing
- }
-
- public void registerContextMenu(String menuId, MenuManager menuManager,
- ISelectionProvider selectionProvider, boolean includeEditorInput) {
- // do nothing
-
- }
-
- public Object getService(Class api) {
- // return null
- return null;
- }
-
- public boolean hasService(Class api) {
- // no service
- return false;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogfields/ClasspathResourceButtonDialogField.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogfields/ClasspathResourceButtonDialogField.java
deleted file mode 100644
index 6960121..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogfields/ClasspathResourceButtonDialogField.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.ui.dialogfields;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jst.jsf.common.ui.IFileFolderConstants;
-import org.eclipse.jst.jsf.common.ui.JSFUICommonPlugin;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogField;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.IStringButtonAdapter;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.StringButtonDialogField;
-import org.eclipse.jst.jsf.common.ui.internal.dialogs.ResourceOnClasspathDialog;
-import org.eclipse.jst.pagedesigner.properties.attrgroup.IElementContextable;
-import org.eclipse.jst.pagedesigner.utils.StructuredModelUtil;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- * @author mengbo
- */
-public class ClasspathResourceButtonDialogField extends StringButtonDialogField implements IElementContextable
-{
-
- private static final String[] PROPERTIES_FILES_SUFFIXS = new String[] { IFileFolderConstants.EXT_PROPERTIES }; //$NON-NLS-1$
-
- private static class MyStringButtonAdapter implements IStringButtonAdapter
- {
- private IProject _project;
-
- public void changeControlPressed(DialogField field) {
- browseButtonPressed(field);
- }
-
- private void browseButtonPressed(DialogField field)
- {
- if (field instanceof ClasspathResourceButtonDialogField)
- {
- ClasspathResourceButtonDialogField classPathField =
- (ClasspathResourceButtonDialogField) field;
- Shell shell = field.getShell();
- ResourceOnClasspathDialog dialog =
- new ResourceOnClasspathDialog(shell, getJavaProject());
- dialog.setTitle(JSFUICommonPlugin
- .getResourceString("DialogField.ResourceButton.SelectFile"));//$NON-NLS-1$
- dialog.setSuffixs(PROPERTIES_FILES_SUFFIXS);
- if (dialog.open() == Window.OK) {
- String oldValue = classPathField.getText();
-
- String newValue = (String) dialog.getResult()[0];
- if (oldValue != newValue) {
- classPathField.setText(newValue);
- }
- }
- }
- }
-
- private IJavaProject getJavaProject() {
- try {
- if (_project != null && _project.hasNature(JavaCore.NATURE_ID)) {
- return JavaCore.create(_project);
- }
- return null;
- } catch (CoreException e) {
- return null;
- }
- }
- }
-
- /**
-s */
- public ClasspathResourceButtonDialogField() {
- super(new MyStringButtonAdapter());
- }
-
- public void setElementContext(
- org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode ancester,
- IDOMElement element) {
- IProject prj = StructuredModelUtil.getProjectFor(ancester.getModel());
-
- IStringButtonAdapter adapter = getStringButtonAdapter();
-
- if (adapter instanceof MyStringButtonAdapter)
- {
- ((MyStringButtonAdapter)adapter)._project = prj;
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogfields/ContextableResourceButtonDialogField.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogfields/ContextableResourceButtonDialogField.java
deleted file mode 100644
index a9e50ec..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogfields/ContextableResourceButtonDialogField.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.ui.dialogfields;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.ResourceButtonDialogField;
-import org.eclipse.jst.pagedesigner.properties.attrgroup.IElementContextable;
-import org.eclipse.jst.pagedesigner.utils.StructuredModelUtil;
-import org.eclipse.jst.pagedesigner.utils.WebAppUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class ContextableResourceButtonDialogField extends
- ResourceButtonDialogField implements IElementContextable {
-
- /**
- * Default constructor
- */
- public ContextableResourceButtonDialogField() {
- super(null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.properties.attrgroup.IElementContextable#setElementContext(org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode,
- * org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement)
- */
- public void setElementContext(IDOMNode ancester, IDOMElement element) {
- if (ancester == null) {
- setProject(null);
- setReferredFile(null);
- } else {
- IDOMModel model = ancester.getModel();
- IFile file = StructuredModelUtil.getFileFor(model);
- IProject prj = (file == null ? null : file.getProject());
- setProject(prj);
- setReferredFile(file);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.jsf.common.ui.internal.dialogfield.ResourceButtonDialogField#browseButtonPressed()
- */
- protected String browseButtonPressed() {
- String url = super.browseButtonPressed();
- url = WebAppUtil.transformJSPURL(url, this.getReferredFile());
- return url;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogfields/DialogFieldWrapper.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogfields/DialogFieldWrapper.java
deleted file mode 100644
index 893f40e..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogfields/DialogFieldWrapper.java
+++ /dev/null
@@ -1,480 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.ui.dialogfields;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogField;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.IDialogFieldApplyListener;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.IDialogFieldChangeListener;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.IStringButtonAdapter;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.ISupportTextValue;
-import org.eclipse.jst.pagedesigner.editors.properties.IPropertyPageDescriptor;
-import org.eclipse.jst.pagedesigner.meta.IAttributeDescriptor;
-import org.eclipse.jst.pagedesigner.meta.IBindingHandler;
-import org.eclipse.jst.pagedesigner.properties.attrgroup.IElementContextable;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.forms.events.IHyperlinkListener;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-
-/**
- * This is a wrapper to a dialog field, by adding a small image button at the
- * end. The caller is responsible to provide the image and the button click
- * handler.
- *
- * @author mengbo
- * @version 1.5
- * @see org.eclipse.jst.pagedesigner.properties.celleditors.CellEditorWrapper
- */
-// NOTE: currently this class is dedicated to page designer by using the
-// IElementContextable interface.
-// It should be very easy to make it standard alone and reused in other places.
-@SuppressWarnings("deprecation")
-public class DialogFieldWrapper implements DialogField, ISupportTextValue,
- IElementContextable {
- private DialogField _wrapped;
-
- private IDOMNode _ancester;
-
- private IDOMElement _element;
-
- private Button _databindingButton;
-
- private boolean _databindingEnabled;
-
- private Image _image;
-
- private Image _disabledImage;
-
- private IStringButtonAdapter _adapter;
-
- private String _uri;
-
- private String _tagName;
-
- private IAttributeDescriptor _attr;
-
- private IBindingHandler _handler;
-
- private IPropertyPageDescriptor _pdattr;
-
- /**
- * @param field
- * @param image
- * @param disabledImage
- * @param uri
- * @param tagName
- * @param attr
- * @param handler
- *
- */
- public DialogFieldWrapper(DialogField field, Image image,
- Image disabledImage, String uri, String tagName,
- IAttributeDescriptor attr, IBindingHandler handler) {
- super();
- if (!(field instanceof ISupportTextValue)) {
- throw new IllegalArgumentException(
- "Field must be ISupportTextValue");
- }
- _wrapped = field;
- this._image = image;
- this._disabledImage = disabledImage;
- this._uri = uri;
- this._tagName = tagName;
- this._attr = attr;
- this._handler = handler;
-
- setDatabindingPressedHandler(new IStringButtonAdapter() {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.jsf.common.ui.internal.dialogfield.IStringButtonAdapter#changeControlPressed(org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogField)
- */
- public void changeControlPressed(DialogField field1) {
- Shell shell = field1.getLabelControl(null, null).getShell();
- DialogFieldWrapper wrapper = (DialogFieldWrapper) field1;
- String result = _handler
- .handleBinding(shell, wrapper.getAncester(), wrapper
- .getElement(), wrapper.getText());
- if (result != null) {
- wrapper.setText(result);
- }
- }
- });
- }
-
- /**
- * @param field
- * @param image
- * @param disabledImage
- * @param uri
- * @param tagName
- * @param attr
- * @param handler
- *
- */
- public DialogFieldWrapper(DialogField field, Image image,
- Image disabledImage, String uri, String tagName,
- IPropertyPageDescriptor attr, IBindingHandler handler) {
- super();
- if (!(field instanceof ISupportTextValue)) {
- throw new IllegalArgumentException(
- "Field must be ISupportTextValue");
- }
- _wrapped = field;
- this._image = image;
- this._disabledImage = disabledImage;
- this._uri = uri;
- this._tagName = tagName;
- this._pdattr = attr;
- this._handler = handler;
-
- setDatabindingPressedHandler(new IStringButtonAdapter() {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.jsf.common.ui.internal.dialogfield.IStringButtonAdapter#changeControlPressed(org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogField)
- */
- public void changeControlPressed(DialogField field1) {
- Shell shell = field1.getLabelControl(null, null).getShell();
- DialogFieldWrapper wrapper = (DialogFieldWrapper) field1;
- String result = _handler
- .handleBinding(shell, wrapper.getAncester(), wrapper
- .getElement(), wrapper.getText());
- if (result != null) {
- wrapper.setText(result);
- }
- }
- });
- }
-
- private void setDatabindingPressedHandler(IStringButtonAdapter adapter) {
- this._adapter = adapter;
- this.updateDatabindingControl();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.jsf.common.ui.internal.dialogfield.ISupportTextValue#setTextWithoutUpdate(java.lang.String)
- */
- public void setTextWithoutUpdate(String value) {
- ((ISupportTextValue) _wrapped).setTextWithoutUpdate(value);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.jsf.common.ui.internal.dialogfield.ISupportTextValue#getText()
- */
- public String getText() {
- return ((ISupportTextValue) _wrapped).getText();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.jsf.common.ui.internal.dialogfield.ISupportTextValue#setText(java.lang.String)
- */
- public void setText(String value) {
- ((ISupportTextValue) _wrapped).setText(value);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.properties.attrgroup.IElementContextable#setElementContext(org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode,
- * org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement)
- */
- public void setElementContext(IDOMNode ancester, IDOMElement element) {
- if (_wrapped instanceof IElementContextable) {
- ((IElementContextable) _wrapped).setElementContext(ancester,
- element);
- }
- this._ancester = ancester;
- this._element = element;
-
- boolean bindingEnabled = false;
-
- if (_attr != null)
- bindingEnabled = _handler.isEnabled(_ancester, _element, _uri,
- _tagName, _attr);
- else if (_pdattr != null)
- bindingEnabled = false;//_handler.isEnabled(_ancester, _element, _pdattr);
-
- this.setDatabindingEnabled(bindingEnabled);
- }
-
- // --------------------------------------------------------------------------------------------
- // wrapped method to add the data binding browse button
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogField#doFillIntoGrid(org.eclipse.ui.forms.widgets.FormToolkit,
- * org.eclipse.swt.widgets.Composite, int)
- */
- public Control[] doFillIntoGrid(FormToolkit toolkit, Composite parent,
- int nColumns) {
- Control[] wrappedControls = _wrapped.doFillIntoGrid(toolkit, parent,
- nColumns - 1);
- Control[] result = new Control[wrappedControls.length];
-
- Control button = getDatabingingButton(toolkit, parent);
- button.setLayoutData(gridDataForDatabindingButton(1));
- button.setVisible(false);
-
- System.arraycopy(wrappedControls, 0, result, 0, wrappedControls.length);
- result[result.length - 1] = _databindingButton;
- return result;
- }
-
- /**
- * @param span
- * @return
- */
- private GridData gridDataForDatabindingButton(int span) {
- GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- gd.horizontalSpan = span;
- gd.widthHint = gd.heightHint = 18;
- return gd;
- }
-
- /**
- * @param toolkit
- * @param parent
- * @return
- */
- private Control getDatabingingButton(FormToolkit toolkit, Composite parent) {
- if (_databindingButton == null || _databindingButton.isDisposed()) {
- Assert.isNotNull(parent,
- "uncreated control requested with composite null"); //$NON-NLS-1$
- if (toolkit != null) {
- _databindingButton = toolkit.createButton(parent, "", SWT.PUSH);
- _databindingButton.setImage(getImage());
- } else {
- _databindingButton = new Button(parent, SWT.PUSH);
- _databindingButton.setImage(getImage());
- }
- _databindingButton.addPaintListener(new PaintListener() {
- public void paintControl(PaintEvent e) {
- if (!_databindingButton.isEnabled()
- && getDisabledImage() != null) {
- Rectangle buttonBounds = _databindingButton.getBounds();
- Rectangle imageBounds = getDisabledImage().getBounds();
- e.gc.drawImage(getDisabledImage(),
- (buttonBounds.width - imageBounds.width) / 2,
- (buttonBounds.height - imageBounds.height) / 2);
- }
- }
- });
- _databindingButton.setEnabled(isEnabled() && _databindingEnabled);
- _databindingButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- databindingControlPressed();
- }
-
- public void widgetSelected(SelectionEvent e) {
- databindingControlPressed();
- }
- });
-
- }
- return _databindingButton;
- }
-
- /**
- * @return
- */
- private Image getImage() {
- return _image;
- }
-
- private Image getDisabledImage() {
- return _disabledImage;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogField#getLabelControl(org.eclipse.ui.forms.widgets.FormToolkit,
- * org.eclipse.swt.widgets.Composite)
- */
- public Control getLabelControl(FormToolkit _formToolkit, Composite parent) {
- return _wrapped.getLabelControl(_formToolkit, parent);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.jsf.common.ui.internal.dialogfield.IDialogField#setHyperLink(org.eclipse.ui.forms.events.IHyperlinkListener)
- */
- public void setHyperLink(IHyperlinkListener listener) {
- _wrapped.setHyperLink(listener);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.jsf.common.ui.internal.dialogfield.IDialogField#setLabelText(java.lang.String)
- */
- public void setLabelText(String labeltext) {
- _wrapped.setLabelText(labeltext);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.jsf.common.ui.internal.dialogfield.IDialogField#setDialogFieldChangeListener(org.eclipse.jst.jsf.common.ui.internal.dialogfield.IDialogFieldChangeListener)
- */
- public void setDialogFieldChangeListener(IDialogFieldChangeListener listener) {
- _wrapped.setDialogFieldChangeListener(listener);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.jsf.common.ui.internal.dialogfield.IDialogField#setDialogFieldApplyListener(org.eclipse.jst.jsf.common.ui.internal.dialogfield.IDialogFieldApplyListener)
- */
- public void setDialogFieldApplyListener(IDialogFieldApplyListener listener) {
- _wrapped.setDialogFieldApplyListener(listener);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.jsf.common.ui.internal.dialogfield.IDialogField#setFocus()
- */
- public boolean setFocus() {
- return _wrapped.setFocus();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.jsf.common.ui.internal.dialogfield.IDialogField#getNumberOfControls()
- */
- public int getNumberOfControls() {
- return _wrapped.getNumberOfControls() + 1;
- }
-
- /**
- * @param enabled
- */
- public void setDatabindingEnabled(boolean enabled) {
- this._databindingEnabled = enabled;
- updateDatabindingControl();
- }
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.jsf.common.ui.internal.dialogfield.IDialogField#setEnabled(boolean)
- */
- public void setEnabled(boolean enabled) {
- _wrapped.setEnabled(enabled);
- updateDatabindingControl();
- }
-
- /**
- *
- */
- private void updateDatabindingControl() {
- if (this._databindingButton != null && !_databindingButton.isDisposed()) {
- this._databindingButton.setEnabled(this.isEnabled()
- && _databindingEnabled && _adapter != null);
- _databindingButton.redraw();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.jsf.common.ui.internal.dialogfield.IDialogField#isEnabled()
- */
- public boolean isEnabled() {
- return _wrapped.isEnabled();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.jsf.common.ui.internal.dialogfield.IDialogField#getAttachedData(java.lang.Object)
- */
- public Object getAttachedData(Object key) {
- return _wrapped.getAttachedData(key);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.jsf.common.ui.internal.dialogfield.IDialogField#putAttachedData(java.lang.Object,
- * java.lang.Object)
- */
- public void putAttachedData(Object key, Object value) {
- _wrapped.putAttachedData(key, value);
- }
-
- private void databindingControlPressed() {
- if (_adapter != null) {
- _adapter.changeControlPressed(this);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogField#handleGrabHorizontal()
- */
- public void handleGrabHorizontal() {
- _wrapped.handleGrabHorizontal();
- }
-
- private IDOMNode getAncester() {
- return _ancester;
- }
-
- private IDOMElement getElement() {
- return _element;
- }
-
- /**
- * @return the wrapped field
- */
- public DialogField getWrappedDialogField() {
- return _wrapped;
- }
-
- public boolean isRequired() {
- return _wrapped.isRequired();
- }
-
- public void setToolTip(String toolTip) {
- _wrapped.setToolTip(toolTip);
- }
-
- public Shell getShell() {
- return _wrapped.getShell();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogfields/ExtendedResourceButtonDialogField.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogfields/ExtendedResourceButtonDialogField.java
deleted file mode 100644
index 0c458ec..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogfields/ExtendedResourceButtonDialogField.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.ui.dialogfields;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.ResourceButtonDialogField;
-import org.eclipse.jst.pagedesigner.utils.WebAppUtil;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class ExtendedResourceButtonDialogField extends
- ResourceButtonDialogField {
- /**
- * @param project
- */
- public ExtendedResourceButtonDialogField(IProject project) {
- super(project);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.jsf.common.ui.internal.dialogfield.ResourceButtonDialogField#browseButtonPressed()
- */
- protected String browseButtonPressed() {
- String url = super.browseButtonPressed();
- url = WebAppUtil.transformJSPURL(url, this.getReferredFile());
- return url;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogfields/StyleButtonDialogField.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogfields/StyleButtonDialogField.java
deleted file mode 100644
index 0e05a53..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogfields/StyleButtonDialogField.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.ui.dialogfields;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.preference.PreferenceManager;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogField;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.IStringButtonAdapter;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.StringButtonDialogField;
-import org.eclipse.jst.jsf.core.internal.tld.IJSFConstants;
-import org.eclipse.jst.pagedesigner.commands.single.ChangeStyleCommand;
-import org.eclipse.jst.pagedesigner.properties.attrgroup.IElementContextable;
-import org.eclipse.jst.pagedesigner.ui.dialogs.DialogsMessages;
-import org.eclipse.jst.pagedesigner.ui.dialogs.StyleDialog;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclaration;
-import org.eclipse.wst.css.core.internal.util.declaration.CSSPropertyContext;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.css.ElementCSSInlineStyle;
-
-/**
- * @author mengbo
- */
-public class StyleButtonDialogField extends StringButtonDialogField implements
- IElementContextable {
- private IDOMElement _element;
-
- /**
- * Equivalent to StyleButtonDialogField(null)
- */
- public StyleButtonDialogField() {
- this(null);
- }
-
- /**
- * @param element
- */
- public StyleButtonDialogField(IDOMElement element) {
- this(null, element);
- setStringButtonAdapter(new IStringButtonAdapter() {
- public void changeControlPressed(DialogField field) {
- browseButtonPressed();
- }
- });
- setButtonLabel(DialogsMessages.getString("StyleButtonDialogField.Edit"));//$NON-NLS-1$
- }
-
- /**
- * @param adapter
- * @param element
- */
- public StyleButtonDialogField(IStringButtonAdapter adapter,
- IDOMElement element) {
- super(adapter);
- _element = element;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.properties.attrgroup.IElementContextable#setElementContext(org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode,
- * org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement)
- */
- public void setElementContext(IDOMNode ancester, IDOMElement element) {
- this._element = element;
- }
-
- private void browseButtonPressed() {
- if (_element instanceof ElementCSSInlineStyle) {
- ICSSStyleDeclaration styleDeclaration = (ICSSStyleDeclaration) ((ElementCSSInlineStyle) _element)
- .getStyle();
-
- PreferenceManager manager = new PreferenceManager();
- Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
- .getShell();
-
- CSSPropertyContext context = new CSSPropertyContext(
- styleDeclaration);
- StyleDialog dialog = new StyleDialog(shell, manager, _element,
- context);
- if (dialog.open() == Dialog.OK) {
- if (!context.isModified()) {
- return;
- }
- ChangeStyleCommand c = new ChangeStyleCommand(_element, context);
- c.execute();
-
- String style = (_element == null ? null : _element
- .getAttribute(IJSFConstants.ATTR_STYLE));
- setText(style);
- }
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/BackgroudPreferenceNode.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/BackgroudPreferenceNode.java
deleted file mode 100644
index f1fe115..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/BackgroudPreferenceNode.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.ui.dialogs;
-
-import org.eclipse.jface.preference.IPreferenceNode;
-import org.eclipse.jface.preference.IPreferencePage;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.css.core.internal.util.declaration.CSSPropertyContext;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class BackgroudPreferenceNode implements IPreferenceNode {
- private BackgroundPreferencePage _page;
-
- private IDOMElement _element;
-
- private CSSPropertyContext _style;
-
- /**
- * @param element
- * @param style
- */
- public BackgroudPreferenceNode(IDOMElement element, CSSPropertyContext style) {
- super();
- _element = element;
- _style = style;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#add(org.eclipse.jface.preference.IPreferenceNode)
- */
- public void add(IPreferenceNode node) {
- // TODO: do nothing?
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#createPage()
- */
- public void createPage() {
- _page = new BackgroundPreferencePage(_element, _style);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#disposeResources()
- */
- public void disposeResources() {
- //TODO: do nothing?
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#findSubNode(java.lang.String)
- */
- public IPreferenceNode findSubNode(String id) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getId()
- */
- public String getId() {
- return "Background";
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getLabelImage()
- */
- public Image getLabelImage() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getLabelText()
- */
- public String getLabelText() {
- return DialogsMessages.getString("BackgroundPreferenceNode.LabelText");
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getPage()
- */
- public IPreferencePage getPage() {
- return _page;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getSubNodes()
- */
- public IPreferenceNode[] getSubNodes() {
- return new IPreferenceNode[0];
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#remove(java.lang.String)
- */
- public IPreferenceNode remove(String id) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#remove(org.eclipse.jface.preference.IPreferenceNode)
- */
- public boolean remove(IPreferenceNode node) {
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/BackgroundPreferencePage.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/BackgroundPreferencePage.java
deleted file mode 100644
index 83ca8c4..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/BackgroundPreferencePage.java
+++ /dev/null
@@ -1,320 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.ui.dialogs;
-
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.ColorButtonDialogField;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogField;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.IDialogFieldApplyListener;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.wst.css.core.internal.util.declaration.CSSPropertyContext;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class BackgroundPreferencePage extends PreferencePage {
- private CSSPropertyContext _style;
-
- private StyleCombo _backgroundImageCombo, _backgroundRepeatCombo,
- _backgroundAttachmentCombo, _horizontalNumberCombo,
- _horizontalUnitCombo, _verticalNumberCombo, _verticalUnitCombo;
-
- private ColorButtonDialogField _backgroundColorField;
-
- /**
- * @param element
- * @param style
- */
- public BackgroundPreferencePage(IDOMElement element,
- CSSPropertyContext style) {
- super();
- _style = style;
-
- setTitle(DialogsMessages.getString("BackgroundPreferencePage.Title")); //$NON-NLS-1$
- }
-
- /**
- * @see org.eclipse.jface.preference.
- * PreferencePage#createContents(Composite)
- */
- protected Control createContents(Composite parent) {
- GridLayout layout;
- GridData data;
-
- Composite top = new Composite(parent, SWT.NONE);
- layout = new GridLayout(3, false);
- data = new GridData(GridData.FILL_BOTH);
- top.setLayout(layout);
- top.setLayoutData(data);
-
- _backgroundColorField = new ColorButtonDialogField(SWT.BORDER, new ColorUtil());
- _backgroundColorField.setLabelText(DialogsMessages
- .getString("BackgroundBoxPreferencePage.BackgroundColor"));
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- _backgroundColorField.getLabelControl(null, top).setLayoutData(data);
-
- data = new GridData(GridData.FILL_HORIZONTAL);
- _backgroundColorField.getComboControl(null, top).setLayoutData(data);
-
- data = new GridData();
- _backgroundColorField.getChangeControl(null, top).setLayoutData(data);
- _backgroundColorField
- .setDialogFieldApplyListener(new IDialogFieldApplyListener() {
- public void dialogFieldApplied(DialogField field) {
- String color = _backgroundColorField.getText();
-
- _style.setBackgroundColor(color);
- }
- });
-
- Label backgroundImageLabel = new Label(top, SWT.NONE);
- backgroundImageLabel.setText(DialogsMessages
- .getString("BackgroundBoxPreferencePage.BackgroundImage")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- backgroundImageLabel.setLayoutData(data);
-
- _backgroundImageCombo = new StyleCombo(top, SWT.NONE);
- _backgroundImageCombo.setItems(IStyleConstants.NONE);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _backgroundImageCombo.setLayoutData(data);
- _backgroundImageCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String image = _backgroundImageCombo.getText();
-
- _style.setBackgroundImage(image);
- }
- });
-
- new Label(top, SWT.NONE);
-
- Label backgroundRepeatLabel = new Label(top, SWT.NONE);
- backgroundRepeatLabel
- .setText(DialogsMessages
- .getString("BackgroundBoxPreferencePage.BackgroundRepeatLabel")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- backgroundRepeatLabel.setLayoutData(data);
-
- _backgroundRepeatCombo = new StyleCombo(top, SWT.NONE);
- _backgroundRepeatCombo.setItems(IStyleConstants.REPEAT);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _backgroundRepeatCombo.setLayoutData(data);
- _backgroundRepeatCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String repeat = _backgroundRepeatCombo.getText();
-
- _style.setBackgroundRepeat(repeat);
- }
- });
-
- new Label(top, SWT.NONE);
-
- Label backgroundAttachmentLabel = new Label(top, SWT.NONE);
- backgroundAttachmentLabel
- .setText(DialogsMessages
- .getString("BackgroundBoxPreferencePage.BackgroundAttachmentLabel")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- backgroundAttachmentLabel.setLayoutData(data);
-
- _backgroundAttachmentCombo = new StyleCombo(top, SWT.NONE);
- _backgroundAttachmentCombo.setItems(IStyleConstants.ATTACHMENT);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _backgroundAttachmentCombo.setLayoutData(data);
- _backgroundAttachmentCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String attachment = _backgroundAttachmentCombo.getText();
-
- _style.setBackgroundAttachment(attachment);
- }
- });
-
- new Label(top, SWT.NONE);
-
- Label backgroundHorizontalLabel = new Label(top, SWT.NONE);
- backgroundHorizontalLabel.setText(DialogsMessages
- .getString("BackgroundBoxPreferencePage.HorizontalLabel")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- backgroundHorizontalLabel.setLayoutData(data);
-
- _horizontalNumberCombo = new StyleCombo(top, SWT.NONE);
- _horizontalNumberCombo.setItems(IStyleConstants.POSITION);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _horizontalNumberCombo.setLayoutData(data);
- _horizontalNumberCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- _horizontalUnitCombo.setEnabled(true);
- try {
- Integer.valueOf(_horizontalNumberCombo.getText());
- } catch (NumberFormatException ex) {
- _horizontalUnitCombo.setEnabled(false);
- }
-
- String position = _horizontalNumberCombo.getText();
- if (_horizontalUnitCombo.isEnabled()) {
- position += _horizontalUnitCombo.getText();
- }
-
- _style.setBackgroundPositionX(position);
- }
- });
-
- _horizontalUnitCombo = new StyleCombo(top, SWT.READ_ONLY);
- _horizontalUnitCombo.setItems(IStyleConstants.SIZE_UNIT);
- data = new GridData(GridData.FILL);
- _horizontalUnitCombo.setLayoutData(data);
- _horizontalUnitCombo.select(0);
- _horizontalUnitCombo.setEnabled(false);
- _horizontalUnitCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String position = _horizontalNumberCombo.getText();
- if (_horizontalUnitCombo.isEnabled()) {
- position += _horizontalUnitCombo.getText();
- }
-
- _style.setBackgroundPositionX(position);
-
- }
- });
-
- Label backgroundVerticalLabel = new Label(top, SWT.NONE);
- backgroundVerticalLabel.setText(DialogsMessages
- .getString("BackgroundBoxPreferencePage.VerticalLabel")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- backgroundVerticalLabel.setLayoutData(data);
-
- _verticalNumberCombo = new StyleCombo(top, SWT.NONE);
- _verticalNumberCombo.setItems(IStyleConstants.POSITION);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _verticalNumberCombo.setLayoutData(data);
- _verticalNumberCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- _verticalUnitCombo.setEnabled(true);
- try {
- Integer.valueOf(_verticalNumberCombo.getText());
- } catch (NumberFormatException ex) {
- _verticalUnitCombo.setEnabled(false);
- }
-
- String position = _verticalNumberCombo.getText();
- if (_verticalUnitCombo.isEnabled()) {
- position += _verticalUnitCombo.getText();
- }
-
- _style.setBackgroundPositionY(position);
- }
- });
-
- _verticalUnitCombo = new StyleCombo(top, SWT.READ_ONLY);
- _verticalUnitCombo.setItems(IStyleConstants.SIZE_UNIT);
- data = new GridData(GridData.FILL);
- _verticalUnitCombo.setLayoutData(data);
- _verticalUnitCombo.select(0);
- _verticalUnitCombo.setEnabled(false);
- _verticalUnitCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String position = _verticalNumberCombo.getText();
- if (_verticalUnitCombo.isEnabled()) {
- position += _verticalUnitCombo.getText();
- }
-
- _style.setBackgroundPositionY(position);
- }
- });
-
- initializeControls();
-
- return top;
- }
-
- private void initializeControls() {
- // background-color
- String color = _style.getBackgroundColor();
- if (!isEmptyString(color)) {
- _backgroundColorField.setTextWithoutUpdate(color);
- }
-
- // background-image
- String image = _style.getBackgroundImage();
- if (!isEmptyString(image)) {
- int index = _backgroundImageCombo.indexOf(image);
- if (index != -1) {
- _backgroundImageCombo.select(index);
- } else {
- _backgroundImageCombo.setText(image);
- }
- }
-
- // background-repeat
- String repeat = _style.getBackgroundRepeat();
- if (!isEmptyString(repeat)) {
- int index = _backgroundRepeatCombo.indexOf(repeat);
- if (index != -1) {
- _backgroundRepeatCombo.select(index);
- } else {
- _backgroundRepeatCombo.setText(repeat);
- }
- }
-
- // background-attachment
- String attachment = _style.getBackgroundAttachment();
- if (!isEmptyString(attachment)) {
- int index = _backgroundAttachmentCombo.indexOf(repeat);
- if (index != -1) {
- _backgroundAttachmentCombo.select(index);
- } else {
- _backgroundAttachmentCombo.setText(attachment);
- }
- }
-
- // background-position
- String position = _style.getBackgroundPositionX();
- if (!isEmptyString(position)) {
- int index = _horizontalNumberCombo.indexOf(position);
- if (index != -1) {
- _horizontalNumberCombo.select(index);
- } else {
- _horizontalNumberCombo.setText(position);
- }
- }
- position = _style.getBackgroundPositionY();
- if (!isEmptyString(position)) {
- int index = _verticalNumberCombo.indexOf(position);
- if (index != -1) {
- _verticalNumberCombo.select(index);
- } else {
- _verticalNumberCombo.setText(position);
- }
- }
- }
-
- public void setVisible(boolean visible) {
- super.setVisible(visible);
-
- getApplyButton().setVisible(false);
- getDefaultsButton().setVisible(false);
- }
-
- private boolean isEmptyString(String str) {
- if (str == null || str.length() == 0) {
- return true;
- }
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/BlockPreferenceNode.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/BlockPreferenceNode.java
deleted file mode 100644
index 064cefc..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/BlockPreferenceNode.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.ui.dialogs;
-
-import org.eclipse.jface.preference.IPreferenceNode;
-import org.eclipse.jface.preference.IPreferencePage;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.css.core.internal.util.declaration.CSSPropertyContext;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class BlockPreferenceNode implements IPreferenceNode {
- private BlockPreferencePage _page;
-
- private IDOMElement _element;
-
- private CSSPropertyContext _style;
-
- /**
- * @param element
- * @param style
- */
- public BlockPreferenceNode(IDOMElement element, CSSPropertyContext style) {
- super();
- _element = element;
- _style = style;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#add(org.eclipse.jface.preference.IPreferenceNode)
- */
- public void add(IPreferenceNode node) {
- // TODO: do nothing?
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#createPage()
- */
- public void createPage() {
- _page = new BlockPreferencePage(_element, _style);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#disposeResources()
- */
- public void disposeResources() {
- // TODO: do nothing?
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#findSubNode(java.lang.String)
- */
- public IPreferenceNode findSubNode(String id) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getId()
- */
- public String getId() {
- return "Block";
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getLabelImage()
- */
- public Image getLabelImage() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getLabelText()
- */
- public String getLabelText() {
- return DialogsMessages.getString("BlockPreferenceNode.LabelText");
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getPage()
- */
- public IPreferencePage getPage() {
- return _page;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getSubNodes()
- */
- public IPreferenceNode[] getSubNodes() {
- return new IPreferenceNode[0];
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#remove(java.lang.String)
- */
- public IPreferenceNode remove(String id) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#remove(org.eclipse.jface.preference.IPreferenceNode)
- */
- public boolean remove(IPreferenceNode node) {
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/BlockPreferencePage.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/BlockPreferencePage.java
deleted file mode 100644
index 786e738..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/BlockPreferencePage.java
+++ /dev/null
@@ -1,398 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.ui.dialogs;
-
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.css.core.internal.util.declaration.CSSPropertyContext;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class BlockPreferencePage extends PreferencePage {
- private CSSPropertyContext _style;
-
- private StyleCombo _wordSpacingNumberCombo, _wordSpacingUnitCombo,
- _letterSpacingNumberCombo, _letterSpacingUnitCombo,
- _verticalAlignNumberCombo, _verticalAlignUnitCombo,
- _textAlignCombo, _textIndentUnitCombo, _whiteSpaceCombo,
- _displayCombo;
-
- private Text _textIndentText;
-
- /**
- * @param element
- * @param style
- */
- public BlockPreferencePage(IDOMElement element, CSSPropertyContext style) {
- super();
- _style = style;
-
- setTitle(DialogsMessages.getString("BlockPreferencePage.Title")); //$NON-NLS-1$
- }
-
- /**
- * @see org.eclipse.jface.preference.
- * PreferencePage#createContents(Composite)
- */
- protected Control createContents(Composite parent) {
- GridLayout layout;
- GridData data;
-
- Composite top = new Composite(parent, SWT.NONE);
- layout = new GridLayout(3, false);
- data = new GridData(GridData.FILL_BOTH);
- top.setLayout(layout);
- top.setLayoutData(data);
-
- Label wordSpacingLabel = new Label(top, SWT.NONE);
- wordSpacingLabel.setText(DialogsMessages
- .getString("BlockPreferencePage.WordSpacing")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- wordSpacingLabel.setLayoutData(data);
-
- _wordSpacingNumberCombo = new StyleCombo(top, SWT.NONE);
- _wordSpacingNumberCombo.setItems(IStyleConstants.NORMAL);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _wordSpacingNumberCombo.setLayoutData(data);
- _wordSpacingNumberCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- _wordSpacingUnitCombo.setEnabled(true);
- try {
- Integer.valueOf(_wordSpacingNumberCombo.getText());
- } catch (NumberFormatException ex) {
- _wordSpacingUnitCombo.setEnabled(false);
- }
-
- String spacing = _wordSpacingNumberCombo.getText();
- if (_wordSpacingUnitCombo.isEnabled()) {
- spacing += _wordSpacingUnitCombo.getText();
- }
-
- _style.setWordSpacing(spacing);
- }
- });
-
- _wordSpacingUnitCombo = new StyleCombo(top, SWT.READ_ONLY);
- _wordSpacingUnitCombo.setItems(IStyleConstants.SIZE_UNIT);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _wordSpacingUnitCombo.setLayoutData(data);
- _wordSpacingUnitCombo.select(0);
- _wordSpacingUnitCombo.setEnabled(false);
- _wordSpacingUnitCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String spacing = _wordSpacingNumberCombo.getText();
- if (_wordSpacingUnitCombo.isEnabled()) {
- spacing += _wordSpacingUnitCombo.getText();
- }
-
- _style.setWordSpacing(spacing);
-
- }
- });
-
- Label letterSpacingLabel = new Label(top, SWT.NONE);
- letterSpacingLabel.setText(DialogsMessages
- .getString("BlockPreferencePage.LetterSpacing")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- letterSpacingLabel.setLayoutData(data);
-
- _letterSpacingNumberCombo = new StyleCombo(top, SWT.NONE);
- _letterSpacingNumberCombo.setItems(IStyleConstants.NORMAL);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _letterSpacingNumberCombo.setLayoutData(data);
- _letterSpacingNumberCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- _letterSpacingUnitCombo.setEnabled(true);
- try {
- Integer.valueOf(_letterSpacingNumberCombo.getText());
- } catch (NumberFormatException ex) {
- _letterSpacingUnitCombo.setEnabled(false);
- }
-
- String spacing = _letterSpacingNumberCombo.getText();
- if (_letterSpacingUnitCombo.isEnabled()) {
- spacing += _letterSpacingUnitCombo.getText();
- }
-
- _style.setLetterSpacing(spacing);
- }
- });
-
- _letterSpacingUnitCombo = new StyleCombo(top, SWT.READ_ONLY);
- _letterSpacingUnitCombo.setItems(IStyleConstants.SIZE_UNIT);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _letterSpacingUnitCombo.setLayoutData(data);
- _letterSpacingUnitCombo.select(0);
- _letterSpacingUnitCombo.setEnabled(false);
- _letterSpacingUnitCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String spacing = _letterSpacingNumberCombo.getText();
- if (_letterSpacingUnitCombo.isEnabled()) {
- spacing += _letterSpacingUnitCombo.getText();
- }
-
- _style.setLetterSpacing(spacing);
- }
- });
-
- Label verticalAlignLabel = new Label(top, SWT.NONE);
- verticalAlignLabel.setText(DialogsMessages
- .getString("BlockPreferencePage.VerticalAlign")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- verticalAlignLabel.setLayoutData(data);
-
- _verticalAlignNumberCombo = new StyleCombo(top, SWT.NONE);
- _verticalAlignNumberCombo.setItems(IStyleConstants.VERTICAL_ALIGN);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _verticalAlignNumberCombo.setLayoutData(data);
- _verticalAlignNumberCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- _verticalAlignUnitCombo.setEnabled(true);
- try {
- Integer.valueOf(_verticalAlignNumberCombo.getText());
- } catch (NumberFormatException ex) {
- _verticalAlignUnitCombo.setEnabled(false);
- }
-
- String align = _verticalAlignNumberCombo.getText();
- if (_verticalAlignUnitCombo.isEnabled()) {
- align += _verticalAlignUnitCombo.getText();
- }
-
- _style.setVerticalAlign(align);
- }
- });
-
- _verticalAlignUnitCombo = new StyleCombo(top, SWT.READ_ONLY);
- _verticalAlignUnitCombo.setItems(IStyleConstants.PERCENT);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _verticalAlignUnitCombo.setLayoutData(data);
- _verticalAlignUnitCombo.select(0);
- _verticalAlignUnitCombo.setEnabled(false);
- _verticalAlignUnitCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String align = _verticalAlignNumberCombo.getText();
- if (_verticalAlignUnitCombo.isEnabled()) {
- align += _verticalAlignUnitCombo.getText();
- }
-
- _style.setVerticalAlign(align);
- }
- });
-
- Label textAlignLabel = new Label(top, SWT.NONE);
- textAlignLabel.setText(DialogsMessages
- .getString("BlockPreferencePage.TextAlign")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- textAlignLabel.setLayoutData(data);
-
- _textAlignCombo = new StyleCombo(top, SWT.NONE);
- _textAlignCombo.setItems(IStyleConstants.TEXT_ALIGN);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _textAlignCombo.setLayoutData(data);
- _textAlignCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String align = _textAlignCombo.getText();
-
- _style.setTextAlign(align);
- }
- });
-
- new Label(top, SWT.NONE);
-
- Label textIndentLabel = new Label(top, SWT.NONE);
- textIndentLabel.setText(DialogsMessages
- .getString("BlockPreferencePage.TextIndent")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- textIndentLabel.setLayoutData(data);
-
- _textIndentText = new Text(top, SWT.BORDER);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _textIndentText.setLayoutData(data);
- _textIndentText.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- _textIndentUnitCombo.setEnabled(true);
- try {
- Integer.valueOf(_textIndentText.getText());
- } catch (NumberFormatException ex) {
- _textIndentUnitCombo.setEnabled(false);
- }
-
- String indent = _textIndentText.getText();
- if (_textIndentUnitCombo.isEnabled()) {
- indent += _textIndentUnitCombo.getText();
- }
-
- _style.setTextIndent(indent);
- }
- });
-
- _textIndentUnitCombo = new StyleCombo(top, SWT.READ_ONLY);
- _textIndentUnitCombo.setItems(IStyleConstants.SIZE_UNIT);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _textIndentUnitCombo.setLayoutData(data);
- _textIndentUnitCombo.select(0);
- _textIndentUnitCombo.setEnabled(false);
- _textIndentUnitCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String indent = _textIndentText.getText();
- if (_textIndentUnitCombo.isEnabled()) {
- indent += _textIndentUnitCombo.getText();
- }
-
- _style.setTextIndent(indent);
- }
- });
-
- Label whiteSpaceLabel = new Label(top, SWT.NONE);
- whiteSpaceLabel.setText(DialogsMessages
- .getString("BlockPreferencePage.WhiteSpace")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- whiteSpaceLabel.setLayoutData(data);
-
- _whiteSpaceCombo = new StyleCombo(top, SWT.NONE);
- _whiteSpaceCombo.setItems(IStyleConstants.WHITE_SPACE);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _whiteSpaceCombo.setLayoutData(data);
- _whiteSpaceCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String space = _whiteSpaceCombo.getText();
-
- _style.setWhiteSpace(space);
- }
- });
-
- new Label(top, SWT.NONE);
-
- Label displayLabel = new Label(top, SWT.NONE);
- displayLabel.setText(DialogsMessages
- .getString("BlockPreferencePage.Display")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- displayLabel.setLayoutData(data);
-
- _displayCombo = new StyleCombo(top, SWT.NONE);
- _displayCombo.setItems(IStyleConstants.DISPLAY);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _displayCombo.setLayoutData(data);
- _displayCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String display = _displayCombo.getText();
-
- _style.setDisplay(display);
- }
- });
-
- initializeControls();
-
- return top;
- }
-
- private void initializeControls() {
- // word-spacing
- String spacing = _style.getWordSpacing();
- if (!isEmptyString(spacing)) {
- int index = _wordSpacingNumberCombo.indexOf(spacing);
- if (index != -1) {
- _wordSpacingNumberCombo.select(index);
- } else {
- _wordSpacingNumberCombo.setText(spacing);
- }
- }
-
- // letter-spacing
- spacing = _style.getLetterSpacing();
- if (!isEmptyString(spacing)) {
- int index = _letterSpacingNumberCombo.indexOf(spacing);
- if (index != -1) {
- _letterSpacingNumberCombo.select(index);
- } else {
- _letterSpacingNumberCombo.setText(spacing);
- }
- }
-
- // veritcal-align
- String align = _style.getVerticalAlign();
- if (!isEmptyString(align)) {
- int index = _verticalAlignNumberCombo.indexOf(align);
- if (index != -1) {
- _verticalAlignNumberCombo.select(index);
- } else {
- _verticalAlignNumberCombo.setText(align);
- }
- }
-
- // text-align
- align = _style.getTextAlign();
- if (!isEmptyString(align)) {
- int index = _textAlignCombo.indexOf(align);
- if (index != -1) {
- _textAlignCombo.select(index);
- } else {
- _textAlignCombo.setText(align);
- }
- }
-
- // text-indent
- String indent = _style.getTextIndent();
- if (!isEmptyString(indent)) {
- _textIndentText.setText(indent);
- }
-
- // white-space
- String space = _style.getWhiteSpace();
- if (!isEmptyString(space)) {
- int index = _whiteSpaceCombo.indexOf(space);
- if (index != -1) {
- _whiteSpaceCombo.select(index);
- } else {
- _whiteSpaceCombo.setText(space);
- }
- }
-
- // display
- String display = _style.getDisplay();
- if (!isEmptyString(display)) {
- int index = _displayCombo.indexOf(display);
- if (index != -1) {
- _displayCombo.select(index);
- } else {
- _displayCombo.setText(display);
- }
- }
- }
-
- public void setVisible(boolean visible) {
- super.setVisible(visible);
-
- getApplyButton().setVisible(false);
- getDefaultsButton().setVisible(false);
- }
-
- // TODO: seeing this method repeated in on other preference pages..
- private boolean isEmptyString(String str) {
- if (str == null || str.length() == 0) {
- return true;
- }
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/BorderPreferenceNode.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/BorderPreferenceNode.java
deleted file mode 100644
index 63e775f..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/BorderPreferenceNode.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.ui.dialogs;
-
-import org.eclipse.jface.preference.IPreferenceNode;
-import org.eclipse.jface.preference.IPreferencePage;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.css.core.internal.util.declaration.CSSPropertyContext;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class BorderPreferenceNode implements IPreferenceNode {
- private BorderPreferencePage _page;
-
- private IDOMElement _element;
-
- private CSSPropertyContext _style;
-
- /**
- * @param element
- * @param style
- */
- public BorderPreferenceNode(IDOMElement element, CSSPropertyContext style) {
- super();
- _element = element;
- _style = style;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#add(org.eclipse.jface.preference.IPreferenceNode)
- */
- public void add(IPreferenceNode node) {
- // TODO: do nothing?
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#createPage()
- */
- public void createPage() {
- _page = new BorderPreferencePage(_element, _style);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#disposeResources()
- */
- public void disposeResources() {
- // TODO: do nothing?
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#findSubNode(java.lang.String)
- */
- public IPreferenceNode findSubNode(String id) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getId()
- */
- public String getId() {
- return "Border";
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getLabelImage()
- */
- public Image getLabelImage() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getLabelText()
- */
- public String getLabelText() {
- return DialogsMessages.getString("BorderPreferenceNode.LabelText");
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getPage()
- */
- public IPreferencePage getPage() {
- return _page;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getSubNodes()
- */
- public IPreferenceNode[] getSubNodes() {
- return new IPreferenceNode[0];
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#remove(java.lang.String)
- */
- public IPreferenceNode remove(String id) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#remove(org.eclipse.jface.preference.IPreferenceNode)
- */
- public boolean remove(IPreferenceNode node) {
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/BorderPreferencePage.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/BorderPreferencePage.java
deleted file mode 100644
index 78e99f5..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/BorderPreferencePage.java
+++ /dev/null
@@ -1,538 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.ui.dialogs;
-
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.ColorButtonDialogField;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogField;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.IDialogFieldApplyListener;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.wst.css.core.internal.util.declaration.CSSPropertyContext;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class BorderPreferencePage extends PreferencePage {
- private CSSPropertyContext _style;
-
- private StyleCombo _styleTopCombo, _styleRightCombo, _styleBottomCombo,
- _styleLeftCombo;
-
- private StyleCombo _widthTopNumberCombo, _widthRightNumberCombo,
- _widthBottomNumberCombo, _widthLeftNumberCombo;
-
- private StyleCombo _widthTopUnitCombo, _widthRightUnitCombo,
- _widthBottomUnitCombo, _widthLeftUnitCombo;
-
- private ColorButtonDialogField _colorTopField, _colorRightField,
- _colorBottomField, _colorLeftField;
-
- /**
- * @param element
- * @param style
- */
- public BorderPreferencePage(IDOMElement element, CSSPropertyContext style) {
- super();
- _style = style;
-
- setTitle(DialogsMessages.getString("BorderPreferencePage.Title")); //$NON-NLS-1$
- }
-
- /**
- * @see org.eclipse.jface.preference.
- * PreferencePage#createContents(Composite)
- */
- protected Control createContents(Composite parent) {
- GridLayout layout;
- GridData data;
-
- Composite top = new Composite(parent, SWT.NONE);
- layout = new GridLayout(1, false);
- data = new GridData(GridData.FILL_BOTH);
- top.setLayout(layout);
- top.setLayoutData(data);
-
- Group styleGroup = new Group(top, SWT.NONE);
- styleGroup.setText(DialogsMessages
- .getString("BorderPreferencePage.Style"));
- data = new GridData(GridData.FILL_HORIZONTAL);
- styleGroup.setLayoutData(data);
- layout = new GridLayout(2, false);
- styleGroup.setLayout(layout);
-
- Label styleTopLabel = new Label(styleGroup, SWT.NONE);
- styleTopLabel.setText(DialogsMessages
- .getString("BorderPreferencePage.Top"));
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- styleTopLabel.setLayoutData(data);
-
- _styleTopCombo = new StyleCombo(styleGroup, SWT.NONE);
- _styleTopCombo.setItems(IStyleConstants.BORDER_STYLE);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _styleTopCombo.setLayoutData(data);
- _styleTopCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String style = _styleTopCombo.getText();
- _style.setBorderTopStyle(style);
- }
- });
-
- Label styleRightLabel = new Label(styleGroup, SWT.NONE);
- styleRightLabel.setText(DialogsMessages
- .getString("BorderPreferencePage.Right"));
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- styleRightLabel.setLayoutData(data);
-
- _styleRightCombo = new StyleCombo(styleGroup, SWT.NONE);
- _styleRightCombo.setItems(IStyleConstants.BORDER_STYLE);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _styleRightCombo.setLayoutData(data);
- _styleRightCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String style = _styleRightCombo.getText();
- _style.setBorderRightStyle(style);
- }
- });
-
- Label styleBottomLabel = new Label(styleGroup, SWT.NONE);
- styleBottomLabel.setText(DialogsMessages
- .getString("BorderPreferencePage.Bottom"));
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- styleBottomLabel.setLayoutData(data);
-
- _styleBottomCombo = new StyleCombo(styleGroup, SWT.NONE);
- _styleBottomCombo.setItems(IStyleConstants.BORDER_STYLE);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _styleBottomCombo.setLayoutData(data);
- _styleBottomCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String style = _styleBottomCombo.getText();
- _style.setBorderBottomStyle(style);
- }
- });
-
- Label styleLeftLabel = new Label(styleGroup, SWT.NONE);
- styleLeftLabel.setText(DialogsMessages
- .getString("BorderPreferencePage.Left"));
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- styleLeftLabel.setLayoutData(data);
-
- _styleLeftCombo = new StyleCombo(styleGroup, SWT.NONE);
- _styleLeftCombo.setItems(IStyleConstants.BORDER_STYLE);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _styleLeftCombo.setLayoutData(data);
- _styleLeftCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String style = _styleLeftCombo.getText();
- _style.setBorderLeftStyle(style);
- }
- });
-
- Group colorGroup = new Group(top, SWT.NONE);
- colorGroup.setText(DialogsMessages
- .getString("BorderPreferencePage.Color"));
- data = new GridData(GridData.FILL_HORIZONTAL);
- colorGroup.setLayoutData(data);
- layout = new GridLayout(3, false);
- colorGroup.setLayout(layout);
-
- _colorTopField = new ColorButtonDialogField(SWT.BORDER, new ColorUtil());
- _colorTopField.setLabelText(DialogsMessages
- .getString("BorderPreferencePage.Top"));
-
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- _colorTopField.getLabelControl(null, colorGroup).setLayoutData(data);
-
- data = new GridData(GridData.FILL_HORIZONTAL);
- _colorTopField.getComboControl(null, colorGroup).setLayoutData(data);
-
- data = new GridData();
- _colorTopField.getChangeControl(null, colorGroup).setLayoutData(data);
- _colorTopField
- .setDialogFieldApplyListener(new IDialogFieldApplyListener() {
- public void dialogFieldApplied(DialogField field) {
- String color = _colorTopField.getText();
- _style.setBorderTopColor(color);
- }
- });
-
- _colorRightField = new ColorButtonDialogField(SWT.BORDER, new ColorUtil());
- _colorRightField.setLabelText(DialogsMessages
- .getString("BorderPreferencePage.Right"));
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- _colorRightField.getLabelControl(null, colorGroup).setLayoutData(data);
-
- data = new GridData(GridData.FILL_HORIZONTAL);
- _colorRightField.getComboControl(null, colorGroup).setLayoutData(data);
-
- data = new GridData();
- _colorRightField.getChangeControl(null, colorGroup).setLayoutData(data);
- _colorRightField
- .setDialogFieldApplyListener(new IDialogFieldApplyListener() {
- public void dialogFieldApplied(DialogField field) {
- String color = _colorRightField.getText();
- _style.setBorderRightColor(color);
- }
- });
-
- _colorBottomField = new ColorButtonDialogField(SWT.BORDER, new ColorUtil());
- _colorBottomField.setLabelText(DialogsMessages
- .getString("BorderPreferencePage.Bottom"));
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- _colorBottomField.getLabelControl(null, colorGroup).setLayoutData(data);
-
- data = new GridData(GridData.FILL_HORIZONTAL);
- _colorBottomField.getComboControl(null, colorGroup).setLayoutData(data);
-
- data = new GridData();
- _colorBottomField.getChangeControl(null, colorGroup)
- .setLayoutData(data);
- _colorBottomField
- .setDialogFieldApplyListener(new IDialogFieldApplyListener() {
- public void dialogFieldApplied(DialogField field) {
- String color = _colorBottomField.getText();
- _style.setBorderBottomColor(color);
- }
- });
-
- _colorLeftField = new ColorButtonDialogField(SWT.BORDER, new ColorUtil());
- _colorLeftField.setLabelText(DialogsMessages
- .getString("BorderPreferencePage.Left"));
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- _colorLeftField.getLabelControl(null, colorGroup).setLayoutData(data);
-
- data = new GridData(GridData.FILL_HORIZONTAL);
- _colorLeftField.getComboControl(null, colorGroup).setLayoutData(data);
-
- data = new GridData();
- _colorLeftField.getChangeControl(null, colorGroup).setLayoutData(data);
- _colorLeftField
- .setDialogFieldApplyListener(new IDialogFieldApplyListener() {
- public void dialogFieldApplied(DialogField field) {
- String color = _colorLeftField.getText();
- _style.setBorderLeftColor(color);
- }
- });
-
- Group widthGroup = new Group(top, SWT.NONE);
- widthGroup.setText(DialogsMessages
- .getString("BorderPreferencePage.Width"));
- data = new GridData(GridData.FILL_HORIZONTAL);
- widthGroup.setLayoutData(data);
- layout = new GridLayout(3, false);
- widthGroup.setLayout(layout);
-
- Label widthTopLabel = new Label(widthGroup, SWT.NONE);
- widthTopLabel.setText(DialogsMessages
- .getString("BorderPreferencePage.Top"));
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- widthTopLabel.setLayoutData(data);
-
- _widthTopNumberCombo = new StyleCombo(widthGroup, SWT.NONE);
- _widthTopNumberCombo.setItems(IStyleConstants.BORDER_WIDTH);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _widthTopNumberCombo.setLayoutData(data);
- _widthTopNumberCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- _widthTopUnitCombo.setEnabled(true);
- try {
- Integer.valueOf(_widthTopNumberCombo.getText());
- } catch (NumberFormatException ex) {
- _widthTopUnitCombo.setEnabled(false);
- }
-
- String width = _widthTopNumberCombo.getText();
- if (_widthTopUnitCombo.isEnabled()) {
- width += _widthTopUnitCombo.getText();
- }
-
- _style.setBorderTopWidth(width);
- }
- });
-
- _widthTopUnitCombo = new StyleCombo(widthGroup, SWT.READ_ONLY);
- _widthTopUnitCombo.setItems(IStyleConstants.SIZE_UNIT);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _widthTopUnitCombo.setLayoutData(data);
- _widthTopUnitCombo.select(0);
- _widthTopUnitCombo.setEnabled(false);
- _widthTopUnitCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String width = _widthTopNumberCombo.getText();
- if (_widthTopUnitCombo.isEnabled()) {
- width += _widthTopUnitCombo.getText();
- }
-
- _style.setBorderTopWidth(width);
- }
- });
-
- Label widthRightLabel = new Label(widthGroup, SWT.NONE);
- widthRightLabel.setText(DialogsMessages
- .getString("BorderPreferencePage.Right"));
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- widthRightLabel.setLayoutData(data);
-
- _widthRightNumberCombo = new StyleCombo(widthGroup, SWT.NONE);
- _widthRightNumberCombo.setItems(IStyleConstants.BORDER_WIDTH);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _widthRightNumberCombo.setLayoutData(data);
- _widthRightNumberCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- _widthRightUnitCombo.setEnabled(true);
- try {
- Integer.valueOf(_widthRightNumberCombo.getText());
- } catch (NumberFormatException ex) {
- _widthRightUnitCombo.setEnabled(false);
- }
-
- String width = _widthRightNumberCombo.getText();
- if (_widthRightUnitCombo.isEnabled()) {
- width += _widthRightUnitCombo.getText();
- }
-
- _style.setBorderRightWidth(width);
- }
- });
-
- _widthRightUnitCombo = new StyleCombo(widthGroup, SWT.READ_ONLY);
- _widthRightUnitCombo.setItems(IStyleConstants.SIZE_UNIT);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _widthRightUnitCombo.setLayoutData(data);
- _widthRightUnitCombo.select(0);
- _widthRightUnitCombo.setEnabled(false);
- _widthRightUnitCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String width = _widthRightNumberCombo.getText();
- if (_widthRightUnitCombo.isEnabled()) {
- width += _widthRightUnitCombo.getText();
- }
-
- _style.setBorderRightWidth(width);
- }
- });
-
- Label widthBottomLabel = new Label(widthGroup, SWT.NONE);
- widthBottomLabel.setText(DialogsMessages
- .getString("BorderPreferencePage.Bottom"));
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- widthBottomLabel.setLayoutData(data);
-
- _widthBottomNumberCombo = new StyleCombo(widthGroup, SWT.NONE);
- _widthBottomNumberCombo.setItems(IStyleConstants.BORDER_WIDTH);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _widthBottomNumberCombo.setLayoutData(data);
- _widthBottomNumberCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- _widthBottomUnitCombo.setEnabled(true);
- try {
- Integer.valueOf(_widthBottomNumberCombo.getText());
- } catch (NumberFormatException ex) {
- _widthBottomUnitCombo.setEnabled(false);
- }
-
- String width = _widthBottomNumberCombo.getText();
- if (_widthBottomUnitCombo.isEnabled()) {
- width += _widthBottomUnitCombo.getText();
- }
-
- _style.setBorderBottomWidth(width);
- }
- });
-
- _widthBottomUnitCombo = new StyleCombo(widthGroup, SWT.READ_ONLY);
- _widthBottomUnitCombo.setItems(IStyleConstants.SIZE_UNIT);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _widthBottomUnitCombo.setLayoutData(data);
- _widthBottomUnitCombo.select(0);
- _widthBottomUnitCombo.setEnabled(false);
- _widthBottomUnitCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String width = _widthBottomNumberCombo.getText();
- if (_widthBottomUnitCombo.isEnabled()) {
- width += _widthBottomUnitCombo.getText();
- }
-
- _style.setBorderBottomWidth(width);
- }
- });
-
- Label widthLeftLabel = new Label(widthGroup, SWT.NONE);
- widthLeftLabel.setText(DialogsMessages
- .getString("BorderPreferencePage.Left"));
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- widthLeftLabel.setLayoutData(data);
-
- _widthLeftNumberCombo = new StyleCombo(widthGroup, SWT.NONE);
- _widthLeftNumberCombo.setItems(IStyleConstants.BORDER_WIDTH);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _widthLeftNumberCombo.setLayoutData(data);
- _widthLeftNumberCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- _widthLeftUnitCombo.setEnabled(true);
- try {
- Integer.valueOf(_widthLeftNumberCombo.getText());
- } catch (NumberFormatException ex) {
- _widthLeftUnitCombo.setEnabled(false);
- }
-
- String width = _widthLeftNumberCombo.getText();
- if (_widthLeftUnitCombo.isEnabled()) {
- width += _widthLeftUnitCombo.getText();
- }
-
- _style.setBorderLeftWidth(width);
- }
- });
-
- _widthLeftUnitCombo = new StyleCombo(widthGroup, SWT.READ_ONLY);
- _widthLeftUnitCombo.setItems(IStyleConstants.SIZE_UNIT);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _widthLeftUnitCombo.setLayoutData(data);
- _widthLeftUnitCombo.select(0);
- _widthLeftUnitCombo.setEnabled(false);
- _widthLeftUnitCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String width = _widthLeftNumberCombo.getText();
- if (_widthLeftUnitCombo.isEnabled()) {
- width += _widthLeftUnitCombo.getText();
- }
-
- _style.setBorderLeftWidth(width);
- }
- });
-
- initializeControls();
-
- return top;
- }
-
- private void initializeControls() {
- // border-style
- String style = _style.getBorderTopStyle();
- if (!isEmptyString(style)) {
- int index = _styleTopCombo.indexOf(style);
- if (index != -1) {
- _styleTopCombo.select(index);
- } else {
- _styleTopCombo.setText(style);
- }
- }
- style = _style.getBorderRightStyle();
- if (!isEmptyString(style)) {
- int index = _styleRightCombo.indexOf(style);
- if (index != -1) {
- _styleRightCombo.select(index);
- } else {
- _styleRightCombo.setText(style);
- }
- }
- style = _style.getBorderBottomStyle();
- if (!isEmptyString(style)) {
- int index = _styleBottomCombo.indexOf(style);
- if (index != -1) {
- _styleBottomCombo.select(index);
- } else {
- _styleBottomCombo.setText(style);
- }
- }
- style = _style.getBorderLeftStyle();
- if (!isEmptyString(style)) {
- int index = _styleLeftCombo.indexOf(style);
- if (index != -1) {
- _styleLeftCombo.select(index);
- } else {
- _styleLeftCombo.setText(style);
- }
- }
-
- // border-color
- String color = _style.getBorderTopColor();
- if (!isEmptyString(color)) {
- _colorTopField.setTextWithoutUpdate(color);
- }
- color = _style.getBorderRightColor();
- if (!isEmptyString(color)) {
- _colorRightField.setTextWithoutUpdate(color);
- }
- color = _style.getBorderBottomColor();
- if (!isEmptyString(color)) {
- _colorBottomField.setTextWithoutUpdate(color);
- }
- color = _style.getBorderLeftColor();
- if (!isEmptyString(color)) {
- _colorLeftField.setTextWithoutUpdate(color);
- }
-
- // border-width
- String width = _style.getBorderTopWidth();
- if (!isEmptyString(width)) {
- int index = _widthTopNumberCombo.indexOf(width);
- if (index != -1) {
- _widthTopNumberCombo.select(index);
- } else {
- _widthTopNumberCombo.setText(width);
- }
- }
- width = _style.getBorderRightWidth();
- if (!isEmptyString(width)) {
- int index = _widthRightNumberCombo.indexOf(width);
- if (index != -1) {
- _widthRightNumberCombo.select(index);
- } else {
- _widthRightNumberCombo.setText(width);
- }
- }
- width = _style.getBorderBottomWidth();
- if (!isEmptyString(width)) {
- int index = _widthBottomNumberCombo.indexOf(width);
- if (index != -1) {
- _widthBottomNumberCombo.select(index);
- } else {
- _widthBottomNumberCombo.setText(width);
- }
- }
- width = _style.getBorderLeftWidth();
- if (!isEmptyString(width)) {
- int index = _widthLeftNumberCombo.indexOf(width);
- if (index != -1) {
- _widthLeftNumberCombo.select(index);
- } else {
- _widthLeftNumberCombo.setText(width);
- }
- }
- }
-
- public void setVisible(boolean visible) {
- super.setVisible(visible);
-
- getApplyButton().setVisible(false);
- getDefaultsButton().setVisible(false);
- }
-
- private boolean isEmptyString(String str) {
- if (str == null || str.length() == 0) {
- return true;
- }
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/BoxPreferenceNode.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/BoxPreferenceNode.java
deleted file mode 100644
index 8899b9f..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/BoxPreferenceNode.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.ui.dialogs;
-
-import org.eclipse.jface.preference.IPreferenceNode;
-import org.eclipse.jface.preference.IPreferencePage;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.css.core.internal.util.declaration.CSSPropertyContext;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class BoxPreferenceNode implements IPreferenceNode {
- private BoxPreferencePage _page;
-
- private IDOMElement _element;
-
- private CSSPropertyContext _styles;
-
- /**
- * @param element
- * @param style
- */
- public BoxPreferenceNode(IDOMElement element, CSSPropertyContext style) {
- super();
- _element = element;
- _styles = style;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#add(org.eclipse.jface.preference.IPreferenceNode)
- */
- public void add(IPreferenceNode node) {
- // TODO: this pattern is being repeated; perhaps need common super for preference nodes?
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#createPage()
- */
- public void createPage() {
- _page = new BoxPreferencePage(_element, _styles);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#disposeResources()
- */
- public void disposeResources() {
- // TODO:
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#findSubNode(java.lang.String)
- */
- public IPreferenceNode findSubNode(String id) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getId()
- */
- public String getId() {
- return "Box";
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getLabelImage()
- */
- public Image getLabelImage() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getLabelText()
- */
- public String getLabelText() {
- return DialogsMessages.getString("BoxPreferenceNode.LabelText");
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getPage()
- */
- public IPreferencePage getPage() {
- return _page;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getSubNodes()
- */
- public IPreferenceNode[] getSubNodes() {
- return new IPreferenceNode[0];
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#remove(java.lang.String)
- */
- public IPreferenceNode remove(String id) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#remove(org.eclipse.jface.preference.IPreferenceNode)
- */
- public boolean remove(IPreferenceNode node) {
- return false;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/BoxPreferencePage.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/BoxPreferencePage.java
deleted file mode 100644
index 697944f..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/BoxPreferencePage.java
+++ /dev/null
@@ -1,673 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.ui.dialogs;
-
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.css.core.internal.util.declaration.CSSPropertyContext;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class BoxPreferencePage extends PreferencePage {
- private CSSPropertyContext _style;
-
- private StyleCombo _widthNumberCombo, _widthUnitCombo, _heightNumberCombo,
- _heightUnitCombo, _clearCombo;
-
- private Text _paddingTopNumberText, _paddingRightNumberText,
- _paddingBottomNumberText, _paddingLeftNumberText;
-
- private StyleCombo _paddingTopUnitCombo, _paddingRightUnitCombo,
- _paddingBottomUnitCombo, _paddingLeftUnitCombo;
-
- private StyleCombo _marginTopNumberCombo, _marginRightNumberCombo,
- _marginBottomNumberCombo, _marginLeftNumberCombo;
-
- private StyleCombo _marginTopUnitCombo, _marginRightUnitCombo,
- _marginBottomUnitCombo, _marginLeftUnitCombo;
-
- /**
- * @param element
- * @param style
- */
- public BoxPreferencePage(IDOMElement element, CSSPropertyContext style) {
- super();
- _style = style;
-
- setTitle(DialogsMessages.getString("BoxPreferencePage.Title")); //$NON-NLS-1$
- }
-
- /**
- * @see org.eclipse.jface.preference.
- * PreferencePage#createContents(Composite)
- */
- protected Control createContents(Composite parent) {
- GridLayout layout;
- GridData data;
-
- Composite top = new Composite(parent, SWT.NONE);
- layout = new GridLayout(6, false);
- data = new GridData(GridData.FILL_BOTH);
- top.setLayout(layout);
- top.setLayoutData(data);
-
- Label widthLabel = new Label(top, SWT.NONE);
- widthLabel
- .setText(DialogsMessages.getString("BoxPreferencePage.Width")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- widthLabel.setLayoutData(data);
-
- _widthNumberCombo = new StyleCombo(top, SWT.NONE);
- _widthNumberCombo.setItems(IStyleConstants.AUTO);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _widthNumberCombo.setLayoutData(data);
- _widthNumberCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- _widthUnitCombo.setEnabled(true);
- try {
- Integer.valueOf(_widthNumberCombo.getText());
- } catch (NumberFormatException ex) {
- _widthUnitCombo.setEnabled(false);
- }
-
- String width = _widthNumberCombo.getText();
- if (_widthUnitCombo.isEnabled()) {
- width += _widthUnitCombo.getText();
- }
-
- _style.setWidth(width);
- }
- });
-
- _widthUnitCombo = new StyleCombo(top, SWT.READ_ONLY);
- _widthUnitCombo.setItems(IStyleConstants.SIZE_UNIT);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _widthUnitCombo.setLayoutData(data);
- _widthUnitCombo.select(0);
- _widthUnitCombo.setEnabled(false);
- _widthUnitCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String width = _widthNumberCombo.getText();
- if (_widthUnitCombo.isEnabled()) {
- width += _widthUnitCombo.getText();
- }
-
- _style.setWidth(width);
- }
- });
-
- Label clearLabel = new Label(top, SWT.NONE);
- clearLabel
- .setText(DialogsMessages.getString("BoxPreferencePage.Clear")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- clearLabel.setLayoutData(data);
-
- _clearCombo = new StyleCombo(top, SWT.NONE);
- _clearCombo.setItems(IStyleConstants.CLEAR);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _clearCombo.setLayoutData(data);
- _clearCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String clear = _clearCombo.getText();
- _style.setClear(clear);
- }
- });
-
- new Label(top, SWT.NONE);
-
- Label heightLabel = new Label(top, SWT.NONE);
- heightLabel.setText(DialogsMessages
- .getString("BoxPreferencePage.Height")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- heightLabel.setLayoutData(data);
-
- _heightNumberCombo = new StyleCombo(top, SWT.NONE);
- _heightNumberCombo.setItems(IStyleConstants.AUTO);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _heightNumberCombo.setLayoutData(data);
- _heightNumberCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- _heightUnitCombo.setEnabled(true);
- try {
- Integer.valueOf(_heightNumberCombo.getText());
- } catch (NumberFormatException ex) {
- _heightUnitCombo.setEnabled(false);
- }
-
- String height = _heightNumberCombo.getText();
- if (_heightUnitCombo.isEnabled()) {
- height += _heightUnitCombo.getText();
- }
-
- _style.setHeight(height);
- }
- });
-
- _heightUnitCombo = new StyleCombo(top, SWT.READ_ONLY);
- _heightUnitCombo.setItems(IStyleConstants.SIZE_UNIT);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _heightUnitCombo.setLayoutData(data);
- _heightUnitCombo.select(0);
- _heightUnitCombo.setEnabled(false);
- _heightUnitCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String height = _heightNumberCombo.getText();
- if (_heightUnitCombo.isEnabled()) {
- height += _heightNumberCombo.getText();
- }
-
- _style.setHeight(height);
- }
- });
-
- new Label(top, SWT.NONE);
- new Label(top, SWT.NONE);
- new Label(top, SWT.NONE);
-
- Group paddingGroup = new Group(top, SWT.NONE);
- paddingGroup.setText(DialogsMessages
- .getString("BoxPreferencePage.Padding"));
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 3;
- data.verticalSpan = 4;
- paddingGroup.setLayoutData(data);
- layout = new GridLayout(3, false);
- paddingGroup.setLayout(layout);
-
- Label paddingTopLabel = new Label(paddingGroup, SWT.NONE);
- paddingTopLabel.setText(DialogsMessages
- .getString("BoxPreferencePage.Top")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- paddingTopLabel.setLayoutData(data);
-
- _paddingTopNumberText = new Text(paddingGroup, SWT.BORDER);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _paddingTopNumberText.setLayoutData(data);
- _paddingTopNumberText.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- _paddingTopUnitCombo.setEnabled(true);
- try {
- Integer.valueOf(_paddingTopNumberText.getText());
- } catch (NumberFormatException ex) {
- _paddingTopUnitCombo.setEnabled(false);
- }
-
- String padding = _paddingTopNumberText.getText();
- if (_paddingTopUnitCombo.isEnabled()) {
- padding += _paddingTopUnitCombo.getText();
- }
-
- _style.setPaddingTop(padding);
- }
- });
-
- _paddingTopUnitCombo = new StyleCombo(paddingGroup, SWT.READ_ONLY);
- _paddingTopUnitCombo.setItems(IStyleConstants.SIZE_UNIT);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _paddingTopUnitCombo.setLayoutData(data);
- _paddingTopUnitCombo.select(0);
- _paddingTopUnitCombo.setEnabled(false);
- _paddingTopUnitCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String padding = _paddingTopNumberText.getText();
- if (_paddingTopUnitCombo.isEnabled()) {
- padding += _paddingTopUnitCombo.getText();
- }
-
- _style.setPaddingTop(padding);
- }
- });
-
- Label paddingRightLabel = new Label(paddingGroup, SWT.NONE);
- paddingRightLabel.setText(DialogsMessages
- .getString("BoxPreferencePage.Right")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- paddingRightLabel.setLayoutData(data);
-
- _paddingRightNumberText = new Text(paddingGroup, SWT.BORDER);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _paddingRightNumberText.setLayoutData(data);
- _paddingRightNumberText.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- _paddingRightUnitCombo.setEnabled(true);
- try {
- Integer.valueOf(_paddingRightNumberText.getText());
- } catch (NumberFormatException ex) {
- _paddingRightUnitCombo.setEnabled(false);
- }
-
- String padding = _paddingRightNumberText.getText();
- if (_paddingRightUnitCombo.isEnabled()) {
- padding += _paddingRightUnitCombo.getText();
- }
-
- _style.setPaddingRight(padding);
- }
- });
-
- _paddingRightUnitCombo = new StyleCombo(paddingGroup, SWT.READ_ONLY);
- _paddingRightUnitCombo.setItems(IStyleConstants.SIZE_UNIT);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _paddingRightUnitCombo.setLayoutData(data);
- _paddingRightUnitCombo.select(0);
- _paddingRightUnitCombo.setEnabled(false);
- _paddingRightUnitCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String padding = _paddingRightNumberText.getText();
- if (_paddingRightUnitCombo.isEnabled()) {
- padding += _paddingRightUnitCombo.getText();
- }
-
- _style.setPaddingRight(padding);
- }
- });
-
- Label paddingBottomLabel = new Label(paddingGroup, SWT.NONE);
- paddingBottomLabel.setText(DialogsMessages
- .getString("BoxPreferencePage.Bottom")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- paddingBottomLabel.setLayoutData(data);
-
- _paddingBottomNumberText = new Text(paddingGroup, SWT.BORDER);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _paddingBottomNumberText.setLayoutData(data);
- _paddingBottomNumberText.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- _paddingBottomUnitCombo.setEnabled(true);
- try {
- Integer.valueOf(_paddingBottomNumberText.getText());
- } catch (NumberFormatException ex) {
- _paddingBottomUnitCombo.setEnabled(false);
- }
-
- String padding = _paddingBottomNumberText.getText();
- if (_paddingBottomUnitCombo.isEnabled()) {
- padding += _paddingBottomUnitCombo.getText();
- }
-
- _style.setPaddingBottom(padding);
- }
- });
-
- _paddingBottomUnitCombo = new StyleCombo(paddingGroup, SWT.READ_ONLY);
- _paddingBottomUnitCombo.setItems(IStyleConstants.SIZE_UNIT);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _paddingBottomUnitCombo.setLayoutData(data);
- _paddingBottomUnitCombo.select(0);
- _paddingBottomUnitCombo.setEnabled(false);
- _paddingBottomUnitCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String padding = _paddingBottomNumberText.getText();
- if (_paddingBottomUnitCombo.isEnabled()) {
- padding += _paddingBottomUnitCombo.getText();
- }
-
- _style.setPaddingBottom(padding);
- }
- });
-
- Label paddingLeftLabel = new Label(paddingGroup, SWT.NONE);
- paddingLeftLabel.setText(DialogsMessages
- .getString("BoxPreferencePage.Left")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- paddingLeftLabel.setLayoutData(data);
-
- _paddingLeftNumberText = new Text(paddingGroup, SWT.BORDER);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _paddingLeftNumberText.setLayoutData(data);
- _paddingLeftNumberText.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- _paddingLeftUnitCombo.setEnabled(true);
- try {
- Integer.valueOf(_paddingLeftNumberText.getText());
- } catch (NumberFormatException ex) {
- _paddingLeftUnitCombo.setEnabled(false);
- }
-
- String top1 = _paddingLeftNumberText.getText();
- if (_paddingLeftUnitCombo.isEnabled()) {
- top1 += _paddingLeftUnitCombo.getText();
- }
-
- _style.setPaddingLeft(top1);
- }
- });
-
- _paddingLeftUnitCombo = new StyleCombo(paddingGroup, SWT.READ_ONLY);
- _paddingLeftUnitCombo.setItems(IStyleConstants.SIZE_UNIT);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _paddingLeftUnitCombo.setLayoutData(data);
- _paddingLeftUnitCombo.select(0);
- _paddingLeftUnitCombo.setEnabled(false);
- _paddingLeftUnitCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String top1 = _paddingLeftNumberText.getText();
- if (_paddingLeftUnitCombo.isEnabled()) {
- top1 += _paddingLeftUnitCombo.getText();
- }
-
- _style.setPaddingLeft(top1);
- }
- });
-
- Group marginGroup = new Group(top, SWT.NONE);
- marginGroup.setText(DialogsMessages
- .getString("BoxPreferencePage.Margin"));
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 3;
- data.verticalSpan = 4;
- marginGroup.setLayoutData(data);
- layout = new GridLayout(3, false);
- marginGroup.setLayout(layout);
-
- Label marginTopLabel = new Label(marginGroup, SWT.NONE);
- marginTopLabel.setText(DialogsMessages
- .getString("BoxPreferencePage.Top")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- marginTopLabel.setLayoutData(data);
-
- _marginTopNumberCombo = new StyleCombo(marginGroup, SWT.NONE);
- _marginTopNumberCombo.setItems(IStyleConstants.AUTO);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _marginTopNumberCombo.setLayoutData(data);
- _marginTopNumberCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- _marginTopUnitCombo.setEnabled(true);
- try {
- Integer.valueOf(_marginTopNumberCombo.getText());
- } catch (NumberFormatException ex) {
- _marginTopUnitCombo.setEnabled(false);
- }
-
- String margin = _marginTopNumberCombo.getText();
- if (_marginTopUnitCombo.isEnabled()) {
- margin += _marginTopUnitCombo.getText();
- }
-
- _style.setMarginTop(margin);
- }
- });
-
- _marginTopUnitCombo = new StyleCombo(marginGroup, SWT.READ_ONLY);
- _marginTopUnitCombo.setItems(IStyleConstants.SIZE_UNIT);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _marginTopUnitCombo.setLayoutData(data);
- _marginTopUnitCombo.select(0);
- _marginTopUnitCombo.setEnabled(false);
- _marginTopUnitCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String margin = _marginTopNumberCombo.getText();
- if (_marginTopUnitCombo.isEnabled()) {
- margin += _marginTopUnitCombo.getText();
- }
-
- _style.setMarginTop(margin);
- }
- });
-
- Label marginRightLabel = new Label(marginGroup, SWT.NONE);
- marginRightLabel.setText(DialogsMessages
- .getString("BoxPreferencePage.Right")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- marginRightLabel.setLayoutData(data);
-
- _marginRightNumberCombo = new StyleCombo(marginGroup, SWT.NONE);
- _marginRightNumberCombo.setItems(IStyleConstants.AUTO);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _marginRightNumberCombo.setLayoutData(data);
- _marginRightNumberCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- _marginRightUnitCombo.setEnabled(true);
- try {
- Integer.valueOf(_marginRightNumberCombo.getText());
- } catch (NumberFormatException ex) {
- _marginRightUnitCombo.setEnabled(false);
- }
-
- String margin = _marginRightNumberCombo.getText();
- if (_marginRightUnitCombo.isEnabled()) {
- margin += _marginRightUnitCombo.getText();
- }
-
- _style.setMarginRight(margin);
- }
- });
-
- _marginRightUnitCombo = new StyleCombo(marginGroup, SWT.READ_ONLY);
- _marginRightUnitCombo.setItems(IStyleConstants.SIZE_UNIT);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _marginRightUnitCombo.setLayoutData(data);
- _marginRightUnitCombo.select(0);
- _marginRightUnitCombo.setEnabled(false);
- _marginRightUnitCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String margin = _marginRightNumberCombo.getText();
- if (_marginRightUnitCombo.isEnabled()) {
- margin += _marginRightUnitCombo.getText();
- }
-
- _style.setMarginRight(margin);
- }
- });
-
- Label marginBottomLabel = new Label(marginGroup, SWT.NONE);
- marginBottomLabel.setText(DialogsMessages
- .getString("BoxPreferencePage.Bottom")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- marginBottomLabel.setLayoutData(data);
-
- _marginBottomNumberCombo = new StyleCombo(marginGroup, SWT.NONE);
- _marginBottomNumberCombo.setItems(IStyleConstants.AUTO);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _marginBottomNumberCombo.setLayoutData(data);
- _marginBottomNumberCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- _marginBottomUnitCombo.setEnabled(true);
- try {
- Integer.valueOf(_marginBottomNumberCombo.getText());
- } catch (NumberFormatException ex) {
- _marginBottomUnitCombo.setEnabled(false);
- }
-
- String margin = _marginBottomNumberCombo.getText();
- if (_marginBottomUnitCombo.isEnabled()) {
- margin += _marginBottomUnitCombo.getText();
- }
-
- _style.setMarginBottom(margin);
- }
- });
-
- _marginBottomUnitCombo = new StyleCombo(marginGroup, SWT.READ_ONLY);
- _marginBottomUnitCombo.setItems(IStyleConstants.SIZE_UNIT);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _marginBottomUnitCombo.setLayoutData(data);
- _marginBottomUnitCombo.select(0);
- _marginBottomUnitCombo.setEnabled(false);
- _marginBottomUnitCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String margin = _marginBottomNumberCombo.getText();
- if (_marginBottomUnitCombo.isEnabled()) {
- margin += _marginBottomUnitCombo.getText();
- }
-
- _style.setMarginBottom(margin);
- }
- });
-
- Label marginLeftLabel = new Label(marginGroup, SWT.NONE);
- marginLeftLabel.setText(DialogsMessages
- .getString("BoxPreferencePage.Left")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- marginLeftLabel.setLayoutData(data);
-
- _marginLeftNumberCombo = new StyleCombo(marginGroup, SWT.NONE);
- _marginLeftNumberCombo.setItems(IStyleConstants.AUTO);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _marginLeftNumberCombo.setLayoutData(data);
- _marginLeftNumberCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- _marginLeftUnitCombo.setEnabled(true);
- try {
- Integer.valueOf(_marginLeftNumberCombo.getText());
- } catch (NumberFormatException ex) {
- _marginLeftUnitCombo.setEnabled(false);
- }
-
- String top1 = _marginLeftNumberCombo.getText();
- if (_marginLeftUnitCombo.isEnabled()) {
- top1 += _marginLeftUnitCombo.getText();
- }
-
- _style.setMarginLeft(top1);
- }
- });
-
- _marginLeftUnitCombo = new StyleCombo(marginGroup, SWT.READ_ONLY);
- _marginLeftUnitCombo.setItems(IStyleConstants.SIZE_UNIT);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _marginLeftUnitCombo.setLayoutData(data);
- _marginLeftUnitCombo.select(0);
- _marginLeftUnitCombo.setEnabled(false);
- _marginLeftUnitCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String top1 = _marginLeftNumberCombo.getText();
- if (_marginLeftUnitCombo.isEnabled()) {
- top1 += _marginLeftUnitCombo.getText();
- }
-
- _style.setMarginLeft(top1);
- }
- });
-
- initializeControls();
-
- return top;
- }
-
- private void initializeControls() {
- // width
- String width = _style.getWidth();
- if (!isEmptyString(width)) {
- int index = _widthNumberCombo.indexOf(width);
- if (index != -1) {
- _widthNumberCombo.select(index);
- } else {
- _widthNumberCombo.setText(width);
- }
- }
-
- // height
- String height = _style.getHeight();
- if (!isEmptyString(height)) {
- int index = _heightNumberCombo.indexOf(height);
- if (index != -1) {
- _heightNumberCombo.select(index);
- } else {
- _heightNumberCombo.setText(height);
- }
- }
-
- // clear
- String clear = _style.getClear();
- if (!isEmptyString(clear)) {
- int index = _clearCombo.indexOf(clear);
- if (index != -1) {
- _clearCombo.select(index);
- } else {
- _clearCombo.setText(clear);
- }
- }
-
- // padding
- String padding = _style.getPaddingTop();
- if (!isEmptyString(padding)) {
- _paddingTopNumberText.setText(padding);
- }
- padding = _style.getPaddingRight();
- if (!isEmptyString(padding)) {
- _paddingRightNumberText.setText(padding);
- }
- padding = _style.getPaddingBottom();
- if (!isEmptyString(padding)) {
- _paddingBottomNumberText.setText(padding);
- }
- padding = _style.getPaddingLeft();
- if (!isEmptyString(padding)) {
- _paddingLeftNumberText.setText(padding);
- }
-
- // margin
- String margin = _style.getMarginTop();
- if (!isEmptyString(margin)) {
- int index = _marginTopNumberCombo.indexOf(margin);
- if (index != -1) {
- _marginTopNumberCombo.select(index);
- } else {
- _marginTopNumberCombo.setText(margin);
- }
- }
- margin = _style.getMarginRight();
- if (!isEmptyString(margin)) {
- int index = _marginRightNumberCombo.indexOf(margin);
- if (index != -1) {
- _marginRightNumberCombo.select(index);
- } else {
- _marginRightNumberCombo.setText(margin);
- }
- }
- margin = _style.getMarginBottom();
- if (!isEmptyString(margin)) {
- int index = _marginBottomNumberCombo.indexOf(margin);
- if (index != -1) {
- _marginBottomNumberCombo.select(index);
- } else {
- _marginBottomNumberCombo.setText(margin);
- }
- }
- margin = _style.getMarginLeft();
- if (!isEmptyString(margin)) {
- int index = _marginLeftNumberCombo.indexOf(margin);
- if (index != -1) {
- _marginLeftNumberCombo.select(index);
- } else {
- _marginLeftNumberCombo.setText(margin);
- }
- }
- }
-
- public void setVisible(boolean visible) {
- super.setVisible(visible);
-
- getApplyButton().setVisible(false);
- getDefaultsButton().setVisible(false);
- }
-
- private boolean isEmptyString(String str) {
- if (str == null || str.length() == 0) {
- return true;
- }
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/ColorUtil.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/ColorUtil.java
deleted file mode 100644
index 39349a9..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/ColorUtil.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.ui.dialogs;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.ColorPalette;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class ColorUtil extends ColorPalette {
- private static final Map EXTENDED_COLORS = new HashMap(20);
-
- private static final Map BASIC_COLORS = new HashMap(143);
-
- static {
- BASIC_COLORS.put("Aqua", new Color(null, 0x00, 0xFF, 0xFF));
- BASIC_COLORS.put("Black", new Color(null, 0x00, 0x00, 0x00));
- BASIC_COLORS.put("Blue", new Color(null, 0x00, 0x00, 0xFF));
- BASIC_COLORS.put("Fuchsia", new Color(null, 0xFF, 0x00, 0xFF));
- BASIC_COLORS.put("Gray", new Color(null, 0x80, 0x80, 0x80));
- BASIC_COLORS.put("Green", new Color(null, 0x00, 0x80, 0x00));
- BASIC_COLORS.put("Lime", new Color(null, 0x00, 0xFF, 0x00));
- BASIC_COLORS.put("Maroon", new Color(null, 0x80, 0x00, 0x00));
- BASIC_COLORS.put("Navy", new Color(null, 0x00, 0x00, 0x80));
- BASIC_COLORS.put("Olive", new Color(null, 0x80, 0x80, 0x00));
- BASIC_COLORS.put("Purple", new Color(null, 0x80, 0x00, 0x80));
- BASIC_COLORS.put("Red", new Color(null, 0xFF, 0x00, 0x00));
- BASIC_COLORS.put("Silver", new Color(null, 0xC0, 0xC0, 0xC0));
- BASIC_COLORS.put("Teal", new Color(null, 0x00, 0x80, 0x80));
- BASIC_COLORS.put("White", new Color(null, 0xFF, 0xFF, 0xFF));
- BASIC_COLORS.put("Yellow", new Color(null, 0xFF, 0xFF, 0x00));
- }
-
- static {
- EXTENDED_COLORS.put("AliceBlue", new Color(null, 0xF0, 0xF8, 0xFF));
- EXTENDED_COLORS.put("AntiqueWhite", new Color(null, 0xFA, 0xEB, 0xD7));
- EXTENDED_COLORS.put("Aqua", new Color(null, 0x00, 0xFF, 0xFF));
- EXTENDED_COLORS.put("Aquamarine", new Color(null, 0x7F, 0xFF, 0xD4));
- EXTENDED_COLORS.put("Azure", new Color(null, 0xF0, 0xFF, 0xFF));
- EXTENDED_COLORS.put("Beige", new Color(null, 0xF5, 0xF5, 0xDC));
- EXTENDED_COLORS.put("Bisque", new Color(null, 0xFF, 0xE4, 0xC4));
- EXTENDED_COLORS.put("Black", new Color(null, 0x00, 0x00, 0x00));
- EXTENDED_COLORS
- .put("BlanchedAlmond", new Color(null, 0xFF, 0xEB, 0xCD));
- EXTENDED_COLORS.put("Blue", new Color(null, 0x00, 0x00, 0xFF));
- EXTENDED_COLORS.put("BlueViolet", new Color(null, 0x8A, 0x2B, 0xE2));
- EXTENDED_COLORS.put("Brown", new Color(null, 0xA5, 0x2A, 0x2A));
- EXTENDED_COLORS.put("BurlyWood", new Color(null, 0xDE, 0xB8, 0x87));
- EXTENDED_COLORS.put("CadetBlue", new Color(null, 0x5F, 0x9E, 0xA0));
- EXTENDED_COLORS.put("Chartreuse", new Color(null, 0x7F, 0xFF, 0x00));
- EXTENDED_COLORS.put("Chocolate", new Color(null, 0xD2, 0x69, 0x1E));
- EXTENDED_COLORS.put("Coral", new Color(null, 0xFF, 0x7F, 0x50));
- EXTENDED_COLORS
- .put("CornflowerBlue", new Color(null, 0x64, 0x95, 0xED));
- EXTENDED_COLORS.put("Cornsilk", new Color(null, 0xFF, 0xF8, 0xDC));
- EXTENDED_COLORS.put("Crimson", new Color(null, 0xDC, 0x14, 0x3C));
- EXTENDED_COLORS.put("Cyan", new Color(null, 0x00, 0xFF, 0xFF));
- EXTENDED_COLORS.put("DarkBlue", new Color(null, 0x00, 0x00, 0x8B));
- EXTENDED_COLORS.put("DarkCyan", new Color(null, 0x00, 0x8B, 0x8B));
- EXTENDED_COLORS.put("DarkGoldenRod", new Color(null, 0xB8, 0x86, 0x0B));
- EXTENDED_COLORS.put("DarkGray", new Color(null, 0xA9, 0xA9, 0xA9));
- EXTENDED_COLORS.put("DarkGreen", new Color(null, 0x00, 0x64, 0x00));
- EXTENDED_COLORS.put("DarkKhaki", new Color(null, 0xBD, 0xB7, 0x6B));
- EXTENDED_COLORS.put("DarkMagenta", new Color(null, 0x8B, 0x00, 0x8B));
- EXTENDED_COLORS
- .put("DarkOliveGreen", new Color(null, 0x55, 0x6B, 0x2F));
- EXTENDED_COLORS.put("Darkorange", new Color(null, 0xFF, 0x8C, 0x00));
- EXTENDED_COLORS.put("DarkOrchid", new Color(null, 0x99, 0x32, 0xCC));
- EXTENDED_COLORS.put("DarkRed", new Color(null, 0x8B, 0x00, 0x00));
- EXTENDED_COLORS.put("DarkSalmon", new Color(null, 0xE9, 0x96, 0x7A));
- EXTENDED_COLORS.put("DarkSeaGreen", new Color(null, 0x8F, 0xBC, 0x8F));
- EXTENDED_COLORS.put("DarkSlateBlue", new Color(null, 0x48, 0x3D, 0x8B));
- EXTENDED_COLORS.put("DarkSlateGray", new Color(null, 0x2F, 0x4F, 0x4F));
- EXTENDED_COLORS.put("DarkTurquoise", new Color(null, 0x00, 0xCE, 0xD1));
- EXTENDED_COLORS.put("DarkViolet", new Color(null, 0x94, 0x00, 0xD3));
- EXTENDED_COLORS.put("DeepPink", new Color(null, 0xFF, 0x14, 0x93));
- EXTENDED_COLORS.put("DeepSkyBlue", new Color(null, 0x00, 0xBF, 0xFF));
- EXTENDED_COLORS.put("DimGray", new Color(null, 0x69, 0x69, 0x69));
- EXTENDED_COLORS.put("DodgerBlue", new Color(null, 0x1E, 0x90, 0xFF));
- EXTENDED_COLORS.put("Feldspar", new Color(null, 0xD1, 0x92, 0x75));
- EXTENDED_COLORS.put("FireBrick", new Color(null, 0xB2, 0x22, 0x22));
- EXTENDED_COLORS.put("FloralWhite", new Color(null, 0xFF, 0xFA, 0xF0));
- EXTENDED_COLORS.put("ForestGreen", new Color(null, 0x22, 0x8B, 0x22));
- EXTENDED_COLORS.put("Fuchsia", new Color(null, 0xFF, 0x00, 0xFF));
- EXTENDED_COLORS.put("Gainsboro", new Color(null, 0xDC, 0xDC, 0xDC));
- EXTENDED_COLORS.put("GhostWhite", new Color(null, 0xF8, 0xF8, 0xFF));
- EXTENDED_COLORS.put("Gold", new Color(null, 0xFF, 0xD7, 0x00));
- EXTENDED_COLORS.put("GoldenRod", new Color(null, 0xDA, 0xA5, 0x20));
- EXTENDED_COLORS.put("Gray", new Color(null, 0x80, 0x80, 0x80));
- EXTENDED_COLORS.put("Green", new Color(null, 0x00, 0x80, 0x00));
- EXTENDED_COLORS.put("GreenYellow", new Color(null, 0xAD, 0xFF, 0x2F));
- EXTENDED_COLORS.put("HoneyDew", new Color(null, 0xF0, 0xFF, 0xF0));
- EXTENDED_COLORS.put("HotPink", new Color(null, 0xFF, 0x69, 0xB4));
- EXTENDED_COLORS.put("IndianRed", new Color(null, 0xCD, 0x5C, 0x5C));
- EXTENDED_COLORS.put("Indigo", new Color(null, 0x4B, 0x00, 0x82));
- EXTENDED_COLORS.put("Ivory", new Color(null, 0xFF, 0xFF, 0xF0));
- EXTENDED_COLORS.put("Khaki", new Color(null, 0xF0, 0xE6, 0x8C));
- EXTENDED_COLORS.put("Lavender", new Color(null, 0xE6, 0xE6, 0xFA));
- EXTENDED_COLORS.put("LavenderBlush", new Color(null, 0xFF, 0xF0, 0xF5));
- EXTENDED_COLORS.put("LawnGreen", new Color(null, 0x7C, 0xFC, 0x00));
- EXTENDED_COLORS.put("LemonChiffon", new Color(null, 0xFF, 0xFA, 0xCD));
- EXTENDED_COLORS.put("LightBlue", new Color(null, 0xAD, 0xD8, 0xE6));
- EXTENDED_COLORS.put("LightCoral", new Color(null, 0xF0, 0x80, 0x80));
- EXTENDED_COLORS.put("LightCyan", new Color(null, 0xE0, 0xFF, 0xFF));
- EXTENDED_COLORS.put("LightGoldenRodYellow", new Color(null, 0xFA, 0xFA,
- 0xD2));
- EXTENDED_COLORS.put("LightGrey", new Color(null, 0xD3, 0xD3, 0xD3));
- EXTENDED_COLORS.put("LightGreen", new Color(null, 0x90, 0xEE, 0x90));
- EXTENDED_COLORS.put("LightPink", new Color(null, 0xFF, 0xB6, 0xC1));
- EXTENDED_COLORS.put("LightSalmon", new Color(null, 0xFF, 0xA0, 0x7A));
- EXTENDED_COLORS.put("LightSeaGreen", new Color(null, 0x20, 0xB2, 0xAA));
- EXTENDED_COLORS.put("LightSkyBlue", new Color(null, 0x87, 0xCE, 0xFA));
- EXTENDED_COLORS
- .put("LightSlateBlue", new Color(null, 0x84, 0x70, 0xFF));
- EXTENDED_COLORS
- .put("LightSlateGray", new Color(null, 0x77, 0x88, 0x99));
- EXTENDED_COLORS
- .put("LightSteelBlue", new Color(null, 0xB0, 0xC4, 0xDE));
- EXTENDED_COLORS.put("LightYellow", new Color(null, 0xFF, 0xFF, 0xE0));
- EXTENDED_COLORS.put("Lime", new Color(null, 0x00, 0xFF, 0x00));
- EXTENDED_COLORS.put("LimeGreen", new Color(null, 0x32, 0xCD, 0x32));
- EXTENDED_COLORS.put("Linen", new Color(null, 0xFA, 0xF0, 0xE6));
- EXTENDED_COLORS.put("Magenta", new Color(null, 0xFF, 0x00, 0xFF));
- EXTENDED_COLORS.put("Maroon", new Color(null, 0x80, 0x00, 0x00));
- EXTENDED_COLORS.put("MediumAquaMarine", new Color(null, 0x66, 0xCD,
- 0xAA));
- EXTENDED_COLORS.put("MediumBlue", new Color(null, 0x00, 0x00, 0xCD));
- EXTENDED_COLORS.put("MediumOrchid", new Color(null, 0xBA, 0x55, 0xD3));
- EXTENDED_COLORS.put("MediumPurple", new Color(null, 0x93, 0x70, 0xD8));
- EXTENDED_COLORS
- .put("MediumSeaGreen", new Color(null, 0x3C, 0xB3, 0x71));
- EXTENDED_COLORS.put("MediumSlateBlue",
- new Color(null, 0x7B, 0x68, 0xEE));
- EXTENDED_COLORS.put("MediumSpringGreen", new Color(null, 0x00, 0xFA,
- 0x9A));
- EXTENDED_COLORS.put("MediumTurquoise",
- new Color(null, 0x48, 0xD1, 0xCC));
- EXTENDED_COLORS.put("MediumVioletRed",
- new Color(null, 0xC7, 0x15, 0x85));
- EXTENDED_COLORS.put("MidnightBlue", new Color(null, 0x19, 0x19, 0x70));
- EXTENDED_COLORS.put("MintCream", new Color(null, 0xF5, 0xFF, 0xFA));
- EXTENDED_COLORS.put("MistyRose", new Color(null, 0xFF, 0xE4, 0xE1));
- EXTENDED_COLORS.put("Moccasin", new Color(null, 0xFF, 0xE4, 0xB5));
- EXTENDED_COLORS.put("NavajoWhite", new Color(null, 0xFF, 0xDE, 0xAD));
- EXTENDED_COLORS.put("Navy", new Color(null, 0x00, 0x00, 0x80));
- EXTENDED_COLORS.put("OldLace", new Color(null, 0xFD, 0xF5, 0xE6));
- EXTENDED_COLORS.put("Olive", new Color(null, 0x80, 0x80, 0x00));
- EXTENDED_COLORS.put("OliveDrab", new Color(null, 0x6B, 0x8E, 0x23));
- EXTENDED_COLORS.put("Orange", new Color(null, 0xFF, 0xA5, 0x00));
- EXTENDED_COLORS.put("OrangeRed", new Color(null, 0xFF, 0x45, 0x00));
- EXTENDED_COLORS.put("Orchid", new Color(null, 0xDA, 0x70, 0xD6));
- EXTENDED_COLORS.put("PaleGoldenRod", new Color(null, 0xEE, 0xE8, 0xAA));
- EXTENDED_COLORS.put("PaleGreen", new Color(null, 0x98, 0xFB, 0x98));
- EXTENDED_COLORS.put("PaleTurquoise", new Color(null, 0xAF, 0xEE, 0xEE));
- EXTENDED_COLORS.put("PaleVioletRed", new Color(null, 0xD8, 0x70, 0x93));
- EXTENDED_COLORS.put("PapayaWhip", new Color(null, 0xFF, 0xEF, 0xD5));
- EXTENDED_COLORS.put("PeachPuff", new Color(null, 0xFF, 0xDA, 0xB9));
- EXTENDED_COLORS.put("Peru", new Color(null, 0xCD, 0x85, 0x3F));
- EXTENDED_COLORS.put("Pink", new Color(null, 0xFF, 0xC0, 0xCB));
- EXTENDED_COLORS.put("Plum", new Color(null, 0xDD, 0xA0, 0xDD));
- EXTENDED_COLORS.put("PowderBlue", new Color(null, 0xB0, 0xE0, 0xE6));
- EXTENDED_COLORS.put("Purple", new Color(null, 0x80, 0x00, 0x80));
- EXTENDED_COLORS.put("Red", new Color(null, 0xFF, 0x00, 0x00));
- EXTENDED_COLORS.put("RosyBrown", new Color(null, 0xBC, 0x8F, 0x8F));
- EXTENDED_COLORS.put("RoyalBlue", new Color(null, 0x41, 0x69, 0xE1));
- EXTENDED_COLORS.put("SaddleBrown", new Color(null, 0x8B, 0x45, 0x13));
- EXTENDED_COLORS.put("Salmon", new Color(null, 0xFA, 0x80, 0x72));
- EXTENDED_COLORS.put("SandyBrown", new Color(null, 0xF4, 0xA4, 0x60));
- EXTENDED_COLORS.put("SeaGreen", new Color(null, 0x2E, 0x8B, 0x57));
- EXTENDED_COLORS.put("SeaShell", new Color(null, 0xFF, 0xF5, 0xEE));
- EXTENDED_COLORS.put("Sienna", new Color(null, 0xA0, 0x52, 0x2D));
- EXTENDED_COLORS.put("Silver", new Color(null, 0xC0, 0xC0, 0xC0));
- EXTENDED_COLORS.put("SkyBlue", new Color(null, 0x87, 0xCE, 0xEB));
- EXTENDED_COLORS.put("SlateBlue", new Color(null, 0x6A, 0x5A, 0xCD));
- EXTENDED_COLORS.put("SlateGray", new Color(null, 0x70, 0x80, 0x90));
- EXTENDED_COLORS.put("Snow", new Color(null, 0xFF, 0xFA, 0xFA));
- EXTENDED_COLORS.put("SpringGreen", new Color(null, 0x00, 0xFF, 0x7F));
- EXTENDED_COLORS.put("SteelBlue", new Color(null, 0x46, 0x82, 0xB4));
- EXTENDED_COLORS.put("Tan", new Color(null, 0xD2, 0xB4, 0x8C));
- EXTENDED_COLORS.put("Teal", new Color(null, 0x00, 0x80, 0x80));
- EXTENDED_COLORS.put("Thistle", new Color(null, 0xD8, 0xBF, 0xD8));
- EXTENDED_COLORS.put("Tomato", new Color(null, 0xFF, 0x63, 0x47));
- EXTENDED_COLORS.put("Turquoise", new Color(null, 0x40, 0xE0, 0xD0));
- EXTENDED_COLORS.put("Violet", new Color(null, 0xEE, 0x82, 0xEE));
- EXTENDED_COLORS.put("VioletRed", new Color(null, 0xD0, 0x20, 0x90));
- EXTENDED_COLORS.put("Wheat", new Color(null, 0xF5, 0xDE, 0xB3));
- EXTENDED_COLORS.put("White", new Color(null, 0xFF, 0xFF, 0xFF));
- EXTENDED_COLORS.put("WhiteSmoke", new Color(null, 0xF5, 0xF5, 0xF5));
- EXTENDED_COLORS.put("Yellow", new Color(null, 0xFF, 0xFF, 0x00));
- EXTENDED_COLORS.put("YellowGreen", new Color(null, 0x9A, 0xCD, 0x32));
- }
-
- public final Map getBasicColorMap() {
- return Collections.unmodifiableMap(BASIC_COLORS);
- }
-
- public final Map getExtendedColorMap() {
- return Collections.unmodifiableMap(EXTENDED_COLORS);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/DialogsMessages.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/DialogsMessages.java
deleted file mode 100644
index 612d976..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/DialogsMessages.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.ui.dialogs;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class DialogsMessages {
- private static final String BUNDLE_NAME = "org.eclipse.jst.pagedesigner.ui.dialogs.DialogsMessages"; //$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
- .getBundle(BUNDLE_NAME);
-
- private DialogsMessages() {
- // no external instantiation
- }
-
- /**
- * @param key
- * @return the value for key or !!key!! if none
- */
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/DialogsMessages.properties b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/DialogsMessages.properties
deleted file mode 100644
index 4bf4dd2..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/DialogsMessages.properties
+++ /dev/null
@@ -1,93 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2007 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are 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:
-# Oracle Corporation - initial API and implementation
-###############################################################################
-StyleButtonDialogField.Edit=Edit...
-StyleDialog.Title=CSS Style Definition
-
-TextPreferenceNode.LabelText=Text
-TextPreferencePage.Title=Text
-TextPreferencePage.Font=Font:
-TextPreferencePage.Size=Size:
-TextPreferencePage.Weight=Weight:
-TextPreferencePage.Style=Style:
-TextPreferencePage.Variant=Variant:
-TextPreferencePage.LineHeight=Line Height:
-TextPreferencePage.Case=Case:
-TextPreferencePage.Decoration=Decoration:
-TextPreferencePage.Color=Color:
-
-BackgroundPreferenceNode.LabelText=Background
-BackgroundPreferencePage.Title=Background
-BackgroundBoxPreferencePage.BackgroundColor=Background color:
-BackgroundBoxPreferencePage.BackgroundImage=Background image:
-BackgroundBoxPreferencePage.BackgroundRepeatLabel=Repeat:
-BackgroundBoxPreferencePage.BackgroundAttachmentLabel=Attachment:
-BackgroundBoxPreferencePage.HorizontalLabel=Horizontal position:
-BackgroundBoxPreferencePage.VerticalLabel=Vertical position:
-
-BlockPreferenceNode.LabelText=Block
-BlockPreferencePage.Title=Block
-BlockPreferencePage.WordSpacing=Word spacing:
-BlockPreferencePage.LetterSpacing=Letter spacing:
-BlockPreferencePage.VerticalAlign=Vertical align:
-BlockPreferencePage.TextAlign=Text align:
-BlockPreferencePage.TextIndent=Text indent:
-BlockPreferencePage.WhiteSpace=White space:
-BlockPreferencePage.Display=Display:
-
-BoxPreferenceNode.LabelText=Box
-BoxPreferencePage.Title=Box
-BoxPreferencePage.Width=Width:
-BoxPreferencePage.Clear=Clear:
-BoxPreferencePage.Height=Height:
-BoxPreferencePage.Padding=Padding
-BoxPreferencePage.Margin=Margin
-BoxPreferencePage.Top=Top:
-BoxPreferencePage.Right=Right:
-BoxPreferencePage.Bottom=Bottom:
-BoxPreferencePage.Left=Left:
-
-BorderPreferenceNode.LabelText=Border
-BorderPreferencePage.Title=Border
-BorderPreferencePage.Style=Style
-BorderPreferencePage.Width=Width
-BorderPreferencePage.Color=Color
-BorderPreferencePage.Top=Top:
-BorderPreferencePage.Right=Right:
-BorderPreferencePage.Bottom=Bottom:
-BorderPreferencePage.Left=Left:
-
-ListPreferenceNode.LabelText=List
-ListPreferencePage.Title=List
-ListPreferencePage.Type=Type:
-ListPreferencePage.Image=Bullet image:
-ListPreferencePage.Position=Position:
-
-PositioningPreferenceNode.LabelText=Positioning
-PositioningPreferencePage.Title=Positioning
-PositioningPreferencePage.Type=Type:
-PositioningPreferencePage.Visibility=Visibility:
-PositioningPreferencePage.Width=Width:
-PositioningPreferencePage.ZIndex=Z-Index:
-PositioningPreferencePage.Height=Height:
-PositioningPreferencePage.Overflow=Overflow:
-PositioningPreferencePage.Placement=Placement
-PositioningPreferencePage.Clip=Clip
-PositioningPreferencePage.Right=Right:
-PositioningPreferencePage.Bottom=Bottom:
-PositioningPreferencePage.Left=Left:
-
-ExtensionsPreferenceNode.LabelText=Extensions
-ExtensionsPreferencePage.Title=Extensions
-ExtensionsPreferencePage.PageBreak=Page break
-ExtensionsPreferencePage.Before=Before:
-ExtensionsPreferencePage.After=After:
-ExtensionsPreferencePage.VisualEffect=Visual effect
-ExtensionsPreferencePage.Cursor=Cursor:
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/ExtensionsPreferenceNode.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/ExtensionsPreferenceNode.java
deleted file mode 100644
index 39eca4f..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/ExtensionsPreferenceNode.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.ui.dialogs;
-
-import org.eclipse.jface.preference.IPreferenceNode;
-import org.eclipse.jface.preference.IPreferencePage;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.css.core.internal.util.declaration.CSSPropertyContext;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class ExtensionsPreferenceNode implements IPreferenceNode {
- private ExtensionsPreferencePage _page;
-
- private IDOMElement _element;
-
- private CSSPropertyContext _style;
-
- /**
- * @param element
- * @param style
- */
- public ExtensionsPreferenceNode(IDOMElement element,
- CSSPropertyContext style) {
- super();
- _element = element;
- _style = style;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#add(org.eclipse.jface.preference.IPreferenceNode)
- */
- public void add(IPreferenceNode node) {
- // TODO:
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#createPage()
- */
- public void createPage() {
- _page = new ExtensionsPreferencePage(_element, _style);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#disposeResources()
- */
- public void disposeResources() {
- // TODO:
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#findSubNode(java.lang.String)
- */
- public IPreferenceNode findSubNode(String id) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getId()
- */
- public String getId() {
- return "Extensions";
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getLabelImage()
- */
- public Image getLabelImage() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getLabelText()
- */
- public String getLabelText() {
- return DialogsMessages.getString("ExtensionsPreferenceNode.LabelText");
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getPage()
- */
- public IPreferencePage getPage() {
- return _page;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getSubNodes()
- */
- public IPreferenceNode[] getSubNodes() {
- return new IPreferenceNode[0];
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#remove(java.lang.String)
- */
- public IPreferenceNode remove(String id) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#remove(org.eclipse.jface.preference.IPreferenceNode)
- */
- public boolean remove(IPreferenceNode node) {
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/ExtensionsPreferencePage.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/ExtensionsPreferencePage.java
deleted file mode 100644
index 650e7a3..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/ExtensionsPreferencePage.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.ui.dialogs;
-
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.wst.css.core.internal.util.declaration.CSSPropertyContext;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class ExtensionsPreferencePage extends PreferencePage {
- private CSSPropertyContext _style;
-
- private StyleCombo _beforeCombo, _afterCombo, _cursorCombo;
-
- /**
- * Creates an instance.
- *
- * @param element IDOMElement instance.
- * @param style CSSPropertyContext instance.
- */
- public ExtensionsPreferencePage(IDOMElement element,
- CSSPropertyContext style) {
- super();
- _style = style;
-
- setTitle(DialogsMessages.getString("ExtensionsPreferencePage.Title")); //$NON-NLS-1$
- }
-
- /**
- * @see org.eclipse.jface.preference.
- * PreferencePage#createContents(Composite)
- */
- protected Control createContents(Composite parent) {
- GridLayout layout;
- GridData data;
-
- Composite top = new Composite(parent, SWT.NONE);
- layout = new GridLayout(1, false);
- data = new GridData(GridData.FILL_BOTH);
- top.setLayout(layout);
- top.setLayoutData(data);
-
- Group pageGroup = new Group(top, SWT.NONE);
- pageGroup.setText(DialogsMessages
- .getString("ExtensionsPreferencePage.PageBreak"));
- data = new GridData(GridData.FILL_HORIZONTAL);
- pageGroup.setLayoutData(data);
- layout = new GridLayout(2, false);
- pageGroup.setLayout(layout);
-
- Label beforeLabel = new Label(pageGroup, SWT.NONE);
- beforeLabel.setText(DialogsMessages
- .getString("ExtensionsPreferencePage.Before")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- beforeLabel.setLayoutData(data);
-
- _beforeCombo = new StyleCombo(pageGroup, SWT.NONE);
- _beforeCombo.setItems(IStyleConstants.PAGE_BREAK);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _beforeCombo.setLayoutData(data);
- _beforeCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String page = _beforeCombo.getText();
- _style.setPageBreakBefore(page);
- }
- });
-
- Label afterLabel = new Label(pageGroup, SWT.NONE);
- afterLabel.setText(DialogsMessages
- .getString("ExtensionsPreferencePage.After")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- afterLabel.setLayoutData(data);
-
- _afterCombo = new StyleCombo(pageGroup, SWT.NONE);
- _afterCombo.setItems(IStyleConstants.PAGE_BREAK);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _afterCombo.setLayoutData(data);
- _afterCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String page = _afterCombo.getText();
- _style.setPageBreakAfter(page);
- }
- });
-
- Group visualGroup = new Group(top, SWT.NONE);
- visualGroup.setText(DialogsMessages
- .getString("ExtensionsPreferencePage.VisualEffect"));
- data = new GridData(GridData.FILL_HORIZONTAL);
- visualGroup.setLayoutData(data);
- layout = new GridLayout(2, false);
- visualGroup.setLayout(layout);
-
- Label cursorLabel = new Label(visualGroup, SWT.NONE);
- cursorLabel.setText(DialogsMessages
- .getString("ExtensionsPreferencePage.Cursor")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- cursorLabel.setLayoutData(data);
-
- _cursorCombo = new StyleCombo(visualGroup, SWT.NONE);
- _cursorCombo.setItems(IStyleConstants.CURSOR);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _cursorCombo.setLayoutData(data);
- _cursorCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String cursor = _cursorCombo.getText();
- _style.setCursor(cursor);
- }
- });
-
- initializeControls();
-
- return top;
- }
-
- private void initializeControls() {
- // page-break-before
- String page = _style.getPageBreakBefore();
- if (!isEmptyString(page)) {
- int index = _beforeCombo.indexOf(page);
- if (index != -1) {
- _beforeCombo.select(index);
- } else {
- _beforeCombo.setText(page);
- }
- }
-
- // page-break-after
- page = _style.getPageBreakAfter();
- if (!isEmptyString(page)) {
- int index = _afterCombo.indexOf(page);
- if (index != -1) {
- _afterCombo.select(index);
- } else {
- _afterCombo.setText(page);
- }
- }
-
- // cursor
- String cursor = _style.getCursor();
- if (!isEmptyString(cursor)) {
- int index = _cursorCombo.indexOf(cursor);
- if (index != -1) {
- _cursorCombo.select(index);
- } else {
- _cursorCombo.setText(cursor);
- }
- }
- }
-
- public void setVisible(boolean visible) {
- super.setVisible(visible);
-
- getApplyButton().setVisible(false);
- getDefaultsButton().setVisible(false);
- }
-
- private boolean isEmptyString(String str) {
- if (str == null || str.length() == 0) {
- return true;
- }
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/IStyleConstants.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/IStyleConstants.java
deleted file mode 100644
index 4a840d6..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/IStyleConstants.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.ui.dialogs;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public interface IStyleConstants {
- /**
- * attachment constants
- */
- final public static String[] ATTACHMENT = { "fixed", "scroll" };
-
- /**
- * auto constants
- */
- final public static String[] AUTO = { "auto" };
-
- /**
- * border style constants
- */
- final public static String[] BORDER_STYLE = { "none", "dotted", "dashed",
- "solid", "double", "groove", "ridge", "inset", "outset" };
-
- /**
- * border width constants
- */
- final public static String[] BORDER_WIDTH = { "thin", "medium", "thick" };
-
- /**
- * clear constants
- */
- final public static String[] CLEAR = { "left", "right", "both", "none" };
-
- /**
- * color constants
- */
- final public static String[] COLOR = { "black", "blue", "gray", "green",
- "orange", "red", "white", "yellow", "aqua", "fuchsia", "lime",
- "maroon", "navy", "olive", "purple", "silver", "teal" };
-
- /**
- * display constants
- */
- final public static String[] DISPLAY = { "none", "inline", "block",
- "list-item", "run-in", "compact", "marker", "table",
- "inline-table", "table-row-group", "table-header-group",
- "table-footer-group", "table-row", "table-column-group",
- "table-column", "table-cell", "table-caption" };
-
- /**
- * float constants
- */
- final public static String[] FLOAT = { "left", "right", "none" };
-
- /**
- * font family constants
- */
- final public static String[] FONT_FAMILY = { "Verdana, Arial, Sans-Serif",
- "Tahoma, Verdana, Arial, Sans-Serif", "\"Times New Roman\", Serif",
- "Georgia, \"Times New Roman\", Serif",
- "\"Book Antiqua\", \"Times New Roman\", Serif",
- "\"Comic Sans MS\", Sans-Serif", "\"Courier New\", Courier",
- "\"Trebuchet MS\", Sans-Serif" };
-
- /**
- * font size constants
- */
- final public static String[] FONT_SIZE_NUMBER = { "9", "10", "12", "14",
- "16", "18", "24", "36", "xx-small", "x-small", "small", "medium",
- "large", "x-large", "xx-large", "smaller", "larger" };
-
- /**
- * font style constants
- */
- final public static String[] FONT_STYLE = { "normal", "italic", "oblique" };
-
- /**
- * font transform constants
- */
- final public static String[] FONT_TEXTTRANSFORM = { "capitalize",
- "uppercase", "lowercase", "none" };
-
- /**
- * font variant constants
- */
- final public static String[] FONT_VARIANT = { "normal", "small-caps" };
-
- /**
- * font weight constants
- */
- final public static String[] FONT_WEIGHT = { "normal", "bold", "bolder",
- "lighter", "100", "200", "300", "400", "500", "600", "700", "800",
- "900" };
-
- /**
- * list position constants
- */
- final public static String[] LIST_POSITION = { "inside", "outside" };
-
- /**
- * list type constants
- */
- final public static String[] LIST_TYPE = { "disc", "circle", "sqaure",
- "decimal", "lower-roman", "upper-roman", "lower-alpha",
- "upper-alpah", "none" };
-
- /**
- * none
- */
- final public static String[] NONE = { "none" };
-
- /**
- * normal
- */
- final public static String[] NORMAL = { "normal" };
-
- /**
- * percent
- */
- final public static String[] PERCENT = { "%" };
-
- /**
- * position constants
- */
- final public static String[] POSITION = { "left", "center", "right" };
-
- /**
- * positioning type constants
- */
- final public static String[] POSITIONING_TYPE = { "absolute", "relative",
- "static" };
-
- /**
- * repeat constants
- */
- final public static String[] REPEAT = { "no-repeat", "repeat", "repeat-x",
- "repeat-y" };
-
- /**
- * unit of size constants
- */
- final public static String[] SIZE_UNIT = { "px", "pt", "in", "cm", "mm",
- "pc", "em", "ex", "%" };
-
- /**
- * text align constants
- */
- final public static String[] TEXT_ALIGN = { "left", "right", "center",
- "justify" };
-
- /**
- * text decoration constants
- */
- final public static String[] TEXT_DECORATION = { "underline", "overline",
- "line-through", "blink", "none" };
-
- /**
- * veritical align constants
- */
- final public static String[] VERTICAL_ALIGN = { "baseline", "sub", "super",
- "top", "text-top", "middle", "bottom", "text-bottom" };
-
- /**
- * white space constants
- */
- final public static String[] WHITE_SPACE = { "normal", "pre", "nowrap" };
-
- /**
- * visibility constants
- */
- final public static String[] VISIBILITY = { "inherit", "visible", "hidden" };
-
- /**
- * overflow constants
- */
- final public static String[] OVERFLOW = { "visible", "hidden", "scroll",
- "auto" };
-
- /**
- * page break constants
- */
- final public static String[] PAGE_BREAK = { "auto", "always", "left",
- "right" };
-
- /**
- * cursor constants
- */
- final public static String[] CURSOR = { "hand", "crosshair", "text",
- "wait", "default", "help", "e-resize", "ne-resize", "n-resize",
- "nw-resize", "w-resize", "sw-resize", "s-resize", "se-resize",
- "auto" };
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/ListPreferenceNode.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/ListPreferenceNode.java
deleted file mode 100644
index a0cd4a3..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/ListPreferenceNode.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.ui.dialogs;
-
-import org.eclipse.jface.preference.IPreferenceNode;
-import org.eclipse.jface.preference.IPreferencePage;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.css.core.internal.util.declaration.CSSPropertyContext;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class ListPreferenceNode implements IPreferenceNode {
- private ListPreferencePage _page;
-
- private IDOMElement _element;
-
- private CSSPropertyContext _style;
-
- /**
- * @param element
- * @param style
- */
- public ListPreferenceNode(IDOMElement element, CSSPropertyContext style) {
- super();
- _element = element;
- _style = style;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#add(org.eclipse.jface.preference.IPreferenceNode)
- */
- public void add(IPreferenceNode node) {
- // TODO:
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#createPage()
- */
- public void createPage() {
- _page = new ListPreferencePage(_element, _style);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#disposeResources()
- */
- public void disposeResources() {
- // TODO:
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#findSubNode(java.lang.String)
- */
- public IPreferenceNode findSubNode(String id) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getId()
- */
- public String getId() {
- return "List";
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getLabelImage()
- */
- public Image getLabelImage() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getLabelText()
- */
- public String getLabelText() {
- return DialogsMessages.getString("ListPreferenceNode.LabelText");
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getPage()
- */
- public IPreferencePage getPage() {
- return _page;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getSubNodes()
- */
- public IPreferenceNode[] getSubNodes() {
- return new IPreferenceNode[0];
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#remove(java.lang.String)
- */
- public IPreferenceNode remove(String id) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#remove(org.eclipse.jface.preference.IPreferenceNode)
- */
- public boolean remove(IPreferenceNode node) {
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/ListPreferencePage.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/ListPreferencePage.java
deleted file mode 100644
index eda6fa5..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/ListPreferencePage.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.ui.dialogs;
-
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.wst.css.core.internal.util.declaration.CSSPropertyContext;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class ListPreferencePage extends PreferencePage {
- private CSSPropertyContext _style;
-
- private StyleCombo _typeCombo, _imageCombo, _positionCombo;
-
- /**
- * @param element
- * @param style
- */
- public ListPreferencePage(IDOMElement element, CSSPropertyContext style) {
- super();
- _style = style;
-
- setTitle(DialogsMessages.getString("ListPreferencePage.Title")); //$NON-NLS-1$
- }
-
- /**
- * @see org.eclipse.jface.preference.
- * PreferencePage#createContents(Composite)
- */
- protected Control createContents(Composite parent) {
- GridLayout layout;
- GridData data;
-
- Composite top = new Composite(parent, SWT.NONE);
- layout = new GridLayout(2, false);
- data = new GridData(GridData.FILL_BOTH);
- top.setLayout(layout);
- top.setLayoutData(data);
-
- Label typeLabel = new Label(top, SWT.NONE);
- typeLabel.setText(DialogsMessages.getString("ListPreferencePage.Type")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- typeLabel.setLayoutData(data);
-
- _typeCombo = new StyleCombo(top, SWT.NONE);
- _typeCombo.setItems(IStyleConstants.LIST_TYPE);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _typeCombo.setLayoutData(data);
- _typeCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String type = _typeCombo.getText();
- _style.setListStyleType(type);
- }
- });
-
- Label imageLabel = new Label(top, SWT.NONE);
- imageLabel.setText(DialogsMessages
- .getString("ListPreferencePage.Image")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- imageLabel.setLayoutData(data);
-
- _imageCombo = new StyleCombo(top, SWT.NONE);
- _imageCombo.setItems(IStyleConstants.NONE);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _imageCombo.setLayoutData(data);
- _imageCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String image = _imageCombo.getText();
- _style.setListStyleImage(image);
- }
- });
-
- Label positionLabel = new Label(top, SWT.NONE);
- positionLabel.setText(DialogsMessages
- .getString("ListPreferencePage.Position")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- positionLabel.setLayoutData(data);
-
- _positionCombo = new StyleCombo(top, SWT.NONE);
- _positionCombo.setItems(IStyleConstants.LIST_POSITION);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _positionCombo.setLayoutData(data);
- _positionCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String position = _positionCombo.getText();
- _style.setListStylePosition(position);
- }
- });
-
- initializeControls();
-
- return top;
- }
-
- private void initializeControls() {
- // list-style-tyle
- String type = _style.getListStyleType();
- if (!isEmptyString(type)) {
- int index = _typeCombo.indexOf(type);
- if (index != -1) {
- _typeCombo.select(index);
- } else {
- _typeCombo.setText(type);
- }
- }
-
- // list-style-image
- String image = _style.getListStyleImage();
- if (!isEmptyString(image)) {
- int index = _imageCombo.indexOf(image);
- if (index != -1) {
- _imageCombo.select(index);
- } else {
- _imageCombo.setText(image);
- }
- }
-
- // list-style-position
- String position = _style.getListStylePosition();
- if (!isEmptyString(position)) {
- int index = _positionCombo.indexOf(position);
- if (index != -1) {
- _positionCombo.select(index);
- } else {
- _positionCombo.setText(position);
- }
- }
- }
-
- public void setVisible(boolean visible) {
- super.setVisible(visible);
-
- getApplyButton().setVisible(false);
- getDefaultsButton().setVisible(false);
- }
-
- private boolean isEmptyString(String str) {
- if (str == null || str.length() == 0) {
- return true;
- }
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/PositioningPreferenceNode.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/PositioningPreferenceNode.java
deleted file mode 100644
index 78f7576..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/PositioningPreferenceNode.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.ui.dialogs;
-
-import org.eclipse.jface.preference.IPreferenceNode;
-import org.eclipse.jface.preference.IPreferencePage;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.css.core.internal.util.declaration.CSSPropertyContext;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class PositioningPreferenceNode implements IPreferenceNode {
- private PositioningPreferencePage _page;
-
- private IDOMElement _element;
-
- private CSSPropertyContext _style;
-
- /**
- * @param element
- * @param style
- */
- public PositioningPreferenceNode(IDOMElement element,
- CSSPropertyContext style) {
- super();
- _element = element;
- _style = style;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#add(org.eclipse.jface.preference.IPreferenceNode)
- */
- public void add(IPreferenceNode node) {
- // TODO:
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#createPage()
- */
- public void createPage() {
- _page = new PositioningPreferencePage(_element, _style);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#disposeResources()
- */
- public void disposeResources() {
- // TODO:
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#findSubNode(java.lang.String)
- */
- public IPreferenceNode findSubNode(String id) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getId()
- */
- public String getId() {
- return "Positioning";
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getLabelImage()
- */
- public Image getLabelImage() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getLabelText()
- */
- public String getLabelText() {
- return DialogsMessages.getString("PositioningPreferenceNode.LabelText");
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getPage()
- */
- public IPreferencePage getPage() {
- return _page;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getSubNodes()
- */
- public IPreferenceNode[] getSubNodes() {
- return new IPreferenceNode[0];
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#remove(java.lang.String)
- */
- public IPreferenceNode remove(String id) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#remove(org.eclipse.jface.preference.IPreferenceNode)
- */
- public boolean remove(IPreferenceNode node) {
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/PositioningPreferencePage.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/PositioningPreferencePage.java
deleted file mode 100644
index 0d1c494..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/PositioningPreferencePage.java
+++ /dev/null
@@ -1,782 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.ui.dialogs;
-
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.wst.css.core.internal.util.declaration.CSSPropertyContext;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class PositioningPreferencePage extends PreferencePage {
- private CSSPropertyContext _style;
-
- private Combo _typeCombo, _visibilityCombo, _widthNumberCombo,
- _widthUnitCombo, _zIndexCombo, _heightNumberCombo,
- _heightUnitCombo, _overflowCombo;
-
- private Combo _placementTopNumberCombo, _placementRightNumberCombo,
- _placementBottomNumberCombo, _placementLeftNumberCombo;
-
- private Combo _placementTopUnitCombo, _placementRightUnitCombo,
- _placementBottomUnitCombo, _placementLeftUnitCombo;
-
- private Combo _clipTopNumberCombo, _clipRightNumberCombo,
- _clipBottomNumberCombo, _clipLeftNumberCombo;
-
- private Combo _clipTopUnitCombo, _clipRightUnitCombo, _clipBottomUnitCombo,
- _clipLeftUnitCombo;
-
- /**
- * @param element
- * @param style
- */
- public PositioningPreferencePage(IDOMElement element,
- CSSPropertyContext style) {
- super();
- _style = style;
-
- setTitle(DialogsMessages.getString("PositioningPreferencePage.Title")); //$NON-NLS-1$
- }
-
- /**
- * @see org.eclipse.jface.preference.
- * PreferencePage#createContents(Composite)
- */
- protected Control createContents(Composite parent) {
- GridLayout layout;
- GridData data;
-
- Composite top = new Composite(parent, SWT.NONE);
- layout = new GridLayout(6, false);
- data = new GridData(GridData.FILL_BOTH);
- top.setLayout(layout);
- top.setLayoutData(data);
-
- Label typeLabel = new Label(top, SWT.NONE);
- typeLabel.setText(DialogsMessages
- .getString("PositioningPreferencePage.Type")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- typeLabel.setLayoutData(data);
-
- _typeCombo = new Combo(top, SWT.NONE);
- _typeCombo.setItems(IStyleConstants.POSITIONING_TYPE);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 2;
- _typeCombo.setLayoutData(data);
- _typeCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String type = _typeCombo.getText();
- _style.setPosition(type);
- }
- });
-
- Label visibilityLabel = new Label(top, SWT.NONE);
- visibilityLabel.setText(DialogsMessages
- .getString("PositioningPreferencePage.Visibility")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- visibilityLabel.setLayoutData(data);
-
- _visibilityCombo = new Combo(top, SWT.NONE);
- _visibilityCombo.setItems(IStyleConstants.VISIBILITY);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _visibilityCombo.setLayoutData(data);
- _visibilityCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String visibility = _visibilityCombo.getText();
- _style.setVisibility(visibility);
- }
- });
-
- new Label(top, SWT.NONE);
-
- Label widthLabel = new Label(top, SWT.NONE);
- widthLabel.setText(DialogsMessages
- .getString("PositioningPreferencePage.Width")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- widthLabel.setLayoutData(data);
-
- _widthNumberCombo = new Combo(top, SWT.NONE);
- _widthNumberCombo.setItems(IStyleConstants.LIST_POSITION);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _widthNumberCombo.setLayoutData(data);
- _widthNumberCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- _widthUnitCombo.setEnabled(true);
- try {
- Integer.valueOf(_widthNumberCombo.getText());
- } catch (NumberFormatException ex) {
- _widthUnitCombo.setEnabled(false);
- }
-
- String width = _widthNumberCombo.getText();
- if (_widthUnitCombo.isEnabled()) {
- width += _widthUnitCombo.getText();
- }
-
- _style.setWidth(width);
- }
- });
-
- _widthUnitCombo = new Combo(top, SWT.READ_ONLY);
- _widthUnitCombo.setItems(IStyleConstants.SIZE_UNIT);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _widthUnitCombo.setLayoutData(data);
- _widthUnitCombo.select(0);
- _widthUnitCombo.setEnabled(false);
- _widthUnitCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String width = _widthNumberCombo.getText();
- if (_widthUnitCombo.isEnabled()) {
- width += _widthUnitCombo.getText();
- }
-
- _style.setWidth(width);
- }
- });
-
- Label zIndexLabel = new Label(top, SWT.NONE);
- zIndexLabel.setText(DialogsMessages
- .getString("PositioningPreferencePage.ZIndex")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- zIndexLabel.setLayoutData(data);
-
- _zIndexCombo = new Combo(top, SWT.NONE);
- _zIndexCombo.setItems(IStyleConstants.AUTO);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _zIndexCombo.setLayoutData(data);
- _zIndexCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String index = _zIndexCombo.getText();
- _style.setZIndex(index);
- }
- });
-
- new Label(top, SWT.NONE);
-
- Label heightLabel = new Label(top, SWT.NONE);
- heightLabel.setText(DialogsMessages
- .getString("PositioningPreferencePage.Height")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- heightLabel.setLayoutData(data);
-
- _heightNumberCombo = new Combo(top, SWT.NONE);
- _heightNumberCombo.setItems(IStyleConstants.LIST_POSITION);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _heightNumberCombo.setLayoutData(data);
- _heightNumberCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- _heightUnitCombo.setEnabled(true);
- try {
- Integer.valueOf(_heightNumberCombo.getText());
- } catch (NumberFormatException ex) {
- _heightUnitCombo.setEnabled(false);
- }
-
- String height = _heightNumberCombo.getText();
- if (_heightUnitCombo.isEnabled()) {
- height += _heightUnitCombo.getText();
- }
-
- _style.setHeight(height);
- }
- });
-
- _heightUnitCombo = new Combo(top, SWT.READ_ONLY);
- _heightUnitCombo.setItems(IStyleConstants.SIZE_UNIT);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _heightUnitCombo.setLayoutData(data);
- _heightUnitCombo.select(0);
- _heightUnitCombo.setEnabled(false);
- _heightUnitCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String height = _heightNumberCombo.getText();
- if (_heightUnitCombo.isEnabled()) {
- height += _heightUnitCombo.getText();
- }
-
- _style.setHeight(height);
- }
- });
-
- Label overflowLabel = new Label(top, SWT.NONE);
- overflowLabel.setText(DialogsMessages
- .getString("PositioningPreferencePage.Overflow")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- overflowLabel.setLayoutData(data);
-
- _overflowCombo = new Combo(top, SWT.NONE);
- _overflowCombo.setItems(IStyleConstants.OVERFLOW);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _overflowCombo.setLayoutData(data);
- _overflowCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String overflow = _overflowCombo.getText();
- _style.setOverflow(overflow);
- }
- });
-
- Group placementGroup = new Group(top, SWT.NONE);
- placementGroup.setText(DialogsMessages
- .getString("PositioningPreferencePage.Placement"));
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 3;
- data.verticalSpan = 4;
- placementGroup.setLayoutData(data);
- layout = new GridLayout(3, false);
- placementGroup.setLayout(layout);
-
- Label placementTopLabel = new Label(placementGroup, SWT.NONE);
- placementTopLabel.setText(DialogsMessages
- .getString("BoxPreferencePage.Top")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- placementTopLabel.setLayoutData(data);
-
- _placementTopNumberCombo = new Combo(placementGroup, SWT.NONE);
- _placementTopNumberCombo.setItems(IStyleConstants.AUTO);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _placementTopNumberCombo.setLayoutData(data);
- _placementTopNumberCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- _placementTopUnitCombo.setEnabled(true);
- try {
- Integer.valueOf(_placementTopNumberCombo.getText());
- } catch (NumberFormatException ex) {
- _placementTopUnitCombo.setEnabled(false);
- }
-
- String placement = _placementTopNumberCombo.getText();
- if (_placementTopUnitCombo.isEnabled()) {
- placement += _placementTopUnitCombo.getText();
- }
-
- _style.setTop(placement);
- }
- });
-
- _placementTopUnitCombo = new Combo(placementGroup, SWT.READ_ONLY);
- _placementTopUnitCombo.setItems(IStyleConstants.SIZE_UNIT);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _placementTopUnitCombo.setLayoutData(data);
- _placementTopUnitCombo.select(0);
- _placementTopUnitCombo.setEnabled(false);
- _placementTopUnitCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String placement = _placementTopNumberCombo.getText();
- if (_placementTopUnitCombo.isEnabled()) {
- placement += _placementTopUnitCombo.getText();
- }
-
- _style.setTop(placement);
- }
- });
-
- Label placementRightLabel = new Label(placementGroup, SWT.NONE);
- placementRightLabel.setText(DialogsMessages
- .getString("BoxPreferencePage.Right")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- placementRightLabel.setLayoutData(data);
-
- _placementRightNumberCombo = new Combo(placementGroup, SWT.NONE);
- _placementRightNumberCombo.setItems(IStyleConstants.AUTO);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _placementRightNumberCombo.setLayoutData(data);
- _placementRightNumberCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- _placementRightUnitCombo.setEnabled(true);
- try {
- Integer.valueOf(_placementRightNumberCombo.getText());
- } catch (NumberFormatException ex) {
- _placementRightUnitCombo.setEnabled(false);
- }
-
- String placement = _placementRightNumberCombo.getText();
- if (_placementRightUnitCombo.isEnabled()) {
- placement += _placementRightUnitCombo.getText();
- }
-
- _style.setRight(placement);
- }
- });
-
- _placementRightUnitCombo = new Combo(placementGroup, SWT.READ_ONLY);
- _placementRightUnitCombo.setItems(IStyleConstants.SIZE_UNIT);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _placementRightUnitCombo.setLayoutData(data);
- _placementRightUnitCombo.select(0);
- _placementRightUnitCombo.setEnabled(false);
- _placementRightUnitCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String placement = _placementRightNumberCombo.getText();
- if (_placementRightUnitCombo.isEnabled()) {
- placement += _placementRightUnitCombo.getText();
- }
-
- _style.setRight(placement);
- }
- });
-
- Label placementBottomLabel = new Label(placementGroup, SWT.NONE);
- placementBottomLabel.setText(DialogsMessages
- .getString("BoxPreferencePage.Bottom")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- placementBottomLabel.setLayoutData(data);
-
- _placementBottomNumberCombo = new Combo(placementGroup, SWT.NONE);
- _placementBottomNumberCombo.setItems(IStyleConstants.AUTO);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _placementBottomNumberCombo.setLayoutData(data);
- _placementBottomNumberCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- _placementBottomUnitCombo.setEnabled(true);
- try {
- Integer.valueOf(_placementBottomNumberCombo.getText());
- } catch (NumberFormatException ex) {
- _placementBottomUnitCombo.setEnabled(false);
- }
-
- String placement = _placementBottomNumberCombo.getText();
- if (_placementBottomUnitCombo.isEnabled()) {
- placement += _placementBottomUnitCombo.getText();
- }
-
- _style.setBottom(placement);
- }
- });
-
- _placementBottomUnitCombo = new Combo(placementGroup, SWT.READ_ONLY);
- _placementBottomUnitCombo.setItems(IStyleConstants.SIZE_UNIT);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _placementBottomUnitCombo.setLayoutData(data);
- _placementBottomUnitCombo.select(0);
- _placementBottomUnitCombo.setEnabled(false);
- _placementBottomUnitCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String placement = _placementBottomNumberCombo.getText();
- if (_placementBottomUnitCombo.isEnabled()) {
- placement += _placementBottomUnitCombo.getText();
- }
-
- _style.setBottom(placement);
- }
- });
-
- Label placementLeftLabel = new Label(placementGroup, SWT.NONE);
- placementLeftLabel.setText(DialogsMessages
- .getString("BoxPreferencePage.Left")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- placementLeftLabel.setLayoutData(data);
-
- _placementLeftNumberCombo = new Combo(placementGroup, SWT.NONE);
- _placementLeftNumberCombo.setItems(IStyleConstants.AUTO);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _placementLeftNumberCombo.setLayoutData(data);
- _placementLeftNumberCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- _placementLeftUnitCombo.setEnabled(true);
- try {
- Integer.valueOf(_placementLeftNumberCombo.getText());
- } catch (NumberFormatException ex) {
- _placementLeftUnitCombo.setEnabled(false);
- }
-
- String top1 = _placementLeftNumberCombo.getText();
- if (_placementLeftUnitCombo.isEnabled()) {
- top1 += _placementLeftUnitCombo.getText();
- }
-
- _style.setLeft(top1);
- }
- });
-
- _placementLeftUnitCombo = new Combo(placementGroup, SWT.READ_ONLY);
- _placementLeftUnitCombo.setItems(IStyleConstants.SIZE_UNIT);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _placementLeftUnitCombo.setLayoutData(data);
- _placementLeftUnitCombo.select(0);
- _placementLeftUnitCombo.setEnabled(false);
- _placementLeftUnitCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String top1 = _placementLeftNumberCombo.getText();
- if (_placementLeftUnitCombo.isEnabled()) {
- top1 += _placementLeftUnitCombo.getText();
- }
-
- _style.setLeft(top1);
- }
- });
-
- Group clipGroup = new Group(top, SWT.NONE);
- clipGroup.setText(DialogsMessages
- .getString("PositioningPreferencePage.Clip"));
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 3;
- data.verticalSpan = 4;
- clipGroup.setLayoutData(data);
- layout = new GridLayout(3, false);
- clipGroup.setLayout(layout);
-
- Label clipTopLabel = new Label(clipGroup, SWT.NONE);
- clipTopLabel
- .setText(DialogsMessages.getString("BoxPreferencePage.Top")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- clipTopLabel.setLayoutData(data);
-
- _clipTopNumberCombo = new Combo(clipGroup, SWT.NONE);
- _clipTopNumberCombo.setItems(IStyleConstants.AUTO);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _clipTopNumberCombo.setLayoutData(data);
- _clipTopNumberCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- _clipTopUnitCombo.setEnabled(true);
- try {
- Integer.valueOf(_clipTopNumberCombo.getText());
- } catch (NumberFormatException ex) {
- _clipTopUnitCombo.setEnabled(false);
- }
-
- String clip = _clipTopNumberCombo.getText();
- if (_clipTopUnitCombo.isEnabled()) {
- clip += _clipTopUnitCombo.getText();
- }
-
- _style.setClipTop(clip);
- }
- });
-
- _clipTopUnitCombo = new Combo(clipGroup, SWT.READ_ONLY);
- _clipTopUnitCombo.setItems(IStyleConstants.SIZE_UNIT);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _clipTopUnitCombo.setLayoutData(data);
- _clipTopUnitCombo.select(0);
- _clipTopUnitCombo.setEnabled(false);
- _clipTopUnitCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String clip = _clipTopNumberCombo.getText();
- if (_clipTopUnitCombo.isEnabled()) {
- clip += _clipTopUnitCombo.getText();
- }
-
- _style.setClipTop(clip);
- }
- });
-
- Label clipRightLabel = new Label(clipGroup, SWT.NONE);
- clipRightLabel.setText(DialogsMessages
- .getString("PositioningPreferencePage.Right")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- clipRightLabel.setLayoutData(data);
-
- _clipRightNumberCombo = new Combo(clipGroup, SWT.NONE);
- _clipRightNumberCombo.setItems(IStyleConstants.AUTO);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _clipRightNumberCombo.setLayoutData(data);
- _clipRightNumberCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- _clipRightUnitCombo.setEnabled(true);
- try {
- Integer.valueOf(_clipRightNumberCombo.getText());
- } catch (NumberFormatException ex) {
- _clipRightUnitCombo.setEnabled(false);
- }
-
- String clip = _clipRightNumberCombo.getText();
- if (_clipRightUnitCombo.isEnabled()) {
- clip += _clipRightUnitCombo.getText();
- }
-
- _style.setClipRight(clip);
- }
- });
-
- _clipRightUnitCombo = new Combo(clipGroup, SWT.READ_ONLY);
- _clipRightUnitCombo.setItems(IStyleConstants.SIZE_UNIT);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _clipRightUnitCombo.setLayoutData(data);
- _clipRightUnitCombo.select(0);
- _clipRightUnitCombo.setEnabled(false);
- _clipRightUnitCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String clip = _clipRightNumberCombo.getText();
- if (_clipRightUnitCombo.isEnabled()) {
- clip += _clipRightUnitCombo.getText();
- }
-
- _style.setClipRight(clip);
- }
- });
-
- Label clipBottomLabel = new Label(clipGroup, SWT.NONE);
- clipBottomLabel.setText(DialogsMessages
- .getString("PositioningPreferencePage.Bottom")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- clipBottomLabel.setLayoutData(data);
-
- _clipBottomNumberCombo = new Combo(clipGroup, SWT.NONE);
- _clipBottomNumberCombo.setItems(IStyleConstants.AUTO);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _clipBottomNumberCombo.setLayoutData(data);
- _clipBottomNumberCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- _clipBottomUnitCombo.setEnabled(true);
- try {
- Integer.valueOf(_clipBottomNumberCombo.getText());
- } catch (NumberFormatException ex) {
- _clipBottomUnitCombo.setEnabled(false);
- }
-
- String clip = _clipBottomNumberCombo.getText();
- if (_clipBottomUnitCombo.isEnabled()) {
- clip += _clipBottomUnitCombo.getText();
- }
-
- _style.setClipBottom(clip);
- }
- });
-
- _clipBottomUnitCombo = new Combo(clipGroup, SWT.READ_ONLY);
- _clipBottomUnitCombo.setItems(IStyleConstants.SIZE_UNIT);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _clipBottomUnitCombo.setLayoutData(data);
- _clipBottomUnitCombo.select(0);
- _clipBottomUnitCombo.setEnabled(false);
- _clipBottomUnitCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String clip = _clipBottomNumberCombo.getText();
- if (_clipBottomUnitCombo.isEnabled()) {
- clip += _clipBottomUnitCombo.getText();
- }
-
- _style.setClipBottom(clip);
- }
- });
-
- Label clipLeftLabel = new Label(clipGroup, SWT.NONE);
- clipLeftLabel.setText(DialogsMessages
- .getString("PositioningPreferencePage.Left")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- clipLeftLabel.setLayoutData(data);
-
- _clipLeftNumberCombo = new Combo(clipGroup, SWT.NONE);
- _clipLeftNumberCombo.setItems(IStyleConstants.AUTO);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _clipLeftNumberCombo.setLayoutData(data);
- _clipLeftNumberCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- _clipLeftUnitCombo.setEnabled(true);
- try {
- Integer.valueOf(_clipLeftNumberCombo.getText());
- } catch (NumberFormatException ex) {
- _clipLeftUnitCombo.setEnabled(false);
- }
-
- String top1 = _clipLeftNumberCombo.getText();
- if (_clipLeftUnitCombo.isEnabled()) {
- top1 += _clipLeftUnitCombo.getText();
- }
-
- _style.setClipLeft(top1);
- }
- });
-
- _clipLeftUnitCombo = new Combo(clipGroup, SWT.READ_ONLY);
- _clipLeftUnitCombo.setItems(IStyleConstants.SIZE_UNIT);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _clipLeftUnitCombo.setLayoutData(data);
- _clipLeftUnitCombo.select(0);
- _clipLeftUnitCombo.setEnabled(false);
- _clipLeftUnitCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String top1 = _clipLeftNumberCombo.getText();
- if (_clipLeftUnitCombo.isEnabled()) {
- top1 += _clipLeftUnitCombo.getText();
- }
-
- _style.setClipLeft(top1);
- }
- });
-
- initializeControls();
-
- return top;
- }
-
- private void initializeControls() {
- // position
- String position = _style.getPosition();
- if (!isEmptyString(position)) {
- int index = _typeCombo.indexOf(position);
- if (index != -1) {
- _typeCombo.select(index);
- } else {
- _typeCombo.setText(position);
- }
- }
-
- // visibility
- String visibility = _style.getVisibility();
- if (!isEmptyString(visibility)) {
- int index = _visibilityCombo.indexOf(visibility);
- if (index != -1) {
- _visibilityCombo.select(index);
- } else {
- _visibilityCombo.setText(visibility);
- }
- }
-
- // width
- String width = _style.getWidth();
- if (!isEmptyString(width)) {
- int index = _widthNumberCombo.indexOf(width);
- if (index != -1) {
- _widthNumberCombo.select(index);
- } else {
- _widthNumberCombo.setText(width);
- }
- }
-
- // z-index
- String zindex = _style.getZIndex();
- if (!isEmptyString(zindex)) {
- int index = _zIndexCombo.indexOf(zindex);
- if (index != -1) {
- _zIndexCombo.select(index);
- } else {
- _zIndexCombo.setText(zindex);
- }
- }
-
- // height
- String height = _style.getHeight();
- if (!isEmptyString(height)) {
- int index = _heightNumberCombo.indexOf(height);
- if (index != -1) {
- _heightNumberCombo.select(index);
- } else {
- _heightNumberCombo.setText(height);
- }
- }
-
- // overflow
- String overflow = _style.getOverflow();
- if (!isEmptyString(overflow)) {
- int index = _overflowCombo.indexOf(overflow);
- if (index != -1) {
- _overflowCombo.select(index);
- } else {
- _overflowCombo.setText(overflow);
- }
- }
-
- // placement
- String placement = _style.getTop();
- if (!isEmptyString(placement)) {
- int index = _placementTopNumberCombo.indexOf(placement);
- if (index != -1) {
- _placementTopNumberCombo.select(index);
- } else {
- _placementTopNumberCombo.setText(placement);
- }
- }
- placement = _style.getRight();
- if (!isEmptyString(placement)) {
- int index = _placementRightNumberCombo.indexOf(placement);
- if (index != -1) {
- _placementRightNumberCombo.select(index);
- } else {
- _placementRightNumberCombo.setText(placement);
- }
- }
- placement = _style.getBottom();
- if (!isEmptyString(placement)) {
- int index = _placementBottomNumberCombo.indexOf(placement);
- if (index != -1) {
- _placementBottomNumberCombo.select(index);
- } else {
- _placementBottomNumberCombo.setText(placement);
- }
- }
- placement = _style.getLeft();
- if (!isEmptyString(placement)) {
- int index = _placementLeftNumberCombo.indexOf(placement);
- if (index != -1) {
- _placementLeftNumberCombo.select(index);
- } else {
- _placementLeftNumberCombo.setText(placement);
- }
- }
-
- // clip
- String clip = _style.getClipTop();
- if (!isEmptyString(clip)) {
- int index = _clipTopNumberCombo.indexOf(clip);
- if (index != -1) {
- _clipTopNumberCombo.select(index);
- } else {
- _clipTopNumberCombo.setText(clip);
- }
- }
- clip = _style.getClipRight();
- if (!isEmptyString(clip)) {
- int index = _clipRightNumberCombo.indexOf(clip);
- if (index != -1) {
- _clipRightNumberCombo.select(index);
- } else {
- _clipRightNumberCombo.setText(clip);
- }
- }
- clip = _style.getClipBottom();
- if (!isEmptyString(clip)) {
- int index = _clipBottomNumberCombo.indexOf(clip);
- if (index != -1) {
- _clipBottomNumberCombo.select(index);
- } else {
- _clipBottomNumberCombo.setText(clip);
- }
- }
- clip = _style.getClipLeft();
- if (!isEmptyString(clip)) {
- int index = _clipLeftNumberCombo.indexOf(clip);
- if (index != -1) {
- _clipLeftNumberCombo.select(index);
- } else {
- _clipLeftNumberCombo.setText(clip);
- }
- }
- }
-
- public void setVisible(boolean visible) {
- super.setVisible(visible);
-
- getApplyButton().setVisible(false);
- getDefaultsButton().setVisible(false);
- }
-
- private boolean isEmptyString(String str) {
- if (str == null || str.length() == 0) {
- return true;
- }
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/StyleCombo.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/StyleCombo.java
deleted file mode 100644
index e50a885..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/StyleCombo.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.ui.dialogs;
-
-import org.eclipse.swt.events.ControlAdapter;
-import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class StyleCombo extends Combo {
-
- /**
- * @param parent
- * @param style
- */
- public StyleCombo(Composite parent, int style) {
- super(parent, style);
- this.addControlListener(new ControlAdapter() {
- public void controlResized(ControlEvent e) {
- Combo combo = (Combo) e.widget;
- combo.setSelection(new Point(0, 0));
- }
- });
- }
-
- protected void checkSubclass() {
- // override subclass validation, otherwise Widget.isValidSubclass
- // will throw an error
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/StyleDialog.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/StyleDialog.java
deleted file mode 100644
index ee269aa..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/StyleDialog.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.ui.dialogs;
-
-import org.eclipse.jface.preference.PreferenceDialog;
-import org.eclipse.jface.preference.PreferenceManager;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.css.core.internal.util.declaration.CSSPropertyContext;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class StyleDialog extends PreferenceDialog {
- /**
- * @param parentShell
- * @param manager
- * @param element
- * @param style
- */
- public StyleDialog(Shell parentShell, PreferenceManager manager,
- IDOMElement element, CSSPropertyContext style) {
- super(parentShell, manager);
- manager.addToRoot(new TextPreferenceNode(element, style));
- manager.addToRoot(new BackgroudPreferenceNode(element, style));
- manager.addToRoot(new BlockPreferenceNode(element, style));
- manager.addToRoot(new BoxPreferenceNode(element, style));
- manager.addToRoot(new BorderPreferenceNode(element, style));
- manager.addToRoot(new ListPreferenceNode(element, style));
- manager.addToRoot(new PositioningPreferenceNode(element, style));
- manager.addToRoot(new ExtensionsPreferenceNode(element, style));
- }
-
- protected Control createDialogArea(Composite parent) {
- Control control = super.createDialogArea(parent);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(control,
- PDPlugin.getResourceString("StyleDialog.help.id"));
- PlatformUI.getWorkbench().getHelpSystem().setHelp(
- getTreeViewer().getControl(),
- PDPlugin.getResourceString("StyleDialog.help.id"));
- return control;
- }
-
- protected void update() {
- super.update();
- getShell().setText(DialogsMessages.getString("StyleDialog.Title"));
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/TextPreferenceNode.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/TextPreferenceNode.java
deleted file mode 100644
index f01913e..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/TextPreferenceNode.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.ui.dialogs;
-
-import org.eclipse.jface.preference.IPreferenceNode;
-import org.eclipse.jface.preference.IPreferencePage;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.css.core.internal.util.declaration.CSSPropertyContext;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class TextPreferenceNode implements IPreferenceNode {
- private TextPreferencePage _page;
-
- private CSSPropertyContext _style;
-
- private IDOMElement _element;
-
- /**
- * @param element
- * @param style
- */
- public TextPreferenceNode(IDOMElement element, CSSPropertyContext style) {
- super();
- _element = element;
- _style = style;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#add(org.eclipse.jface.preference.IPreferenceNode)
- */
- public void add(IPreferenceNode node) {
- // TODO:
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#createPage()
- */
- public void createPage() {
- _page = new TextPreferencePage(_element, _style);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#disposeResources()
- */
- public void disposeResources() {
- // TODO:
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#findSubNode(java.lang.String)
- */
- public IPreferenceNode findSubNode(String id) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getId()
- */
- public String getId() {
- return "Text";
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getLabelImage()
- */
- public Image getLabelImage() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getLabelText()
- */
- public String getLabelText() {
- return DialogsMessages.getString("TextPreferenceNode.LabelText");
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getPage()
- */
- public IPreferencePage getPage() {
- return _page;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#getSubNodes()
- */
- public IPreferenceNode[] getSubNodes() {
- return new IPreferenceNode[0];
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#remove(java.lang.String)
- */
- public IPreferenceNode remove(String id) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferenceNode#remove(org.eclipse.jface.preference.IPreferenceNode)
- */
- public boolean remove(IPreferenceNode node) {
- return false;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/TextPreferencePage.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/TextPreferencePage.java
deleted file mode 100644
index abb291d..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/dialogs/TextPreferencePage.java
+++ /dev/null
@@ -1,525 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.ui.dialogs;
-
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.ColorButtonDialogField;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.DialogField;
-import org.eclipse.jst.jsf.common.ui.internal.dialogfield.IDialogFieldApplyListener;
-import org.eclipse.swt.SWT;
-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.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.wst.css.core.internal.util.declaration.CSSPropertyContext;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class TextPreferencePage extends PreferencePage {
- private CSSPropertyContext _style;
-
- private StyleCombo _fontFamilyCombo, _fontSizeNumberCombo,
- _fontSizeUnitCombo, _fontWeightCombo, _fontStyleCombo,
- _fontVariantCombo, _fontLineHeightNumberCombo,
- _fontLineHeightUnitCombo, _textTransformCombo;
-
- private ColorButtonDialogField _colorField;
-
- private Button _textDecorationUnderlineButton,
- _textDecorationOverlineButton, _textDecorationLineThroughButton,
- _textDecorationBlinkButton, _textDecorationNoneButton;
-
- /**
- * @param element
- * @param style
- */
- public TextPreferencePage(IDOMElement element, CSSPropertyContext style) {
- super();
- _style = style;
-
- // Set the preference store for the preference page.
- // IPreferenceStore store =
- // JMTIntegrationPlugin.getDefault().getPreferenceStore();
- // setPreferenceStore(store);
- setTitle(DialogsMessages.getString("TextPreferencePage.Title")); //$NON-NLS-1$
- }
-
- /**
- * @see org.eclipse.jface.preference.
- * PreferencePage#createContents(Composite)
- */
- protected Control createContents(Composite parent) {
- GridLayout layout;
- GridData data;
-
- Composite top = new Composite(parent, SWT.NONE);
- layout = new GridLayout(5, false);
- data = new GridData(GridData.FILL_BOTH);
- top.setLayout(layout);
- top.setLayoutData(data);
-
- Label fontLabel = new Label(top, SWT.NONE);
- fontLabel.setText(DialogsMessages.getString("TextPreferencePage.Font")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- fontLabel.setLayoutData(data);
-
- _fontFamilyCombo = new StyleCombo(top, SWT.NONE);
- _fontFamilyCombo.setItems(IStyleConstants.FONT_FAMILY);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 4;
- _fontFamilyCombo.setLayoutData(data);
- _fontFamilyCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- _style.setFontFamily(_fontFamilyCombo.getText());
- }
- });
-
- Label sizeLabel = new Label(top, SWT.NONE);
- sizeLabel.setText(DialogsMessages.getString("TextPreferencePage.Size")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- sizeLabel.setLayoutData(data);
-
- _fontSizeNumberCombo = new StyleCombo(top, SWT.NONE);
- _fontSizeNumberCombo.setItems(IStyleConstants.FONT_SIZE_NUMBER);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _fontSizeNumberCombo.setLayoutData(data);
- _fontSizeNumberCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- _fontSizeUnitCombo.setEnabled(true);
- try {
- Integer.valueOf(_fontSizeNumberCombo.getText());
- } catch (NumberFormatException ex) {
- _fontSizeUnitCombo.setEnabled(false);
- }
-
- String size = _fontSizeNumberCombo.getText();
- if (_fontSizeUnitCombo.isEnabled()) {
- size += _fontSizeUnitCombo.getText();
- }
-
- _style.setFontSize(size);
- }
- });
-
- _fontSizeUnitCombo = new StyleCombo(top, SWT.READ_ONLY);
- _fontSizeUnitCombo.setItems(IStyleConstants.SIZE_UNIT);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _fontSizeUnitCombo.setLayoutData(data);
- _fontSizeUnitCombo.select(0);
- _fontSizeUnitCombo.setEnabled(false);
- _fontSizeUnitCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String size = _fontSizeNumberCombo.getText();
- if (_fontSizeUnitCombo.isEnabled()) {
- size += _fontSizeUnitCombo.getText();
- }
-
- _style.setFontSize(size);
- }
- });
-
- Label weightLabel = new Label(top, SWT.NONE);
- weightLabel.setText(DialogsMessages
- .getString("TextPreferencePage.Weight")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- weightLabel.setLayoutData(data);
-
- _fontWeightCombo = new StyleCombo(top, SWT.NONE);
- _fontWeightCombo.setItems(IStyleConstants.FONT_WEIGHT);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _fontWeightCombo.setLayoutData(data);
- _fontWeightCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String weight = _fontWeightCombo.getText();
- _style.setFontWeight(weight);
- }
- });
-
- Label stylesLabel = new Label(top, SWT.NONE);
- stylesLabel.setText(DialogsMessages
- .getString("TextPreferencePage.Style")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- stylesLabel.setLayoutData(data);
-
- _fontStyleCombo = new StyleCombo(top, SWT.NONE);
- _fontStyleCombo.setItems(IStyleConstants.FONT_STYLE);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _fontStyleCombo.setLayoutData(data);
- _fontStyleCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String style = _fontStyleCombo.getText();
- _style.setFontStyle(style);
- }
- });
-
- new Label(top, SWT.NONE);
-
- Label variantLabel = new Label(top, SWT.NONE);
- variantLabel.setText(DialogsMessages
- .getString("TextPreferencePage.Variant")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- variantLabel.setLayoutData(data);
-
- _fontVariantCombo = new StyleCombo(top, SWT.NONE);
- _fontVariantCombo.setItems(IStyleConstants.FONT_VARIANT);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _fontVariantCombo.setLayoutData(data);
- _fontVariantCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String variant = _fontVariantCombo.getText();
- _style.setFontVariant(variant);
- }
- });
-
- Label lineHeightLabel = new Label(top, SWT.NONE);
- lineHeightLabel.setText(DialogsMessages
- .getString("TextPreferencePage.LineHeight")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- lineHeightLabel.setLayoutData(data);
-
- _fontLineHeightNumberCombo = new StyleCombo(top, SWT.NONE);
- _fontLineHeightNumberCombo.setItems(IStyleConstants.NORMAL);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _fontLineHeightNumberCombo.setLayoutData(data);
- _fontLineHeightNumberCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- _fontLineHeightUnitCombo.setEnabled(true);
- try {
- Integer.valueOf(_fontLineHeightNumberCombo.getText());
- } catch (NumberFormatException ex) {
- _fontLineHeightUnitCombo.setEnabled(false);
- }
-
- String height = _fontLineHeightNumberCombo.getText();
- if (_fontLineHeightUnitCombo.isEnabled()) {
- height += _fontLineHeightUnitCombo.getText();
- }
-
- _style.setLineHeight(height);
- }
- });
-
- _fontLineHeightUnitCombo = new StyleCombo(top, SWT.READ_ONLY);
- _fontLineHeightUnitCombo.setItems(IStyleConstants.SIZE_UNIT);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _fontLineHeightUnitCombo.setLayoutData(data);
- _fontLineHeightUnitCombo.select(0);
- _fontLineHeightUnitCombo.setEnabled(false);
- _fontLineHeightUnitCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String height = _fontLineHeightNumberCombo.getText();
- if (_fontLineHeightUnitCombo.isEnabled()) {
- height += _fontLineHeightUnitCombo.getText();
- }
-
- _style.setLineHeight(height);
- }
- });
-
- Label caseLabel = new Label(top, SWT.NONE);
- caseLabel.setText(DialogsMessages.getString("TextPreferencePage.Case")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- caseLabel.setLayoutData(data);
-
- _textTransformCombo = new StyleCombo(top, SWT.NONE);
- _textTransformCombo.setItems(IStyleConstants.FONT_TEXTTRANSFORM);
- data = new GridData(GridData.FILL_HORIZONTAL);
- _textTransformCombo.setLayoutData(data);
- _textTransformCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String textTransform = _textTransformCombo.getText();
- _style.setTextTransform(textTransform);
- }
- });
-
- Label decorationLabel = new Label(top, SWT.NONE);
- decorationLabel.setText(DialogsMessages
- .getString("TextPreferencePage.Decoration")); //$NON-NLS-1$
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- decorationLabel.setLayoutData(data);
-
- Composite decorationComposite = new Composite(top, SWT.NONE);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 4;
- decorationComposite.setLayoutData(data);
- layout = new GridLayout(5, true);
- layout.marginWidth = 0;
- decorationComposite.setLayout(layout);
-
- _textDecorationUnderlineButton = new Button(decorationComposite,
- SWT.CHECK);
- _textDecorationUnderlineButton
- .setText(IStyleConstants.TEXT_DECORATION[0]);
- _textDecorationUnderlineButton
- .addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (_textDecorationUnderlineButton.getSelection()) {
- _textDecorationNoneButton.setSelection(false);
- }
- _style.setTextDecoration(getTextDecoration());
- }
- });
-
- _textDecorationOverlineButton = new Button(decorationComposite,
- SWT.CHECK);
- _textDecorationOverlineButton
- .setText(IStyleConstants.TEXT_DECORATION[1]);
- _textDecorationOverlineButton
- .addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (_textDecorationOverlineButton.getSelection()) {
- _textDecorationNoneButton.setSelection(false);
- }
- _style.setTextDecoration(getTextDecoration());
- }
- });
-
- _textDecorationLineThroughButton = new Button(decorationComposite,
- SWT.CHECK);
- _textDecorationLineThroughButton
- .setText(IStyleConstants.TEXT_DECORATION[2]);
- _textDecorationLineThroughButton
- .addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (_textDecorationLineThroughButton.getSelection()) {
- _textDecorationNoneButton.setSelection(false);
- }
- _style.setTextDecoration(getTextDecoration());
- }
- });
-
- _textDecorationBlinkButton = new Button(decorationComposite, SWT.CHECK);
- _textDecorationBlinkButton.setText(IStyleConstants.TEXT_DECORATION[3]);
- _textDecorationBlinkButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (_textDecorationBlinkButton.getSelection()) {
- _textDecorationNoneButton.setSelection(false);
- }
- _style.setTextDecoration(getTextDecoration());
- }
- });
-
- _textDecorationNoneButton = new Button(decorationComposite, SWT.CHECK);
- _textDecorationNoneButton.setText(IStyleConstants.TEXT_DECORATION[4]);
- _textDecorationNoneButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (_textDecorationNoneButton.getSelection()) {
- _textDecorationUnderlineButton.setSelection(false);
- _textDecorationOverlineButton.setSelection(false);
- _textDecorationLineThroughButton.setSelection(false);
- _textDecorationBlinkButton.setSelection(false);
- }
- _style.setTextDecoration(getTextDecoration());
- }
- });
-
- _colorField = new ColorButtonDialogField(SWT.BORDER, new ColorUtil());
- _colorField.setLabelText(DialogsMessages
- .getString("TextPreferencePage.Color"));
-
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- _colorField.getLabelControl(null, top).setLayoutData(data);
-
- data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = false;
- _colorField.getComboControl(null, top).setLayoutData(data);
-
- data = new GridData();
- _colorField.getChangeControl(null, top).setLayoutData(data);
- _colorField
- .setDialogFieldApplyListener(new IDialogFieldApplyListener() {
- public void dialogFieldApplied(DialogField field) {
- String color = _colorField.getText();
- _style.setColor(color);
- }
- });
-
- initializeControls();
-
- return top;
- }
-
- private void initializeControls() {
- // font-family
- String fontFamily = _style.getFontFamily();
- if (!isEmptyString(fontFamily)) {
- int index = _fontFamilyCombo.indexOf(fontFamily);
- if (index != -1) {
- _fontFamilyCombo.select(index);
- } else {
- _fontFamilyCombo.setText(fontFamily);
- }
- }
-
- // font-size
- String fontSize = _style.getFontSize();
- if (!isEmptyString(fontSize)) {
- int index = _fontSizeNumberCombo.indexOf(fontSize);
- if (index != -1) {
- _fontSizeNumberCombo.select(index);
- } else {
- _fontSizeNumberCombo.setText(fontSize);
- }
- }
-
- // font-weight
- String fontWeight = _style.getFontWeight();
- if (!isEmptyString(fontWeight)) {
- int index = _fontWeightCombo.indexOf(fontWeight);
- if (index != -1) {
- _fontWeightCombo.select(index);
- } else {
- _fontWeightCombo.setText(fontWeight);
- }
- }
-
- // font-style
- String fontStyle = _style.getFontStyle();
- if (!isEmptyString(fontStyle)) {
- int index = _fontStyleCombo.indexOf(fontStyle);
- if (index != -1) {
- _fontStyleCombo.select(index);
- } else {
- _fontStyleCombo.setText(fontStyle);
- }
- }
-
- // font-variant
- String fontVariant = _style.getFontVariant();
- if (!isEmptyString(fontVariant)) {
- int index = _fontVariantCombo.indexOf(fontVariant);
- if (index != -1) {
- _fontVariantCombo.select(index);
- } else {
- _fontVariantCombo.setText(fontVariant);
- }
- }
-
- // line-height
- String lineHeight = _style.getLineHeight();
- if (!isEmptyString(lineHeight)) {
- int index = _fontLineHeightNumberCombo.indexOf(lineHeight);
- if (index != -1) {
- _fontLineHeightNumberCombo.select(index);
- } else {
- _fontLineHeightNumberCombo.setText(lineHeight);
- }
- }
-
- // text-transform
- String textTransform = _style.getTextTransform();
- if (!isEmptyString(textTransform)) {
- int index = _textTransformCombo.indexOf(textTransform);
- if (index != -1) {
- _textTransformCombo.select(index);
- } else {
- _textTransformCombo.setText(textTransform);
- }
- }
-
- // text-decoration
- String textDecoration = _style.getTextDecoration();
- if (!isEmptyString(textDecoration)) {
- int index = textDecoration
- .indexOf(IStyleConstants.TEXT_DECORATION[0]);
- if (index != -1) {
- _textDecorationUnderlineButton.setSelection(true);
- } else {
- _textDecorationUnderlineButton.setSelection(false);
- }
-
- index = textDecoration.indexOf(IStyleConstants.TEXT_DECORATION[1]);
- if (index != -1) {
- _textDecorationOverlineButton.setSelection(true);
- } else {
- _textDecorationOverlineButton.setSelection(false);
- }
-
- index = textDecoration.indexOf(IStyleConstants.TEXT_DECORATION[2]);
- if (index != -1) {
- _textDecorationLineThroughButton.setSelection(true);
- } else {
- _textDecorationLineThroughButton.setSelection(false);
- }
-
- index = textDecoration.indexOf(IStyleConstants.TEXT_DECORATION[3]);
- if (index != -1) {
- _textDecorationBlinkButton.setSelection(true);
- } else {
- _textDecorationBlinkButton.setSelection(false);
- }
-
- index = textDecoration.indexOf(IStyleConstants.TEXT_DECORATION[4]);
- if (index != -1) {
- _textDecorationNoneButton.setSelection(true);
- } else {
- _textDecorationNoneButton.setSelection(false);
- }
- }
-
- // color
- String color = _style.getColor();
- if (!isEmptyString(color)) {
- _colorField.setTextWithoutUpdate(color);
- }
- }
-
- private String getTextDecoration() {
- StringBuffer textDecoration = new StringBuffer();
- if (_textDecorationUnderlineButton.getSelection()) {
- textDecoration.append(_textDecorationUnderlineButton.getText())
- .append(' ');
- }
- if (_textDecorationOverlineButton.getSelection()) {
- textDecoration.append(_textDecorationOverlineButton.getText())
- .append(' ');
- }
- if (_textDecorationLineThroughButton.getSelection()) {
- textDecoration.append(_textDecorationLineThroughButton.getText())
- .append(' ');
- }
- if (_textDecorationBlinkButton.getSelection()) {
- textDecoration.append(_textDecorationBlinkButton.getText()).append(
- ' ');
- }
- if (_textDecorationNoneButton.getSelection()) {
- textDecoration.append(_textDecorationNoneButton.getText()).append(
- ' ');
- }
-
- return textDecoration.toString().trim();
- }
-
- public void setVisible(boolean visible) {
- super.setVisible(visible);
-
- getApplyButton().setVisible(false);
- getDefaultsButton().setVisible(false);
- }
-
- private boolean isEmptyString(String str) {
- if (str == null || str.length() == 0) {
- return true;
- }
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/BodyHelper.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/BodyHelper.java
deleted file mode 100644
index 2a20b1a..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/BodyHelper.java
+++ /dev/null
@@ -1,345 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.utils;
-
-import java.util.ArrayList;
-import java.util.Comparator;
-
-import javax.xml.namespace.QName;
-
-import org.eclipse.jst.jsf.core.internal.tld.CMUtil;
-import org.eclipse.jst.jsf.core.internal.tld.ITLDConstants;
-import org.eclipse.jst.pagedesigner.adapters.IBodyInfo;
-import org.eclipse.jst.pagedesigner.adapters.internal.BodyInfo;
-import org.eclipse.jst.pagedesigner.dom.DOMPosition;
-import org.eclipse.jst.pagedesigner.dom.DOMRefPosition;
-import org.eclipse.jst.pagedesigner.dom.DOMRefPosition2;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * This class helps location insertion position to inside correct body or doc
- * prefix. NOTE: this class only doing limited support on doc level position
- * validation. Element specific position validation will be done in other
- * places.
- *
- * @author mengbo
- */
-public class BodyHelper {
- // bit flags used for child skipping.
- /**
- * Bit flag for empty text node
- */
- public static final int EMPTY_TEXT = 1;
-
- /**
- * Bit flag for comment node
- */
- public static final int COMMENT = 2;
-
- /**
- * Bit flag for HEAD node
- */
- public static final int HEADER = 3;
-
- /**
- *
- * @param child
- * @return boolean
- */
- private static boolean isSkippableChild(Node parent, Node child, int flag) {
- if ((flag & COMMENT) != 0 && child.getNodeType() == Node.COMMENT_NODE)
- return true;
- if ((flag & EMPTY_TEXT) != 0 && child instanceof IDOMText
- && ((IDOMText) child).isElementContentWhitespace())
- return true;
-
- if ((flag & HEADER) != 0 && child.getNodeType() == Node.ELEMENT_NODE) {
- String uri = CMUtil.getElementNamespaceURI((Element) child);
- IBodyInfo parentInfo = getBodyInfo((IDOMNode) parent);
- if (parentInfo != null
- && parentInfo.isBodyHeader((IDOMNode) parent, uri,
- ((Element) child).getLocalName()))
- return true;
- }
- return false;
- }
-
- /**
- * check whether uri/tag should be header of any body container that is
- * ancester of the start node.
- *
- * @param start
- * @param uri
- * @param tag
- * @return IDOMNode
- */
- public static IDOMNode findHeaderContainer(IDOMNode start, String uri,
- String tag) {
- while (start != null) {
- IBodyInfo designInfo = getBodyInfo(start);
- if (designInfo != null && designInfo.isBodyContainer(start)) {
- if (designInfo.isBodyHeader(start, uri, tag))
- return start;
- }
- start = (IDOMNode) start.getParentNode();
- }
- return null;
- }
-
- /**
- * find the closest body insertion point, to make it as deep as possible.
- * (Move into as more body as possible)
- * @param position
- * @return IDOMPosition
- */
- public static IDOMPosition findBodyInsertLocation(IDOMPosition position) {
- // forward first.
- Node reference = position.getNextSiblingNode();
- Node container = position.getContainerNode();
- while (reference != null) {
- IBodyInfo info = getBodyInfo((IDOMNode) reference);
- if (info != null && info.isBodyContainer((IDOMNode) reference)) {
- // good, we find a body!
- position = new DOMPosition(reference, 0);
- return findBodyInsertLocation(position);
- }
- if (isSkippableChild(container, reference, EMPTY_TEXT | COMMENT
- | HEADER)) {
- reference = reference.getNextSibling();
- continue;
- }
- break;
- }
-
- // backward
- reference = position.getPreviousSiblingNode();
- while (reference != null) {
- IBodyInfo info = getBodyInfo((IDOMNode) reference);
- if (info != null && info.isBodyContainer((IDOMNode) reference)) {
- // good, we find a body!
- position = new DOMPosition(reference, reference.getChildNodes()
- .getLength());
- return findBodyInsertLocation(position);
- }
- // XXX: not skip header here. So if there is some header with wrong
- // location, we will respect user.
- if (isSkippableChild(container, reference, EMPTY_TEXT | COMMENT)) {
- reference = reference.getPreviousSibling();
- continue;
- }
- break;
- }
-
- // not find any body at same level as the insertion point.
- return position;
- }
-
- /**
- * The element type identified by "uri" and "tag" is going to be inserted
- * into the document. This method is used to adjust the insert position so
- * it can be put into correct body or header section.
- * @param uri
- * @param tag
- * @param position
- * @return IDOMPosition
- *
- */
- public static IDOMPosition adjustInsertPosition(String uri, String tag,
- IDOMPosition position) {
- IDOMNode parent = (IDOMNode) position.getContainerNode();
- IBodyInfo designInfo = getBodyInfo(parent);
- if (designInfo == null) {
- return position; // should not happen.
- }
-
- IDOMNode headerContainer = findHeaderContainer(parent, uri, tag);
-
- if (headerContainer == null) {
- // the new node is not header.
- if (shouldIgnoreAdjust(uri, tag)) {
- return position;
- }
-
- // new node is not body header. So should place inside the inner most
- // body.
- if (!designInfo.isBodyContainer(parent)) {
- return position; // it's parent is not body, so we suggest
- // it's parent already correctly located, and respect user's
- // choice.
- }
-
- // ok, we are inside some body, but we don't know whether we are in
- // the inner most body.
- // try to find a body container at same level and see whether we can
- // move into that body.
- return findBodyInsertLocation(position);
- }
- // good, we find a body container and the new node should be header
- // of it.
- Node child = headerContainer.getFirstChild();
-
- // if parent is different from headerContainer, then
- // child!=referenceHolder[0] will always be true
- while (child != null) // && child != refNode)
- {
- Comparator comp = NodeLocationComparator.getInstance();
- // Currently the comparator deels with tags like taglib and
- // loadbundle particularly, comparasion result 0
- // means it didn't compare the tags.
- if (comp.compare(child, tag) < 0
- || (comp.compare(child, tag) == 0 && isSkippableChild(
- headerContainer, child, COMMENT | EMPTY_TEXT
- | HEADER))) {
- child = child.getNextSibling();
- } else {
- break;
- }
- }
- if (child != null) {
- return new DOMRefPosition(child, false);
- }
- return new DOMPosition(parent, parent.getChildNodes()
- .getLength());
- }
-
- /**
- * Find the position to insert a header element into the specified parent.
- *
- * @param uri
- * @param tag
- * @param parent
- * @param ref
- */
- public static void findHeaderInsertPosition(String uri, String tag,
- Node parent, Node[] ref) {
- Node child = parent.getFirstChild();
- while (child != null) {
- Comparator comp = NodeLocationComparator.getInstance();
- if (comp.compare(child, tag) < 0
- || (comp.compare(child, tag) == 0 && isSkippableChild(
- parent, child, COMMENT | EMPTY_TEXT | HEADER))) {
- child = child.getNextSibling();
- } else {
- break;
- }
- }
- ref[0] = child;
- return;
- }
-
- /**
- * @param position
- * @param body
- * @param defaultPrefix
- * @return the new dom position based on the insert. May return null if
- * insert fails.
- */
- public static IDOMPosition insertBody(IDOMPosition position, QName body,
- String defaultPrefix) {
- IBodyInfo bodyInfo = getBodyInfo((IDOMNode) position.getContainerNode());
-
- Node node = position.getContainerNode();
- final Node originalContainer = node;
- final Node nextSibling = position.getNextSiblingNode();
-
- // create the body element first.
- Document ownerDoc;
- if (node instanceof Document) {
- ownerDoc = (Document) node;
- } else {
- ownerDoc = node.getOwnerDocument();
- }
- if (ownerDoc == null) {
- return null; // should not happen
- }
-
- final String prefix = JSPUtil.getOrCreatePrefix(((IDOMNode) node).getModel(),
- body.getNamespaceURI(), defaultPrefix);
- final Element ele = ownerDoc.createElement((prefix == null ? ""
- : (prefix + ":"))
- + body.getLocalPart());
-
- // need to find out the insertion point
- while (node instanceof IDOMNode) {
- if (bodyInfo.isBodyContainer((IDOMNode) node)) {
- // ok, node is a body container.
- // we could create the new node as child of node and move all
- // node's none header children
- // as children of the new node.
-
- NodeList nl = node.getChildNodes();
- ArrayList list = new ArrayList();
- for (int i = 0; i < nl.getLength(); i++) {
- Node child = nl.item(i);
- if (isSkippableChild(node, child, HEADER | COMMENT
- | EMPTY_TEXT)) {
- continue;
- }
- list.add(nl.item(i));
- }
- for (int i = 0; i < list.size(); i++) {
- ele.appendChild((Node) list.get(i));
- }
- node.appendChild(ele);
-
- if (node == originalContainer) {
- if (nextSibling == null) {
- return new DOMRefPosition2(ele, true);
- } else if (nextSibling.getParentNode() == ele) {
- // next sibling is not in header part
- return new DOMRefPosition(nextSibling, false);
- } else {
- return new DOMPosition(ele, 0);
- }
- }
- return position;
- }
- node = node.getParentNode();
- }
- // should not happen, because document and documentfragment node will
- // always be body node
- // so if reach here, means the position is not in document.
- return null;
- }
-
- /**
- * For certain special tags, do not following the "header"/"body" separation
- * and can't fit into the relocation process.
- *
- * @param uri
- * @param tag
- * @return true if tag is an element that should be moved in response to
- * body insert.
- */
- public static boolean shouldIgnoreAdjust(String uri, String tag) {
- // FIXME:
- return (ITLDConstants.URI_HTML.equalsIgnoreCase(uri) && "script"
- .equalsIgnoreCase(tag))
- || (ITLDConstants.URI_JSP.equals(uri));
- }
-
- /**
- * @param node
- * @return the body info corresponding to node (should we use a node adapter?)
- */
- public static IBodyInfo getBodyInfo(IDOMNode node) {
- // TODO: in the future, when bodyinfo is no longer singleton, we'll use
- // adapter mechanism.
- return BodyInfo.getInstance();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/CacheManager.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/CacheManager.java
deleted file mode 100644
index 5483281..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/CacheManager.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.utils;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.Map;
-
-/**
- * This is a cache manager. It will use the ICacheEntryCreator interface to
- * manage creating new item and dispose old item.
- *
- * @author mengbo
- * @version 1.5
- */
-public class CacheManager {
- ICacheEntryCreator _creator;
-
- int _maxSize;
-
- // key --> value
- Map _map = new HashMap();
-
- // keep track of LRU
- LinkedList _keys = new LinkedList();
-
- /**
- * @param creator
- * @param maxSize
- */
- public CacheManager(ICacheEntryCreator creator, int maxSize) {
- _creator = creator;
- _maxSize = maxSize;
- if (_maxSize <= 0) {
- _maxSize = 10;
- }
- }
-
- /**
- * @param key
- * @return the cache entry for key
- */
- public Object getEntry(Object key) {
- Object result = _map.get(key);
- if (result == null) {
- // not existed yet.
- if (_map.size() >= _maxSize) {
- // we need to remove the oldest one.
- Object keyRemove = _keys.removeFirst();
- Object objToRemove = _map.remove(keyRemove);
- _creator.dispose(keyRemove, objToRemove);
- }
- result = _creator.createEntry(key);
- _keys.addLast(key);
- _map.put(key, result);
- return result;
- }
- _keys.remove(key);
- _keys.addLast(key);
- return result;
- }
-
- /**
- * Dispose the cache
- */
- public void disposeAll() {
- _keys.clear();
- for (Iterator iter = _map.keySet().iterator(); iter.hasNext();) {
- Object key = iter.next();
- Object entry = _map.get(key);
- _creator.dispose(key, entry);
- }
- _map.clear();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/CommandUtil.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/CommandUtil.java
deleted file mode 100644
index b86284f..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/CommandUtil.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.utils;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jst.jsf.common.metadata.query.ITaglibDomainMetaDataModelContext;
-import org.eclipse.jst.jsf.common.metadata.query.TaglibDomainMetaDataQueryHelper;
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IWorkspaceContextResolver;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContextFactory;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.jst.pagedesigner.editors.palette.TagToolPaletteEntry;
-import org.eclipse.jst.pagedesigner.itemcreation.CreationData;
-import org.eclipse.jst.pagedesigner.itemcreation.ITagCreator;
-import org.eclipse.jst.pagedesigner.itemcreation.internal.TagCreationFactory;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class CommandUtil {
- private static final Logger _log = PDPlugin.getLogger(CommandUtil.class);
-
- /**
- * @param tagItem
- * @param model
- * @param domPosition
- * @param customizationData
- * @return the element inserted or null if failed
- */
- public static Element excuteInsertion(TagToolPaletteEntry tagItem,
- IDOMModel model, IDOMPosition domPosition, IAdaptable customizationData) {
- try
- {
- IStructuredDocument doc = model.getDocument().getStructuredDocument();
-
- IStructuredDocumentContext context =
- IStructuredDocumentContextFactory.INSTANCE.getContext(doc, -1);
- IWorkspaceContextResolver resolver =
- IStructuredDocumentContextResolverFactory.INSTANCE.getWorkspaceContextResolver(context);
-
- IProject project = resolver.getProject();
-
- final ITaglibDomainMetaDataModelContext modelContext =
- TaglibDomainMetaDataQueryHelper
- .createMetaDataModelContext(project, tagItem.getURI());
-
- // TODO: note that the constructor currently causes the prefix defn
- // to be added to the target doc. This should be moved into
- // an ensure method in the AbstractTagCreator
- final CreationData creationData =
- new CreationData(tagItem, model, domPosition, modelContext, customizationData);
-
- ITagCreator tagCreator =
- TagCreationFactory.getInstance().createTagCreator(creationData.getTagId());
-
- if (tagCreator == null)
- {
- return null;//should never get here!
- }
-
- return tagCreator.createTag(creationData);
- } catch (Exception e) {
- _log.error("Problem creating tag "+tagItem.getTagName()+" at:" + domPosition + "\n", e);
- }
- return null;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/DOMUtil.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/DOMUtil.java
deleted file mode 100644
index 098d285..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/DOMUtil.java
+++ /dev/null
@@ -1,260 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.utils;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.xml.core.internal.document.ElementImpl;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-/**
- * @author mengbo
- */
-public class DOMUtil {
- /**
- * @param parent
- * @param tag
- * @return the list of child elements of parent that are Elements
- * and that have name 'tag' ignoring case
- */
- public static List getChildElementsByTagIgnoreCase(Element parent,
- String tag) {
- List ret = new ArrayList();
- NodeList nodeList = parent.getChildNodes();
- for (int i = 0, size = nodeList.getLength(); i < size; i++) {
- Node node = nodeList.item(i);
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- String t = node.getNodeName();
- if (tag.equalsIgnoreCase(t)) {
- ret.add(node);
- }
- }
- }
- return ret;
- }
-
- /**
- * @param ele
- * @return the element value of the TEXT_NODE children of element
- * concat'd together
- */
- public static String getTextElementValue(Element ele) {
- StringBuffer buffer = new StringBuffer();
- Node node = ele.getFirstChild();
- while (node != null) {
- if (node.getNodeType() == Node.TEXT_NODE) {
- buffer.append(node.getNodeValue());
- } else if (node.getNodeType() == Node.CDATA_SECTION_NODE) {
- buffer.append(node.getNodeValue());
- }
- node = node.getNextSibling();
- }
- return buffer.toString();
- }
-
- /**
- * @param element
- * @param string
- * @return the attribute named string on element ignoring case in the comparison
- * or null if not found
- */
- public static String getAttributeIgnoreCase(Element element, String string) {
- NamedNodeMap map = element.getAttributes();
- for (int i = 0; i < map.getLength(); i++) {
- Node attr = map.item(i);
- if (string.equalsIgnoreCase(attr.getNodeName())) {
- return attr.getNodeValue();
- }
- }
- return null;
- }
-
- /**
- * @param parent
- * @param tags
- * @return the list of children of parent with name in tags ignoring case
- */
- public static List getChildrenByTagsIgnoreCase(Element parent, String[] tags) {
- List result = new ArrayList();
- NodeList nodeList = parent.getChildNodes();
- for (int i = 0, size = nodeList.getLength(); i < size; i++) {
- Node node = nodeList.item(i);
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- String t = node.getNodeName();
- for (int k = 0; k < tags.length; k++) {
- if (tags[k].equalsIgnoreCase(t)) {
- result.add(node);
- break;
- }
- }
- }
- }
- return result;
- }
-
- /**
- * @param ele
- */
- public static void removeAllChildren(Element ele) {
- ((ElementImpl) ele).removeChildNodes();
- }
-
- /**
- * @param ele
- * @param value
- */
- public static void setTextElementValue(Element ele, String value) {
- removeAllChildren(ele);
- Text txt = ele.getOwnerDocument().createTextNode(value);
- ele.appendChild(txt);
- }
-
- /**
- * @param ele
- * @param attr
- * @param defaultvalue
- * @return the integer attribute of ele called attr. Default value
- * is returned if the attribute is not found.
- */
- public static int getIntAttributeIgnoreCase(Element ele, String attr,
- int defaultvalue) {
- if (ele == null) {
- return defaultvalue;
- }
- String attrvalue = getAttributeIgnoreCase(ele, attr);
- if (attrvalue == null) {
- return defaultvalue;
- }
- try {
- return Integer.parseInt(attrvalue);
- } catch (NumberFormatException ex) {
- return defaultvalue;
- }
- }
-
- /**
- * get all child elements
- *
- * @param ele
- * @return the list of element children of type ELEMENT_NODE
- */
- public static List getElementChildren(Element ele) {
- List ret = new ArrayList();
- NodeList nodeList = ele.getChildNodes();
- for (int i = 0, size = nodeList.getLength(); i < size; i++) {
- Node node = nodeList.item(i);
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- ret.add(node);
- }
- }
- return ret;
- }
-
- /**
- * judge whether element has an attribute named attrName
- *
- * @param ele
- * @param attrName
- * @return true if element has attribute called attrName ignoring
- * case in the comparison.
- */
- public static boolean hasAttribute(Element ele, String attrName) {
- NamedNodeMap map = ele.getAttributes();
- for (int i = 0; i < map.getLength(); i++) {
- Node attr = map.item(i);
- if (attr.getNodeName().equalsIgnoreCase(attrName)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * @param node
- * @param sb
- */
- public static void nodeToString(Node node, StringBuffer sb) {
- int type = node.getNodeType();
- switch (type) {
- case Node.DOCUMENT_NODE:
- sb.append("<?xml version=\"1.0\" ?>");
- nodeToString(((Document) node).getDocumentElement(), sb);
- break;
-
- case Node.ELEMENT_NODE:
- sb.append("<");
- sb.append(node.getNodeName());
- NamedNodeMap attrs = node.getAttributes();
- for (int i = 0; i < attrs.getLength(); i++) {
- Node attr = attrs.item(i);
- sb.append(" " + attr.getNodeName() + "=\""
- + attr.getNodeValue() + "\"");
- }
-
- NodeList children = node.getChildNodes();
- if (children != null) {
- int len = children.getLength();
- if (len != 0) {
- sb.append(">");
- }
- for (int i = 0; i < len; i++) {
- nodeToString(children.item(i), sb);
- }
- }
- break;
-
- case Node.ENTITY_REFERENCE_NODE:
- sb.append("&");
- sb.append(node.getNodeName());
- sb.append(";");
- break;
-
- case Node.CDATA_SECTION_NODE:
- sb.append("<![CDATA[");
- sb.append(node.getNodeValue());
- sb.append("]]>");
- break;
-
- case Node.TEXT_NODE:
- sb.append(node.getNodeValue());
- break;
-
- case Node.PROCESSING_INSTRUCTION_NODE:
- sb.append("<?");
- sb.append(node.getNodeName());
- String data = node.getNodeValue();
- {
- sb.append(" ");
- sb.append(data);
- }
- sb.append("?>");
- break;
- }
-
- if (type == Node.ELEMENT_NODE) {
- if (node.getFirstChild() != null) {
- sb.append("</");
- sb.append(node.getNodeName());
- sb.append(">");
- } else {
- sb.append("/>");
- }
-
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/EntityMap.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/EntityMap.java
deleted file mode 100644
index 0b68bad..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/EntityMap.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.utils;
-
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-
-/**
- * @author mengbo
- */
-public class EntityMap {
- private static Logger _log = PDPlugin.getLogger(EntityMap.class);
-
- /**
- * @param s
- * @return s translated for HTML entities.
- */
- public static String translate(String s) {
- char[] array = s.toCharArray();
- StringBuffer buffer = new StringBuffer();
- int posi = 0;
- int len = array.length;
- while (posi < len) {
- if (array[posi] != '&') {
- buffer.append(replaceBadEntity(array[posi++]));
- continue;
- }
-
- // now array[posi] == '&'
- int lastPosi = posi;
- posi++;
- if (posi < len && array[posi] == '#') {
- posi++;
- }
- while (posi < len) {
- if (!Character.isLetterOrDigit(array[posi]))
- {
- break;
- }
- posi++;
- }
- // now posi>=array.length or array[posi] is non letter or digit
- String str = new String(array, lastPosi, posi - lastPosi);
- if (translateEntity(str, buffer)) {
- // translated, skip the ';'
- if (posi < len && array[posi] == ';') {
- posi++;
- }
- }
-
- if (posi == len) {
- return buffer.toString();
- }
- }
- return buffer.toString();
- }
-
- /**
- * Translate entity maps and compact whitespace. For heading and training
- * space, will not trim, only compact (making multiple whitespace to become
- * a single ' ' char).
- * @param s
- * @return the result string.
- */
- public static String translateAndCompact(String s) {
- char[] array = s.toCharArray();
- StringBuffer buffer = new StringBuffer();
- int posi = 0;
- int len = array.length;
- while (posi < len) {
- if (HTMLUtil.isHTMLWhitespace(array[posi])) {
- while (++posi < len && HTMLUtil.isHTMLWhitespace(array[posi]))
- {
- // no body
- // loop until we have find non-whitepspace or endof array
- }
-
- buffer.append(' ');
- continue;
- }
- if (array[posi] != '&') {
- buffer.append(replaceBadEntity(array[posi++]));
- continue;
- }
-
- // now array[posi] == '&'
- int lastPosi = posi;
- posi++;
- if (posi < len && array[posi] == '#') {
- posi++;
- }
- while (posi < len) {
- if (!Character.isLetterOrDigit(array[posi])) {
- break;
- }
- posi++;
- }
- // now posi>=array.length or array[posi] is non letter or digit
- String str = new String(array, lastPosi, posi - lastPosi);
-
- if (translateEntity(str, buffer)) {
- // translated, skip the ';'
- if (posi < len && array[posi] == ';') {
- posi++;
- }
- }
-
- if (posi == len) {
- return buffer.toString();
- }
- }
- return buffer.toString();
- }
-
- /**
- * if can translate will return true and append the result string if can't
- * translate will return false and append original string
- *
- * @param s
- * the form &#number or &letterordigit without the trailing ";"
- * @param strBuf
- * @return true the translation can be done
- */
- public static boolean translateEntity(String s, StringBuffer strBuf) {
- int i = HTMLSpecialCharHelper.getSpecial(s); // HTMLSpecialCharHelper
- // support without
- // traning ';'
- if (i != -1) {
- strBuf.append((char) i);
- return true;
- }
- if (s.length() > 2 && s.charAt(1) == '#') {
- String number;
- number = s.substring(2);
- try {
- int n;
- if (number.length() > 0
- && (number.charAt(0) == 'x' || number.charAt(0) == 'X')) {
- n = Integer.parseInt(number.substring(1), 16);
- } else {
- n = Integer.parseInt(number);
- }
- strBuf.append(replaceBadEntity((char) n));
- return true;
- } catch (Exception ex) {
- // Error in integer formating
- _log.info("Error occurred in integer formatting", ex); //$NON-NLS-1$
- strBuf.append(s);
- return false;
- }
- }
- strBuf.append(s);
- return false;
- }
-
- /**
- * In HTML • is sometimes used (mostly based on CP 1252), but is
- * illegal, because it does not exist in Unicode
- *
- * @param n
- * @return
- * see http://www.w3.org/Talks/1999/0830-tutorial-unicode-mjd/slide27-0.html
- */
- private static char replaceBadEntity(char n) {
- if (n < 132 || n > 156)
- return n;
- switch (n) {
- case 132:
- return (char) 8222;
- case 133:
- return (char) 8230;
- case 134:
- return (char) 8224;
- case 135:
- return (char) 8225;
- case 139:
- return (char) 8249;
- case 140:
- return (char) 338;
- case 145:
- return (char) 8216;
- case 146:
- return (char) 8217;
- case 147:
- return (char) 8220;
- case 148:
- return (char) 8221;
- case 149:
- return (char) 8226;
- case 151:
- return (char) 8212;
- case 153:
- return (char) 8482;
- case 155:
- return (char) 8250;
- case 156:
- return (char) 339;
- default:
- return n;
- }
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/HTMLSpecialCharHelper.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/HTMLSpecialCharHelper.java
deleted file mode 100644
index 4959198..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/HTMLSpecialCharHelper.java
+++ /dev/null
@@ -1,464 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.utils;
-
-import java.io.IOException;
-import java.io.Writer;
-import java.util.Enumeration;
-import java.util.Hashtable;
-
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-
-/**
- * entity map support.
- *
- * @author mengbo
- */
-public class HTMLSpecialCharHelper {
- private static Logger _log = PDPlugin
- .getLogger(HTMLSpecialCharHelper.class);
-
- private static Hashtable _table;
-
- private static Hashtable _reverse;
- static {
- _table = new Hashtable(256);
-
- _table.put(Integer.valueOf(34), """); //$NON-NLS-1$
- _table.put(Integer.valueOf(38), "&"); //$NON-NLS-1$
- _table.put(Integer.valueOf(60), "<"); //$NON-NLS-1$
- _table.put(Integer.valueOf(62), ">"); //$NON-NLS-1$
-
- _table.put(Integer.valueOf(160), " "); //$NON-NLS-1$
- _table.put(Integer.valueOf(161), "¡"); //$NON-NLS-1$
- _table.put(Integer.valueOf(162), "¢"); //$NON-NLS-1$
- _table.put(Integer.valueOf(163), "£"); //$NON-NLS-1$
- _table.put(Integer.valueOf(164), "¤"); //$NON-NLS-1$
- _table.put(Integer.valueOf(165), "¥"); //$NON-NLS-1$
- _table.put(Integer.valueOf(166), "¦"); //$NON-NLS-1$
- _table.put(Integer.valueOf(167), "§"); //$NON-NLS-1$
- _table.put(Integer.valueOf(168), "¨"); //$NON-NLS-1$
- _table.put(Integer.valueOf(169), "©"); //$NON-NLS-1$
- _table.put(Integer.valueOf(170), "ª"); //$NON-NLS-1$
- _table.put(Integer.valueOf(171), "«"); //$NON-NLS-1$
- _table.put(Integer.valueOf(172), "¬"); //$NON-NLS-1$
- _table.put(Integer.valueOf(173), "­"); //$NON-NLS-1$
- _table.put(Integer.valueOf(174), "®"); //$NON-NLS-1$
- _table.put(Integer.valueOf(175), "¯"); //$NON-NLS-1$
- _table.put(Integer.valueOf(176), "°"); //$NON-NLS-1$
- _table.put(Integer.valueOf(177), "±"); //$NON-NLS-1$
- _table.put(Integer.valueOf(178), "²"); //$NON-NLS-1$
- _table.put(Integer.valueOf(179), "³"); //$NON-NLS-1$
- _table.put(Integer.valueOf(180), "´"); //$NON-NLS-1$
- _table.put(Integer.valueOf(181), "µ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(182), "¶"); //$NON-NLS-1$
- _table.put(Integer.valueOf(183), "·"); //$NON-NLS-1$
- _table.put(Integer.valueOf(184), "¸"); //$NON-NLS-1$
- _table.put(Integer.valueOf(185), "¹"); //$NON-NLS-1$
- _table.put(Integer.valueOf(186), "º"); //$NON-NLS-1$
- _table.put(Integer.valueOf(187), "»"); //$NON-NLS-1$
- _table.put(Integer.valueOf(188), "¼"); //$NON-NLS-1$
- _table.put(Integer.valueOf(189), "½"); //$NON-NLS-1$
- _table.put(Integer.valueOf(190), "¾"); //$NON-NLS-1$
- _table.put(Integer.valueOf(191), "¿"); //$NON-NLS-1$
- _table.put(Integer.valueOf(192), "À"); //$NON-NLS-1$
- _table.put(Integer.valueOf(193), "Á"); //$NON-NLS-1$
- _table.put(Integer.valueOf(194), "Â"); //$NON-NLS-1$
- _table.put(Integer.valueOf(195), "Ã"); //$NON-NLS-1$
- _table.put(Integer.valueOf(196), "Ä"); //$NON-NLS-1$
- _table.put(Integer.valueOf(197), "Å"); //$NON-NLS-1$
- _table.put(Integer.valueOf(198), "Æ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(199), "Ç"); //$NON-NLS-1$
- _table.put(Integer.valueOf(200), "È"); //$NON-NLS-1$
- _table.put(Integer.valueOf(201), "É"); //$NON-NLS-1$
- _table.put(Integer.valueOf(202), "Ê"); //$NON-NLS-1$
- _table.put(Integer.valueOf(203), "Ë"); //$NON-NLS-1$
- _table.put(Integer.valueOf(204), "Ì"); //$NON-NLS-1$
- _table.put(Integer.valueOf(205), "Í"); //$NON-NLS-1$
- _table.put(Integer.valueOf(206), "Î"); //$NON-NLS-1$
- _table.put(Integer.valueOf(207), "Ï"); //$NON-NLS-1$
- _table.put(Integer.valueOf(208), "Ð"); //$NON-NLS-1$
- _table.put(Integer.valueOf(209), "Ñ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(210), "Ò"); //$NON-NLS-1$
- _table.put(Integer.valueOf(211), "Ó"); //$NON-NLS-1$
- _table.put(Integer.valueOf(212), "Ô"); //$NON-NLS-1$
- _table.put(Integer.valueOf(213), "Õ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(214), "Ö"); //$NON-NLS-1$
- _table.put(Integer.valueOf(215), "×"); //$NON-NLS-1$
- _table.put(Integer.valueOf(216), "Ø"); //$NON-NLS-1$
- _table.put(Integer.valueOf(217), "Ù"); //$NON-NLS-1$
- _table.put(Integer.valueOf(218), "Ú"); //$NON-NLS-1$
- _table.put(Integer.valueOf(219), "Û"); //$NON-NLS-1$
- _table.put(Integer.valueOf(220), "Ü"); //$NON-NLS-1$
- _table.put(Integer.valueOf(221), "Ý"); //$NON-NLS-1$
- _table.put(Integer.valueOf(222), "Þ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(223), "ß"); //$NON-NLS-1$
- _table.put(Integer.valueOf(224), "à"); //$NON-NLS-1$
- _table.put(Integer.valueOf(225), "á"); //$NON-NLS-1$
- _table.put(Integer.valueOf(226), "â"); //$NON-NLS-1$
- _table.put(Integer.valueOf(227), "ã"); //$NON-NLS-1$
- _table.put(Integer.valueOf(228), "ä"); //$NON-NLS-1$
- _table.put(Integer.valueOf(229), "å"); //$NON-NLS-1$
- _table.put(Integer.valueOf(230), "æ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(231), "ç"); //$NON-NLS-1$
- _table.put(Integer.valueOf(232), "è"); //$NON-NLS-1$
- _table.put(Integer.valueOf(233), "é"); //$NON-NLS-1$
- _table.put(Integer.valueOf(234), "ê"); //$NON-NLS-1$
- _table.put(Integer.valueOf(235), "ë"); //$NON-NLS-1$
- _table.put(Integer.valueOf(236), "ì"); //$NON-NLS-1$
- _table.put(Integer.valueOf(237), "í"); //$NON-NLS-1$
- _table.put(Integer.valueOf(238), "î"); //$NON-NLS-1$
- _table.put(Integer.valueOf(239), "ï"); //$NON-NLS-1$
- _table.put(Integer.valueOf(240), "ð"); //$NON-NLS-1$
- _table.put(Integer.valueOf(241), "ñ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(242), "ò"); //$NON-NLS-1$
- _table.put(Integer.valueOf(243), "ó"); //$NON-NLS-1$
- _table.put(Integer.valueOf(244), "ô"); //$NON-NLS-1$
- _table.put(Integer.valueOf(245), "õ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(246), "ö"); //$NON-NLS-1$
- _table.put(Integer.valueOf(247), "÷"); //$NON-NLS-1$
- _table.put(Integer.valueOf(248), "ø"); //$NON-NLS-1$
- _table.put(Integer.valueOf(249), "ù"); //$NON-NLS-1$
- _table.put(Integer.valueOf(250), "ú"); //$NON-NLS-1$
- _table.put(Integer.valueOf(251), "û"); //$NON-NLS-1$
- _table.put(Integer.valueOf(252), "ü"); //$NON-NLS-1$
- _table.put(Integer.valueOf(253), "ý"); //$NON-NLS-1$
- _table.put(Integer.valueOf(254), "þ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(255), "ÿ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(402), "ƒ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(913), "Α"); //$NON-NLS-1$
- _table.put(Integer.valueOf(914), "Β"); //$NON-NLS-1$
- _table.put(Integer.valueOf(915), "Γ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(916), "Δ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(917), "Ε"); //$NON-NLS-1$
- _table.put(Integer.valueOf(918), "Ζ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(919), "Η"); //$NON-NLS-1$
- _table.put(Integer.valueOf(920), "Θ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(921), "Ι"); //$NON-NLS-1$
- _table.put(Integer.valueOf(922), "Κ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(923), "Λ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(924), "Μ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(925), "Ν"); //$NON-NLS-1$
- _table.put(Integer.valueOf(926), "Ξ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(927), "Ο"); //$NON-NLS-1$
- _table.put(Integer.valueOf(928), "Π"); //$NON-NLS-1$
- _table.put(Integer.valueOf(929), "Ρ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(931), "Σ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(932), "Τ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(933), "Υ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(934), "Φ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(935), "Χ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(936), "Ψ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(937), "Ω"); //$NON-NLS-1$
- _table.put(Integer.valueOf(945), "α"); //$NON-NLS-1$
- _table.put(Integer.valueOf(946), "β"); //$NON-NLS-1$
- _table.put(Integer.valueOf(947), "γ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(948), "δ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(949), "ε"); //$NON-NLS-1$
- _table.put(Integer.valueOf(950), "ζ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(951), "η"); //$NON-NLS-1$
- _table.put(Integer.valueOf(952), "θ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(953), "ι"); //$NON-NLS-1$
- _table.put(Integer.valueOf(954), "κ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(955), "λ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(956), "μ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(957), "ν"); //$NON-NLS-1$
- _table.put(Integer.valueOf(958), "ξ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(959), "ο"); //$NON-NLS-1$
- _table.put(Integer.valueOf(960), "π"); //$NON-NLS-1$
- _table.put(Integer.valueOf(961), "ρ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(962), "ς"); //$NON-NLS-1$
- _table.put(Integer.valueOf(963), "σ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(964), "τ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(965), "υ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(966), "φ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(967), "χ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(968), "ψ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(969), "ω"); //$NON-NLS-1$
- _table.put(Integer.valueOf(977), "ϑ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(978), "ϒ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(982), "ϖ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8226), "•"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8230), "…"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8242), "′"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8243), "″"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8254), "‾"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8260), "⁄"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8472), "℘"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8465), "ℑ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8476), "ℜ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8482), "™"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8501), "ℵ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8592), "←"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8593), "↑"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8594), "→"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8595), "↓"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8596), "↔"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8629), "↵"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8656), "⇐"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8657), "⇑"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8658), "⇒"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8659), "⇓"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8660), "⇔"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8704), "∀"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8706), "∂"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8707), "∃"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8709), "∅"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8711), "∇"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8712), "∈"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8713), "∉"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8715), "∋"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8719), "∏"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8722), "∑"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8722), "−"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8727), "∗"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8730), "√"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8733), "∝"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8734), "∞"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8736), "∠"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8869), "∧"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8870), "∨"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8745), "∩"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8746), "∪"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8747), "∫"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8756), "∴"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8764), "∼"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8773), "≅"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8773), "≈"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8800), "≠"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8801), "≡"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8804), "≤"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8805), "≥"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8834), "⊂"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8835), "⊃"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8836), "⊄"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8838), "⊆"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8839), "⊇"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8853), "⊕"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8855), "⊗"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8869), "⊥"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8901), "⋅"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8968), "⌈"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8969), "⌉"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8970), "⌊"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8971), "⌋"); //$NON-NLS-1$
- _table.put(Integer.valueOf(9001), "⟨"); //$NON-NLS-1$
- _table.put(Integer.valueOf(9002), "⟩"); //$NON-NLS-1$
- _table.put(Integer.valueOf(9674), "◊"); //$NON-NLS-1$
- _table.put(Integer.valueOf(9824), "♠"); //$NON-NLS-1$
- _table.put(Integer.valueOf(9827), "♣"); //$NON-NLS-1$
- _table.put(Integer.valueOf(9829), "♥"); //$NON-NLS-1$
- _table.put(Integer.valueOf(9830), "♦"); //$NON-NLS-1$
-
- _table.put(Integer.valueOf(338), "Œ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(339), "œ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(352), "Š"); //$NON-NLS-1$
- _table.put(Integer.valueOf(353), "š"); //$NON-NLS-1$
- _table.put(Integer.valueOf(376), "Ÿ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(710), "ˆ"); //$NON-NLS-1$
- _table.put(Integer.valueOf(732), "˜"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8194), " "); //$NON-NLS-1$
- _table.put(Integer.valueOf(8195), " "); //$NON-NLS-1$
- _table.put(Integer.valueOf(8201), " "); //$NON-NLS-1$
- _table.put(Integer.valueOf(8204), "‌"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8205), "‍"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8206), "‎"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8207), "‏"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8211), "–"); //$NON-NLS-1$
- _table.put(Integer.valueOf(151), "—"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8216), "‘"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8217), "’"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8218), "‚"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8220), "“"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8221), "”"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8222), "„"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8224), "†"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8225), "‡"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8240), "‰"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8249), "‹"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8250), "›"); //$NON-NLS-1$
- _table.put(Integer.valueOf(8364), "€"); //$NON-NLS-1$
-
- _reverse = new Hashtable(256);
- for (Enumeration e = _table.keys(); e.hasMoreElements();) {
- Object key = e.nextElement();
- String value = (String) _table.get(key);
- _reverse.put(value, key);
- // also support without the training ';'
- _reverse.put(value.substring(0, value.length() - 1), key);
- }
- }
-
- /**
- * @param ch
- * @return if not in the special list
- */
- public static String getSpecial(int ch) {
- return (String) _table.get(Integer.valueOf(ch));
- }
-
- /**
- * @param str
- * @return the code value corresponding to the string or null
- * if string is unknown
- */
- public static int getSpecial(String str) {
- Integer result = (Integer) _reverse.get(str);
- if (result == null) {
- return -1;
- }
- return result.intValue();
- }
-
- /**
- * @param str
- * @param start
- * @param end
- * @param writer
- * @throws IOException
- */
- public static void encode(String str, int start, int end, Writer writer)
- throws IOException {
- for (int i = start; i < end; i++) {
- char ch = str.charAt(i);
- String special = getSpecial(ch);
- if (special != null) {
- writer.write(special);
- } else {
- if ((ch & 0xff) != 0) {
- writer.write("&#"); //$NON-NLS-1$
- writer.write(Integer.toString(ch));
- writer.write(";"); //$NON-NLS-1$
- } else {
- writer.write(ch);
- }
- }
- }
- }
-
- /**
- * @param str
- * @param result
- * @return the encoded string buffer
- */
- public static StringBuffer encode(String str, StringBuffer result) {
- return encode(str, 0, str.length(), result);
- }
-
- /**
- * @param str
- * @param start
- * @param end
- * @param result
- * @return the encoded string buffer
- */
- public static StringBuffer encode(String str, int start, int end,
- StringBuffer result) {
- for (int i = start; i < end; i++) {
- char ch = str.charAt(i);
- String special = getSpecial(ch);
- if (special != null) {
- result.append(special);
- } else {
- if ((ch & 0xff00) != 0) {
- result.append("&#"); //$NON-NLS-1$
- result.append(Integer.toString(ch));
- result.append(";"); //$NON-NLS-1$
- } else {
- result.append(ch);
- }
- }
- }
- return result;
- }
-
- /**
- * @param str
- * @param buffer
- * @return the decoded string buffer
- * @throws RuntimeException
- */
- public static StringBuffer decode(String str, StringBuffer buffer)
- throws RuntimeException {
- return decode(str, 0, str.length(), buffer);
- }
-
- /**
- * @param str
- * @param start
- * @param end
- * @param buffer
- * @return the decoded string buffer
- * @throws RuntimeException
- */
- public static StringBuffer decode(String str, int start, int end,
- StringBuffer buffer) throws RuntimeException {
- int pos = start;
- do {
- char ch = str.charAt(pos);
- if (ch == '&') {
- int stop = str.indexOf(';', pos + 1);
- if (stop < 0 || stop >= end) {
- _log.error("HTMLSpecialCharHelper.3"); //$NON-NLS-1$
- throw new RuntimeException("HTMLSpecialCharHelper.2"); //$NON-NLS-1$
- }
- String sp = str.substring(pos, stop + 1);
- int special = getSpecial(sp);
- if (special != -1) {
- buffer.append((char) special);
- } else {
- ch = sp.charAt(1);
- if (ch != '#')
- throw new RuntimeException("HTMLSpecialCharHelper.1"); //$NON-NLS-1$
- try {
- buffer.append((char) Integer.parseInt(sp.substring(2,
- sp.length() - 1)));
- } catch (NumberFormatException ex) {
- _log.info("HTMLSpecialCharHelper.0", ex); //$NON-NLS-1$
- throw new RuntimeException("illegal: " + sp); //$NON-NLS-1$
- }
- }
- pos = stop + 1;
- } else {
- buffer.append(ch);
- pos++;
- }
- } while (pos < end);
- return buffer;
- }
-
- /**
- * @param entityRef
- * @return the code for the decoded entity reference
- */
- public static int decodeEntity(String entityRef) {
- Integer result = (Integer) _reverse.get(entityRef);
- if (result != null) {
- return result.intValue();
- }
- if (entityRef.length() >= 2 && entityRef.charAt(1) == '#') {
- String s = entityRef.substring(2);
- if (s.endsWith(";")) {
- s = s.substring(0, s.length() - 1);
- }
- try {
- return Integer.parseInt(s);
- } catch (Exception ex) {
- // ignore
- }
- }
- return -1;
- }
-}
-
-// FIXME: will it better to use Character instead of Integer ? (yang)
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/HTMLUtil.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/HTMLUtil.java
deleted file mode 100644
index a4400d2..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/HTMLUtil.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.utils;
-
-import java.util.Arrays;
-
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.w3c.dom.Text;
-
-/**
- * @author mengbo
- */
-public class HTMLUtil {
- /**
- * check whether a char is a HTML whitespace.
- *
- * @param ch
- * @return true if ch is considered to be HTML whitespace
- * @see <a href="http://www.w3.org/TR/html4/struct/text.html#h-9.1">white
- * space </a>
- */
- public static boolean isHTMLWhitespace(char ch) {
- return ch == ' ' || ch == 0x09 || ch == 0x0c || ch == 0x0d
- || ch == 0x0a || ch == 0x200b;
- }
-
- /**
- * @param text
- * @return true if the entire string is considered to be HTML whitespace
- */
- public static boolean isHTMLWhitespaceString(String text) {
- for (int i = 0, size = text.length(); i < size; i++) {
- if (!isHTMLWhitespace(text.charAt(i))) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * the HTML tags considered to be hidden
- */
- static final String[] HiddenTags = new String[] {
- IHTMLConstants.TAG_APPLET, IHTMLConstants.TAG_AREA,
- IHTMLConstants.TAG_BASE, IHTMLConstants.TAG_BASEFONT,
- IHTMLConstants.TAG_HEAD, IHTMLConstants.TAG_IFRAME,
- IHTMLConstants.TAG_ISINDEX, IHTMLConstants.TAG_META,
- IHTMLConstants.TAG_NOEMBED, IHTMLConstants.TAG_NOFRAMES,
- IHTMLConstants.TAG_NOSCRIPT, IHTMLConstants.TAG_SCRIPT,
- IHTMLConstants.TAG_STYLE, IHTMLConstants.TAG_TITLE,
- IHTMLConstants.TAG_PARAM };
-
- /**
- * @param tag
- * @return true if the tag name is not in the list of hidden tags
- */
- public static boolean isVisualHtmlElement(String tag) {
- return !Arrays.asList(HiddenTags).contains(tag.toLowerCase());
- }
-
- /**
- * Handling white space. Basically, for leading and trailing whitespace,
- * will handle according whether the text is just after tag start or before
- * tag close.
- * <p>
- * For consequent whitespace, will compact them.
- * @param textNode
- * @param s
- * @return the compacted string
- * see http://www.w3.org/TR/html4/struct/text.html#h-9.1
- */
- // XXX: currently, the whitespace handling is in this class, in the future
- // may consider move it
- // into lower layer (display/CSS layer)
- public static String compactWhitespaces(Text textNode, String s) {
- char[] array = s.toCharArray();
- StringBuffer buffer = new StringBuffer(array.length);
- int posi = 0;
- int len = array.length;
-
- while (posi < len) {
- if (HTMLUtil.isHTMLWhitespace(array[posi])) {
- while (++posi < len && HTMLUtil.isHTMLWhitespace(array[posi]))
- {
- // no body
- // loop until we have find non-whitepspace or endof array
- }
-
- buffer.append(' ');
- continue;
- }
- buffer.append(array[posi++]);
- continue;
- }
- return buffer.toString();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/ICacheEntryCreator.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/ICacheEntryCreator.java
deleted file mode 100644
index a63faee..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/ICacheEntryCreator.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.utils;
-
-/**
- * Identifies a factory/dispose advisor for cache entries
- * @param <KEY>
- * @param <ENTRY>
- */
-public interface ICacheEntryCreator<KEY,ENTRY> {
- /**
- * @param key
- * @return the created entry
- */
- public ENTRY createEntry(KEY key);
-
- /**
- * @param key
- * @param entry
- */
- public void dispose(KEY key, ENTRY entry);
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/ImageResolver.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/ImageResolver.java
deleted file mode 100644
index 29305bf..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/ImageResolver.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.utils;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.SWTException;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.core.internal.util.URIResolver;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Element;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class ImageResolver {
- /**
- *
- * @param element
- * @param attrName
- * @return
- */
- static String getResolvedURL(Element element, String attrName) {
- URIResolver resolver = null;
- if (element instanceof IDOMNode) {
- resolver = ((IDOMNode) element).getModel().getResolver();
- }
- if (null == resolver) {
- return null;
- }
- String src = DOMUtil.getAttributeIgnoreCase(element, attrName);
- if (src != null && src.length() > 0) {
- return resolver.getLocationByURI(src);
- }
- return null;
- }
-
- /**
- * given the element and an attribute name identifying the src of the image,
- * create a image.
- *
- * @param element
- * @param attrName
- * @return the new image
- */
- public static Image initializeImage(Element element, String attrName) {
- String url = getResolvedURL(element, attrName);
- if (url == null) {
- return null;
- }
- Image img = null;
- int colonIndex = url.indexOf(":");
- int slashIndex = url.indexOf("/");
- if (colonIndex != -1 && (slashIndex != -1 && colonIndex < slashIndex)) {
- //the url seems to have a protocol, so try to load it as a URL
- try {
- URL urlObj = new URL(url);
- ImageDescriptor imgDesc = ImageDescriptor.createFromURL(urlObj);
- img = imgDesc.createImage(false);
- } catch(MalformedURLException mfe) {
- //attempt to load as a file
- try {
- img = new Image(null, url);
- } catch(SWTException se) {
- //img remains null on return
- }
- } catch(SWTException se) {
- //img remains null on return
- }
- } else {
- //no protocol, so load it as a file
- try {
- img = new Image(null, url);
- } catch(SWTException se) {
- //img remains null on return
- }
- }
- return img;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/IntFlexArray.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/IntFlexArray.java
deleted file mode 100644
index 4c50dcf..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/IntFlexArray.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.utils;
-
-/**
- * Flexible int array. You can set/get of any index value. The array size will
- * be automatically adjusted.
- *
- * @author mengbo
- */
-public class IntFlexArray {
- int[] array;
-
- int size = 0;
-
- /**
- * Create a new flex array with default capacity
- */
- public IntFlexArray() {
- this(10);
- }
-
- /**
- * @param initCapacity
- */
- public IntFlexArray(int initCapacity) {
- if (initCapacity <= 0)
- initCapacity = 10;
- array = new int[initCapacity];
- }
-
- /**
- * @param idx
- * @param obj
- */
- public void setAt(int idx, int obj) {
- ensureCapacity(idx + 1);
- array[idx] = obj;
- if (idx + 1 > size)
- size = idx + 1;
- }
-
- /**
- * @param idx
- * @return the value at idx or 0 if idx is out of bounds
- */
- public int getAt(int idx) {
- if (idx < array.length)
- return array[idx];
- return 0;
- }
-
- /**
- * @return the current size of the array
- */
- public int getSize() {
- return size;
- }
-
- private void ensureCapacity(int size1) {
- if (size1 <= array.length)
- return;
- int[] temp = array;
- array = new int[2 * temp.length];
- System.arraycopy(temp, 0, array, 0, temp.length);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/JSPUtil.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/JSPUtil.java
deleted file mode 100644
index b3b5a37..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/JSPUtil.java
+++ /dev/null
@@ -1,288 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.utils;
-
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jst.jsf.core.internal.tld.ITLDConstants;
-import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TaglibTracker;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDDocument;
-import org.eclipse.jst.jsp.core.taglib.TaglibIndex;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.eclipse.wst.html.core.internal.format.HTMLFormatProcessorImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * utility class for JSP related information.
- *
- * @author mengbo
- */
-public class JSPUtil {
- /**
- * find out whether the specified taglib has been defined in the IDOMModel.
- * If found, then return the prefix. If can't find, then will try to add a
- * taglib declaration into the model, and try to use the specified default
- * prefix
- *
- * @param model
- * @param uri
- * @param defaultPrefix
- * @return prefix
- */
- public static String getOrCreatePrefix(IDOMModel model, String uri,
- String defaultPrefix) {
- return getOrCreatePrefix(model, uri, defaultPrefix, null);
- }
-
- /**
- *
- * @param model
- * @param uri
- * @param defaultPrefix
- * @param nodes
- * if a taglib node is created, then the created tag lib node is
- * returned in this. In the case of xml format, it is the attribute node on
- * jsp:root
- * @return prefix
- */
- public static String getOrCreatePrefix(IDOMModel model, String uri,
- String defaultPrefix, Node[] nodes) {
-
- String prefix = getPrefix(model, uri);
- if (prefix != null) {
- return prefix;
- }
-
- prefix = findUnusedPrefix(model, defaultPrefix);
-
- //need proper API to determine xml type... this may need to change in future
- if (! model.getDocument().isXMLType()){
- // TODO: should create the taglib inside the IDOMModel
- Node[] ref = new Node[1];
- BodyHelper.findHeaderInsertPosition(ITLDConstants.URI_JSP, "taglib",
- model.getDocument(), ref);
-
- Element ele = model.getDocument().createElement("jsp:directive.taglib");
- ((IDOMElement) ele).setJSPTag(true);
- ele.setAttribute(ICSSPropertyID.ATTR_URI, uri);
- ele.setAttribute(ICSSPropertyID.ATTR_PREFIX, prefix);
- if (nodes != null && nodes.length > 0) {
- nodes[0] = ele;
- }
- model.getDocument().insertBefore(ele, ref[0]);
- new HTMLFormatProcessorImpl().formatNode(ele);
- }
- else {//xml format
- //find root element
- boolean tldRefExists = false;
- Element root = getRootElement(model);
- if (root != null){
- NamedNodeMap attrs = root.getAttributes();
- for (int i=0;i<attrs.getLength();i++){
- Attr a = (Attr)attrs.item(i);
- //is the taglib uri already declared?
- if (a.getValue().equals(uri)){
- tldRefExists = true;
- break;
- }
- }
- if (!tldRefExists){
- //create attribute
- Attr a = model.getDocument().createAttribute("xmlns:"+prefix);
- a.setValue(uri);
- root.setAttributeNode(a);
- new HTMLFormatProcessorImpl().formatNode(root);
-
- //duplicating what non-xml case does... no callerd making use of this currently
- if (nodes != null && nodes.length > 0) {
- nodes[0] = a;
- }
- }
- }
- }
- return prefix;
- }
-
- private static Element getRootElement(IDOMModel model) {
- Document docNode = EditModelQuery.getDocumentNode(model.getDocument());
- return docNode.getDocumentElement();
- }
-
- /**
- * Return prefix for taglib if declared in jsp file
- * @param model
- * @param uri
- * @return null means this is tld is not declared in the jsp file
- */
- public static String getPrefix(IDOMModel model, String uri) {
- TLDCMDocumentManager m = TaglibController.getTLDCMDocumentManager(model
- .getStructuredDocument());
- if (m == null) {
- // if the doc manager has nothing but the type is XML,
- // then see if the prefix is encoded as a namespace in
- // the doc root
- if (model.getDocument().isXMLType())
- {
- Element root = getRootElement(model);
- if (root != null){
- NamedNodeMap attrs = root.getAttributes();
- for (int i=0;i<attrs.getLength();i++){
- Attr a = (Attr)attrs.item(i);
- //is the taglib uri already declared?
- if (a.getValue().equals(uri)
- && a.getName().startsWith("xmlns:"))
- {
- String prefix = a.getNodeName().substring("xmlns:".length());
-
- if ("".equals(prefix))
- {
- prefix = null;
- }
- return prefix;
- }
- }
- }
- }
- return null;
- }
- List trackers = m.getTaglibTrackers();
- for (Iterator iter = trackers.iterator(); iter.hasNext();) {
- TaglibTracker tracker = (TaglibTracker) iter.next();
- if (uri.equals(tracker.getURI())) {
- return tracker.getPrefix();
- }
- CMDocument cmdoc = tracker.getDocument();
- if (cmdoc instanceof TLDDocument
- && uri.equals(((TLDDocument) cmdoc).getUri())) {
- return tracker.getPrefix();
- }
- }
- return null;
- }
-
- /**
- * create specified taglib declaration as jsp directive element
- *
- * @param model
- * @param uri
- * @param prefix
- * @return Element
- */
- public static Element createTaglibDeclaration(IDOMModel model, String uri,
- String prefix) {
- Node[] ref = new Node[1];
- BodyHelper.findHeaderInsertPosition(ITLDConstants.URI_JSP, "taglib",
- model.getDocument(), ref);
- Element ele = model.getDocument().createElement("jsp:directive.taglib");
- ((IDOMElement) ele).setJSPTag(true);
- ele.setAttribute("uri", uri);
- ele.setAttribute("prefix", prefix);
- model.getDocument().insertBefore(ele, ref[0]);
- return ele;
- }
-
- /**
- * Return prefix to use based upon the suggestion.
- * Appends an integer until unique, if suggestion was used.
- * @param model
- * @param suggestion
- * @return prefix
- */
- public static String findUnusedPrefix(IDOMModel model, String suggestion) {
- if (suggestion == null) {
- suggestion = "p";
- }
- TLDCMDocumentManager m = TaglibController.getTLDCMDocumentManager(model
- .getStructuredDocument());
- if (m == null) {
- return suggestion;
- }
- List trackers = m.getTaglibTrackers();
- Set map = new HashSet();
- for (Iterator iter = trackers.iterator(); iter.hasNext();) {
- TaglibTracker tracker = (TaglibTracker) iter.next();
- map.add(tracker.getPrefix());
- }
- if (!map.contains(suggestion)) {
- return suggestion;
- }
- for (int i = 1;; i++) {
- if (!map.contains(suggestion + i)) {
- return suggestion + i;
- }
- }
- }
-
- /**
- * given the prefix, find the corresponding jsp tld URI.
- *
- * @param model
- * @param prefix
- * @return prefix
- */
- public static String findURIForPrefix(IDOMModel model, String prefix) {
- if (prefix == null || model == null) {
- return null;
- }
- TLDCMDocumentManager m = TaglibController.getTLDCMDocumentManager(model
- .getStructuredDocument());
- if (m == null) {
- return null;
- }
- List trackers = m.getTaglibTrackers();
- for (Iterator iter = trackers.iterator(); iter.hasNext();) {
- TaglibTracker tracker = (TaglibTracker) iter.next();
- if (prefix.equals(tracker.getPrefix())) {
- CMDocument cmdoc = tracker.getDocument();
- if (cmdoc instanceof TLDDocument) {
- return ((TLDDocument) cmdoc).getUri();
- }
- break; // fall out and return null
- }
- }
- return null;
- }
-
- /**
- * judge whether the the baseFile belonged project can support uri specified
- * tag lib
- *
- * @param uri
- * tag lib uri
- * @param baseFile
- * @return boolean
- */
- public static boolean supportTaglib(String uri, IFile baseFile) {
- //IPath location = baseFile.getLocation();
- //Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=221197
- IPath location = baseFile.getFullPath();
- if (location != null) {
- return TaglibIndex.resolve(location.toString(), uri, false) != null;
- }
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/JavaUtil.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/JavaUtil.java
deleted file mode 100644
index 7d554c6..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/JavaUtil.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.utils;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJarEntryResource;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jst.jsf.common.ui.IFileFolderConstants;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-
-/**
- * @author mengbo
- */
-public class JavaUtil {
- /**
- *
- * @param javaProject
- * @param parent
- * @return the path in javaProject or new Path("") if not found on a class path
- * @author mengbo
- */
- public static IPath getPathOnClasspath(IJavaProject javaProject,
- Object parent) {
- IPath result = null;
- if (javaProject == null || parent == null) {
- return new Path("");
- }
- IClasspathEntry[] entries = javaProject.readRawClasspath();
- IPath classPath = null;
- if (parent instanceof IResource) {
- if (((javaProject != null) && !javaProject
- .isOnClasspath((IResource) parent))) {
- return new Path("");
- }
- if (parent instanceof IFile) {
- IPath elementPath = ((IFile) parent).getFullPath();
- if (((IFile) parent).getFileExtension().equalsIgnoreCase(
- IFileFolderConstants.EXT_PROPERTIES)) {
- int machings = 0;
- try {
- for (int i = 0; i < entries.length; i++) {
- // Determine whether on this classentry's path
- machings = entries[i].getPath()
- .matchingFirstSegments(elementPath);
- if (machings > 0) {
- // Get package name
- classPath = elementPath.removeFirstSegments(
- machings).removeLastSegments(1);
- break;
- }
- }
- // Not on the classpath?
- if (classPath == null) {
- return null;
- } else if (classPath.segmentCount() > 0)
- result = javaProject.findElement(classPath)
- .getPath().removeFirstSegments(machings)
- .append(((IFile) parent).getName());
- else
- result = ((IFile) parent).getFullPath()
- .removeFirstSegments(machings);
- } catch (Exception e) {
- // Error.DesignerPropertyTool.NatureQuerying = Error in
- // project java nature querying
- PDPlugin.getLogger(JavaUtil.class).error(
- "Error.DesignerPropertyTool.NatureQuerying", e);
- return null;
- }
- }
- }
- } else if (parent instanceof IJarEntryResource) {
- IPath elementPath = ((IJarEntryResource) parent).getFullPath();
- if (elementPath.getFileExtension().equalsIgnoreCase(
- IFileFolderConstants.EXT_PROPERTIES)) {
- result = elementPath;
- }
- }
- if (result != null) {
- return result;
- }
- return new Path("");
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/NodeLocationComparator.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/NodeLocationComparator.java
deleted file mode 100644
index 571819a..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/NodeLocationComparator.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.utils;
-
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Assert;
-import org.w3c.dom.Node;
-
-/**
- * To sort the location of tags, this comparator is used to compare tags' order.
- *
- * @author mengbo
- */
-public class NodeLocationComparator implements Comparator {
- private final static Map orders = new HashMap();
-
- private final static Integer DEFAULT_ORDER = Integer.valueOf(Integer.MAX_VALUE);
-
- private static NodeLocationComparator _instance = new NodeLocationComparator();
- static {
- orders.put("taglib", Integer.valueOf(0));
- orders.put("directive.taglib", Integer.valueOf(0));
- orders.put("head", Integer.valueOf(1));
- }
-
- private NodeLocationComparator() {
- // no external instantiation
- }
-
- /**
- * @return the singleton
- */
- public static NodeLocationComparator getInstance() {
- return _instance;
- }
-
- /**
- * The object to be compared could be Node or tag name.
- *
- * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
- */
- public int compare(Object o1, Object o2) {
- Assert.isTrue((o1 instanceof Node || o1 instanceof String)
- && (o2 instanceof Node || o2 instanceof String));
- Integer i1 = getOrder(o1);
- Integer i2 = getOrder(o2);
- return i1.compareTo(i2);
- }
-
- private Integer getOrder(Object n) {
- String name = null;
- if (n instanceof Node) {
- name = ((Node) n).getLocalName();
- } else {
- name = (String) n;
- }
- if (name != null) {
- Object order = orders.get(name);
- if (order != null) {
- return (Integer) order;
- }
- }
- return DEFAULT_ORDER;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/PreviewUtil.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/PreviewUtil.java
deleted file mode 100644
index ef48056..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/PreviewUtil.java
+++ /dev/null
@@ -1,412 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.utils;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.PrintStream;
-import java.io.StringReader;
-import java.nio.charset.Charset;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.MissingResourceException;
-import java.util.PropertyResourceBundle;
-import java.util.Map.Entry;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.jst.jsf.common.ui.IFileFolderConstants;
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.jsf.common.ui.internal.utils.PathUtil;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.ui.IEditorInput;
-import org.w3c.dom.Attr;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * @author mengbo
- */
-public class PreviewUtil {
- /** Create the logger for this class */
- private static Logger _log = PDPlugin.getLogger(PreviewUtil.class);
-
- /** line separator */
- public static final String LINE_SEPARATOR = System
- .getProperty("line.separator"); //$NON-NLS-1$
-
- /** web root path */
- private final static String WEBROOT_PATH = null;
-
- /** the file being previewed */
- private static IFile CURRENT_FILE = null;
-
- /** the property bundel */
- private static PropertyResourceBundle BUNDLE = null;
-
- /** the property bundel map used for loadbundle preview action */
- private static Map BUNDLE_MAP = null;
-
- /** the variable name used for loadbundel preview action */
- private static String VAR = null;
-
- /** key is prefix value is uri */
- private static Map _taglibMap = new HashMap();
-
-
- /**
- * @return the current bundle
- */
- public static final PropertyResourceBundle getBUNDLE() {
- return BUNDLE;
- }
-
- /**
- * @param bundle
- */
- public static final void setBUNDLE(PropertyResourceBundle bundle) {
- BUNDLE = bundle;
- }
-
- /**
- * @return the current bundle map
- */
- public static final Map getBUNDLE_MAP() {
- return BUNDLE_MAP;
- }
-
- /**
- * @param bundle_map
- */
- public static final void setBUNDLE_MAP(Map bundle_map) {
- BUNDLE_MAP = bundle_map;
- }
-
- /**
- * @return the current variable
- */
- public static final String getVAR() {
- return VAR;
- }
-
- /**
- * @param var
- */
- public static final void setVAR(String var) {
- VAR = var;
- }
-
- /**
- * @return Returns the _taglibMap.
- */
- public static Map getTaglibMap() {
- return _taglibMap;
- }
-
- /**
- * @param map
- * The _taglibMap to set.
- */
- public static void setTaglibMap(Map map) {
- _taglibMap = map;
- }
-
- /**
- * Get tag attribute string from attribute map
- *
- * @param map
- * tag attribute map
- * @return the attribute string
- */
- public static String getAttributesAsString(Map map) {
- return getAttributesAsString(map, true);
- }
-
- /**
- * Get file path from uri
- *
- * @param uri
- * taglib uri
- * @return the path as a string
- */
- public static String getPathFromURI(String uri) {
- if (uri == null) {
- return uri;
- }
-
- if (uri.startsWith(IFileFolderConstants.PATH_SEPARATOR)) {
- return PreviewUtil.WEBROOT_PATH + uri;
- }
- IFile curFile = PreviewUtil.CURRENT_FILE;
- if (curFile != null) {
- IContainer con = curFile.getParent();
- if (con != null) {
- IPath path = con.getLocation();
- if (path != null) {
- String aPath = path.toString() + File.separator + uri;
-
- aPath = aPath.replace('/', File.separatorChar);
- aPath = aPath.replace('\\', File.separatorChar);
- if (aPath.endsWith(File.separator)) {
- aPath += File.separator;
- }
- File file = new File(aPath);
- if (file.exists()) {
- return aPath;
- }
- return uri;
- }
- }
- }
- return null;
- }
-
- /**
- * Get bundle value for expression
- *
- * @param attrValue
- * expression
- * @return the value
- */
- public static String getValueOFEP(String attrValue) {
- if (attrValue != null) {
- if (attrValue.startsWith("#{")) //$NON-NLS-1$
- {
- String key, value = null;
- int i = attrValue.lastIndexOf("."); //$NON-NLS-1$
- if (i > 0) {
- key = attrValue.substring(i + 1, attrValue.length() - 1)
- .trim();
- String bundleVariable = attrValue.substring(2, i).trim();
- if (BUNDLE_MAP == null) {
- return attrValue; //$NON-NLS-1$
- }
- PropertyResourceBundle bundle = (PropertyResourceBundle) BUNDLE_MAP
- .get(bundleVariable);
-
- if (bundle != null) {
- try {
- value = bundle.getString(key);
- if (value != null) {
- return value;
- }
- return attrValue; //$NON-NLS-1$
- } catch (MissingResourceException e1) {
- // "Error in resource bundle processing:"
- _log.info("PreviewUtil.Error.0", e1); //$NON-NLS-1$
- }
- }
- }
- }
- }
- return attrValue;
- }
-
- /**
- * Get tag attribute string from attribute map
- *
- * @param map
- * tag attribute map
- * @param flag
- * state
- * @return the attributes as a single string
- */
- private static String getAttributesAsString(Map<String, String> map, boolean flag) {
- if (map == null) {
- return null;
- }
-
- StringBuffer stringbuffer = new StringBuffer();
- for (Iterator<Entry<String, String>> e = map.entrySet().iterator(); e.hasNext();) {
- Map.Entry<String,String> entry = e.next();
- String attrName = entry.getKey();
- String attrValue = entry.getValue();
- attrValue = getValueOFEP(attrValue);
- if (ICSSPropertyID.ATTR_SRC.equalsIgnoreCase(attrName)
- || ICSSPropertyID.ATTR_HREF.equalsIgnoreCase(attrName)
- || ICSSPropertyID.ATTR_URI.equalsIgnoreCase(attrName)
- || ICSSPropertyID.ATTR_BINDING.equalsIgnoreCase(attrName)
- || ICSSPropertyID.ATTR_PAGE.equalsIgnoreCase(attrName)) {
- if (PreviewUtil.WEBROOT_PATH != null && attrValue != null
- && !attrValue.startsWith("http") //$NON-NLS-1$
- && !attrValue.startsWith("file")) //$NON-NLS-1$
- {
- attrValue = getPathFromURI(attrValue);
- }
- }
- if (attrValue != null) {
- stringbuffer.append(" ").append(attrName); //$NON-NLS-1$
- if (attrValue.indexOf(34) != -1) {
- StringBuffer stringbuffer1 = new StringBuffer();
- for (int j = 0; j < attrValue.length(); j++) {
- char c = attrValue.charAt(j);
- if (c != '"') {
- stringbuffer1.append(c);
- }
- }
-
- attrValue = stringbuffer1.toString();
- }
- if (attrValue != null && attrValue.startsWith("#{")) //$NON-NLS-1$
- {
- attrValue = ""; //$NON-NLS-1$
- }
- stringbuffer.append("=\"").append(attrValue).append('"'); //$NON-NLS-1$
- }
- }
- // System.out.println("BBBB:" +stringbuffer.toString());
-
- return stringbuffer.toString();
- }
-
- /**
- * Change NamedNodeMap type to Map type
- *
- * @param nodeMap
- * NamedNodeMap type
- * @return the map
- */
- public static Map getAttributeMap(NamedNodeMap nodeMap) {
- if (nodeMap != null) {
- int len = nodeMap.getLength();
- HashMap map = new HashMap();
- for (int i = 0; i < len; i++) {
- Node node = nodeMap.item(i);
- String name = node.getNodeName();
- String value = node.getNodeValue();
- if (name != null
- && !name.trim().equalsIgnoreCase("") && value != null) //$NON-NLS-1$
- {
- map.put(name, value);
- }
- }
- return map;
- }
- return null;
- }
-
- /**
- * @param result
- * @param editorInput
- * @return the file
- */
- public static File toFile(StringBuffer result, IEditorInput editorInput) {
- try {
- File file = File.createTempFile("previewtmp", ".html"); //$NON-NLS-1$ //$NON-NLS-2$
- if (!file.exists()) {
- file.createNewFile();
- }
-
- //fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=202613 kindly contributed by Eiji Morito.
- IContentTypeManager contentTypeManager = Platform.getContentTypeManager();
- IContentType contentType = contentTypeManager.getContentType("org.eclipse.wst.html.core.htmlsource"); //$NON-NLS-1$
- IContentDescription contentDescription = contentType.getDescriptionFor(new StringReader(result.toString()), null);
- String charset = contentDescription.getCharset();
-
- if (charset == null || !Charset.isSupported(charset)) {
- charset = ResourcesPlugin.getEncoding();
- if (charset == null)
- charset = "UTF-8"; //$NON-NLS-1$
- }
-
- FileOutputStream fos = new FileOutputStream(file);
- PrintStream ps = new PrintStream(fos, true, charset);
- ps.print(result.toString());
- ps.close();
- fos.close();
- return file;
- } catch (IOException e) {
- // "Error in file open:"
- _log.info("PreviewUtil.Error.3", e); //$NON-NLS-1$
- return null;
- }
- }
-
-
- /**
- * do preivew on Node recursively translate escape char for Node and Node's
- * child translate relative path for Node and Node's child
- *
- * @param node
- * root node that will be previewed
- */
- public static void previewNode(Node node) {
- if (node == null) {
- return;
- }
- NodeList nodeList = node.getChildNodes();
- if (nodeList == null) {
- return;
- }
- NamedNodeMap attrMap = node.getAttributes();
-
- if (attrMap != null) {
- for (int i = 0, n = attrMap.getLength(); i < n; i++) {
- Node attrNode = attrMap.item(i);
- if (attrNode instanceof Attr) {
- Attr attr = (Attr) attrNode;
- attr.setNodeValue(getValueOFEP(attr.getNodeValue()));
- attr.setNodeValue(PathUtil.convertToAbsolutePath(attr
- .getNodeValue(), null));
- //TODO: dead?
-// StringBuffer buf = new StringBuffer();
-// String attrValue = attr.getNodeValue();
- }
- }
- }
- for (int i = 0, n = nodeList.getLength(); i < n; i++) {
- previewNode(nodeList.item(i));
- }
- }
-
- // /**
- // * handle escape attebute of tag
- // *
- // * @param node
- // * @return
- // */
- // public static boolean escapeFoeNode(Node node)
- // {
- // if (node == null)
- // {
- // return false;
- // }
- // NamedNodeMap attrMap = node.getAttributes();
- // if (attrMap != null)
- // {
- // for (int i = 0, n = attrMap.getLength(); i < n; i++)
- // {
- // Node attrNode = attrMap.item(i);
- // if (attrNode != null && attrNode instanceof Attr)
- // {
- // if ("escape".equalsIgnoreCase(attrNode.getNodeName())
- // && "true".equalsIgnoreCase(attrNode.getNodeValue()))
- // {
- // return true;
- // }
- // }
- // }
- // }
- // return false;
- // }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/ProjectResolver.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/ProjectResolver.java
deleted file mode 100644
index e18044d..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/ProjectResolver.java
+++ /dev/null
@@ -1,521 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.utils;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-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.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jst.jsf.common.ui.IFileFolderConstants;
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.jsf.common.ui.internal.utils.ResourceUtils;
-import org.eclipse.jst.jsf.common.ui.internal.utils.WebrootUtil;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.util.URIResolver;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * A URIResolver implementation
- *
- */
-public class ProjectResolver implements URIResolver {
- private static final String TLD_TAG_URI = "uri";
-
- private static final String URI_PREFIX_HTTP = "http";
-
- private static final String FILE_PROTOCOL = "file";
-
- /** Create the logger for this class */
- private static Logger _log = PDPlugin.getLogger(ProjectResolver.class);
-
- private IProject _project = null;
-
- private String _fileBaseLocation = null;
-
- private static Map _uriMap = null;
-
- /**
- * It is strongly recommended that clients use
- * project.getAdapter(URIResolver.class) to obtain a URIResolver aware of
- * the Project's special requirements. Note that a URIResolver may not be
- * returned at all so manually creating this object may still be required.
- * @param project
- */
- public ProjectResolver(IProject project) {
- super();
- _project = project;
- }
-
- /**
- * @param path
- */
- public void seekTld(IFolder path) {
- if (path == null) {
- return;
- }
- if (_uriMap == null) {
- _uriMap = new HashMap();
- }
-
- try {
- IResource[] res = path.members();
- if (null == res) {
- return;
- }
- for (int i = 0; i < res.length; i++) {
- if (res[i] instanceof IFolder) {
- seekTld((IFolder) res[i]);
- }
- String ext = res[i].getFileExtension();
- if (IFileFolderConstants.EXT_TAGLIB.equalsIgnoreCase(ext)) {
- IFile tldFile = (IFile) res[i];
- String uri = getURIfromTLD(tldFile);
- String locate = tldFile.getLocation().toOSString();
- if (uri != null && _uriMap.get(uri) == null) {
- _uriMap.put(uri, locate);
- }
- }
- }
- } catch (CoreException e) {
- _log.error("Error.ProjectResolver.GetlocationByURI.0", e);
- }
- }
-
- /**
- * @param path
- */
- public void seekTld(File path) {
- if (path == null || !path.isDirectory()) {
- return;
- }
- if (_uriMap == null) {
- _uriMap = new HashMap();
- }
-
- try {
- File[] res = path.listFiles();
- if (null == res) {
- return;
- }
- for (int i = 0; i < res.length; i++) {
- if (res[i] instanceof IFolder) {
- seekTld(res[i]);
- }
-
- if (res[i].getName().endsWith(
- IFileFolderConstants.DOT
- + IFileFolderConstants.EXT_TAGLIB)) {
- String uri = getURIfromTLD(res[i]);
- String locate;
-
- locate = res[i].getCanonicalPath();
-
- if (uri != null && _uriMap.get(uri) == null) {
- _uriMap.put(uri, locate);
- }
- }
- }
- } catch (IOException e1) {
- _log.error("Error.ProjectResolver.GetlocationByURI.0", e1);
- }
- }
-
- /**
- * @param tldFile
- * @return the uri for the tld in tldFile or null
- */
- public String getURIfromTLD(File tldFile) {
-
- if (tldFile == null) {
- return null;
- }
- IDOMModel tldModel = null;
-
- InputStream in = null;
- try {
- in = new FileInputStream(tldFile);
- } catch (FileNotFoundException e) {
- _log.error("RenderingTraverser.Error.FileNotFound", e);
- return null;
- }
-// IDOMModel xmlModel = null;
-
- try {
- tldModel = (IDOMModel) StructuredModelManager.getModelManager().getModelForRead(
- tldFile.getAbsolutePath(), in, null);
- NodeList uriList = tldModel.getDocument().getElementsByTagName(
- TLD_TAG_URI);
- for (int i = 0, n = uriList.getLength(); i < n; i++) {
- Node uri = uriList.item(i);
- return uri.getChildNodes().item(0).getNodeValue();
- }
- } catch (UnsupportedEncodingException e1) {
- _log.error("RenderingTraverser.Error.UnsupportedEncoding", e1);
- } catch (IOException e1) {
- _log.error("RenderingTraverser.Error.IO", e1);
- } finally {
- ResourceUtils.ensureClosed(in);
-
- if (tldModel != null)
- {
- tldModel.releaseFromRead();
- }
- }
-
- return null;
- }
-
- /**
- * @param tldFile
- * @return the URI for the TLD in tldFile or null
- */
- public String getURIfromTLD(IFile tldFile) {
- if (tldFile == null) {
- return null;
- }
- IDOMModel tldModel;
-
- try {
- tldModel = (IDOMModel) getModelManager().getModelForRead(tldFile);
- NodeList uriList = tldModel.getDocument().getElementsByTagName(
- TLD_TAG_URI);
- for (int i = 0, n = uriList.getLength(); i < n; i++) {
- Node uri = uriList.item(i);
- return uri.getChildNodes().item(0).getNodeValue();
- }
- } catch (IOException e) {
- // Error in taglib locating.
- _log.error("Error.ProjectResolver.GetlocationByURI.0", e); //$NON-NLS-1$
- } catch (CoreException e1) {
- _log.error("Error.ProjectResolver.GetlocationByURI.0", e1);
- }
- return null;
- }
-
- /**
- * initialize the map of tlds
- */
- public void initTldMap() {
- if (_uriMap == null) {
- _uriMap = new HashMap();
- }
- if (_project == null) {
- return;
- }
- if (WebrootUtil.getWebContentFolder(_project) == null) {
- return;
- }
- IFolder webinf = WebrootUtil.getWebContentFolder(_project).getFolder(
- IFileFolderConstants.FOLDER_WEBINF);
- if (webinf != null && webinf.exists()) {
- seekTld(webinf);
- }
-
- String locate = PDPlugin.getInstallLocation().append("/jsf-tld")
- .toString();
- File jsfDir = new File(locate);
- seekTld(jsfDir);
-
- }
-
- public java.lang.String getFileBaseLocation() {
- return _fileBaseLocation;
- }
-
- public java.lang.String getLocationByURI(String uri) {
- // System.out.println(getLocationByURI(uri, getFileBaseLocation()));
- return getLocationByURI(uri, getFileBaseLocation());
- }
-
- private IModelManager getModelManager() {
- return StructuredModelManager.getModelManager();
- }
-
- private String getLocationFromWEBXML(String uri, String baseReference) {
- if (uri == null) {
- return null;
- }
- try {
- // if (_project.hasNature(ICommonConstants.NATURE_WEBAPP))
- // {
- if (uri.startsWith(IFileFolderConstants.PATH_SEPARATOR)) {
- uri = _project.getProject().getLocation().toString()
- + IFileFolderConstants.PATH_SEPARATOR
- + WebrootUtil.getWebContentFolderName(_project) + uri;
- }
- if (uri.startsWith(URI_PREFIX_HTTP)) {
- IFile webxml = WebrootUtil.getWebContentFolder(_project)
- .getFolder(IFileFolderConstants.FOLDER_WEBINF).getFile(
- IFileFolderConstants.FILE_WEB_XML);
- IDOMModel xmlModel;
-
- if (webxml.exists()) {
- try {
- xmlModel = (IDOMModel) getModelManager()
- .getModelForRead(webxml);
-
- NodeList taglibNodeList = xmlModel
- .getDocument()
- .getElementsByTagName(ICSSPropertyID.TAG_TAGLIB);
-
- for (int i = 0, size = taglibNodeList.getLength(); i < size; i++) {
- Node taglibNode = taglibNodeList.item(i);
-
- NodeList childList = taglibNode.getChildNodes();
- String taguri = "";
- String taglocation = "";
- for (int j = 0, childSize = childList.getLength(); j < childSize; j++) {
- Node childTaglibNode = childList.item(j);
- if (ICSSPropertyID.ATTR_TAGLIB_URI
- .equalsIgnoreCase(childTaglibNode
- .getNodeName())) {
- taguri = childTaglibNode.getChildNodes()
- .item(0).getNodeValue();
- }
- if (ICSSPropertyID.ATTR_TAGLIB_LOCATION
- .equalsIgnoreCase(childTaglibNode
- .getNodeName())) {
- taglocation = childTaglibNode
- .getChildNodes().item(0)
- .getNodeValue();
- }
-
- }
- if (uri.equalsIgnoreCase(taguri))
- uri = _project.getProject().getLocation()
- .toString()
- + IFileFolderConstants.PATH_SEPARATOR
- + WebrootUtil
- .getWebContentFolderName(_project)
- + taglocation;
- }
- xmlModel.releaseFromRead();
- } catch (IOException e) {
-
- // Error in taglib locating.
- _log.error(
- "Error.ProjectResolver.GetlocationByURI.0", e); //$NON-NLS-1$
- } catch (CoreException e1) {
- e1.printStackTrace();
- _log.error("Error.ProjectResolver.GetlocationByURI.0",
- e1);
- }
-
- }
- }
- // }
- } catch (DOMException e1) {
- // Error in taglib locating.
- _log.error("Error.ProjectResolver.GetlocationByURI.0", e1); //$NON-NLS-1$
- }
- // catch (CoreException e1)
- // {
- //
- // _log.error("Error.ProjectResolver.GetlocationByURI.0", e1);
- // }
-
- if (isFileURL(uri)) {
- try {
- URL url = new URL(uri);
- return getPath(url);
- } catch (MalformedURLException e) {
- _log.error("Error.ProjectResolver.GetlocationByURI.0", e);
- }
- }
- // defect 244817 end
- return URIHelper.normalize(uri, baseReference, getRootLocationString());
-
- }
-
- public String getLocationByURI(String uri, String baseReference) {
- // DataWindow may generate URL like "d:\somefile" (dos path). We may
- // need some
- // special support. (lium)
- int columnIndex = uri.indexOf(":");
- int slashIndex = uri.indexOf("/");
- if (columnIndex != -1 && (slashIndex == -1 || columnIndex < slashIndex)) {
- return uri;
- }
-
- String result = getLocationFromWEBXML(uri, baseReference);
- if (result != null && !result.equals(uri)) {
- return result;
- }
- if (_uriMap == null) {
- initTldMap();
- }
- if (_uriMap != null) {
- return (String) _uriMap.get(uri);
- }
- return null;
- }
-
- // defect 244817 start
- /**
- * @param passedSpec
- * @return boolean
- */
- private boolean isFileURL(String passedSpec) {
- if (passedSpec == null) {
- return false;
- }
- final String spec = passedSpec.trim();
- if (spec.length() == 0) {
- return false;
- }
- String newProtocol = null;
- for (int index = 0, limit = spec.length(); index < limit; index++) {
- final char p = spec.charAt(index);
- if (p == '/') {
- //$NON-NLS-1$
- break;
- }
- if (p == ':') {
- //$NON-NLS-1$
- newProtocol = spec.substring(0, index);
- break;
- }
- }
- return (newProtocol != null && newProtocol
- .compareToIgnoreCase(FILE_PROTOCOL) == 0); //$NON-NLS-1$
- }
-
- /**
- * @param url
- * @return String
- */
- private String getPath(URL url) {
- String ref = url.getRef() == null ? "" : "#" + url.getRef(); //$NON-NLS-1$ //$NON-NLS-2$
- String strPath = url.getFile() + ref;
- IPath path;
- if (strPath.length() == 0) {
- path = Path.ROOT;
- } else {
- path = new Path(strPath);
- String query = null;
- StringTokenizer parser = new StringTokenizer(strPath, "?"); //$NON-NLS-1$
- int tokenCount = parser.countTokens();
- if (tokenCount == 2) {
- path = new Path((String) parser.nextElement());
- query = (String) parser.nextElement();
- }
- if (query == null) {
- parser = new StringTokenizer(path.toString(), "#"); //$NON-NLS-1$
- tokenCount = parser.countTokens();
- if (tokenCount == 2) {
- path = new Path((String) parser.nextElement());
- }
- }
- }
- return getPath(path, url.getHost());
- }
-
- /**
- * @param path
- * @param host
- * @return String
- */
- private String getPath(IPath path, String host) {
- IPath newPath = path;
- // They are potentially for only Windows operating system.
- // a.) if path has a device, and if it begins with IPath.SEPARATOR,
- // remove it
- final String device = path.getDevice();
- if (device != null && device.length() > 0) {
- if (device.charAt(0) == IPath.SEPARATOR) {
- final String newDevice = device.substring(1);
- newPath = path.setDevice(newDevice);
- }
- }
- // b.) if it has a hostname, it is UNC name... Any java or eclipse api
- // helps it ??
- if (newPath != null && host != null && host.length() != 0) {
- IPath uncPath = new Path(host);
- uncPath = uncPath.append(path);
- newPath = uncPath.makeUNC(true);
- }
-
- if (newPath != null)
- {
- return newPath.toString();
- }
- return path.toString();
- }
-
- /**
- * Resolve the (possibly relative) URI acording to RFC1808 using the default
- * file base location. Resolves resource references into absolute resource
- * locations without ensuring that the resource actually exists. Note:
- * currently resolveCrossProjectLinks is ignored in this implementation.
- */
- public java.lang.String getLocationByURI(String uri,
- boolean resolveCrossProjectLinks) {
- return getLocationByURI(uri, getFileBaseLocation(),
- resolveCrossProjectLinks);
- }
-
- /**
- * Perform the getLocationByURI action using the baseReference as the point
- * of reference instead of the default for this resolver Note: currently
- * resolveCrossProjectLinks is ignored in this implementation.
- */
- public java.lang.String getLocationByURI(String uri, String baseReference,
- boolean resolveCrossProjectLinks) {
- return getLocationByURI(uri, baseReference);
- }
-
- public org.eclipse.core.resources.IProject getProject() {
- return _project;
- }
-
- public org.eclipse.core.resources.IContainer getRootLocation() {
- return _project;
- }
-
- private String getRootLocationString() {
- return null;
- }
-
- public void setFileBaseLocation(java.lang.String newFileBaseLocation) {
- _fileBaseLocation = newFileBaseLocation;
- }
-
- public void setProject(org.eclipse.core.resources.IProject newProject) {
- _project = newProject;
- }
-
- public InputStream getURIStream(String uri) {
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/SelectManyHelper.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/SelectManyHelper.java
deleted file mode 100644
index a7f3ff6..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/SelectManyHelper.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.utils;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.jst.jsf.core.internal.tld.CMUtil;
-import org.eclipse.jst.jsf.core.internal.tld.IJSFConstants;
-import org.eclipse.jst.jsf.core.internal.tld.ITLDConstants;
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * @author mengbo
- */
-public class SelectManyHelper {
-
- private final static Set<String> JSF_SELECT_TAGS, HTML_SELECT_TAGS;
-
-
- static {
- Set<String> tempSet = new HashSet<String>(4);
- tempSet.add(IHTMLConstants.TAG_SELECT);
- tempSet.add(IHTMLConstants.TAG_OPTGROUP);
- HTML_SELECT_TAGS = Collections.unmodifiableSet(tempSet);
-
- tempSet = new HashSet(8);
- tempSet.add(IJSFConstants.TAG_SELECTONELISTBOX);
- tempSet.add(IJSFConstants.TAG_SELECTONEMENU);
- tempSet.add(IJSFConstants.TAG_SELECTMANYLISTBOX);//
- tempSet.add(IJSFConstants.TAG_SELECTMANYMENU);//
- tempSet.add(IJSFConstants.TAG_SELECTMANYCHECKBOX);
- JSF_SELECT_TAGS = Collections.unmodifiableSet(tempSet);
- }
-
- /**
- * @param node
- * @return the select option children of node
- */
- public static Object[] getSelectOptions(Element node) {
- if (node == null) {
- return null;
- }
- IDOMModel xmlModel = null;
- if (node instanceof IDOMNode) {
- xmlModel = ((IDOMNode) node).getModel();
- }
- if (xmlModel == null) {
- return null;
- }
- // TODO: this query is not cached.
- String prefixNode = JSPUtil.getPrefix(xmlModel,
- ITLDConstants.URI_JSF_HTML);
- if (prefixNode != null && node.getPrefix() != null
- && node.getPrefix().equals(prefixNode)) {
- if (JSF_SELECT_TAGS.contains(node.getLocalName())) {
- String prefixItem = JSPUtil.getPrefix(xmlModel,
- ITLDConstants.URI_JSF_CORE);
- List result = new ArrayList();
- NodeList items = node.getElementsByTagName(prefixItem
- + ":" + IJSFConstants.TAG_SELECTITEM); //$NON-NLS-1$
- for (int i = 0, n = items.getLength(); i < n; i++) {
- result.add(items.item(i));
- }
- items = node.getElementsByTagName(prefixItem
- + ":" + IJSFConstants.TAG_SELECTITEMS); //$NON-NLS-1$
- for (int i = 0, n = items.getLength(); i < n; i++) {
- result.add(items.item(i));
- }
- return result.size() > 0 ? result.toArray(new Node[result
- .size()]) : null;
- }
- }
- if (node.getPrefix() == null) {
- if (HTML_SELECT_TAGS.contains(node.getNodeName().toLowerCase())) {
- List result = new ArrayList();
- NodeList options = node
- .getElementsByTagName(IHTMLConstants.TAG_OPTION);
- NodeList optionGroups = node
- .getElementsByTagName(IHTMLConstants.TAG_OPTGROUP);
- for (int i = 0, n = options.getLength(); i < n; i++) {
- result.add(options.item(i));
- }
- for (int i = 0, n = optionGroups.getLength(); i < n; i++) {
- result.add(optionGroups.item(i));
- }
- return result.toArray(new Node[result.size()]);
- }
- }
- return null;
- }
-
- /**
- * @param node
- * @return the selection option children of node as strings
- */
- public static String[] getSelectOptionsString(Element node) {
- if (node == null) {
- return null;
- }
- Object[] options = getSelectOptions(node);
- if (null == options || options[0] == null) {
- return null;
- }
- List result = new ArrayList();
- for (int i = 0, n = options.length; i < n; i++) {
- if (options[i] instanceof Element) {
- Element element = (Element) options[i];
- Node value = null;
- if (element.getNodeName()
- .indexOf(IJSFConstants.TAG_SELECTITEMS) >= 0) {
- value = element.getAttributeNode(IJSFConstants.ATTR_VALUE);
- } else if (element.getNodeName().indexOf(
- IJSFConstants.TAG_SELECTITEM) >= 0) {
- value = element
- .getAttributeNode(ICSSPropertyID.ATTR_ITEMLABEL);
- }
- if (value != null) {
- result.add(value.getNodeValue());
- }
- }
- }
- return (String[]) result.toArray(new String[] {});
- }
-
- /**
- * @param node
- * @return true if node has select option children
- */
- public static boolean hasSelectOptions(Element node) {
- if (node == null) {
- return false;
- }
- String uri = CMUtil.getElementNamespaceURI(node);
- if (ITLDConstants.URI_JSF_HTML.equals(uri)) {
-
- if (JSF_SELECT_TAGS.contains(node.getLocalName())) {
- IDOMModel model = ((IDOMElement) node).getModel();
- String jsfcorePrefix = JSPUtil.getPrefix(model,
- ITLDConstants.URI_JSF_CORE);
- if (jsfcorePrefix != null) {
- NodeList nl = node.getElementsByTagName(jsfcorePrefix + ":"
- + IJSFConstants.TAG_SELECTITEM);
- NodeList nl1 = node.getElementsByTagName(jsfcorePrefix
- + ":" + IJSFConstants.TAG_SELECTITEMS);
- return nl.getLength() > 0 || nl1.getLength() > 0;
- }
- return false;
- }
- }
- if (ITLDConstants.URI_HTML.equals(uri)) {
- if (HTML_SELECT_TAGS.contains(node.getNodeName().toLowerCase())) {
- NodeList nl = node
- .getElementsByTagName(IHTMLConstants.TAG_OPTION);
- NodeList nl1 = node
- .getElementsByTagName(IHTMLConstants.TAG_OPTGROUP);
- return nl.getLength() > 0 || nl1.getLength() > 0;
- }
- }
- return false;
- }
-
- /**
- * @param node
- * @return true if node is a core or HTML select tag
- */
- public static boolean supportSections(Element node) {
- String uri = CMUtil.getElementNamespaceURI(node);
- if (ITLDConstants.URI_JSF_HTML.equals(uri)) {
- return JSF_SELECT_TAGS.contains(node.getLocalName());
- }
- if (ITLDConstants.URI_HTML.equals(uri)) {
- return HTML_SELECT_TAGS.contains(node.getNodeName().toLowerCase());
- }
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/SelectionHelper.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/SelectionHelper.java
deleted file mode 100644
index ee93b58..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/SelectionHelper.java
+++ /dev/null
@@ -1,384 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.utils;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jst.jsf.core.internal.tld.CMUtil;
-import org.eclipse.jst.pagedesigner.dom.DOMPosition;
-import org.eclipse.jst.pagedesigner.dom.DOMPositionHelper;
-import org.eclipse.jst.pagedesigner.dom.DOMRefPosition;
-import org.eclipse.jst.pagedesigner.dom.DOMRefPosition2;
-import org.eclipse.jst.pagedesigner.dom.DOMUtil;
-import org.eclipse.jst.pagedesigner.dom.EditValidateUtil;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.jst.pagedesigner.parts.NodeEditPart;
-import org.eclipse.jst.pagedesigner.viewer.DesignPosition;
-import org.eclipse.jst.pagedesigner.viewer.DesignRange;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.CharacterData;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class SelectionHelper {
- /**
- * convert the text selection to a Node. Will use the start offset of the
- * text selection.
- *
- * @param model
- * @param textSel
- * @return the node for the text selectin in model or null
- */
- public static Node toNode(IStructuredModel model, ITextSelection textSel) {
- // FIXME: currently always normalize to a single node. should also
- // consider change into DesignRange
- // on text selection, find the appropriate Node
- Object inode = model.getIndexedRegion(textSel.getOffset());
- if (inode instanceof Node) {
- return (Node) inode;
- }
- return null;
- }
-
- /**
- * convert a structured selection of NodeEditPart or Node into the first
- * node.
- *
- * @param selection
- * @return the node for the selection or null
- */
- public static Node toNode(IStructuredSelection selection) {
- if (selection.isEmpty()) {
- return null;
- }
- Object first = selection.getFirstElement();
- if (first instanceof Node) {
- return (Node) first;
- } else if (first instanceof NodeEditPart) {
- return ((NodeEditPart) first).getIDOMNode();
- } else {
- return null;
- }
- }
-
- /**
- * convert a DesignRange into a single node.
- *
- * @param range
- * @return the node for the design range or null
- */
- public static Node toNode(DesignRange range) {
- if (range.isValid()) {
- Node node1 = range.getStartPosition().getContainerNode();
- Node node2 = range.getEndPosition().getContainerNode();
- return DOMUtil.findCommonAncester(node1, node2);
- }
- return null;
- }
-
- /**
- * @param model
- * @param region
- * if null, then will calculate it using offset.
- * @param offset
- * offset in source.
- * @return a dom position for the region and offset
- */
- public static IDOMPosition toDOMPosition(IDOMModel model,
- IndexedRegion region, int offset) {
- if (region == null) {
- region = model.getIndexedRegion(offset);
- }
- if (region == null && offset > 0) {
- // in case this is at end of file.
- offset = offset - 1;
- region = model.getIndexedRegion(offset);
- if (region != null) {
- if (region.getEndOffset() >= offset + 1) {
- offset += 1; // restore offset.
- }
- }
- }
- if (region == null) {
- return new DOMPosition(model.getDocument(), 0);
- }
- IDOMNode node = (IDOMNode) region;
- int start = node.getStartOffset();
- if (offset <= start) {
- return new DOMRefPosition(node, false);
- }
- int end = node.getEndOffset();
- if (offset >= end) {
- return new DOMRefPosition(node, true);
- }
- if (node instanceof CharacterData) {
- String data = ((CharacterData) node).getData();
- String source = node.getSource();
- if (data.equals(source)) {
- return new DOMPosition(node, offset - start);
- }
- IStructuredDocumentRegion r = node
- .getFirstStructuredDocumentRegion();
- int countedData = 0;
- // TODO: dead? int offsetInNode = offset - start;
- while (r != null) {
- if (DOMRegionContext.XML_CHAR_REFERENCE.equals(r.getType())
- || DOMRegionContext.XML_ENTITY_REFERENCE.equals(r
- .getType())) {
- countedData += 1; // FIXME: what if the entity reference's
- // corresponding data is more than 1
- // char?
- // where can we get that information?
- if (r.getEnd() >= offset) {
- return new DOMPosition(node, countedData);
- }
- } else {
- if (r.getEnd() >= offset) {
- return new DOMPosition(node, countedData + offset
- - r.getStart());
- }
- countedData += r.getLength();
- }
- r = r.getNext();
- }
- return new DOMRefPosition(node, true);
- } else if (node instanceof Element) {
- CMElementDeclaration cm = CMUtil
- .getElementDeclaration((Element) node);
- if (cm != null && cm.getContentType() == CMElementDeclaration.EMPTY) {
- // this node can't have children.
- return new DOMRefPosition(node, true);
- }
- IStructuredDocumentRegion startRegion = node
- .getStartStructuredDocumentRegion();
- if (startRegion == null) {
- return new DOMRefPosition(node, true);
- }
- int startRegionEnd = node.getStartStructuredDocumentRegion()
- .getEnd();
- if (offset <= startRegionEnd) {
- // it is in the start tag region. So put position at first
- // child position.
- return new DOMRefPosition2(node, false);
- }
- return new DOMRefPosition2(node, true);
- } else {
- return new DOMRefPosition(node, true);
- }
- // XXX: the implementation in EditModelQuery seemed to be very complex.
- // Need revisit that
- // and refactor the implementation to this class later. (lium)
- }
-
- /**
- * Give a text selection with offset and length, convert it into a Designer
- * selection (IStrucuturedSelection of editpart or DesignerRange). If the
- * text selection include just a single element node, we'll create a
- * IStructuredSelection, otherwise we'll create a DesignerRange.
- *
- * @param graphicViewer
- * @param offset
- * @param length
- * @return a selection
- */
- public static ISelection convertToDesignerSelection(
- IHTMLGraphicalViewer graphicViewer, int offset, int length) {
- IDOMModel model = graphicViewer.getModel();
- IndexedRegion region1 = model.getIndexedRegion(offset);
- IndexedRegion region2 = model.getIndexedRegion(offset + length);
- IDOMNode node1 = (IDOMNode) region1;
-
- if (node1 == null) {
- IDOMPosition endOfDoc = new DOMRefPosition2(model.getDocument(),
- true);
- DesignPosition p = DOMPositionHelper.toDesignPosition(endOfDoc);
- return new DesignRange(p, p);
- }
-
- if ((region1 == region2 || node1.getEndOffset() == offset + length)
- && !(node1 instanceof Text)) {
- // ok, we selected a single node.
- EditPart part = (EditPart) node1.getAdapterFor(EditPart.class);
- if (part != null) {
- return new StructuredSelection(part);
- }
- }
-
- // when we reach here, we'll create a DesignerRange
- IDOMPosition position1 = toDOMPosition(model, region1, offset);
- IDOMPosition position2 = (length == 0 ? position1 : toDOMPosition(
- model, region2, offset + length));
-
- if (position1 == null || position2 == null) {
- return new DesignRange(null, null);
- }
- DesignPosition p1 = DOMPositionHelper.toDesignPosition(position1);
- DesignPosition p2 = (length == 0 ? p1 : DOMPositionHelper
- .toDesignPosition(position2));
- if (p1 == null || p2 == null) {
- return new DesignRange(null, null);
- }
-
- return new DesignRange(p1, p2);
-
- }
-
- /**
- * convert a IDOMPosition into index in the source.
- *
- * @param p
- * @return
- */
- private static int getIndexedRegionLocation(IDOMPosition p) {
- if (!EditValidateUtil.validPosition(p)) {
- return 0;
- }
-
- IDOMNode parent = (IDOMNode) p.getContainerNode();
- if (p.isText()) {
- String text = ((CharacterData) parent).getData();
- String source = parent.getSource();
- if (text.length() == source.length()) {
- // no entity reference.
- return parent.getStartOffset() + p.getOffset();
- }
- // CR404708. Need to handle entity reference in the text.
- int offset = p.getOffset();
- int counted = 0;
- IStructuredDocumentRegion r = parent
- .getFirstStructuredDocumentRegion();
- while (r != null && counted < offset) {
- if (DOMRegionContext.XML_CHAR_REFERENCE.equals(r.getType())
- || DOMRegionContext.XML_ENTITY_REFERENCE.equals(r
- .getType())) {
- counted++;
- if (counted >= offset) {
- return r.getEndOffset();
- }
- } else {
- int length = r.getLength();
- if (counted + length >= offset) {
- return r.getStartOffset() + offset - counted;
- }
- counted += length;
- }
- r = r.getNext();
- }
- return parent.getStartOffset() + p.getOffset();
- }
- IDOMNode previous = (IDOMNode) p.getPreviousSiblingNode();
- if (previous != null) {
- return previous.getEndOffset();
- }
- IDOMNode next = (IDOMNode) p.getNextSiblingNode();
- if (next != null) {
- return next.getStartOffset();
- }
- IStructuredDocumentRegion r = parent
- .getStartStructuredDocumentRegion();
- if (r != null) {
- return r.getEnd();
- }
- // r == null normally means the parent is the document node.
- return parent.getEndOffset();
- }
-
- /**
- * convert design selection of structured selection of NodeEditPart into
- * structured selection of Node
- *
- * @param sel
- * @return a structured selectino
- */
- public static IStructuredSelection convertFromDesignSelection(
- IStructuredSelection sel) {
- List list = sel.toList();
- if (list != null) {
- List result = new ArrayList(list.size());
- for (int i = 0, size = list.size(); i < size; i++) {
- NodeEditPart part = (NodeEditPart) list.get(i);
- result.add(part.getIDOMNode());
- }
- return new StructuredSelection(result);
- }
- return new StructuredSelection();
- }
-
- /**
- *
- * @param range
- * selection from designer, could be IStructuredSelection of
- * NodeEditPart, or DesignRange.
- * @return a text selection
- */
- public static ITextSelection convertFromDesignSelection(DesignRange range) {
- if (range.isValid()) {
- IDOMPosition start = DOMPositionHelper.toDOMPosition(range
- .getStartPosition());
- IDOMPosition end = DOMPositionHelper.toDOMPosition(range
- .getEndPosition());
- // We should not encounter invalid position.
- if (EditValidateUtil.validPosition(start)
- && EditValidateUtil.validPosition(end)) {
- int offset = getIndexedRegionLocation(start);
- int endoffset = getIndexedRegionLocation(end);
- if (offset > endoffset) {
- int temp = offset;
- offset = endoffset;
- endoffset = temp;
- }
- return new TextSelection(offset, endoffset - offset);
- }
- }
- return new TextSelection(0, 0);
- }
-
- /**
- * @param selection
- * @return a text selection for the selection or TextSelection(0,0)
- * if nothing can be determined
- */
- public static ITextSelection convertFromDesignSelectionToTextSelection(
- ISelection selection) {
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection nodes = convertFromDesignSelection((IStructuredSelection) selection);
- IDOMNode node = (IDOMNode) nodes.getFirstElement();
- if (node != null && node.getNodeType() != Node.DOCUMENT_NODE) {
- return new TextSelection(node.getStartOffset(), node
- .getEndOffset()
- - node.getStartOffset());
- }
- } else if (selection instanceof DesignRange) {
- return convertFromDesignSelection((DesignRange) selection);
- }
- return new TextSelection(0, 0);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/StructuredModelUtil.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/StructuredModelUtil.java
deleted file mode 100644
index 8853975..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/StructuredModelUtil.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.utils;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-
-/**
- * @author mengbo
- */
-public class StructuredModelUtil {
-
- /**
- * this method is copied from ModelManagerImpl of wtp. Because it is
- * internal.
- *
- * @param model
- * @return null if can't get file.
- */
- // TODO: replace (or supplement) this is a "model info" association to the
- // IFile that created the model
- public static IFile getFileFor(IStructuredModel model) {
- if (model == null)
- return null;
- String path = model.getBaseLocation();
- if (path == null || path.length() == 0) {
- Object id = model.getId();
- if (id == null)
- return null;
- path = id.toString();
- }
- // TODO needs rework for linked resources
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- try {
- IFile file = root.getFile(new Path(path));
- // IFile file = root.getFileForLocation(new Path(path));
- return file;
- } catch (Exception ex) {
- return null;
- }
- }
-
- /**
- *
- * @param model
- * @return null if can't find project for the model
- */
- public static IProject getProjectFor(IStructuredModel model) {
- IProject project = null;
-
- IFile file = getFileFor(model);
- if (file != null) {
- project = file.getProject();
- }
- return project;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/UriAdapterFactory.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/UriAdapterFactory.java
deleted file mode 100644
index 4bad85a..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/UriAdapterFactory.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.utils;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.wst.sse.core.internal.util.URIResolver;
-
-/**
- * @author mengbo comment go to Window - Preferences - Java - Code Style - Code
- * Templates
- */
-public class UriAdapterFactory implements IAdapterFactory {
- /** Create the logger for this class */
- //private static Logger _log = PDPlugin.getLogger(UriAdapterFactory.class);
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object,
- * java.lang.Class)
- */
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- if (URIResolver.class.equals(adapterType)) {
- IProject project = (IProject) adaptableObject;
- URIResolver fProjectResolver = new ProjectResolver(project);
- return fProjectResolver;
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
- */
- public Class[] getAdapterList() {
- Class[] classes = new Class[1];
- classes[0] = URIResolver.class;
- return classes;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/WebAppUtil.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/WebAppUtil.java
deleted file mode 100644
index d3971e2..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/WebAppUtil.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.utils;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jst.j2ee.internal.web.deployables.WebDeployableArtifactUtil;
-import org.eclipse.jst.jsf.common.ui.IFileFolderConstants;
-import org.eclipse.jst.jsf.core.internal.tld.ITLDConstants;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class WebAppUtil {
- private final static String FACES_SERVLET_NAME = "javax.faces.webapp.FacesServlet";
-
- /**
- * @param url
- * @param openedFile
- * @return the transformed url
- */
- public static String transformJSPURL(String url, IFile openedFile) {
- boolean canSupportJSF = JSPUtil.supportTaglib(
- ITLDConstants.URI_JSF_HTML, openedFile);
- if (canSupportJSF
- && url != null
- && url.endsWith(IFileFolderConstants.DOT
- + IFileFolderConstants.EXT_JSP)) {
- String urlPattern = "";
- IVirtualResource[] resources = ComponentCore
- .createResources(openedFile);
- IVirtualComponent component = null;
- if (resources[0] != null) {
- component = resources[0].getComponent();
- }
- if (component != null) {
- urlPattern = WebDeployableArtifactUtil.getServletMapping(
- openedFile.getProject(), true, FACES_SERVLET_NAME,
- component.getName());
- }
- if (urlPattern.lastIndexOf(IFileFolderConstants.DOT) != -1) {
- String extension = urlPattern.substring(urlPattern
- .lastIndexOf(IFileFolderConstants.DOT));
- url = url.substring(0, url.lastIndexOf(IFileFolderConstants.DOT
- + IFileFolderConstants.EXT_JSP))
- + extension;
- }
- }
- return url;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/XMLUtil.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/XMLUtil.java
deleted file mode 100644
index 7638cd4..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/utils/XMLUtil.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.utils;
-
-/**
- * @author mengbo
- */
-
-import java.io.IOException;
-import java.io.OutputStream;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.TransformerFactoryConfigurationError;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.pagedesigner.PDPlugin;
-import org.w3c.dom.Document;
-
-/**
- *
- *
- */
-public class XMLUtil {
- private static Logger _log = PDPlugin.getLogger(XMLUtil.class);
-
- /**
- * Returns a DocumentBuilder capable of creating a DOM Document from input.
- *
- * @return a new instance of a document builder or null if an exception
- * occurs on creation
- */
- public synchronized static DocumentBuilder getDocumentBuilder() {
- DocumentBuilder result = null;
- try {
- result = DocumentBuilderFactory.newInstance().newDocumentBuilder();
- } catch (ParserConfigurationException e) {
- // "Error in create documentBuilder"
- _log.info("XMLUtil.Error.0", e); //$NON-NLS-1$
- }
- return result;
- }
-
- /**
- * Transforms a DOM document into a lightly-formatted UTF-8 represntation
- * and outputs it to an outputstream
- *
- * @param document
- * @param ostream
- * @throws IOException
- */
- public static void serialize(Document document, OutputStream ostream)
- throws IOException {
- Source domSource = new DOMSource(document);
- try {
- Transformer serializer = TransformerFactory.newInstance()
- .newTransformer();
- try {
- serializer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
- serializer.setOutputProperty(
- "{http://xml.apache.org/xslt}indent-amount", "4"); //$NON-NLS-1$ //$NON-NLS-2$
- serializer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); //$NON-NLS-1$
- } catch (IllegalArgumentException e) {
- // "Error in object persistance:"
- _log.info("XMLUtil.Error.2", e); //$NON-NLS-1$
- }
- serializer.transform(domSource, new StreamResult(ostream));
- } catch (TransformerConfigurationException e) {
- // "Error in object persistance:"
- _log.info("XMLUtil.Error.2", e); //$NON-NLS-1$
- throw new IOException(e.getMessage());
- } catch (TransformerFactoryConfigurationError e) {
- // "Error in object persistance:"
- _log.info("XMLUtil.Error.2", e); //$NON-NLS-1$
- throw new IOException(e.getMessage());
- } catch (TransformerException e) {
- // "Error in object persistance:"
- _log.info("XMLUtil.Error.2", e); //$NON-NLS-1$
- throw new IOException(e.getMessage());
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/ActionData.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/ActionData.java
deleted file mode 100644
index e0c1afa..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/ActionData.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.validation.caret;
-
-/**
- * This method represents a user action, the 'data' could be any related
- * data that will be referenced later in the action processing. For example.
- * when user does a DnD, the localData will be referenced as _data.
- *
- * @author mengbo
- */
-public class ActionData {
- /**
- * Action type for palette drag and drop
- */
- public static final int PALETTE_DND = 1;
-
- /**
- * Action type for databinding drag and drop
- */
- public static final int DATABINDING_DND = 2;
-
- /**
- * Action type for other drag and drop
- */
- public static final int OTHER_DND = 3;
-
- /**
- * Action type for key board navigation
- */
- public static final int KEYBOARD_NAVAGATION = 4;
-
- /**
- * Action type for inline editing
- */
- public static final int INLINE_EDIT = 5;
-
- /**
- * Action type for component move
- */
- public static final int COMPONENT_MOVE = 6;
-
- /**
- * Unknown action type (?)
- */
- public static final int UNKNOWN = 0;
-
- private final int _actionType;
-
- private final Object _data;
-
- /**
- * @param action
- * @param data
- */
- public ActionData(int action, Object data) {
- _actionType = action;
- if (data != null) {
- _data = data;
- } else {
- _data = new Object();
- }
- }
-
- /**
- * @return Returns the _actionType.
- */
- public final int getActionType() {
- return _actionType;
- }
-
- /**
- * @return Returns the _data.
- */
- public final Object getData() {
- return _data;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/BasicMovementRule.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/BasicMovementRule.java
deleted file mode 100644
index f1306ce..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/BasicMovementRule.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.validation.caret;
-
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- */
-/*package*/ class BasicMovementRule extends DefaultMovementRule {
-
- /**
- * @param actionData
- */
- public BasicMovementRule(ActionData actionData) {
- super(actionData);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.validation.caret.IMovementRule#allowsMoveIn(org.eclipse.jst.pagedesigner.validation.caret.Target)
- */
- public boolean allowsMoveIn(Target target) {
- if (_actionData.getActionType() == ActionData.INLINE_EDIT) {
- Node node = target.getNode();
- return EditModelQuery.isText(node) || node.hasChildNodes();
- }
- return super.allowsMoveIn(target);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/BasicPositionRule.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/BasicPositionRule.java
deleted file mode 100644
index 3eaa5f0..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/BasicPositionRule.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.validation.caret;
-
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.eclipse.jst.pagedesigner.dom.EditValidateUtil;
-import org.w3c.dom.Node;
-
-/**
- * Deal with widget.
- *
- * @author mengbo
- */
-/*package*/ class BasicPositionRule extends DefaultPositionRule
-{
- private final IPositionMediator _mediator;
-
- /**
- * @param mediator
- * @param actionData
- */
- public BasicPositionRule(IPositionMediator mediator, ActionData actionData) {
- super(actionData);
- _mediator = mediator;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.caret.IPositionRule#hasEditableArea(org.eclipse.gef.EditPart)
- */
- public boolean hasEditableArea(Target target) {
- if (target == null || target.getPart() == null) {
- return false;
- }
- if (!EditValidateUtil.validNode(target.getNode())) {
- return false;
- }
- if (DefaultPositionRule.isWidget(target.getPart())) {
- return false;
- }
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.caret.IPositionRule#isEditable(org.eclipse.gef.EditPart)
- */
- public boolean isEditable(Target target) {
- if (target.getPart() == null) {
- return false;
- }
- Node node = target.getNode();
-
- // text is depending on parent.
- if (EditModelQuery.isText(node)) {
- return _mediator.isEditable(new Target(node.getParentNode()));
- }
- String name = node.getLocalName();
- // Name is null, the node should not be Element
- if (name == null && !EditModelQuery.isDocument(node)
- && !EditModelQuery.isText(node)) {
- return false;
- }
- // if is widget, return false;
- if (DefaultPositionRule.isWidget(target.getPart())) {
- return false;
- }
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.caret.IPositionRule#canStopHere(org.w3c.dom.Node)
- */
- public boolean canReference(Target target, boolean atRight) {
- Node node = target.getNode();
- if (target.getPart() == null || node.getNodeType() != Node.ELEMENT_NODE
- && !EditModelQuery.isText(node)) {
- return false;
- }
- return true;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/ContainerMoveInAndOutRule.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/ContainerMoveInAndOutRule.java
deleted file mode 100644
index c953334..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/ContainerMoveInAndOutRule.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.validation.caret;
-
-import java.util.Arrays;
-
-import org.eclipse.jst.jsf.core.internal.tld.IJSFConstants;
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- */
-/*package*/ class ContainerMoveInAndOutRule extends DefaultMovementRule {
- private static final String[] HTML_CONTAINERS = { IHTMLConstants.TAG_TABLE };
-
- private static final String[] NONE_HTML_CONTAINERS = {};
-
- private static final String[] SPECIAL_HTML_CONTAINERS = {
- IJSFConstants.TAG_OUTPUTLINK, IJSFConstants.TAG_COMMANDLINK,
- IJSFConstants.TAG_FACET, IJSFConstants.TAG_VERBATIM };
-
- /**
- * @param actionData
- */
- public ContainerMoveInAndOutRule(ActionData actionData) {
- super(actionData);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.caret.IMovementRule#canEnter(org.w3c.dom.Node)
- */
- public boolean allowsMoveIn(Target target) {
- Node node = target.getNode();
- if (node.getLocalName() != null && //
- (Arrays.asList(HTML_CONTAINERS).contains(node.getLocalName()
- .toLowerCase())) || //
- Arrays.asList(NONE_HTML_CONTAINERS).contains(
- node.getLocalName()) || //
- Arrays.asList(SPECIAL_HTML_CONTAINERS).contains(
- node.getLocalName())) {
- return false;
- }
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.caret.IMovementRule#canMoveOut(org.eclipse.gef.EditPart)
- */
- public boolean allowsMoveOut(Target target) {
- Node node = target.getNode();
- if (EditModelQuery.isDocument(node)) {
- return false;
- }
-
- if (_actionData.getActionType() == ActionData.INLINE_EDIT
- && (IHTMLConstants.TAG_TD.equalsIgnoreCase(node.getLocalName()) || IHTMLConstants.TAG_TH
- .equalsIgnoreCase(node.getLocalName()))) {
- return false;
- }
- if (node.getLocalName() != null && //
- (Arrays.asList(HTML_CONTAINERS).contains(node.getLocalName()
- .toLowerCase())) || //
- Arrays.asList(NONE_HTML_CONTAINERS).contains(
- node.getLocalName())) {
- return false;
- }
-
- if (node.getLocalName() != null
- && (Arrays.asList(
- RootContainerPositionRule.HTML_ROOT_CONTAINERS)
- .contains(node.getLocalName().toLowerCase()) || //
- Arrays.asList(JSFRootContainerPositionRule.JSF_ROOT_CONTAINERS)
- .contains(node.getLocalName()))) {
- if (!EditModelQuery.isChild(
- JSFRootContainerPositionRule.JSF_ROOT_CONTAINERS, node,
- false, true)
- && //
- !EditModelQuery.isChild(
- RootContainerPositionRule.HTML_ROOT_CONTAINERS,
- node, true, true)) {
- return false;
- }
- }
- return true;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/DefaultMovementRule.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/DefaultMovementRule.java
deleted file mode 100644
index 1aaab7c..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/DefaultMovementRule.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.validation.caret;
-
-/**
- * @author mengbo
- */
-/*package*/ class DefaultMovementRule implements IMovementRule {
- ActionData _actionData;
-
- /**
- * @param actionData
- *
- */
- public DefaultMovementRule(ActionData actionData) {
- super();
- _actionData = actionData;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.validation.caret.IMovementRule#allowsMoveIn(org.eclipse.jst.pagedesigner.validation.caret.Target)
- */
- public boolean allowsMoveIn(Target target) {
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.validation.caret.IMovementRule#allowsMoveOut(org.eclipse.jst.pagedesigner.validation.caret.Target)
- */
- public boolean allowsMoveOut(Target target) {
- return true;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/DefaultPositionRule.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/DefaultPositionRule.java
deleted file mode 100644
index 40e8222..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/DefaultPositionRule.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.validation.caret;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.jst.pagedesigner.dom.DOMRefPosition;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.jst.pagedesigner.parts.NodeEditPart;
-
-/**
- * @author mengbo
- */
-public class DefaultPositionRule implements IPositionRule {
-
- private ActionData _actionData;
-
- /**
- * @param actionData
- *
- */
- public DefaultPositionRule(ActionData actionData) {
- super();
- if (actionData != null) {
- _actionData = actionData;
- } else {
- _actionData = new ActionData(ActionData.UNKNOWN, new Object());
- }
- }
-
- /**
- * @return the action data
- */
- protected final ActionData getActionData()
- {
- return _actionData;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.caret.IPositionRule#hasEditableArea(org.w3c.dom.Node)
- */
- public boolean hasEditableArea(Target target) {
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.caret.IPositionRule#isEditable(org.eclipse.gef.EditPart)
- */
- public boolean isEditable(Target target) {
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.caret.IPositionRule#isTransparent(org.eclipse.gef.EditPart,
- * org.eclipse.draw2d.geometry.Point)
- */
- public boolean canReference(Target target, boolean atRight) {
- return true;
- }
-
- /**
- * If container is inEditable and can be referenced, the position is
- * invalid, otherwise as default the position is valid. (non-Javadoc)
- */
- public boolean isValidPosition(IDOMPosition position) {
- boolean result = isEditable(new Target(position.getContainerNode()));
- if (result) {
- if (position.getOffset() == 0
- || position.getOffset() == position.getContainerNode()
- .getChildNodes().getLength()) {
- result = true;
- } else {
- boolean dir;
- Target target = null;
- if (position instanceof DOMRefPosition) {
- target = new Target(((DOMRefPosition) position)
- .getReferenceNode());
- dir = ((DOMRefPosition) position).isForward();
- result = canReference(target, dir);
- }
- }
- }
- return result;
- }
-
- /**
- * @param host
- * @return true if the host edit part is a widget
- */
- public static boolean isWidget(EditPart host) {
- if (host instanceof NodeEditPart) {
- return ((NodeEditPart) host).isWidget();
- }
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/DefaultPositionValidator.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/DefaultPositionValidator.java
deleted file mode 100644
index 6c45a83..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/DefaultPositionValidator.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.validation.caret;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.jst.pagedesigner.dom.DOMPositionHelper;
-import org.eclipse.jst.pagedesigner.dom.EditHelper;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.jst.pagedesigner.parts.DocumentEditPart;
-import org.eclipse.jst.pagedesigner.viewer.DesignPosition;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- */
-/*package*/ class DefaultPositionValidator implements IPositionMediator {
- private List<IValidationRule> _rules = new ArrayList<IValidationRule>();
-
- /**
- * the validator's action data
- */
- protected final ActionData _actionData;
-
- /**
- * @return Returns the _actionData.
- */
- public ActionData getActionData() {
- return _actionData;
- }
-
- /**
- * @param actionData
- */
- protected DefaultPositionValidator(ActionData actionData) {
- _actionData = actionData;
- initRules();
- }
-
- /**
- * initialize the default rules
- */
- protected void initRules() {
- _rules.clear();
- addRule(new BasicPositionRule(this, _actionData));
- addRule(new IETablePositionRule(_actionData));
- addRule(new RootContainerPositionRule(_actionData));
- addRule(new JSFRootContainerPositionRule(_actionData));
- addRule(new WhitespacePositionMoveRule(_actionData));
- }
-
- /**
- * @return Returns the _rules.
- */
- public List getRules() {
- return Collections.unmodifiableList(_rules);
- }
-
- /**
- * @param rule
- */
- protected void addRule(IValidationRule rule) {
- _rules.add(rule);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.caret.IValidator#hasEditableArea(org.w3c.dom.Node)
- */
- public boolean hasEditableArea(Target target) {
- boolean result = true;
- List rules = getRules();
- for (int i = 0, n = rules.size(); i < n; i++) {
- Object rule = rules.get(i);
- if (rule instanceof IPositionRule) {
- result &= ((IPositionRule) rule).hasEditableArea(target);
- }
- if (!result) {
- break;
- }
- }
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.caret.IValidator#isEditable(org.w3c.dom.Node)
- */
- public boolean isEditable(Target target) {
- Node node = target.getNode();
- boolean result = true;
- List rules = getRules();
- for (int i = 0, n = rules.size(); i < n; i++) {
- Object rule = rules.get(i);
- if (rule instanceof IPositionRule) {
- result &= ((IPositionRule) rule).isEditable(new Target(node));
- }
- if (!result) {
- break;
- }
- }
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.caret.IValidator#isValidPosition(org.eclipse.jst.pagedesigner.viewer.DesignPosition)
- */
- public boolean isValidPosition(DesignPosition position) {
- return isValidPosition(DOMPositionHelper.toDOMPosition(position));
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.caret.IValidator#isValidPosition(org.eclipse.jst.pagedesigner.dom.IDOMPosition)
- */
- public boolean isValidPosition(IDOMPosition position) {
- // if position is really a IDOMRefPosition, convert it to DOMPosition
- position = EditHelper.ensureDOMPosition(position);
- boolean refLeft = true, refRight = true, result = true;
- if (position == null) {
- return false;
- }
- List rules = getRules();
- for (int i = 0, n = rules.size(); i < n; i++) {
- Object rule = rules.get(i);
-
- // rule may be an IValidationRule that is not a position rule
- // so only use those that are actually position rules
- if (rule instanceof IPositionRule) {
- // the IDOMPosition represents a position somewhere in a parent
- // node based on a node list index. We need to verify that the
- // parent is editable.
- result &= ((IPositionRule) rule).isEditable(new Target(position
- .getContainerNode()));
- if (result) {
- if (!position.isText()) {
-
- // TODO C.B: no sure what the point is here. It appears
- // as though it is validating whether the sibling either
- // side of this position is a valid location for this
- // action
-
- // ref1?
- Node node = EditModelQuery.getInstance().getSibling(
- position, true);
- if (node != null & refLeft) {
- refLeft &= ((IPositionRule) rule).canReference(
- new Target(node), false);
- }
- // ref2?
- node = EditModelQuery.getInstance().getSibling(
- position, false);
- if (node != null & refRight) {
- refRight = ((IPositionRule) rule).canReference(
- new Target(node), true);
- }
- if (!(refLeft | refRight)) {
- result = false;
- break;
- }
- }
- } else {
- break;
- }
- // }
- }
- }
- return (result & (refLeft | refRight));
- }
-
- /**
- * Adjust the position to an editable area.
- */
- public EditPart getEditableContainer(Target target) {
- EditPart part = target.getPart();
- if (hasEditableArea(target)) {
- return target.getPart();
- }
- while (part != null && !(part instanceof DocumentEditPart)) {
- if (hasEditableArea(target)) {
- break;
- }
- part = part.getParent();
- target = new Target(part);
- }
- if (part instanceof DocumentEditPart
- && RootContainerPositionRule.hasBasicContainers((Document) part
- .getModel())) {
- Node node = RootContainerPositionRule
- .getBasicContainer((Document) part.getModel());
- part = Target.resolvePart(node);
- }
- return part;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.caret.IValidator#canReference(org.w3c.dom.Node)
- */
- public boolean canReference(Target target, boolean atRight) {
- boolean result = true;
- List rules = getRules();
- for (int i = 0, n = rules.size(); i < n; i++) {
- Object rule = rules.get(i);
- if (rule instanceof IPositionRule) {
- result &= ((IPositionRule) rule).canReference(target, atRight);
- }
- if (!result) {
- break;
- }
- }
- return result;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/DnDPositionValidator.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/DnDPositionValidator.java
deleted file mode 100644
index 6fddc52..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/DnDPositionValidator.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.validation.caret;
-
-/**
- * This validator is used for caret positioning when user do drag & drop on the
- * screen.
- *
- * @author mengbo
- * TODO: is this class complete?
- */
-public class DnDPositionValidator extends DefaultPositionValidator {
- //TODO: not used
-// private static DnDPositionValidator _instance;
-//
-// private ActionData _data;
-
- /**
- * @param actionData
- */
- public DnDPositionValidator(ActionData actionData) {
- super(actionData);
- }
-
- /**
- * Override to make adding rules public on Dnd validators
- */
- public void addRule(IValidationRule rule)
- {
- super.addRule(rule);
- }
-
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/DropActionData.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/DropActionData.java
deleted file mode 100644
index 0d3f211..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/DropActionData.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.validation.caret;
-
-import java.util.Collections;
-import java.util.List;
-
-/**
- * An action data for object drops
- * @author cbateman
- *
- */
-public class DropActionData extends ActionData
-{
- /**
- * @param action
- * @param data
- */
- public DropActionData(int action, DropData data )
- {
- super(action, data);
- }
-
- /**
- * @return the drop data or null if none
- */
- public DropData getDropData()
- {
- return (DropData) getData();
- }
-
- /**
- * Encapsulates the tags to be dropped
- *
- */
- public static class DropData
- {
- private final List _tagIds;
-
- /**
- * @param tagIds
- */
- public DropData(List tagIds)
- {
- _tagIds = Collections.unmodifiableList(tagIds);
- }
-
- /**
- * @return the list of tag ids being dropped. List
- * is unmodifiable
- */
- public List getTagIdentifiers()
- {
- return _tagIds;
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/HeadDataPositionRule.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/HeadDataPositionRule.java
deleted file mode 100644
index ed2fcae..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/HeadDataPositionRule.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.validation.caret;
-
-/**
- * Ensure the DnD for loadBundle or taglib is in head area.
- *
- * @author mengbo
- */
-/*package*/ class HeadDataPositionRule extends DefaultPositionRule {
-
- /**
- * @param data
- */
- public HeadDataPositionRule(ActionData data) {
- super(data);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/IEPanelgridPositionRule.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/IEPanelgridPositionRule.java
deleted file mode 100644
index df41805..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/IEPanelgridPositionRule.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.validation.caret;
-
-import org.eclipse.jst.jsf.core.internal.tld.IJSFConstants;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.w3c.dom.Node;
-
-/**
- * In some place, wen can't do inline editing, like the area between td, in
- * panelGrid, etc. In these places we can't place caret
- *
- * @author mengbo
- */
-/*package*/ class IEPanelgridPositionRule extends DefaultPositionRule {
- /**
- * @param actionData
- */
- public IEPanelgridPositionRule(ActionData actionData) {
- super(actionData);
- }
-
- /**
- * PanelGrid is not editable.
- *
- * @see org.eclipse.jst.pagedesigner.validation.caret.IPositionRule#isEditable(Target)
- */
- public boolean isEditable(Target target) {
- Node node = target.getNode();
- return !EditModelQuery.isChild(new String[] {
- IJSFConstants.TAG_PANELGRID, IJSFConstants.TAG_DATATABLE },
- node, false, false);
- }
-
- public boolean hasEditableArea(Target target) {
- Node node = target.getNode();
- return !EditModelQuery.isChild(new String[] {
- IJSFConstants.TAG_PANELGRID, IJSFConstants.TAG_DATATABLE },
- node, false, false);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/IETablePositionRule.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/IETablePositionRule.java
deleted file mode 100644
index f93405c..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/IETablePositionRule.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.validation.caret;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.eclipse.jst.pagedesigner.dom.EditValidateUtil;
-import org.w3c.dom.Node;
-
-/**
- * This rule constains the operation within a table: 1. The inputing position
- * can only be in 'td' 2. Table structure must be valid.
- *
- * @author mengbo
- */
-public class IETablePositionRule extends DefaultPositionRule {
- // We will introduce validation based on DtD later, this is not final
- // solution.
- private final String[] CONTAINER = { IHTMLConstants.TAG_THEAD,
- IHTMLConstants.TAG_TBODY, IHTMLConstants.TAG_TFOOT };
-
- /**
- * @param actionData
- */
- public IETablePositionRule(ActionData actionData) {
- super(actionData);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.caret.IPositionRule#hasEditableArea(org.eclipse.jst.pagedesigner.caret.Target)
- */
- public boolean hasEditableArea(Target target) {
- if (EditModelQuery.isChild(IHTMLConstants.TAG_TABLE, target.getNode(),
- true)) {
- if (target.getPart() == null) {
- return false;
- }
- Node node = target.getNode();
- // The target must be in a valid table structure.
- String name = node.getLocalName();
- if (node.hasChildNodes()) {
- // for constrained container, depends on its children.
- if (name != null
- && (IHTMLConstants.TAG_TABLE.equalsIgnoreCase(name) || //
- Arrays.asList(CONTAINER).contains(
- name.toLowerCase()) || //
- IHTMLConstants.TAG_TR.equalsIgnoreCase(name))) {
- List children = target.getPart().getChildren();
- for (int i = 0, n = children.size(); i < n; i++) {
- if (hasEditableArea(new Target((EditPart) children
- .get(i)))) {
- return true;
- }
- }
- return false;
- }
- } else {
- if (!isEditable(new Target(node))) {
- return false;
- }
- }
- }
- return super.hasEditableArea(target);
- }
-
- /**
- * Used to valid the structure of table, later will use dtd to do that.
- * @param container
- * @return true if the table is valid
- */
- public boolean isInValidTable(Node container) {
- boolean result = false;
- try {
- if (EditValidateUtil.validNode(container)) {
- if (EditModelQuery.isText(container)) {
- container = container.getParentNode();
- }
- String name = container.getLocalName();
- if (EditModelQuery.isChild(IHTMLConstants.TAG_TABLE, container,
- true)) {
- List ancestors = EditModelQuery.getAncestors(container,
- IHTMLConstants.TAG_TABLE, true);
- int offset = ancestors.size();
- // remove 'table'
- Node temp = (Node) ancestors.remove(offset - 1);
- if (temp == container) {
- return true;
- }
- offset--;
- result = checkValidTrTd(ancestors, container);
- if (!result) {
- // thead->tr->td
- temp = (Node) ancestors.get(offset - 1);
- name = temp.getNodeName();
- if (Arrays.asList(CONTAINER).contains(
- name.toLowerCase())) {
- if (temp == container) {
- result = true;
- } else {
- // remove 'thead'
- ancestors.remove(offset - 1);
- offset--;
- result = checkValidTrTd(ancestors, container);
- }
- }
- }
- }
- }
- return result;
- } catch (Exception e) {
- // The exception means the structure is not a valid table, don't
- // need to report.
- return false;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.caret.IPositionRule#isEditable(org.eclipse.jst.pagedesigner.caret.Target)
- */
- public boolean isEditable(Target target) {
- if (EditModelQuery.isChild(IHTMLConstants.TAG_TABLE, target.getNode(),
- false)) {
- if (isInValidTable(target.getNode())) {
- List ancestors = EditModelQuery.getAncestors(target.getNode(),
- IHTMLConstants.TAG_TABLE, true);
- if (ancestors.size() >= 3) {
- if (IHTMLConstants.TAG_TH
- .equalsIgnoreCase(((Node) ancestors.get(ancestors
- .size() - 3)).getNodeName())
- || //
- IHTMLConstants.TAG_TD
- .equalsIgnoreCase(((Node) ancestors
- .get(ancestors.size() - 3))
- .getNodeName())) {
- return true;
- } else if (ancestors.size() >= 4 //
- && (IHTMLConstants.TAG_TH
- .equalsIgnoreCase(((Node) ancestors
- .get(ancestors.size() - 4))
- .getNodeName()) || //
- IHTMLConstants.TAG_TD
- .equalsIgnoreCase(((Node) ancestors
- .get(ancestors.size() - 4))
- .getNodeName()))) {
- return true;
- }
- }
- }
- return false;
- }
- return super.isEditable(target);
- }
-
- private boolean checkValidTrTd(List ancestors, Node node) {
- int offset = ancestors.size();
- if (IHTMLConstants.TAG_TR.equalsIgnoreCase(((Node) ancestors
- .get(offset - 1)).getLocalName())) {
- if (ancestors.get(offset - 1) == node) {
- return true;
- } else if (IHTMLConstants.TAG_TH.equalsIgnoreCase(((Node) ancestors
- .get(offset - 2)).getLocalName())
- || //
- IHTMLConstants.TAG_TD.equalsIgnoreCase(((Node) ancestors
- .get(offset - 2)).getLocalName())) {
- return true;
- }
- }
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/IMovementMediator.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/IMovementMediator.java
deleted file mode 100644
index 8c1fccd..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/IMovementMediator.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.validation.caret;
-
-import org.eclipse.gef.EditPart;
-
-/**
- * @author mengbo
- */
-public interface IMovementMediator extends IPositionMediator {
- /**
- * @param target
- * @return true if mediator allows movment in
- */
- public boolean allowsMoveIn(Target target);
-
- /**
- * @param target
- * @return true if mediator allows movement out
- */
- public boolean allowsMoveOut(Target target);
-
- /**
- * Return a closest parent part which is editable, and it can't moveout.
- *
- * @param target
- * @return if taget part is editable, then returns itself.
- */
- public EditPart getConstainedEditableContainer(Target target);
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/IMovementRule.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/IMovementRule.java
deleted file mode 100644
index 90377a8..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/IMovementRule.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.validation.caret;
-
-/**
- * @author mengbo
- */
-public interface IMovementRule extends IValidationRule {
- /**
- * @param target
- * @return true if allows move in
- */
- public boolean allowsMoveIn(Target target);
-
- /**
- * @param target
- * @return true allows move out
- */
- public boolean allowsMoveOut(Target target);
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/IPositionMediator.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/IPositionMediator.java
deleted file mode 100644
index 235a164..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/IPositionMediator.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.validation.caret;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.jst.pagedesigner.viewer.DesignPosition;
-
-/**
- * @author mengbo
- */
-public interface IPositionMediator {
- /**
- * @return this mediator's action data
- */
- public ActionData getActionData();
-
- /**
- * To see if the node itself or its descendent is editable.
- *
- * @param target
- * @return true if the target has editable area
- */
- public boolean hasEditableArea(Target target);
-
- /**
- * To see if the position is valid.
- *
- * @param position
- * @return true if position is valid
- */
- public boolean isValidPosition(IDOMPosition position);
-
- /**
- * @param position
- * @return true if position is valid
- */
- public boolean isValidPosition(DesignPosition position);
-
- /**
- * To see if the node is editable.
- *
- * @param target
- * @return true if target is editable
- */
- public boolean isEditable(Target target);
-
- /**
- * @param target
- * @param atRight
- * @return true if can reference target
- */
- public boolean canReference(Target target, boolean atRight);
-
- /**
- * Return a node which contains 'node', and it has editable area.
- *
- * @param target
- * @return if part is editable, then itself is returned, otherwise a parent
- * is returned.
- */
- public EditPart getEditableContainer(Target target);
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/IPositionRule.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/IPositionRule.java
deleted file mode 100644
index 6088e1e..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/IPositionRule.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.validation.caret;
-
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-
-/**
- * @author mengbo
- */
-public interface IPositionRule extends IValidationRule {
- /**
- * To see if the node is editable. For inline editing, this means whether
- * can we input something into the target. For DnD, this means whether can
- * we drag and drop something into it.
- *
- * @param target
- * @return true if target is editable
- */
- public boolean isEditable(Target target);
-
- /**
- * To see if the node itself or its descendent is editable.
- *
- * @param target
- * @return true if target is editable
- */
- public boolean hasEditableArea(Target target);
-
- /**
- * Whether can we place caret against this part's border. Some container we
- * are consider white box, and whitespace may not be suitable for caret
- * reference.
- *
- * @param target
- * @param atRight
- * TODO
- * @return true if can reference target
- */
- public boolean canReference(Target target, boolean atRight);
-
- /**
- * To see if the position is valid. Please note, the container is editable
- * means there is a child area whithin it is editable, the position may be
- * in an inEditable place. So this method is different from hasEditableArea
- * and isEditable.
- *
- * @param position
- * @return true if position is valid
- */
- public boolean isValidPosition(IDOMPosition position);
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/IValidationRule.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/IValidationRule.java
deleted file mode 100644
index 296d02b..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/IValidationRule.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.validation.caret;
-
-/**
- * @author mengbo
- */
-public interface IValidationRule {
- // TODO: tagging interface?
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/InlineEditingNavigationMediator.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/InlineEditingNavigationMediator.java
deleted file mode 100644
index c1c1115..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/InlineEditingNavigationMediator.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.validation.caret;
-
-import java.util.List;
-
-import org.eclipse.draw2d.Viewport;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.gef.editparts.ScalableRootEditPart;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.eclipse.jst.pagedesigner.parts.DocumentEditPart;
-import org.eclipse.jst.pagedesigner.tools.ExposeHelper;
-import org.eclipse.jst.pagedesigner.viewer.DesignPosition;
-import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- */
-public class InlineEditingNavigationMediator extends
- InlineEditingPositionMediator implements IMovementMediator {
-
- /**
- * @param actionData
- */
- public InlineEditingNavigationMediator(ActionData actionData) {
- super(actionData);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.caret.DefaultPositionValidator#initRules(org.eclipse.jst.pagedesigner.caret.ActionData)
- */
- protected void initRules() {
- super.initRules();
- this.addRule(new ContainerMoveInAndOutRule(_actionData));
- this.addRule(new BasicMovementRule(_actionData));
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.caret.IMovementValidator#allowsMoveIn(org.eclipse.gef.EditPart)
- */
- public boolean allowsMoveIn(Target target) {
- boolean result = true;
- List _rules = getRules();
- for (int i = 0, n = _rules.size(); i < n; i++) {
- Object rule = _rules.get(i);
- if (rule instanceof IMovementRule) {
- result &= ((IMovementRule) rule).allowsMoveIn(target);
- } else if (rule instanceof IPositionRule) {
- result &= ((IPositionRule) rule).hasEditableArea(target);
- }
- if (!result) {
- break;
- }
- }
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.caret.IMovementValidator#allowsMoveOut(org.eclipse.gef.EditPart)
- */
- public boolean allowsMoveOut(Target target) {
- boolean result = true;
- List _rules = getRules();
- for (int i = 0, n = _rules.size(); i < n; i++) {
- Object rule = _rules.get(i);
- if (rule instanceof IMovementRule) {
- result &= ((IMovementRule) rule).allowsMoveOut(target);
- }
- if (!result) {
- break;
- }
- }
- return result;
- }
-
- /**
- * @param target
- * @return ?
- */
- public EditPart getRootConstainedEditableContainer(Target target) {
- // if (EditModelQuery.isDocument(target.getNode()))
- // {
- // return target.getPart();
- // }
- EditPart part = target.getPart();
- while (part != null) {
- if (hasEditableArea(target) && !allowsMoveOut(target)) {
- break;
- }
- part = part.getParent();
- target = new Target(part);
- }
- if (part instanceof DocumentEditPart
- && RootContainerPositionRule.hasBasicContainers((Document) part
- .getModel())) {
- Node node = RootContainerPositionRule
- .getBasicContainer((Document) part.getModel());
- part = Target.resolvePart(node);
- }
-
- return part;
- }
-
- /**
- * @see org.eclipse.jst.pagedesigner.validation.caret.IMovementMediator#getConstainedEditableContainer(org.eclipse.jst.pagedesigner.validation.caret.Target)
- */
- public EditPart getConstainedEditableContainer(Target target) {
- EditPart part = target.getPart();
- while (part != null) {
- if (hasEditableArea(target)) {
- break;
- }
- part = part.getParent();
- target = new Target(part);
- }
- if (part instanceof DocumentEditPart
- && RootContainerPositionRule.hasBasicContainers((Document) part
- .getModel())) {
- Node node = RootContainerPositionRule
- .getBasicContainer((Document) part.getModel());
- part = Target.resolvePart(node);
- }
- return part;
- }
-
- /**
- * @param position
- * @param p
- * @param viewer
- * @return the constrained editable container or null if none found for the arguments
- * @see org.eclipse.jst.pagedesigner.validation.caret.IMovementMediator#getConstainedEditableContainer(org.eclipse.jst.pagedesigner.validation.caret.Target)
- */
- public EditPart getConstainedEditableContainer(DesignPosition position,
- Point p, GraphicalViewer viewer) {
- Rectangle rect = new Rectangle(p.x, p.y, 1, 1);
- Viewport port = ((IHTMLGraphicalViewer) viewer).getViewport();
-
- Point viewLocation = port.getViewLocation();
- Point lastLocation = viewLocation.getCopy();
- new ExposeHelper((IHTMLGraphicalViewer) viewer).exposeArea(rect);
- viewLocation = port.getViewLocation();
- Dimension offset = lastLocation.getDifference(viewLocation);
-
- p.translate(offset.width, offset.height);
- EditPart part = viewer.findObjectAt(p);
- if (part != null && !(part instanceof ScalableRootEditPart)) {
- while (part != null) {
- Target target = new Target(part);
- if (hasEditableArea(target)) {
- if (allowsMoveIn(target)
- || EditModelQuery.isChild(target.getNode(),
- position.getContainerNode())) {
- break;
- }
- }
- part = part.getParent();
- }
- if (part instanceof DocumentEditPart
- && RootContainerPositionRule
- .hasBasicContainers((Document) part.getModel())) {
- Node node = RootContainerPositionRule
- .getBasicContainer((Document) part.getModel());
- part = Target.resolvePart(node);
- }
- return part;
- }
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/InlineEditingPositionMediator.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/InlineEditingPositionMediator.java
deleted file mode 100644
index 5329586..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/InlineEditingPositionMediator.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.validation.caret;
-
-/**
- * This validtor is used for inline editing, caret positioning with mouse.
- *
- * @author mengbo
- */
-public class InlineEditingPositionMediator extends DefaultPositionValidator {
-
- /**
- * @param actionData
- */
- public InlineEditingPositionMediator(ActionData actionData) {
- super(actionData);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.caret.DefaultPositionValidator#initRules()
- */
- protected void initRules() {
- super.initRules();
- addRule(new IEPanelgridPositionRule(_actionData));
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/JSFRootContainerPositionRule.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/JSFRootContainerPositionRule.java
deleted file mode 100644
index c4e08ea..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/JSFRootContainerPositionRule.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.validation.caret;
-
-import java.util.Arrays;
-
-import org.eclipse.jst.jsf.common.dom.TagIdentifier;
-import org.eclipse.jst.jsf.core.internal.tld.ITLDConstants;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- * Ensure the DnD of jsf component should be within f:view or f:subview.
- *
- * @author mengbo
- */
-public class JSFRootContainerPositionRule extends DefaultPositionRule {
-
- private final static int DEFAULT_MAX_DEPTH_SEARCH = 3;
-
- /**
- * TODO: this is not enough because it ignores the uri and keys on only
- * the name of the tag.
- */
- /*package*/ static final String[] JSF_ROOT_CONTAINERS = { "view", "subview" };
-
- /**
- * @param actionData
- */
- public JSFRootContainerPositionRule(ActionData actionData) {
- super(actionData);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.validation.caret.IPositionRule#hasEditableArea(org.eclipse.jst.pagedesigner.validation.caret.Target)
- */
- public boolean hasEditableArea(Target target) {
- Node node = target.getNode();
- if (hasBasicContainers(EditModelQuery.getDocumentNode(node),DEFAULT_MAX_DEPTH_SEARCH)) {
- ActionData actionData = getActionData();
- if (actionData instanceof DropActionData) {
- DropActionData dropActionData = (DropActionData) actionData;
- TagIdentifier tagId =
- (TagIdentifier) dropActionData.getDropData().getTagIdentifiers().get(0);
- final String uri = tagId.getUri();
- if (ITLDConstants.URI_JSF_HTML.equalsIgnoreCase(uri)
- || ITLDConstants.URI_JSF_CORE.equalsIgnoreCase(uri)) {
- boolean result = EditModelQuery.isChild(
- JSF_ROOT_CONTAINERS, node, true, false);
- return result
- || EditModelQuery.getChild(node,
- JSF_ROOT_CONTAINERS, 3, false) != null;
- }
- } else if (getActionData().getActionType() == ActionData.DATABINDING_DND) {
- boolean result = EditModelQuery.isChild(JSF_ROOT_CONTAINERS,
- node, true, false);
- return result
- || EditModelQuery.getChild(node, JSF_ROOT_CONTAINERS, 3,
- false) != null;
- }
- }
- return super.isEditable(target);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.validation.caret.IPositionRule#isEditable(org.eclipse.jst.pagedesigner.validation.caret.Target)
- */
- public boolean isEditable(Target target) {
- boolean result = true;
- Node node = target.getNode();
- if (hasBasicContainers(EditModelQuery.getDocumentNode(node), DEFAULT_MAX_DEPTH_SEARCH)) {
- ActionData actionData = getActionData();
- if (actionData instanceof DropActionData) {
- DropActionData dropActionData = (DropActionData) actionData;
- TagIdentifier tagId =
- (TagIdentifier) dropActionData.getDropData().getTagIdentifiers().get(0);
- final String uri = tagId.getUri();
-
- if (ITLDConstants.URI_JSF_HTML.equalsIgnoreCase(uri)
- || ITLDConstants.URI_JSF_CORE.equalsIgnoreCase(uri)) {
- result = EditModelQuery.isChild(JSF_ROOT_CONTAINERS,
- node, true, false);
- }
- } else if (getActionData().getActionType() == ActionData.DATABINDING_DND) {
- result = EditModelQuery.isChild(JSF_ROOT_CONTAINERS, node,
- true, false);
- }
- return result;
- }
- return super.isEditable(target);
- }
-
-
- /**
- * @param document
- * @param maxDepth
- * @return the closest tag called "view" or "subview" to the root of document
- * search to a maximum tag depth of maxDepth
- */
- public static Node getBasicContainer(Document document, int maxDepth) {
- Node node = EditModelQuery.getChild(document, JSF_ROOT_CONTAINERS, maxDepth,
- false);
- return node;
- }
-
- /**
- * We need to see if body, view are there. and they should be at first or
- * second level.
- *
- * @param document
- * @param maxDepth
- * @return true if document has a view and subview limited to a maximum search
- * depth of maxDepth
- */
- public static boolean hasBasicContainers(Document document, int maxDepth) {
- return getBasicContainer(document, maxDepth) != null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.validation.caret.IPositionRule#canReference(org.eclipse.jst.pagedesigner.validation.caret.Target,
- * boolean)
- */
- public boolean canReference(Target target, boolean atRight) {
- Node node = target.getNode();
- if (node.getLocalName() != null) {
- // if the local name of the target is in the list of JSF root
- // containers
- if (Arrays.asList(JSF_ROOT_CONTAINERS).contains(
- node.getLocalName().toLowerCase())) {
-
- // verify that either the target is
- return EditModelQuery.isChild(
- RootContainerPositionRule.HTML_ROOT_CONTAINERS, node,
- false, false)
- || EditModelQuery.isChild(JSF_ROOT_CONTAINERS, node,
- false, false);
- }
- }
- return super.canReference(target, atRight);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/NodeConstructionPositionRule.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/NodeConstructionPositionRule.java
deleted file mode 100644
index 54b389f..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/NodeConstructionPositionRule.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.validation.caret;
-
-/**
- * @author mengbo
- */
-public class NodeConstructionPositionRule extends DefaultPositionRule {
-
- /**
- * @param actionData
- */
- public NodeConstructionPositionRule(ActionData actionData) {
- super(actionData);
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/RootContainerPositionRule.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/RootContainerPositionRule.java
deleted file mode 100644
index 9d41be7..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/RootContainerPositionRule.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.validation.caret;
-
-import java.util.Arrays;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- * This rule deal with containers 'body', 'view', 'subview'.
- *
- * @author mengbo
- */
-public class RootContainerPositionRule extends DefaultPositionRule {
- static final String[] HTML_ROOT_CONTAINERS = { "body" };
-
- /**
- * @param actionData
- */
- public RootContainerPositionRule(ActionData actionData) {
- super(actionData);
- }
-
- /**
- * 1. If anyone of the three containers exists, the target should be in the
- * container. 2. If none of the containers exists, then target will be not
- * restricted.
- *
- * @see org.eclipse.jst.pagedesigner.validation.caret.IPositionRule#hasEditableArea(org.eclipse.jst.pagedesigner.validation.caret.Target)
- */
- public boolean hasEditableArea(Target target) {
- EditPart part = target.getPart();
- if (part == null) {
- return false;
- }
- Node node = target.getNode();
- if (hasBasicContainers(EditModelQuery.getDocumentNode(node))) {
- return true;// isWithinkBasicContainer(node);
- }
- return super.hasEditableArea(target);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.caret.IPositionRule#isEditable(org.eclipse.gef.EditPart)
- */
- public boolean isEditable(Target target) {
- Node node = target.getNode();
- if (hasBasicContainers(EditModelQuery.getDocumentNode(node))) {
- boolean result = isWithinkBasicContainer(node);
- return result;
- }
- return super.isEditable(target);
- }
-
- /**
- * We need to see if body, view are there. and they should be at first or
- * second level.
- *
- * @param document
- * @return true if the document has basic containers
- */
- public static boolean hasBasicContainers(Document document) {
- return getBasicContainer(document) != null;
-
- }
-
- private static boolean isWithinkBasicContainer(Node node) {
- return EditModelQuery.isChild(HTML_ROOT_CONTAINERS, node, true, false);
- }
-
- /**
- * @param document
- * @return the basic root container for the document or null
- */
- public static Node getBasicContainer(Document document) {
- Node node = EditModelQuery.getChild(document, HTML_ROOT_CONTAINERS, 2,
- false);
- if (node == null) {
- node = EditModelQuery.getChild(document, HTML_ROOT_CONTAINERS, 2,
- true);
- }
- return node;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.validation.caret.IPositionRule#canReference(org.eclipse.jst.pagedesigner.validation.caret.Target,
- * boolean)
- */
- public boolean canReference(Target target, boolean atRight) {
- Node node = target.getNode();
- if (node.getLocalName() != null) {
- if (Arrays.asList(HTML_ROOT_CONTAINERS).contains(
- node.getLocalName().toLowerCase())) {
- return EditModelQuery.isChild(
- JSFRootContainerPositionRule.JSF_ROOT_CONTAINERS, node,
- false, false);
- }
- }
- return true;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/Target.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/Target.java
deleted file mode 100644
index d680ec9..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/Target.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.validation.caret;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.gef.EditPart;
-import org.eclipse.jst.jsf.common.dom.TagIdentifier;
-import org.eclipse.jst.jsf.core.internal.tld.TagIdentifierFactory;
-import org.eclipse.jst.pagedesigner.converter.ITagConverter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- */
-public class Target {
- private EditPart _part;
-
- private Node _node;
-
- /**
- * @param part
- */
- public Target(EditPart part) {
- _part = part;
-
- if(part.getModel() instanceof Node)
- {
- _node = (Node) part.getModel();
- }
- else if (part.getModel() instanceof ITagConverter)
- {
- _node = ((ITagConverter)part.getModel()).getHostElement();
- }
- else
- {
- Assert.isTrue(false);
- }
- }
-
- /**
- * @param node
- */
- public Target(Node node) {
- _node = node;
- Assert.isTrue(node instanceof INodeNotifier);
- if (((INodeNotifier) node).getAdapterFor(EditPart.class) != null) {
- _part = (EditPart) ((INodeNotifier) node)
- .getAdapterFor(EditPart.class);
- }
- }
-
- /**
- * @return Returns the _node.
- */
- public Node getNode() {
- return _node;
- }
-
- /**
- * @return Returns the _part.
- */
- public EditPart getPart() {
- return _part;
- }
-
- /**
- * @return the target's tag wrapper or null if the target
- * is not an Element node
- */
- public TagIdentifier getTagWrapper()
- {
- if (_node instanceof Element)
- {
- return TagIdentifierFactory.createDocumentTagWrapper((Element)_node);
- }
-
- return null;
- }
-
- /**
- * @param node
- * @return the edit part for node or null if none found
- */
- public static EditPart resolvePart(Node node) {
- if (node instanceof INodeNotifier
- && ((INodeNotifier) node).getAdapterFor(EditPart.class) != null) {
- return (EditPart) ((INodeNotifier) node)
- .getAdapterFor(EditPart.class);
- }
- return null;
- }
-
- /**
- * @param part
- * @return the node for part
- */
- public static Node resolveNode(EditPart part) {
- return (Node) part.getModel();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/WhitespacePositionMoveRule.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/WhitespacePositionMoveRule.java
deleted file mode 100644
index 79e87c5..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/validation/caret/WhitespacePositionMoveRule.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.validation.caret;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.eclipse.jst.pagedesigner.viewer.DesignPosition;
-import org.eclipse.jst.pagedesigner.viewer.DesignRefPosition;
-import org.eclipse.jst.pagedesigner.viewer.EditPartPositionHelper;
-import org.w3c.dom.Text;
-
-/**
- * For whitespaces 1. If there is sibling can be reference, then we don't
- * reference whitespace text. 2. Position can't be between whitespace text.
- *
- * @author mengbo
- */
-public class WhitespacePositionMoveRule extends DefaultPositionRule implements
- IMovementRule {
-
- /**
- * @param actionData
- */
- public WhitespacePositionMoveRule(ActionData actionData) {
- super(actionData);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.caret.IMovementRule#canEnter(org.eclipse.gef.EditPart)
- */
- public boolean allowsMoveIn(Target target) {
- if (EditModelQuery.isTransparentText(target.getNode())) {
- return false;
- }
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.caret.IMovementRule#canMoveOut(org.eclipse.gef.EditPart)
- */
- public boolean allowsMoveOut(Target target) {
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.caret.IPositionRule#canReference(org.eclipse.jst.pagedesigner.caret.Target)
- */
- public boolean canReference(Target target, boolean atRight) {
- boolean result = super.canReference(target, atRight);
- if (EditModelQuery.isText(target.getNode())) {
- if (((Text) target.getNode()).getData().length() == 0) {
- result = false;
- } else if (EditModelQuery.isTransparentText(target.getNode())) {
- DesignPosition position = new DesignRefPosition(target
- .getPart(), atRight);
- if (EditPartPositionHelper.getConcretePart(position, atRight) != null) {
- result = true;
- } else {
- EditPart part = EditPartPositionHelper.getNextConcretPart(
- position, atRight);
- EditPart oppPart = EditPartPositionHelper
- .getNextConcretPart(position, !atRight);
- if (part == null) {
- if (oppPart == null) {
- result = true;
- }
- }
- result = false;
- }
- }
- }
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.caret.IPositionRule#hasEditableArea(org.eclipse.jst.pagedesigner.caret.Target)
- */
- public boolean hasEditableArea(Target target) {
- if (EditModelQuery.isTransparentText(target.getNode())) {
- return false;
- }
- return super.hasEditableArea(target);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.caret.IPositionRule#isEditable(org.eclipse.jst.pagedesigner.caret.Target)
- */
- public boolean isEditable(Target target) {
- if (EditModelQuery.isTransparentText(target.getNode())) {
- return false;
- }
- return super.isEditable(target);
- }
-
- // /*
- // * (non-Javadoc)
- // *
- // * @see
- // org.eclipse.jst.pagedesigner.caret.IPositionRule#isValidPosition(org.eclipse.jst.pagedesigner.dom.IDOMPosition)
- // */
- // public boolean isValidPosition(IDOMPosition position)
- // {
- // Node node = null;
- // if (position instanceof DOMRefPosition)
- // {
- // node = ((DOMRefPosition)position).getReferenceNode();
- // } else if (position.isText())
- // {
- // node = position.getContainerNode();
- // } else {
- // return super.isValidPosition(position);
- // }
- // if (EditModelQuery.isTransparentText(position.getContainerNode()))
- // {
- // if (node.getPreviousSibling() != null)
- // {
- // node = node.getPreviousSibling();
- // return _mediator.canReference(new Target(node), true);
- // }
- // else if (node.getNextSibling() != null)
- // {
- // node = node.getNextSibling();
- // return _mediator.canReference(new Target(node), false);
- // }
- // }
- // return super.isValidPosition(position);
- // }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/AbstractDropLocationStrategy.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/AbstractDropLocationStrategy.java
deleted file mode 100644
index 6dbeb64..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/AbstractDropLocationStrategy.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.viewer;
-
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.LayerConstants;
-import org.eclipse.gef.editparts.LayerManager;
-import org.eclipse.gef.requests.DropRequest;
-import org.eclipse.jst.pagedesigner.validation.caret.IPositionMediator;
-
-/**
- * Abstract parent of all concrete client implmentation of IDropLocationStrategy's
- * Clients should sub-class instead of implementing {@link IDropLocationStrategy} directly
- * to avoid future API breakage
- *
- * @author cbateman
- *
- */
-public abstract class AbstractDropLocationStrategy implements IDropLocationStrategy
-{
- private final EditPartViewer _viewer;
-
- /**
- * @param viewer
- */
- public AbstractDropLocationStrategy(EditPartViewer viewer)
- {
- _viewer = viewer;
- }
-
- public abstract DesignPosition calculateDesignPosition(EditPart host, Point p,
- IPositionMediator validator);
-
- public abstract List showTargetFeedback(EditPart host, DesignPosition position, DropRequest request);
-
- /**
- * @return the viewer in which this strategy may show target feedback
- */
- protected final EditPartViewer getViewer()
- {
- return _viewer;
- }
-
- /**
- * @return the figure for the feedback layer
- */
- protected final IFigure getFeedbackLayer()
- {
- return LayerManager.Helper.find(_viewer.getRootEditPart().getContents()).getLayer(LayerConstants.FEEDBACK_LAYER);
- }
-
- /**
- * Adds the specified <code>Figure</code> to the {@link LayerConstants#FEEDBACK_LAYER}.
- * @param figure the feedback to add
- */
- protected void addFeedback(IFigure figure) {
- getFeedbackLayer().add(figure);
- }
-
- /**
- * Removes the specified <code>Figure</code> to the {@link LayerConstants#FEEDBACK_LAYER}.
- * @param figure the feedback to remove
- */
- protected void removeFeedback(IFigure figure) {
- getFeedbackLayer().remove(figure);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/CaretPositionResolver.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/CaretPositionResolver.java
deleted file mode 100644
index 27aae69..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/CaretPositionResolver.java
+++ /dev/null
@@ -1,328 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.viewer;
-
-import java.util.List;
-
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.eclipse.jst.pagedesigner.validation.caret.IMovementMediator;
-import org.eclipse.jst.pagedesigner.validation.caret.IPositionMediator;
-import org.eclipse.jst.pagedesigner.validation.caret.Target;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- * @version 1.5
- */
-public class CaretPositionResolver {
- private IPositionMediator _validator;
-
- private Point _point;
-
- private static CaretPositionResolver _instance;
-
- /**
- * @param validator
- * @param point
- * @return the singleton instance
- */
- public static CaretPositionResolver getInstance(
- IPositionMediator validator, Point point) {
- if (_instance == null) {
- _instance = new CaretPositionResolver();
- }
- _instance.setPoint(point);
- _instance.setValidator(validator);
- return _instance;
- }
-
- /**
- * @param _point
- * The _point to set.
- */
- private void setPoint(Point _point) {
- this._point = _point;
- }
-
- /**
- * @param _validator
- * The _validator to set.
- */
- private void setValidator(IPositionMediator _validator) {
- this._validator = _validator;
- }
-
- /**
- * Calculate the two part's distance to point, the shorter one will be
- * return. Distance is calculated based on: if there is one box contains
- * point.y, then calculate that box, or if there is no any such one box,
- * then calculate the y distance.
- *
- * @param part1
- * @param part2
- * @param point
- * @return
- */
- static LayoutPart getCloserPart(LayoutPart part1, LayoutPart part2,
- Point _point) {
- if (part1 == null
- || EditModelQuery.isTransparentText(Target.resolveNode(part1
- .getPart()))) {
- return part2;
- } else if (part2 == null
- || EditModelQuery.isTransparentText(Target.resolveNode(part2
- .getPart()))) {
- return part1;
- }
- Rectangle rect1 = part1.getAbsoluteBounds();
- Rectangle rect2 = part2.getAbsoluteBounds();
- Node n1 = Target.resolveNode(part1.getPart());
- Node n2 = Target.resolveNode(part2.getPart());
- // Within same.
- if (EditModelQuery.isChild(n1, n2)
- && (CaretPositionResolver.getXDistance(rect2, _point) == 0)
- && !part1.isCloseToEdgeFromOutSide()) {
- return part2;
- } else if (EditModelQuery.isChild(n2, n1)
- && (CaretPositionResolver.getXDistance(rect1, _point) == 0 && !part2
- .isCloseToEdgeFromOutSide())
- && !part2.isCloseToEdgeFromOutSide()) {
- return part1;
- }
- if (rect1.intersect(new Rectangle(rect1.x, rect2.y, rect1.width,
- rect2.height)).height == 0) {
- return heightFirst(part1, part2, _point);
- }
- return widthFirst(part1, part2, _point);
- }
-
- private static LayoutPart heightFirst(LayoutPart part1, LayoutPart part2,
- Point _point) {
- Rectangle rect1 = part1.getAbsoluteBounds();
- Rectangle rect2 = part2.getAbsoluteBounds();
- int offset1 = Math.abs(CaretPositionResolver
- .getYDistance(rect1, _point));
- int offset2 = Math.abs(CaretPositionResolver
- .getYDistance(rect2, _point));
- if (offset1 > offset2) {
- return part2;
- } else if (offset1 < offset2) {
- return part1;
- } else {
- offset1 = Math.abs(CaretPositionResolver
- .getXDistance(rect1, _point));
- offset2 = Math.abs(CaretPositionResolver
- .getXDistance(rect2, _point));
- if (offset1 >= offset2) {
- return part2;
- }
- return part1;
- }
- }
-
- private static LayoutPart widthFirst(LayoutPart part1, LayoutPart part2,
- Point _point) {
- Rectangle rect1 = part1.getAbsoluteBounds();
- Rectangle rect2 = part2.getAbsoluteBounds();
- int offset1 = Math.abs(CaretPositionResolver
- .getXDistance(rect1, _point));
- int offset2 = Math.abs(CaretPositionResolver
- .getXDistance(rect2, _point));
- if (offset1 > offset2) {
- return part2;
- } else if (offset1 < offset2) {
- return part1;
- } else {
- offset1 = Math.abs(CaretPositionResolver
- .getYDistance(rect1, _point));
- offset2 = Math.abs(CaretPositionResolver
- .getYDistance(rect2, _point));
- if (offset1 >= offset2) {
- return part2;
- }
- return part1;
- }
- }
-
- /**
- * Return a descendent part under parent that is one of the closest part to
- * point.
- *
- * @param parent
- * @return
- */
- private LayoutPart getClosestChildPart(LayoutPart parent) {
- LayoutPart result = null;
- if (parent != null) {
- List children = null;
- if ((children = parent.getPart().getChildren()).size() > 0) // &&
- // _validator.hasEditableArea(new
- // Target(parent.getPart())))
- {
- // iterate its children, we know the part doesn't contain p. so
- // we only see if its children can be
- // referenced.
- for (int i = 0, n = children.size(); i < n; i++) {
- LayoutPart nextPart = new LayoutPart((EditPart) children
- .get(i), _point);
- Target target = new Target(nextPart.getPart());
- if (_validator.isValidPosition(new DesignRefPosition(target
- .getPart(), false))) {
- result = getCloserPart(result, nextPart, _point);
- } else if (_validator.hasEditableArea(target)) {
- LayoutPart temp = getClosestChildPart(nextPart);
- if (temp == null) {
- temp = nextPart;
- }
- result = getCloserPart(result, temp, _point);
- }
- }
- }
- }
- return result;
- }
-
- /**
- * Use by vertical movement, we need to see whther the par
- *
- * @param closestPart
- * @param target
- * @return
- */
- LayoutPart resolveClosestPartFrom(LayoutPart closestPart) {
- Target target = new Target(closestPart.getPart());
- LayoutPart finalPart = null;
- if (EditModelQuery.isInline(Target.resolveNode(closestPart.getPart()))) {
-
- if (closestPart.isAfterPoint() || closestPart.isBeforePoint()) {
- finalPart = closestPart;
- } else {
- if (_validator.hasEditableArea(target)
- && (_validator instanceof IMovementMediator
- && ((IMovementMediator) _validator)
- .allowsMoveIn(target) || !(_validator instanceof IMovementMediator))) {
- finalPart = getClosestChildPartOrPart(closestPart);
- }
- }
- }
- // block
- else {
- if (closestPart.contains(_point)) {
- if (_validator.hasEditableArea(target) && //
- (_validator instanceof IMovementMediator
- && ((IMovementMediator) _validator)
- .allowsMoveIn(target) || !(_validator instanceof IMovementMediator))) {
- finalPart = getClosestChildPartOrPart(closestPart);
- }
- }
- // outside of bounds
- else {
- if (_validator.hasEditableArea(target)
- && !IHTMLConstants.TAG_TABLE.equalsIgnoreCase(target
- .getNode().getNodeName())
- && (_validator instanceof IMovementMediator
- && ((IMovementMediator) _validator)
- .allowsMoveIn(target) || !(_validator instanceof IMovementMediator))) {
- if (closestPart.atSameRow(_point)) {
- finalPart = getClosestChildPartOrPart(closestPart);
- } else if (!_validator
- .isValidPosition(new DesignRefPosition(target
- .getPart(), true))) {
- finalPart = getClosestChildPartOrPart(closestPart);
- }
- }
- }
- }
- if (finalPart == null && //
- (_validator.isValidPosition(new DesignRefPosition(target
- .getPart(), true)) || //
- _validator.isValidPosition(new DesignRefPosition(target
- .getPart(), false)))) {
- finalPart = closestPart;
- }
- return finalPart;
- }
-
- private LayoutPart getClosestChildPartOrPart(LayoutPart closestPart) {
- LayoutPart result = getClosestChildPart(closestPart);
- if (result != null) {
- result = resolveClosestPartFrom(result);
- } else {
- if (closestPart.getConcretePart() == null) {
- result = closestPart;
- }
- }
- return result;
- }
-
- /**
- * Get the distance from rect's edge to point.x.
- *
- * @param rect
- * @param point
- * @return the X distance
- */
- public static int getXDistance(Rectangle rect, Point point) {
- if (rect.getRight().x <= point.x) {
- return point.x - (rect.getRight().x);
- } else if (rect.x >= point.x) {
- return point.x - rect.x;
- } else if (rect.x <= point.x && point.x <= rect.getRight().x) {
- return 0;
- }
- return -1;
- }
-
- /**
- * from point to middle's distance. If the result is nagative, point is at
- * left part of rect, if it is positive, the point is at the right part.
- *
- * @param rect
- * @param point
- * @return the X distance
- */
- public static int toXMiddle(Rectangle rect, Point point) {
- return (point.x - (rect.x + rect.getRight().x) / 2);
- }
-
- /**
- * from point to middle's distance If the result is nagative, point is at
- * upper part of rect, if it is positive, the point is at the lower part.
- *
- * @param rect
- * @param point
- * @return the Y distance
- */
- public static int toYMiddle(Rectangle rect, Point point) {
- return (point.y - (rect.y + rect.getBottom().y) / 2);
- }
-
- /**
- * @param rect
- * @param point
- * @return the Y distance
- */
- public static int getYDistance(Rectangle rect, Point point) {
- if (rect.y + rect.height <= point.y) {
- return point.y - (rect.y + rect.height);
- } else if (rect.y >= point.y) {
- return point.y - rect.y;
- } else if (rect.y <= point.y && point.y <= rect.y + rect.height) {
- return 0;
- }
- return -1;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/CaretUpdater.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/CaretUpdater.java
deleted file mode 100644
index dde0d69..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/CaretUpdater.java
+++ /dev/null
@@ -1,241 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.viewer;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-
-import org.eclipse.draw2d.FigureListener;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.RangeModel;
-import org.eclipse.draw2d.Viewport;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jst.pagedesigner.css2.property.ICSSPropertyID;
-import org.eclipse.jst.pagedesigner.tools.ExposeHelper;
-import org.eclipse.swt.widgets.Caret;
-
-/**
- * This class is responsible for update the caret location. At least the
- * following changes may result in caret location change. <ll>
- * <li>The selection mode change. For example, from/to text mode to/from object
- * mode, we need to hide/display the caret
- * <li>The caret location change in the model.
- * <li>the figures moved. This may result in model change in somewhere else, or
- * user resized the page designer.
- * <li>The figure that containing the caret get recreated. </ll>
- *
- * @author mengbo
- */
-/*package*/ class CaretUpdater implements IHTMLGraphicalViewerListener,
- FigureListener {
-// private static final Logger _log = PDPlugin.getLogger(CaretUpdater.class);
-
- private IHTMLGraphicalViewer _viewer;
-
- private boolean _viewerBatchChanging = false;
-
- /**
- * the width value of the caret in pixels
- */
- public static final int CARET_WIDTH = 2;
-
- /**
- * the figure the caret associate to, we need to track this figure's
- * resizing, location change, etc.
- */
- private IFigure _trackFigure;
-
- /**
- * @param viewer
- */
- public CaretUpdater(IHTMLGraphicalViewer viewer) {
- _viewer = viewer;
- setup();
- }
-
- /**
- * set up the
- */
- public void setup() {
- _viewer.addHTMLViewerListener(this);
- }
-
- /**
- * this method is called after the view is fully initialized.
- */
- public void connectViewer() {
- Viewport viewport = _viewer.getViewport();
- if (viewport != null) {
- viewport.getHorizontalRangeModel().addPropertyChangeListener(
- new PropertyChangeListener() {
- public void propertyChange(
- PropertyChangeEvent propertychangeevent) {
- if ((propertychangeevent.getSource() instanceof RangeModel)
- && (propertychangeevent.getPropertyName()
- .equals(ICSSPropertyID.ATTR_VALUE) || propertychangeevent
- .getPropertyName().equals("extent")))
- updateCaret();
- }
-
- });
- viewport.getVerticalRangeModel().addPropertyChangeListener(
- new PropertyChangeListener() {
-
- public void propertyChange(
- PropertyChangeEvent propertychangeevent) {
- if ((propertychangeevent.getSource() instanceof RangeModel)
- && (propertychangeevent.getPropertyName()
- .equals(ICSSPropertyID.ATTR_VALUE) || propertychangeevent
- .getPropertyName().equals("extent")))
- updateCaret();
- }
-
- });
- }
- }
-
- /**
- * dispose the instance
- */
- public void dispose() {
- _viewer.removeHTMLViewerListener(this);
- }
-
- /**
- * Update the selection
- */
- public void updateSelection() {
- setCaretVisible(false);
- updateRangeSelection();
- updateCaret();
- reveal();
- }
-
- private void setCaretVisible(boolean visible) {
- Caret caret = _viewer.getCaret();
- if (caret == null)
- return;
- if (caret.isDisposed()) {
- return;
- }
- caret.setVisible(visible);
- }
-
- /**
- *
- */
- private void updateRangeSelection() {
- // FIXME: optimization needed here. Normally should not repaint the
- // whole page.
- ((GraphicalEditPart) _viewer.getRootEditPart()).getFigure().repaint();
- ((GraphicalEditPart) _viewer.getRootEditPart()).getFigure()
- .getUpdateManager().performUpdate();
- }
-
- /**
- * update the caret
- */
- public void updateCaret() {
- if (_trackFigure != null) {
- _trackFigure.removeFigureListener(this);
- _trackFigure = null;
- }
- Caret caret = _viewer.getCaret();
- if (caret == null) {
- return;
- }
- if (caret.isDisposed()) {
- return;
- }
-
- Rectangle rect = null;
-
- // try get the caret bounds.
- if (_viewer.isInRangeMode()) {
- DesignRange range = _viewer.getRangeSelection();
- if (range != null) {
- DesignPosition endPosition = range.getEndPosition();
- if (endPosition != null && endPosition.isValid()) {
- rect = EditPartPositionHelper
- .convertToAbsoluteCaretRect(endPosition);
- _trackFigure = ((GraphicalEditPart) endPosition
- .getContainerPart()).getFigure();
- _trackFigure.addFigureListener(this);
- }
- }
- }
-
- // set visible effect
- if (rect == null) {
- caret.setVisible(false);
- } else {
- caret.setVisible(false); // make sure it get removed from the
- // screen.
- // the caret width doesn't need to be calculated, the x pos should
- // be adjusted more acurately.
- caret.setBounds(rect.x, rect.y, CARET_WIDTH, rect.height);
- caret.setVisible(true);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
- */
- public void selectionChanged(SelectionChangedEvent event) {
- if (_viewerBatchChanging) {
- return;
- }
- updateSelection();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewerListener#selectionAboutToChange()
- */
- public void selectionAboutToChange() {
- _viewerBatchChanging = true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewerListener#selectionChangeFinished()
- */
- public void selectionChangeFinished() {
- _viewerBatchChanging = false;
- updateSelection();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.draw2d.FigureListener#figureMoved(org.eclipse.draw2d.IFigure)
- */
- public void figureMoved(IFigure source) {
- updateCaret();
- }
-
- private void reveal() {
- Caret caret = _viewer.getCaret();
- if (caret != null && !caret.isDisposed() && _viewer.isInRangeMode()) {
- org.eclipse.swt.graphics.Rectangle rect = caret.getBounds();
- ExposeHelper helper = new ExposeHelper(_viewer);
- helper.exposeArea(new Rectangle(rect.x, rect.y, rect.width,
- rect.height));
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/DefaultDropLocationStrategy.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/DefaultDropLocationStrategy.java
deleted file mode 100644
index 38f27cf..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/DefaultDropLocationStrategy.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.viewer;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.LineBorder;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.requests.DropRequest;
-import org.eclipse.jst.pagedesigner.parts.ElementEditPart;
-import org.eclipse.jst.pagedesigner.validation.caret.IPositionMediator;
-
-/**
- * A default implementation of the drop location strategy
- * @author cbateman
- *
- */
-public class DefaultDropLocationStrategy extends AbstractDropLocationStrategy
-{
- // the amount of vertical offset below the mouse pointer to place
- // the upper left of the drop hint tooltip
- private static final int DROP_HINT_VERTICAL_OFFSET = 20;
-
- /**
- * @param viewer
- */
- public DefaultDropLocationStrategy(EditPartViewer viewer) {
- super(viewer);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.viewer.AbstractDropLocationStrategy#calculateDesignPosition(org.eclipse.gef.EditPart, org.eclipse.draw2d.geometry.Point, org.eclipse.jst.pagedesigner.validation.caret.IPositionMediator)
- */
- @Override
- public DesignPosition calculateDesignPosition(EditPart host, Point p,
- IPositionMediator validator) {
- return EditPartPositionHelper.findEditPartPosition(
- host, p, validator);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.pagedesigner.viewer.AbstractDropLocationStrategy#showTargetFeedback(org.eclipse.gef.EditPart, org.eclipse.jst.pagedesigner.viewer.DesignPosition, org.eclipse.gef.requests.DropRequest)
- */
- @Override
- public List showTargetFeedback(EditPart host, DesignPosition position, DropRequest request)
- {
- List feedback = new ArrayList(4);
- feedback.add(showFeedbackRect(createCaretBounds(position)));
- feedback.add(showDropHintLabel(request.getLocation(), position));
-
- return feedback;
- }
-
-
-
- /**
- * @param rect
- * @return the default rectangle figure for the requested visual rectangle
- */
- protected final RectangleFigure showFeedbackRect(Rectangle rect) {
- RectangleFigure pf = createFeedbackFigure();
- pf.translateToRelative(rect);
- pf.setBounds(rect);
- return pf;
- }
-
- /**
- * @param position
- * @return the bounding rectangle for the caret at the current
- * position in absolute coords
- */
- protected Rectangle createCaretBounds(DesignPosition position)
- {
- Rectangle rect = EditPartPositionHelper
- .convertToAbsoluteCaretRect(position);
-
- // to avoid enlarge feedback pane.
- rect = rect.intersect(getFeedbackLayer().getBounds());
-
- return rect;
- }
-
- /**
- * @return the newly created feedback figure
- */
- protected RectangleFigure createFeedbackFigure()
- {
- RectangleFigure feedbackFigure = new RectangleFigure();
- feedbackFigure.setFill(true);
- feedbackFigure.setOutline(true);
- feedbackFigure.setLineWidth(1);
- feedbackFigure.setForegroundColor(ColorConstants.red);
- feedbackFigure.setBounds(new Rectangle(0, 0, 0, 0));
- feedbackFigure.setXOR(true);
- addFeedback(feedbackFigure);
- return feedbackFigure;
- }
-
- /**
- * Shows a label in a position relative to the drop marker
- * that hints where the new component will be dropped in
- * respect of components already there
- * @param mousePosition
- * @param position
- * @return the drop hint label
- */
- protected final Label showDropHintLabel(Point mousePosition, DesignPosition position)
- {
- Label dropHintLabel = new Label();
- dropHintLabel.setOpaque(true);
- dropHintLabel.setBackgroundColor(ColorConstants.tooltipBackground);
- dropHintLabel.setBorder(
- new LineBorder(ColorConstants.black, 1)
- {
- // add an extra pixel of inset to make sure the text
- // isn't pressed against the border
- public Insets getInsets(IFigure figure) {
- return new Insets(getWidth()+1);
- }
- }
- );
- addFeedback(dropHintLabel);
-
- final String hintText = getDropHintText(position);
- dropHintLabel.setText(hintText);
- //TODO: need to handle viewport clipping and adjust label location appropriately
- Dimension hintSize = dropHintLabel.getPreferredSize();
- Point hintLocation = new Point(mousePosition.x, mousePosition.y+DROP_HINT_VERTICAL_OFFSET);
-
- Rectangle hintRect = new Rectangle(hintLocation, hintSize);
-
- // we need to intersect the rectangle with the feedback pane, otherwise, when the mouse
- // is dragged near the edge of the viewport with the drop hint active, the canvas will expand
- // away from the mouse. In future a more ideal solution will be to relocate the tooltip
- // so that is is completely inside the viewport.
- hintRect = hintRect.intersect(getFeedbackLayer().getBounds());
-
- dropHintLabel.translateToRelative(hintRect);
- dropHintLabel.setBounds(hintRect);
-
- return dropHintLabel;
- }
-
- /**
- * @param position
- * @return the drop hint text for the current position
- */
- protected String getDropHintText(DesignPosition position)
- {
- StringBuffer buffer = new StringBuffer("Place");
-
- EditPart prevPart = position.getSiblingEditPart(false);
- EditPart nextPart = position.getSiblingEditPart(true);
-
- if (nextPart instanceof ElementEditPart)
- {
- buffer.append(" before ");
- buffer.append(((ElementEditPart)nextPart).getTagConvert().getHostElement().getNodeName());
- buffer.append(",");
- }
-
- if (prevPart instanceof ElementEditPart)
- {
- buffer.append(" after ");
- buffer.append(((ElementEditPart)prevPart).getTagConvert().getHostElement().getNodeName());
- buffer.append(",");
- }
-
- buffer.append(" inside ");
- buffer.append(position.getContainerNode().getNodeName());
-
- return buffer.toString();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/DesignPosition.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/DesignPosition.java
deleted file mode 100644
index 237c656..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/DesignPosition.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.viewer;
-
-import java.util.List;
-
-import org.eclipse.gef.EditPart;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-/**
- * @author mengbo
- */
-public class DesignPosition {
- /**
- * a singleton that can be used as an invalid position
- */
- public static final DesignPosition INVALID = new DesignPosition(null, -1);
-
- private EditPart _containerPart;
-
- int _offset;
-
- //private Node _containerNode;
-
- /**
- * @param part
- * @param offset
- */
- public DesignPosition(EditPart part, int offset) {
- _containerPart = part;
- _offset = offset;
- }
-
- /**
- * if _containerPart is null, means it is invalid
- *
- * @return the container edit part
- */
- public EditPart getContainerPart() {
- return _containerPart;
- }
-
- /**
- * @return the container node
- */
- public Node getContainerNode() {
- if (_containerPart != null) {
- return (Node) _containerPart.getModel();
- }
- return null;
- }
-
- /**
- * if offset < 0, means it is invalid.
- *
- * @return the offset
- */
- public int getOffset() {
- return _offset;
- }
-
- /**
- * @return true if the design position is valid
- */
- public boolean isValid() {
- return (_containerPart != null) && (_offset >= 0);
- }
-
- /**
- * This method should not be called when is text node.
- *
- * @param forward
- * @return the sibling part one to right in the tree if
- * forward == true, one to the left if forward == false. May
- * return null if position is invalid or there is no valid sibling.
- */
- public EditPart getSiblingEditPart(boolean forward) {
- if (!isValid()) {
- return null;
- }
-
- int index = forward ? (_offset) : (_offset - 1);
- List children = _containerPart.getChildren();
-
- if ((index >= children.size()) || (index < 0)) {
- return null;
- }
-
- return (EditPart) children.get(index);
- }
-
- /**
- * factory method
- *
- * @param part
- * @return a design position one before part
- */
- public static DesignPosition createPositionBeforePart(EditPart part) {
- EditPart parent = part.getParent();
-
- if (parent == null) {
- return new DesignPosition(part, 0);
- }
- return new DesignPosition(parent, parent.getChildren()
- .indexOf(part));
- }
-
- /**
- * factory method
- *
- * @param part
- * @return the design position for one after part
- */
- public static DesignPosition createPositionAfterPart(EditPart part) {
- EditPart parent = part.getParent();
-
- if (parent == null) {
- return new DesignPosition(part, part.getChildren().size());
- }
- return new DesignPosition(parent, parent.getChildren()
- .indexOf(part) + 1);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
- if (obj == this)
- {
- return true;
- }
-
- if (obj instanceof DesignPosition) {
- DesignPosition p = (DesignPosition) obj;
-
- return (p.getContainerPart() == this._containerPart)
- && (p.getOffset() == this._offset);
- }
-
- return false;
- }
-
-
- @Override
- public int hashCode() {
- return System.identityHashCode(_containerPart) ^ System.identityHashCode(Integer.valueOf(_offset));
- }
-
- /**
- * @param buffer
- * @return the buffer with the debug dump
- */
- public StringBuffer debugDump(StringBuffer buffer) {
-// try {
- buffer.append("DesignPosition: ").append(this._containerPart)
- .append(": ").append(this._offset).append("\n");
-
- if (this._containerPart.getModel() instanceof Text) {
- // skip
- } else {
- if (this._offset > 0) {
- buffer.append("after: ").append(
- this._containerPart.getChildren().get(
- this._offset - 1)).append("\n");
- }
-
- if (this._offset < (this._containerPart.getChildren().size() - 1)) {
- buffer.append("before: ")
- .append(
- this._containerPart.getChildren().get(
- this._offset)).append("\n");
- }
- }
- //TODO: what was being caught here?
-// } catch (Exception e) {
-// }
-
- return buffer;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer buffer = new StringBuffer();
-
- return debugDump(buffer).toString();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/DesignRange.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/DesignRange.java
deleted file mode 100644
index a4a0939..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/DesignRange.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.viewer;
-
-import org.eclipse.jface.viewers.ISelection;
-
-/**
- * @author mengbo
- */
-public class DesignRange implements ISelection
-{
- private final DesignPosition _start;
- private final DesignPosition _end;
-
- /**
- * @param start
- * @param end
- */
- public DesignRange(DesignPosition start, DesignPosition end) {
- _start = start;
- _end = end;
- }
-
- /**
- * @return the start position in the range
- */
- public DesignPosition getStartPosition() {
- return _start;
- }
-
- /**
- * @return the end position in the range
- */
- public DesignPosition getEndPosition() {
- return _end;
- }
-
- /**
- * @return true if the range is valid
- */
- public boolean isValid() {
- return _start != null && _start.isValid() && _end != null
- && _end.isValid();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.ISelection#isEmpty()
- */
- public boolean isEmpty() {
- // FIXME: temp implementation, need revisit.
- return !isValid() || _start.equals(_end);
- }
-
- /**
- * @param buffer
- * @return a buffer with the debug dum
- */
- public StringBuffer debugDump(StringBuffer buffer) {
- if (_start != null) {
- buffer.append("Start: ").append(_start);
- } else {
- buffer.append("Start: null");
- }
- if (_end != null) {
- buffer.append("End: ").append(_end);
- } else {
- buffer.append("End: null");
- }
- return buffer;
- }
-
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- return debugDump(buffer).toString();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/DesignRefPosition.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/DesignRefPosition.java
deleted file mode 100644
index da6e305..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/DesignRefPosition.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.viewer;
-
-import org.eclipse.gef.EditPart;
-
-/**
- * @author mengbo
- */
-public class DesignRefPosition extends DesignPosition {
- private boolean _caretIsAtRight;
-
- private EditPart _refPart;
-
- /**
- * @param part
- * @param caretIsAfter
- */
- public DesignRefPosition(EditPart part, boolean caretIsAfter) {
- super(part.getParent(), 0);
- int offset = part.getParent().getChildren().indexOf(part);
- _offset = caretIsAfter ? offset + 1 : offset;
- _refPart = part;
- _caretIsAtRight = caretIsAfter;
- }
-
- /**
- * @return the reference edit part
- */
- public EditPart getRefPart() {
- return _refPart;
- }
-
- /**
- * @return Returns the _isAfter.
- */
- public boolean caretIsAtRight() {
- return _caretIsAtRight;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/EditPartPositionHelper.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/EditPartPositionHelper.java
deleted file mode 100644
index 423b6df..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/EditPartPositionHelper.java
+++ /dev/null
@@ -1,678 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.viewer;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.css2.layout.CSSFigure;
-import org.eclipse.jst.pagedesigner.css2.layout.CSSTextFigure;
-import org.eclipse.jst.pagedesigner.css2.layout.FlowBox;
-import org.eclipse.jst.pagedesigner.dom.DOMPosition;
-import org.eclipse.jst.pagedesigner.dom.DOMPositionHelper;
-import org.eclipse.jst.pagedesigner.dom.DOMRefPosition;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.eclipse.jst.pagedesigner.parts.NodeEditPart;
-import org.eclipse.jst.pagedesigner.parts.TextEditPart;
-import org.eclipse.jst.pagedesigner.validation.caret.IMovementMediator;
-import org.eclipse.jst.pagedesigner.validation.caret.IPositionMediator;
-import org.eclipse.jst.pagedesigner.validation.caret.Target;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- */
-public class EditPartPositionHelper {
-// private final static Logger _log = PDPlugin
-// .getLogger(EditPartPositionHelper.class);
-
- /**
- * Add something to curent
- *
- * @param lineBox
- * @param host
- * @param point
- * @param validator
- */
- private static void addToCurrentLine(FlowBoxLine lineBox, EditPart host,
- Point point, IPositionMediator validator) {
- Node node = Target.resolveNode(host);
- if (!(node == null || EditModelQuery.isDocument(node))) {
- // Either it is referencable or is editable.
- if (validator.isValidPosition(new DOMRefPosition(node, true))
- || //
- validator
- .isValidPosition((new DOMRefPosition(node, false)))
- || //
- validator.isValidPosition(new DOMPosition(node, 0))) {
- lineBox.addLayoutPart(host, point);
- }
- }
- }
-
- /**
- * @param position
- * @return null means failed to convert to rect.
- */
- public static Rectangle convertToAbsoluteCaretRect(DesignPosition position) {
- Rectangle ret = null;
- try {
- final int CARET_OFFSET = 1;
- if (position == null || !position.isValid()) {
- return null;
- }
- EditPart containerEditPart = position.getContainerPart();
- if (containerEditPart instanceof TextEditPart) {
- CSSTextFigure figure = (CSSTextFigure) ((TextEditPart) containerEditPart)
- .getFigure();
- ret = figure.calculateCaretPosition(position.getOffset());
- figure.translateToAbsolute(ret);
- ret.width = CaretUpdater.CARET_WIDTH;
- } else {
- int offset = position.getOffset();
- // there is no child
- if (containerEditPart.getChildren().isEmpty()
- || LayoutPart.getConcretePart(containerEditPart) == null) {
- IFigure figure = ((GraphicalEditPart) containerEditPart)
- .getFigure();
- Rectangle bounds = figure.getBounds();
- if (figure instanceof CSSFigure) {
- List fragments = ((CSSFigure) figure)
- .getFragmentsForRead();
- if (fragments.size() > 0) {
- FlowBox box = (FlowBox) fragments.get(fragments
- .size() - 1);
- bounds = LayoutPart.getBounds(box);
- }
- }
-
- ret = new Rectangle(bounds.x + CARET_OFFSET, bounds.y,
- CaretUpdater.CARET_WIDTH, bounds.height);
-
- figure.translateToAbsolute(ret);
- } else if (offset >= 0
- && offset <= containerEditPart.getChildren().size()) {
- ret = getRefRect(position);
- }
- }
- } catch (Exception e) {
- // This should never happen, we catch here for later analysis.
- // _log.debug("Error in caret rect resolving", e);
- ret = new Rectangle(0, 0, 0, 0);
- }
- if (ret == null) {
- ret = new Rectangle(0, 0, 0, 0);
- }
- return ret;
- }
-
- /**
- * This method will create FlowBoxLine to calculate the accurate parts.
- *
- * @param host
- * @param p
- * @param validator
- * @return the design position
- */
- public static DesignPosition findEditPartPosition(EditPart host, Point p,
- IPositionMediator validator) {
- try {
- host = validator.getEditableContainer(new Target(host));
- FlowBoxLine boxLine = new FlowBoxLine(
- new Rectangle(p.x, p.y, 0, 0), validator, p);
- DesignPosition position = innerFindEditPartPosition(host, host, p,
- boxLine, validator);
- if (position == null) {
- position = innerFindEditPartPosition(host, host, p, boxLine,
- validator);
- if (position == null) {
- EditPart part = boxLine.getClosestPart();
- if (part != null) {
- LayoutPart layoutPart = new LayoutPart(part, p);
- position = layoutPart.resolvePosition(validator);
- }
- }
- }
- return position;
- } catch (Exception e) {
- return null;
- }
-
- }
-
- /**
- * This function find the position, if there is one which is widget or text
- * and it contains p, or there is not such widget, then boxLine will returns
- * the widget that are in a sameline which contains p;
- * @param rootHost
- * @param host
- *
- * @param p
- * @param boxLine
- * @param validator
- * @return the design position
- */
- //TODO: needs refactoring
- public static DesignPosition innerFindEditPartPosition(EditPart rootHost,
- EditPart host, Point p, FlowBoxLine boxLine,
- IPositionMediator validator) {
- Target target = new Target(host);
- LayoutPart lPart = new LayoutPart(host, p);
- // text
- if (host instanceof TextEditPart) {
- if (lPart.contains(p)) {
- DesignPosition position = null;
- // see if the point is within string.
- position = findTextEditPartPosition((TextEditPart) host, p);
- if (position == null) {
- addToCurrentLine(boxLine, host, p, validator);
- }
- // found?!!
- return position;
- }
- addToCurrentLine(boxLine, host, p, validator);
- return null;
- }
- // widget
- else if (isWidget(host)) {
- if (lPart.contains(p)
- && (validator.isValidPosition(new DOMRefPosition(target
- .getNode(), true)) || //
- validator.isValidPosition((new DOMRefPosition(target
- .getNode(), false))))) {
- if (IHTMLConstants.TAG_BR.equalsIgnoreCase(Target.resolveNode(
- host).getNodeName())) {
- return new DesignRefPosition(host, lPart.isBeforePoint(p));
- }
- return new DesignRefPosition(host, lPart.isBeforePoint(p)
- || !lPart.atLeftPart(p));
- }
- addToCurrentLine(boxLine, host, p, validator);
- } else {
- // root host. we always supporse it has editable area.
- if (host == rootHost) {
- if (host.getChildren().size() > 0) {
- List children = host.getChildren();
- for (int i = 0, size = children.size(); i < size; i++) {
- GraphicalEditPart child = (GraphicalEditPart) children
- .get(i);
- DesignPosition position = innerFindEditPartPosition(
- rootHost, child, p, boxLine, validator);
- if (position != null) {
- return position;
- }
- }
- }
- if (boxLine.getPartsList().size() == 0) {
- if (lPart.contains(p)) {
- // found!!!
- return new DesignPosition(host, 0);
- }
- addToCurrentLine(boxLine, host, p, validator);
- }
- }
- // container
- else {
- // cann't edit it.
- if (!validator.hasEditableArea(target)) {
- if (lPart.contains(p) && //
- (validator.isValidPosition(new DesignRefPosition(
- target.getPart(), true)) || //
- validator.isValidPosition(new DesignRefPosition(
- target.getPart(), true)))) {
- return new DesignRefPosition(host, lPart
- .isBeforePoint(p)
- || !lPart.atLeftPart(p));
- }
- addToCurrentLine(boxLine, host, p, validator);
- }
- // can edit
- else {
- // contains p
- if (lPart.contains(p) || //
- (!validator.isValidPosition(new DesignRefPosition(
- target.getPart(), true)) && //
- !validator.isValidPosition(new DesignRefPosition(
- target.getPart(), true)))) {
- if (host.getChildren().size() > 0) {
- List children = host.getChildren();
- for (int i = 0, size = children.size(); i < size; i++) {
- GraphicalEditPart child = (GraphicalEditPart) children
- .get(i);
- DesignPosition position = innerFindEditPartPosition(
- rootHost, child, p, boxLine, validator);
- if (position != null) {
- return position;
- }
- }
- } else {
- // we put the container which is empty here.
- if (lPart.contains(p)) {
- // found!!!
- return new DesignPosition(host, 0);
- }
- addToCurrentLine(boxLine, host, p, validator);
- }
- }
- // not contains p
- else {
- addToCurrentLine(boxLine, host, p, validator);
- }
- }
- }
- }
- return null;
- }
-
- /**
- * similiar to findEditPartPositionConstrained, this method is used to
- * vertically move caret.
- *
- * @param host
- * @param p
- * @param validator
- * @return the design position
- */
- public static DesignPosition findEditPartPositionConstrained(EditPart host,
- Point p, IMovementMediator validator) {
- try {
- FlowBoxLine boxLine = new FlowBoxLine(
- new Rectangle(p.x, p.y, 0, 0), validator, p);
- DesignPosition position = innerFindEditPartPositionConstrained(
- host, host, p, boxLine, validator);
- if (position == null) {
- position = innerFindEditPartPositionConstrained(host, host, p,
- boxLine, validator);
- if (position == null) {
- EditPart part = boxLine.getClosestPart();
- if (part != null) {
- LayoutPart layoutPart = new LayoutPart(part, p);
- position = layoutPart.resolvePosition(validator);
- }
- }
- }
- return position;
- } catch (Exception e) {
- return null;
- }
- }
-
- /**
- * This method is used for move up/down, except for using tactics to deal
- * with container, this method is similiar to findEditPartPosition.
- *
- * @param rootHost
- * @param host
- * @param p
- * @param boxLine
- * @param validator
- * @return the design position
- */
- // TODO: needs refactoring
- public static DesignPosition innerFindEditPartPositionConstrained(
- EditPart rootHost, EditPart host, Point p, FlowBoxLine boxLine,
- IMovementMediator validator) {
- Target target = new Target(host);
- LayoutPart lPart = new LayoutPart(host, p);
- // text
- if (host instanceof TextEditPart) {
- if (lPart.contains(p)) {
- DesignPosition position = null;
- // see if the point is within string.
- position = findTextEditPartPosition((TextEditPart) host, p);
- if (position == null) {
- addToCurrentLine(boxLine, host, p, validator);
- }
- // found?!!
- return position;
- }
- addToCurrentLine(boxLine, host, p, validator);
- return null;
- }
- // widget
- else if (isWidget(host)) {
- if (lPart.contains(p)) {
- // found!!!
- if (IHTMLConstants.TAG_BR.equalsIgnoreCase(Target.resolveNode(
- host).getNodeName())) {
- return new DesignRefPosition(host, lPart.isBeforePoint(p));
- }
- return new DesignRefPosition(host, lPart.isBeforePoint(p)
- || !lPart.atLeftPart(p));
- }
- addToCurrentLine(boxLine, host, p, validator);
- } else {
- // root host. we always supporse it has editable area.
- if (host == rootHost) {
- if (host.getChildren().size() > 0) {
- List children = host.getChildren();
- for (int i = 0, size = children.size(); i < size; i++) {
- GraphicalEditPart child = (GraphicalEditPart) children
- .get(i);
- DesignPosition position = innerFindEditPartPositionConstrained(
- rootHost, child, p, boxLine, validator);
- if (position != null) {
- return position;
- }
- }
- } else {
- if (lPart.contains(p)) {
- // found!!!
- return new DesignPosition(host, 0);
- }
- addToCurrentLine(boxLine, host, p, validator);
- }
- }
- // container
- else {
- // cann't edit it.
- if (!validator.hasEditableArea(target)
- || !validator.allowsMoveIn(target)) {
- if (validator.canReference(target, true)
- || validator.canReference(target, false)) {
- if (lPart.contains(p)) {
- return new DesignRefPosition(host, lPart
- .isBeforePoint(p)
- || !lPart.atLeftPart(p));
- }
- addToCurrentLine(boxLine, host, p, validator);
- }
- }
- // can edit
- else {
- // contains p
- if (lPart.contains(p)) {
- if (host.getChildren().size() > 0) {
- List children = host.getChildren();
- for (int i = 0, size = children.size(); i < size; i++) {
- GraphicalEditPart child = (GraphicalEditPart) children
- .get(i);
- DesignPosition position = innerFindEditPartPositionConstrained(
- rootHost, child, p, boxLine, validator);
- if (position != null) {
- return position;
- }
- }
- } else {
- // we put the container which is empty here.
- if (lPart.contains(p)) {
- // found!!!
- return new DesignPosition(host, 0);
- }
- addToCurrentLine(boxLine, host, p, validator);
- }
- }
- // not contains p
- else {
- addToCurrentLine(boxLine, host, p, validator);
- }
- }
- }
- }
- return null;
-
- }
-
- // /**
- // * @param host
- // * @param p
- // * @return
- // */
- // private static DesignPosition
- // findTextEditPartPositionAdjacent(TextEditPart host, Point p)
- // {
- // if (host.getFigure() instanceof CSSTextFigure)
- // {
- // CSSTextFigure figure = (CSSTextFigure) host.getFigure();
- // // make a copy to not destroy the original o
- // p = p.getCopy();
- // figure.translateToRelative(p);
- // int offset = figure.getNewInsertionOffset(p);
- // if (offset >= 0)
- // {
- // return new DesignPosition(host, offset);
- // }
- // else
- // {
- // return null;
- // }
- // }
- // else
- // {
- // // should not happen.
- // return new DesignPosition(host, 0);
- // }
- // }
-
- /**
- * @param host
- * @param p
- * @return
- */
- private static DesignPosition findTextEditPartPosition(TextEditPart host,
- Point p) {
- if (host.getFigure() instanceof CSSTextFigure) {
- CSSTextFigure figure = (CSSTextFigure) host.getFigure();
- // make a copy to not destroy the original o
- p = p.getCopy();
- figure.translateToRelative(p);
- int offset = figure.getInsertionOffset(p);
- if (offset >= 0) {
- return new DesignPosition(host, offset);
- }
- return null;
- }
- // should not happen.
- return new DesignPosition(host, 0);
- }
-
- /**
- * @param figure
- * @param box
- * @return
- */
-// public static Rectangle getBoxBounds(IFigure figure, FlowBox box) {
-// Rectangle r = new Rectangle(box._x, box._y, box.getWidth(), box
-// .getHeight());
-// figure.translateToAbsolute(r);
-// return r;
-// }
-
- /**
- * If child is a GraphicalEditPart, a new copy of its bounding rectangle
- * will be returned translated to absolute bounds. If child is not a GraphicalEditPart
- * then the empty rectangle (0,0,0,0) is returned.
- *
- * @param child
- * @return the bounding rectangle or (0,0,0,0) if none.
- */
- public static Rectangle getAbsoluteBounds(EditPart child) {
- if (child instanceof GraphicalEditPart) {
- Rectangle bounds = ((GraphicalEditPart) child).getFigure()
- .getBounds().getCopy();
- ((GraphicalEditPart) child).getFigure().translateToAbsolute(bounds);
- return bounds;
- }
- return new Rectangle(0, 0, 0, 0);
- }
-
- /**
- * @param host
- * @param tagName
- * @return
- */
- private static boolean isWidget(EditPart host) {
- if (host instanceof NodeEditPart) {
- return ((NodeEditPart) host).isWidget();
- }
- return false;
- }
-
- /**
- * Is Caret at right?
- *
- * @param position
- * @param caretRefResult
- * @return
- */
- private static EditPart tryTwoWays(DesignPosition position,
- List<Boolean> caretRefResult) {
- EditPart result = null;
- // Sibling first:
- Node node = EditModelQuery.getInstance().getSibling(
- DOMPositionHelper.toDOMPosition(position), true);
- if (node != null && !EditModelQuery.isTransparentText(node)) {
- result = Target.resolvePart(node);
- caretRefResult.add(Boolean.FALSE);
- } else {
- node = EditModelQuery.getInstance().getSibling(
- DOMPositionHelper.toDOMPosition(position), false);
- if (node != null && !EditModelQuery.isTransparentText(node)) {
- result = Target.resolvePart(node);
- caretRefResult.add(Boolean.TRUE);
- }
- }
- if (result == null) {
- if (getConcretePart(position, false) != null) {
- result = getConcretePart(position, false);
- caretRefResult.add(Boolean.TRUE);
- } else if (getConcretePart(position, true) != null) {
- result = getConcretePart(position, true);
- caretRefResult.add(Boolean.FALSE);
- }
- }
- return result;
- }
-
- /*
- * Here we are doing something to avoid reference witespace tag. Since we
- * still need to improve whitespace tags's layout furthure more.
- */
- private static EditPart getNextConcretPart(DesignPosition position,
- List<Boolean> caretIsAtRightTest) {
- EditPart result = null;
- boolean caretIsAtRight = true;
- if (position instanceof DesignRefPosition) {
- caretIsAtRight = ((DesignRefPosition) position).caretIsAtRight();
- result = ((DesignRefPosition) position).getRefPart();
- caretIsAtRightTest.add(Boolean.valueOf(caretIsAtRight));
- }
- if (result == null
- || EditModelQuery.isTransparentText(Target.resolveNode(result))) {
- caretIsAtRightTest.clear();
- result = tryTwoWays(position, caretIsAtRightTest);
- }
- return result;
- }
-
- /**
- * Avoid whitespaces
- *
- * @param position
- * @param forward
- * @return the edit part at position which is non-whitespace ? TODO:
- */
- public static EditPart getConcretePart(DesignPosition position,
- boolean forward) {
- EditPart result = null;
- Node node = EditModelQuery.getInstance().getSibling(
- DOMPositionHelper.toDOMPosition(position), forward);
- while (node != null && EditModelQuery.isTransparentText(node)) {
- node = EditModelQuery.getInstance().getSibling(node, forward);
- }
- if (node != null) {
- result = Target.resolvePart(node);
- }
- return result;
- }
-
- /**
- * @param position
- * @param forward
- * @return the next concrete part.
- */
- public static EditPart getNextConcretPart(DesignPosition position,
- boolean forward) {
- Node node;
- EditPart result = null;
- node = EditModelQuery.getInstance().getSibling(
- DOMPositionHelper.toDOMPosition(position), forward);
- if (node != null) {
- if (forward) {
- while (node != null) {
- if (!EditModelQuery.isTransparentText(node)
- && (result = Target.resolvePart(node)) != null) {
- result = Target.resolvePart(node);
- break;
- }
- node = node.getNextSibling();
- }
- } else {
- while (node != null) {
- if (!EditModelQuery.isTransparentText(node)
- && (result = Target.resolvePart(node)) != null) {
- result = Target.resolvePart(node);
- break;
- }
- node = node.getPreviousSibling();
- }
- }
- }
- return result;
- }
-
- private static Rectangle getRefRect(DesignPosition position) {
- List<Boolean> caretLocation = new ArrayList<Boolean>();
- EditPart part = getNextConcretPart(position, caretLocation);
- LayoutPart layoutPart;
- Rectangle rect = null;
- if (part != null) {
- layoutPart = new LayoutPart(part, null);
- boolean caretIsAtRight = caretLocation.get(0)
- .booleanValue();
- final int CARET_OFFSET = 1;
- Rectangle bounds = null;
- IFigure figure = ((GraphicalEditPart) part).getFigure();
- if (!caretIsAtRight) {
- FlowBox box;
- if ((box = layoutPart.getLine(0)) != null) {
- bounds = LayoutPart.getBounds(box);
- }
- } else {
- FlowBox box;
- if ((box = layoutPart.getLastLine()) != null) {
- bounds = LayoutPart.getBounds(box);
- }
- }
- if (bounds == null) {
- bounds = figure.getBounds();
- }
- if (!caretIsAtRight) {
- rect = new Rectangle(bounds.x - CARET_OFFSET, bounds.y,
- CaretUpdater.CARET_WIDTH, bounds.height);// new
- } else {
- rect = new Rectangle(bounds.getRight().x + CARET_OFFSET,
- bounds.y, CaretUpdater.CARET_WIDTH, bounds.height);// new
- }
- figure.translateToAbsolute(rect);
- } else {
- System.out.println("No concrete part?");
- }
- return rect;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/FlowBoxLine.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/FlowBoxLine.java
deleted file mode 100644
index 5e45ac1..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/FlowBoxLine.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.viewer;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.jst.pagedesigner.validation.caret.ActionData;
-import org.eclipse.jst.pagedesigner.validation.caret.IPositionMediator;
-
-/**
- * FlowBoxLine collects EditParts in a line that cover the x or y coordinate of
- * design view caret. An EditPart may be a widget that can't contains children,
- * a TextEditPart which contains a set of flowbox, or a widgets container which
- * contains some other editparts. For container, there are two types: white box
- * to visitor, that is the container * visitor should consider its content, like
- * <A>, <B>. etc, or black box to visitor, like <TABLE>. Black box means the
- * container will be considered as a whole from outside. For non-container
- * widget we only see TextEditPart can be broken at line end. For black box,
- * only start box or latest box are used for final reference, for white box, we
- * will process its content for reference <@see
- * EditPartPositionHelper.findEditPartPosition>. For Text, the char that is
- * closest to caret will be referenced. In this line class, tree types of
- * EditPart are collected: TextEditPart, Widget, BlackBox container.
- *
- * @author mengbo
- */
-public class FlowBoxLine {
- private int _x;
-
- private int _y;
-
- private int _height;
-
- private int _width;
-
- private HashMap _parts = new HashMap();
-
- private IPositionMediator _validator;
-
- private Point _point;
-
- /**
- * @param rect
- * @param validator
- * @param point
- */
- public FlowBoxLine(Rectangle rect, IPositionMediator validator, Point point) {
- _x = rect.x;
- _y = rect.y;
- _width = rect.width;
- _height = rect.height;
- _validator = validator;
- _point = point;
- }
-
- /**
- * @return Returns the _height.
- */
- public int getHeight() {
- return _height;
- }
-
- /**
- * @return Returns the _width.
- */
- public int getWidth() {
- return _width;
- }
-
- /**
- * @return Returns the _x.
- */
- public int getX() {
- return _x;
- }
-
- /**
- * @return Returns the _y.
- */
- public int getY() {
- return _y;
- }
-
- /**
- * @return the part list
- */
- public Map getPartsList() {
- return _parts;
- }
-
- /**
- * @return the right bottom coordiate
- */
- public Point getRightBottom() {
- return new Point(_x + _width, _y + _height);
- }
-
- /**
- * @param part
- * @param point
- * @return layout part added
- */
- public boolean addLayoutPart(EditPart part, Point point) {
- Assert.isTrue(part != null && point != null);
- Rectangle rect = null;
- LayoutPart lPart = new LayoutPart(part, point);
- if (_parts.size() == 0) {
- resetBounds(lPart);
- return true;
- }
- if (!interact(lPart)) {
- if (closer(lPart)) {
- resetBounds(lPart);
- return true;
- }
- return false;
- }
- rect = lPart.getAbsoluteBounds();
- int xx = Math.min(rect.x, _x);
- int width = Math.max(rect.getRight().x, getRightBottom().x) - xx;
- int yy = Math.min(rect.y, _y);
- int height = Math.max(rect.getBottom().y, getRightBottom().y) - yy;
- _x = xx;
- _y = yy;
- _width = width;
- _height = height;
- _parts.put(part, lPart);
- return true;
- }
-
- /**
- * @param lPart
- * @return true if layout part is within the right bottom corner of the line
- */
- public boolean interact(LayoutPart lPart) {
- Rectangle rect = lPart.getAbsoluteBounds();
- return !(rect.getBottom().y <= _y || getRightBottom().y <= rect.y);
- }
-
- /**
- * @param part
- * @return true if the line contains part
- */
- public boolean contains(EditPart part) {
- return _parts.containsKey(part);
- }
-
- /**
- * @param part
- * @return true if the line contains part
- */
- public boolean contains(LayoutPart part) {
- return _parts.containsValue(part);
- }
-
- /**
- * @param part
- * @return the layout part for part
- */
- public LayoutPart getLayoutPart(EditPart part) {
- return (LayoutPart) _parts.get(part);
- }
-
- //
- /**
- * For vertical movement, we need to see if there is part cover p.x.
- *
- * @return the closest edit part
- */
- public EditPart getClosestPart() {
- if (_parts.isEmpty()) {
- return null;
- }
- Collection parts = _parts.values();
- Iterator iterator = parts.iterator();
- LayoutPart closestPart = (LayoutPart) iterator.next();
- if (iterator.hasNext()) {
- while (iterator.hasNext()) {
- LayoutPart nextPart = (LayoutPart) iterator.next();
- closestPart = CaretPositionResolver.getCloserPart(closestPart,
- nextPart, _point);
- }
- }
- // for children.
- LayoutPart result = null;
- if (_validator.getActionData().getActionType() == ActionData.KEYBOARD_NAVAGATION
- || //
- closestPart.isInline()) {
- result = CaretPositionResolver.getInstance(_validator, _point)
- .resolveClosestPartFrom(closestPart);
- } else {
- result = closestPart;
- }
- if (result != null) {
- return result.getPart();
- }
- return null;
- }
-
- /**
- * See how close the part,box is closer to point, if it is closer than
- * current FlowBoxLine. return true;
- */
- private boolean closer(LayoutPart lPart) {
- int lineYOffset = Math.abs(CaretPositionResolver.getYDistance(
- getBounds(), _point));
- int partYOffset = Math.abs(CaretPositionResolver.getYDistance(lPart
- .getAbsoluteBounds(), _point));
- return lineYOffset > partYOffset;
- }
-
- /**
- * @return the bounding rectangle of the line
- */
- public Rectangle getBounds() {
- return new Rectangle(_x, _y, _width, _height);
- }
-
- private void resetBounds(Rectangle rect) {
- _x = rect.x;
- _y = rect.y;
- _width = rect.width;
- _height = rect.height;
- }
-
- private void resetBounds(LayoutPart lPart) {
- EditPart part = lPart.getPart();
- Rectangle rect = lPart.getAbsoluteBounds();
- resetBounds(rect);
- _parts.clear();
- _parts.put(part, lPart);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/HTMLGraphicalViewer.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/HTMLGraphicalViewer.java
deleted file mode 100644
index 7080136..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/HTMLGraphicalViewer.java
+++ /dev/null
@@ -1,547 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.viewer;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.FigureCanvas;
-import org.eclipse.draw2d.Viewport;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.ui.parts.ScrollingGraphicalViewer;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.pagedesigner.commands.nav.CaretPositionTracker;
-import org.eclipse.jst.pagedesigner.dom.DOMPositionHelper;
-import org.eclipse.jst.pagedesigner.dom.DOMRefPosition;
-import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
-import org.eclipse.jst.pagedesigner.parts.DocumentEditPart;
-import org.eclipse.jst.pagedesigner.parts.ElementEditPart;
-import org.eclipse.jst.pagedesigner.tools.ExposeHelper;
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.swt.widgets.Caret;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Node;
-
-/**
- * For the GraphicalViewer selection management, we have two different selection
- * mode: Range mode and object mode.
- *
- * Range mode is to support inline text editing, it selects a range. Object mode
- * selects a list of edit parts.
- *
- * We let the super class of HTMLGraphicalViewer to handle object selection, and
- * add range selection support in this class. Need to override certain selection
- * related methods of super class to handle selection mode switching.
- *
- * @author mengbo
- */
-/*package*/ class HTMLGraphicalViewer extends ScrollingGraphicalViewer implements
- IHTMLGraphicalViewer, CaretPositionTracker {
- private IEditorPart _parentPart;
- private Caret _caret;
- // initially nothing selected, treat as object selectin mode.
- private boolean _rangeMode = false;
- private DesignRange _selectionRange = null;
- private int _inBatch = 0;
- private final CaretUpdater _caretUpdater;
- private int _xOffset;
- private final List<IHTMLGraphicalViewerListener> _htmlViewerListeners;
- // private ListenerList _postSelectionChangedListeners = new
- // ListenerList(1);
-
- /**
- * @param parent
- *
- */
- public HTMLGraphicalViewer(IEditorPart parent) {
- _parentPart = parent;
- // CaretUpdater is not fully initialized yet, since this time the
- // viewport is not
- // initialized yet, and we need add listener to range model change.
- _htmlViewerListeners = new ArrayList<IHTMLGraphicalViewerListener>();
- _caretUpdater = new CaretUpdater(this);
- }
-
- /**
- * Adds listener both as a selection changed listener and as an
- * {@link IHTMLGraphicalViewerListener}. Callers of this method
- * need not call addSelectionChangedListener.
- * @param listener
- */
- public void addHTMLViewerListener(IHTMLGraphicalViewerListener listener)
- {
- addSelectionChangedListener(listener);
-
- if (!_htmlViewerListeners.contains(listener))
- {
- _htmlViewerListeners.add(listener);
- }
- }
-
- /**
- * Removes listener both as a selection changed listener and as an
- * {@link IHTMLGraphicalViewerListener}. Callers of this method
- * need not call removeSelectionChangedListener.
- * @param listener
- */
- public void removeHTMLViewerListener(IHTMLGraphicalViewerListener listener)
- {
- removeSelectionChangedListener(listener);
- _htmlViewerListeners.remove(listener);
- }
-
- public Viewport getViewport() {
- FigureCanvas canvas = this.getFigureCanvas();
- if (canvas != null) {
- return canvas.getViewport();
- }
- return null;
- }
-
- public IDOMModel getModel() {
- // XXX: temp implementation.
- EditPart part = this.getContents();
- if (part != null) {
- return ((IDOMNode) part.getModel()).getModel();
- }
- return null;
- }
-
- /**
- * @return the status line manager
- */
- public IStatusLineManager getStatusLineManager() {
- if (_parentPart == null) {
- return null;
- }
- return _parentPart.getEditorSite().getActionBars()
- .getStatusLineManager();
- }
-
- public Caret getCaret() {
- if (_caret == null) {
- Canvas parentCanvas = (Canvas) getControl();
- if (parentCanvas == null || parentCanvas.isDisposed()) {
- return null;
- }
-
- _caret = new Caret(parentCanvas, 0);
- _caretUpdater.connectViewer();
- }
- return _caret;
-
- }
-
- /**
- * this method normally should only be called when in object selection mode.
- *
- * @return the edit part that has primary selection or null if none
- */
- public EditPart getPrimarySelectedNode() {
- List list = this.getSelectedEditParts();
- if (list.isEmpty()) {
- return null;
- }
- for (int i = 0, n = list.size(); i < n; i++) {
- EditPart part = (EditPart) list.get(i);
- if (part.getSelected() == EditPart.SELECTED_PRIMARY) {
- return part;
- }
- }
- return (EditPart) list.get(0);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.parts.IHTMLGraphicalViewer#ensureRangeSelectionMode()
- */
- public void ensureRangeSelectionMode() {
- if (!_rangeMode) {
- EditPart primary = getPrimarySelectedNode();
- this.deselectAll();
- DesignPosition begin = primary == null ? DesignPosition.INVALID
- : DesignPosition.createPositionBeforePart(primary);
- DesignPosition after = primary == null ? DesignPosition.INVALID
- : DesignPosition.createPositionAfterPart(primary);
- internalSetRange(begin, after);
- fireSelectionChanged();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.parts.IHTMLGraphicalViewer#ensureObjectSelectionMode()
- */
- public void ensureObjectSelectionMode() {
- if (_rangeMode) {
- // switch to object selection mode with no selection.
- internalToObjectMode();
- fireSelectionChanged();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.parts.IHTMLGraphicalViewer#isInRangeMode()
- */
- public boolean isInRangeMode() {
- return _rangeMode;
- }
-
- public ISelection getSelection() {
- if (isInRangeMode()) {
- return getRangeSelection();
- }
- return super.getSelection();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.parts.IHTMLGraphicalViewer#startSelectionChange()
- */
- public void startSelectionChange() {
- if (_inBatch == 0) {
- fireSelectionAboutToChange();
- }
- _inBatch++;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.parts.IHTMLGraphicalViewer#selectionChanged()
- */
- public void selectionChanged() {
- if (--_inBatch == 0) {
- fireSelectionChanged();
- fireSelectionChangeFinished();
- }
- }
-
- /**
- *
- */
- private void fireSelectionAboutToChange() {
- IHTMLGraphicalViewerListener listeners[] =
- _htmlViewerListeners.toArray(new IHTMLGraphicalViewerListener[0]);
-
- for (int i = 0; i < listeners.length; i++)
- {
- listeners[i].selectionAboutToChange();
- }
- }
-
- /**
- *
- */
- private void fireSelectionChangeFinished()
- {
- IHTMLGraphicalViewerListener listeners[] =
- _htmlViewerListeners.toArray(new IHTMLGraphicalViewerListener[0]);
- for (int i = 0; i < listeners.length; i++)
- {
- listeners[i].selectionChangeFinished();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.ui.parts.AbstractEditPartViewer#fireSelectionChanged()
- */
- protected void fireSelectionChanged() {
- if (_inBatch == 0)// && this.getControl().isFocusControl())
- {
- super.fireSelectionChanged();
- // firePostSelectionChanged(new SelectionChangedEvent(this,
- // getSelection()));
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.ui.parts.AbstractEditPartViewer#setSelection(org.eclipse.jface.viewers.ISelection)
- */
- public void setSelection(ISelection newSelection) {
- if (newSelection instanceof IStructuredSelection) {
- internalToObjectMode();
- ExposeHelper.expose(newSelection, this);
- updateRangeSelection(newSelection);
- super.setSelection(newSelection);
- } else if (newSelection instanceof DesignRange) {
- DesignRange range = (DesignRange) newSelection;
- internalSetRange(range.getStartPosition(), range.getEndPosition());
- fireSelectionChanged();
- }
- // else we don't support, ignore
- }
-
-
- /**
- * @param newSelection
- */
- public void updateRangeSelection(ISelection newSelection) {
- if (newSelection instanceof IStructuredSelection && //
- !(((IStructuredSelection) newSelection).getFirstElement() instanceof DocumentEditPart)) {
- Object element = ((IStructuredSelection) newSelection)
- .getFirstElement();
- if (element instanceof ElementEditPart) {
- updateRangeSelection(new DesignRefPosition((EditPart) element,
- false), new DesignRefPosition((EditPart) element, true));
- } else if (element instanceof Node) {
- IDOMPosition start = new DOMRefPosition((Node) element, false);
- IDOMPosition end = new DOMRefPosition((Node) element, true);
- updateRangeSelection(DOMPositionHelper.toDesignPosition(start),
- DOMPositionHelper.toDesignPosition(end));
- }
- }
- }
-
- /**
- * This method is used to synchronize range mode selection when node
- * selection is changed.
- *
- * @param position
- * @param position2
- */
- private void updateRangeSelection(DesignPosition position,
- DesignPosition position2) {
- // if only one position is invalid, we will make a collapsed range using
- // the valid position
- if (position == null) {
- position = DesignPosition.INVALID;
- }
- if (position2 == null || !position2.isValid()) {
- position2 = position;
- }
- if (!position.isValid()) {
- position = position2;
- }
-
- _selectionRange = new DesignRange(position, position2);
- }
-
- // -------------------------------------------------------------------------------------------------
- // override super class methods for selection handling.
- // operations that handles object selection
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.ui.parts.AbstractEditPartViewer#appendSelection(org.eclipse.gef.EditPart)
- */
- public void appendSelection(EditPart editpart) {
- internalToObjectMode();
- super.appendSelection(editpart); // super will fireSelectionChanged.
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.ui.parts.AbstractEditPartViewer#deselectAll()
- */
- public void deselectAll() {
- internalToObjectMode();
- super.deselectAll(); // super.deselectAll() will fireSelectionChanged
- }
-
- /**
- * Clear the selection to null. When the model is modified, the selection is
- * invalid, so we need to clear the selection. We change the selection
- * directly, it won't need to fire selectionchange event to other part.
- *
- */
- public void clearSelectionRange() {
- internalToObjectMode();
- _selectionRange = null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.ui.parts.AbstractEditPartViewer#deselect(org.eclipse.gef.EditPart)
- */
- public void deselect(EditPart editpart) {
- if (!_rangeMode) {
- super.deselect(editpart); // super will fireSelectionChanged.
- }
- // else just ignore.
- }
-
- // ---------------------------------------------------------------------------------------------
- // range selection handling methods.
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.parts.IHTMLGraphicalViewer#getRangeSelection()
- */
- public DesignRange getRangeSelection() {
- return _selectionRange;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.parts.IHTMLGraphicalViewer#setRange(org.eclipse.jst.pagedesigner.selection.EditPartPosition,
- * org.eclipse.jst.pagedesigner.selection.EditPartPosition)
- */
- public void setRange(DesignPosition position, DesignPosition position2) {
- internalSetRange(position, position2);
- fireSelectionChanged();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.parts.IHTMLGraphicalViewer#setRangeEndPosition(org.eclipse.jst.pagedesigner.selection.EditPartPosition)
- */
- public void setRangeEndPosition(DesignPosition position) {
- DesignRange range = getRangeSelection();
- DesignPosition begin = null;
- if (range != null) {
- begin = range.getStartPosition();
- }
- internalSetRange(begin, position);
- fireSelectionChanged();
- }
-
- // --------------------------------------------------------------------------------------
- /**
- * internall switch to object mode, no selection change event is fired. the
- * caller must call some other methods that will result in selection change
- * event after calling this method.
- */
- private void internalToObjectMode() {
- _rangeMode = false;
- }
-
- /**
- * this method will not fire selection changed event. caller should do that.
- *
- * @param position
- * @param position2
- */
- private void internalSetRange(DesignPosition position,
- DesignPosition position2) {
- if (!_rangeMode) {
- // XXX: deselectAll() will result in fireSelectionChange, so here is
- // one unnecessary
- // event fire. But should be ok.
- deselectAll();
- _rangeMode = true;
- }
- // if only one position is invalid, we will make a collapsed range using
- // the valid position
- if (position == null) {
- position = DesignPosition.INVALID;
- }
- if (position2 == null || !position2.isValid()) {
- position2 = position;
- }
- if (!position.isValid()) {
- position = position2;
- }
-
- _selectionRange = new DesignRange(position, position2);
- }
-
- /**
- * debug method, dump some debug information to the console
- */
- public void dumpStatus() {
- if (isInRangeMode()) {
- // System.out.println("Range start: " +
- // this.getRangeSelection().getStartPosition());
- // System.out.println("Range end: " +
- // this.getRangeSelection().getEndPosition());
- } else {
- // System.out.println("Object selection mode");
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.nav.CaretPositionTracker#getXoffset()
- */
- public int getXoffset() {
- return _xOffset;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.pagedesigner.commands.nav.CaretPositionTracker#setXoffset(int)
- */
- public void setXoffset(int xoffset) {
- this._xOffset = xoffset;
- }
-
- /**
- *
- */
- public void updateHorizontalPos() {
- Caret caret = getCaret();
- if (caret != null && !caret.isDisposed() && isInRangeMode()) {
- org.eclipse.swt.graphics.Rectangle rect = caret.getBounds();
- setXoffset(rect.x);
- }
- }
-
- // public void addPostSelectionChangedListener(ISelectionChangedListener
- // listener)
- // {
- // _postSelectionChangedListeners.add(listener);
- //
- // }
- //
- // public void removePostSelectionChangedListener(ISelectionChangedListener
- // listener)
- // {
- // _postSelectionChangedListeners.remove(listener);
- // }
-
- /**
- * Notifies any post selection listeners that a post selection event has
- * been received. Only listeners registered at the time this method is
- * called are notified.
- *
- * @param event
- * a selection changed event
- *
- * @see #addPostSelectionChangedListener(ISelectionChangedListener)
- */
- // public void firePostSelectionChanged(final SelectionChangedEvent event)
- // {
- // Object[] listeners = _postSelectionChangedListeners.getListeners();
- // for (int i = 0; i < listeners.length; ++i)
- // {
- // final ISelectionChangedListener l = (ISelectionChangedListener)
- // listeners[i];
- // SafeRunnable.run(new SafeRunnable()
- // {
- // public void run()
- // {
- // l.selectionChanged(event);
- // }
- // });
- // }
- // }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/HTMLGraphicalViewerListenenerAdapter.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/HTMLGraphicalViewerListenenerAdapter.java
deleted file mode 100644
index 4b368aa..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/HTMLGraphicalViewerListenenerAdapter.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.viewer;
-
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-
-/**
- * @author cbateman
- *
- * Default adapter class for IHTMLGraphicalViewerListener
- *
- */
-public abstract class HTMLGraphicalViewerListenenerAdapter implements
- IHTMLGraphicalViewerListener {
-
- public void selectionAboutToChange() {
- // do nothing -- override to implement
- }
-
- public void selectionChangeFinished() {
- // do nothing -- override to implement
- }
-
- public void selectionChanged(SelectionChangedEvent event) {
- // do nothing == override to implement
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/IDropLocationStrategy.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/IDropLocationStrategy.java
deleted file mode 100644
index 0798fea..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/IDropLocationStrategy.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.viewer;
-
-import java.util.List;
-
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.requests.DropRequest;
-import org.eclipse.jst.pagedesigner.validation.caret.IPositionMediator;
-
-/**
- * A strategy used to determine the closest valid drop location given
- * a current position.
- *
- * Note: clients should not implement or sub-class this interface. Instead,
- * sub-class AbstractDropLocationStrategy.
- * @author cbateman
- *
- */
-public interface IDropLocationStrategy
-{
- /**
- * @param host
- * @param p
- * @param validator
- * @return the closest valid design positionn to p, starting from host
- * that is valid based on validator, or null if there is no such position
- * (drop not valid). validator.isValidPosition must be honoured.
- */
- DesignPosition calculateDesignPosition(EditPart host, Point p, IPositionMediator validator);
-
- /**
- * May choose to contribute target feedback given a target part host and given
- * the proposed drops location given by position
- *
- * @param host
- * @param position
- * @param request
- * @return must contain all IFigure objects that were added to the feedback layer by
- * this call. Once returned, these IFigure's must not be kept as state information
- * by the strategy because they may be manipulated at any time after return to the caller.
- * This includes erasing them from the feedback layer. List must be modifiable by
- * the caller.
- *
- * Note: most feedback in Draw2D requires that it is added to the feedback layer
- * before it can be fully initialized, which is why this call adds feedback and then
- * returns it. The caller is responsible for erasing the figures in the list.
- */
- List showTargetFeedback(EditPart host, DesignPosition position, DropRequest request);
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/IHTMLGraphicalViewer.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/IHTMLGraphicalViewer.java
deleted file mode 100644
index 6ee3ce4..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/IHTMLGraphicalViewer.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.viewer;
-
-import org.eclipse.draw2d.Viewport;
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.widgets.Caret;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-
-/**
- * @author mengbo
- */
-public interface IHTMLGraphicalViewer extends GraphicalViewer
-{
- /**
- * Factory for IHTMLGraphicalViewers
- *
- */
- static class Factory
- {
- /**
- * @param part
- * @return a new graphical viewer for part
- */
- public static IHTMLGraphicalViewer createGraphicalViewer(IEditorPart part)
- {
- return new HTMLGraphicalViewer(part);
- }
- }
-
- /**
- * @return the dom model
- */
- public IDOMModel getModel();
-
- /**
- * ensure we are in range selection mode
- */
- public void ensureRangeSelectionMode();
-
- /**
- *
- */
- public void ensureObjectSelectionMode();
-
- /**
- * @return true if in range mode
- */
- public boolean isInRangeMode();
-
- /**
- * @return the current selection range
- */
- public DesignRange getRangeSelection();
-
- /**
- * @param position
- * @param position2
- */
- public void setRange(DesignPosition position, DesignPosition position2);
-
- /**
- * @param position
- */
- public void setRangeEndPosition(DesignPosition position);
-
- /**
- * @return the caret
- */
- public Caret getCaret();
-
- /**
- * indicate a batch of operations is began, and may result in selection
- * change. This viewer will only fire a single selection changed event when
- * this batch of operations finish.
- */
- public void startSelectionChange();
-
- /**
- * batch operation that change the selection finished.
- *
- */
- public void selectionChanged();
-
- /**
- * @return the view port
- */
- public Viewport getViewport();
-
- /**
- * @return the status line manager
- */
- public IStatusLineManager getStatusLineManager();
-
- /**
- * @param newSelection
- */
- public void updateRangeSelection(ISelection newSelection);
-
- /**
- * Update the horizontal position
- */
- public void updateHorizontalPos();
-
- /**
- * Clear the selection to null. When the model is modified, the selection is
- * invalid, so we need to clear the selection. We change the selection
- * directly, it won't need to fire selectionchange event to other part.
- */
- public void clearSelectionRange();
-
- /**
- * Adds listener both as a selection changed listener and as an
- * {@link IHTMLGraphicalViewerListener}. Callers of this method
- * need not call addSelectionChangedListener.
- * @param listener
- */
- public void addHTMLViewerListener(IHTMLGraphicalViewerListener listener);
-
- /**
- * Removes listener both as a selection changed listener and as an
- * {@link IHTMLGraphicalViewerListener}. Callers of this method
- * need not call removeSelectionChangedListener.
- * @param listener
- */
- public void removeHTMLViewerListener(IHTMLGraphicalViewerListener listener);
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/IHTMLGraphicalViewerListener.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/IHTMLGraphicalViewerListener.java
deleted file mode 100644
index 0d48ca9..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/IHTMLGraphicalViewerListener.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.viewer;
-
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-
-/**
- * @author mengbo
- */
-public interface IHTMLGraphicalViewerListener extends ISelectionChangedListener {
- /**
- * Fired before selection changes
- */
- public void selectionAboutToChange();
-
- /**
- * Fired after selection changed listeners have all been processed
- * for a change
- */
- public void selectionChangeFinished();
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/LayoutPart.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/LayoutPart.java
deleted file mode 100644
index 31c3713..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/LayoutPart.java
+++ /dev/null
@@ -1,476 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.viewer;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.jst.pagedesigner.IHTMLConstants;
-import org.eclipse.jst.pagedesigner.css2.layout.CSSFigure;
-import org.eclipse.jst.pagedesigner.css2.layout.CSSTextFigure;
-import org.eclipse.jst.pagedesigner.css2.layout.FlowBox;
-import org.eclipse.jst.pagedesigner.css2.layout.FlowUtilities;
-import org.eclipse.jst.pagedesigner.css2.layout.TextFragmentBox;
-import org.eclipse.jst.pagedesigner.css2.layout.TextLayoutSupport;
-import org.eclipse.jst.pagedesigner.dom.DOMRefPosition;
-import org.eclipse.jst.pagedesigner.dom.EditModelQuery;
-import org.eclipse.jst.pagedesigner.parts.SubNodeEditPart;
-import org.eclipse.jst.pagedesigner.parts.TextEditPart;
-import org.eclipse.jst.pagedesigner.validation.caret.IPositionMediator;
-import org.eclipse.jst.pagedesigner.validation.caret.Target;
-import org.w3c.dom.Node;
-
-/**
- * @author mengbo
- */
-public final class LayoutPart {
- private final static int MAX_OFFSET_TO_EDGE = 10;
-
- private EditPart _part;
-
- private FlowBox _box;
-
- private final Point EMPTY_POINT = new Point(0, 0);
-
- private Point _point = EMPTY_POINT;
-
- /**
- * If caller didn't resolve FlowBox, call this.
- *
- * @param part
- * @param point
- */
- public LayoutPart(EditPart part, Point point) {
- Assert.isTrue(part != null);
- _part = part;
- _point = point;
- }
-
- /**
- * @return Returns the _box, when it is null, generate box with part and
- * point.
- */
- public FlowBox getBox() {
- if (_box == null) {
- _box = getClosestBox();
- }
- return _box;
- }
-
- /**
- * @return Returns the _part.
- */
- public EditPart getPart() {
- return _part;
- }
-
- /**
- * Get closest box's bounds.
- *
- * @param point
- * @return
- */
- private Rectangle getClosestBoxAbsoluteBounds() {
- Rectangle rect = null;
- if (getBox() != null) {
- rect = getAbsoluteBounds(getBox());
- }
- return rect;
- }
-
- /**
- * Try to get the closest flowbox absolute bounds.
- *
- * @return the bounding rectangle
- */
- public Rectangle getAbsoluteBounds() {
- Rectangle bounds = null;
- if ((bounds = getClosestBoxAbsoluteBounds()) == null) {
- // This should never happens.
- bounds = EditPartPositionHelper.getAbsoluteBounds(_part);
- }
- return bounds;
- }
-
- /**
- * Get box's absolute bounds.
- *
- * @param box
- * @return the box's bounding rectangle
- */
- public Rectangle getAbsoluteBounds(FlowBox box) {
- if (box != null) {
- IFigure figure = ((GraphicalEditPart) _part).getFigure();
- Rectangle rect = new Rectangle(box.getX(), box.getY(), box.getWidth(), box
- .getHeight());
- figure.translateToAbsolute(rect);
- return rect;
- }
- return null;
- }
-
- /**
- * Closest box is the part's FlowBox which y coordinate is closest to point,
- * and then its x coordinate is more close to point than other boxs of the
- * same line.
- *
- * @param part
- * @param point
- * @return
- */
- private FlowBox getClosestBox() {
- FlowBox closestBox = null;
- List fragments = getLines(_part);
-
- // if there is one which are at the same line with relative,
- // calculate that line first;
- for (int i = 0; i < fragments.size(); i++) {
- FlowBox box = (FlowBox) fragments.get(i);
- Rectangle boxRect = getAbsoluteBounds(box);
- if (boxRect.contains(_point.x, _point.y)) {
- closestBox = box;
- break;
- }
- if (closestBox == null) {
- closestBox = box;
- } else {
- // compare y.
- int offset1 = Math.abs(CaretPositionResolver.getYDistance(
- boxRect, _point));
- Rectangle closestRect = getAbsoluteBounds(closestBox);
- int offset2 = Math.abs(CaretPositionResolver.getYDistance(
- closestRect, _point));
- if (offset1 < offset2) {
- closestBox = box;
- }
- }
- // at the same line
- if (closestBox != box && boxRect.contains(boxRect.x, _point.y)) {
- // compare x.
- int offset1 = Math.abs(CaretPositionResolver.getXDistance(
- boxRect, _point));
- Rectangle closestRect = getAbsoluteBounds(closestBox);
- int offset2 = Math.abs(CaretPositionResolver.getXDistance(
- closestRect, _point));
- if (offset1 < offset2) {
- closestBox = box;
- }
- }
- }
- return closestBox;
- }
-
- /**
- * The point is whitin the bounds of the figure.
- *
- * @param point
- * @return true if point is the absolute bounds of this
- */
- public boolean contains(Point point) {
- return getAbsoluteBounds().contains(point);
- }
-
- /**
- * @return the design position
- */
- public DesignPosition resolveTextPosition() {
- DesignPosition result = null;
- if (_part instanceof TextEditPart
- && !EditModelQuery.isTransparentText(Target.resolveNode(_part))) {
- FlowBox flowBox = getBox();
- if (flowBox instanceof TextFragmentBox) {
- TextFragmentBox box = (TextFragmentBox) flowBox;
- if (((TextEditPart) _part).getFigure() instanceof CSSTextFigure) {
- CSSTextFigure figure = (CSSTextFigure) ((TextEditPart) _part)
- .getFigure();
- Rectangle boxRect = getAbsoluteBounds(box);
- int index = FlowUtilities.getTextInWidth(box.getTextData(),
- figure.getCSSStyle().getCSSFont().getSwtFont(),
- _point.x - boxRect.x, TextLayoutSupport
- .getAverageCharWidth(box));
- result = new DesignPosition(_part, box._offset + index);
- }
- }
- }
- return result;
- }
-
- /**
- * @param validator
- * @return resolve the design position using validator
- */
- public DesignPosition resolvePosition(IPositionMediator validator) {
- DesignPosition result;
- if ((result = resolveTextPosition()) == null) {
- boolean atPointLeft = isBeforePoint(_point);
-// boolean atPointRight = isAfterPoint(_point);
-// if (atPointLeft == atPointRight) {
-// // TODO: and...?
-// }
- Target target = new Target(getPart());
- if (validator.isValidPosition(new DOMRefPosition(target.getNode(),
- atPointLeft))) {
- result = new DesignRefPosition(_part, atPointLeft);
- } else if (validator.isValidPosition(new DOMRefPosition(target
- .getNode(), !atPointLeft))) {
- result = new DesignRefPosition(_part, !atPointLeft);
- } else if (validator.isEditable(target)) {
- if (atPointLeft) {
- result = new DesignPosition(_part, 0);
- } else {
- result = new DesignPosition(_part, _part.getChildren()
- .size());
- }
- }
- }
- return result;
- }
-
- // TODO: dead?
-// private IFigure getFigure() {
-// return ((GraphicalEditPart) _part).getFigure();
-// }
-
- private boolean isAfterPoint(Point point) {
- boolean result = false;
- FlowBox flowBox = getLine(0);
- if (IHTMLConstants.TAG_BR.equalsIgnoreCase(Target.resolveNode(_part)
- .getNodeName())) {
- if (flowBox != null) {
- Rectangle boxRect = getAbsoluteBounds(flowBox);
- result = CaretPositionResolver.getYDistance(boxRect, point) == 0;
- }
- } else {
-
- if (flowBox != null) {
- Rectangle boxRect = getAbsoluteBounds(flowBox);
- if (CaretPositionResolver.getXDistance(boxRect, point) != 0) {
- result = CaretPositionResolver.getXDistance(boxRect, point) < 0
- && //
- CaretPositionResolver.getYDistance(boxRect, point) == 0;
- }
- }
- }
- result |= isUnderCaret();
- // if (isWidget() && flowBox != null)
- // {
- // result |= contains(point) &&
- // CaretPositionResolver.toXMiddle(getAbsoluteBounds(flowBox), point) <
- // 0;
- // }
- return result;
-
- }
-
- /*package*/ boolean isBeforePoint(Point point) {
- boolean result = false;
- FlowBox flowBox = getLastLine();
- if (flowBox != null) {
- Rectangle boxRect = getAbsoluteBounds(flowBox);
- if (IHTMLConstants.TAG_BR.equalsIgnoreCase(Target
- .resolveNode(_part).getNodeName())) {
- return CaretPositionResolver.getYDistance(boxRect, point) == 0;
- } else if (CaretPositionResolver.getXDistance(boxRect, point) != 0) {
- result = CaretPositionResolver.getXDistance(boxRect, point) > 0
- && //
- CaretPositionResolver.getYDistance(boxRect, point) == 0;
- }
- }
- result |= isAboveCaret();
- // if (isWidget() && flowBox != null)
- // {
- // result |= contains(point) &&
- // CaretPositionResolver.toXMiddle(getAbsoluteBounds(flowBox), point) >
- // 0;
- // }
- return result;
- // return !isAfterPoint(point);
- }
-
- /*package*/ boolean isBeforePoint() {
- return isBeforePoint(_point);
- }
-
- /*package*/ boolean atLeftPart(Point point) {
- FlowBox flowBox = getBox();
- if (flowBox != null) {
- Rectangle boxRect = getAbsoluteBounds(flowBox);
- return CaretPositionResolver.toXMiddle(boxRect, point) < 0;
- }
- return true;
- }
-
- /*package*/ boolean isAfterPoint() {
- return isAfterPoint(_point);
- }
-
- // TODO: dead but possibly useful?
-// private boolean atSameLine(Point point) {
-// Rectangle bounds = getAbsoluteBounds();
-// return bounds.contains(bounds.getTop().x, point.y);
-// }
-
- /*package*/ boolean atSameRow(Point point) {
- Rectangle bounds = getAbsoluteBounds();
- return bounds.contains(point.x, bounds.getRight().y);
- }
-
- /*package*/ static Rectangle getBounds(FlowBox box) {
- return new Rectangle(box.getX(), box.getY(), box.getWidth(), box.getHeight());
- }
-
- /**
- * @return Returns the _point.
- */
- public Point getPoint() {
- return _point;
- }
-
- FlowBox getLine(int index) {
- FlowBox result = null;
- List lines = getLines(_part);
- if (lines.size() > 0 && index >= 0 && index <= lines.size() - 1) {
- result = (FlowBox) lines.get(index);
- }
- return result;
- }
-
- FlowBox getLastLine() {
- FlowBox result = null;
- List lines = getLines(_part);
- if (lines.size() > 0) {
- result = (FlowBox) lines.get(lines.size() - 1);
- }
- return result;
- }
-
- /**
- * @param part
- * @return
- */
- List getLines(EditPart part) {
- List fragments = new ArrayList();
- if (part instanceof SubNodeEditPart) {
- IFigure figure = ((GraphicalEditPart) part).getFigure();
-
- if (figure instanceof CSSTextFigure) {
- fragments = ((CSSTextFigure) figure).getFragments();
- ((CSSTextFigure) figure).getCSSStyle();
- } else if (figure instanceof CSSFigure) {
- fragments = ((CSSFigure) figure).getFragmentsForRead();
- ((CSSFigure) figure).getCSSStyle();
- }
- }
- return fragments;
- }
-
- /**
- * To search for none empty string, this is not final.
- * @param part
- * @return the edit part
- *
- */
- /*package*/ static EditPart getConcretePart(EditPart part) {
- if (part != null) {
- Node node = Target.resolveNode(part);
- Node child = node.getFirstChild();
- EditPart result;
- while (child != null) {
- if (!EditModelQuery.isTransparentText(child)
- && (result = Target.resolvePart(child)) != null) {
- return result;
- }
- child = child.getNextSibling();
- }
- }
- return null;
- }
-
- /**
- * To search for none empty string, this is not final.
- * Equivalent to getConcretePart(getPart())
- *
- * @return the edit part
- *
- */
- public EditPart getConcretePart() {
- return getConcretePart(_part);
- }
-
- /**
- * @param node
- * @return the node
- */
- public static Node getConcreteNode(Node node) {
- if (node != null) {
- Node child = node.getFirstChild();
- while (child != null) {
- if (!EditModelQuery.isTransparentText(child)) {
- return node;
- }
- child = child.getNextSibling();
- }
- }
- return null;
- }
-
- /**
- * @return true if is close to edge
- */
- public boolean isCloseToEdgeFromOutSide() {
- boolean result = false;
- if (EditModelQuery.isBlockNode(Target.resolveNode(_part))) {
- result = Math.abs(getAbsoluteBounds().getLeft().x - _point.x) <= MAX_OFFSET_TO_EDGE;
- if (!result) {
- result = Math.abs(getAbsoluteBounds().getRight().x - _point.x) <= MAX_OFFSET_TO_EDGE;
- }
- }
- return result;
- }
-
- private boolean isAboveCaret() {
- return getAbsoluteBounds().getBottom().y <= _point.y;
- }
-
- private boolean isUnderCaret() {
- return getAbsoluteBounds().getTop().y >= _point.y;
- }
-
- /**
- * @return tru if getPart() is considered inline
- */
- /*package*/ boolean isInline() {
- return EditModelQuery.isInline(Target.resolveNode(_part));
- }
-
- // TODO: dead?
-// private boolean isWidget() {
-// return EditModelQuery.isWidget(_part);
-// }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer sb = new StringBuffer();
- sb.append("editPart:" + _part + ", --- box: " + getBox());
- return sb.toString();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/TextPosition.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/TextPosition.java
deleted file mode 100644
index 46850b4..0000000
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/viewer/TextPosition.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.pagedesigner.viewer;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
-
-/**
- * This class used to identify a position in a text node. It's very similiar to
- * EditPartPosition. Used instead of EditPartPosition when in cases we are in
- * the middle of handling something without available EditPart created.
- *
- * offset has the same meaning as in EditPartPosition.
- *
- * @author mengbo
- */
-public class TextPosition {
- private IDOMText _containerNode;
-
- private int _offset;
-
- /**
- * @param part
- * @param offset
- */
- public TextPosition(IDOMText part, int offset) {
- _containerNode = part;
- _offset = offset;
- }
-
- /**
- * if _containerPart is null, means it is invalid
- *
- * @return the text node
- */
- public IDOMText getTextNode() {
- return _containerNode;
- }
-
- /**
- * if offset < 0, means it is invalid.
- *
- * @return the offset
- */
- public int getOffset() {
- return _offset;
- }
-
- /**
- * @return if this position is considered valid
- */
- public boolean isValid() {
- return _containerNode != null && _offset >= 0;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
- if (obj instanceof TextPosition) {
- TextPosition p = (TextPosition) obj;
- return p.getTextNode() == this._containerNode
- && p.getOffset() == this._offset;
- }
- return false;
- }
-
- @Override
- public int hashCode()
- {
- // match hash code to equals criteria
- return System.identityHashCode(getTextNode())
- ^ System.identityHashCode(Integer.valueOf(getOffset()));
- }
-
-
-}